From 94aa9346b1811eff7e67820b75d5098e3f83448d Mon Sep 17 00:00:00 2001 From: Jason Mitchell Date: Sun, 29 Jan 2023 12:03:50 -0800 Subject: [PATCH] [ci skip] spotlessApply with the new settings --- src/main/java/forestry/Forestry.java | 25 +- .../forestry/api/apiculture/BeeManager.java | 1 + .../api/apiculture/DefaultBeeListener.java | 6 +- .../api/apiculture/DefaultBeeModifier.java | 5 +- .../api/apiculture/EnumBeeChromosome.java | 10 +- .../forestry/api/apiculture/EnumBeeType.java | 4 +- .../api/apiculture/FlowerManager.java | 21 +- .../IAlleleBeeAcceleratableEffect.java | 1 + .../api/apiculture/IAlleleBeeEffect.java | 13 +- .../api/apiculture/IAlleleBeeSpecies.java | 9 +- .../apiculture/IAlleleBeeSpeciesCustom.java | 19 +- .../api/apiculture/IApiaristTracker.java | 12 +- .../api/apiculture/IArmorApiarist.java | 13 +- .../api/apiculture/IArmorApiaristHelper.java | 24 +- .../java/forestry/api/apiculture/IBee.java | 12 +- .../forestry/api/apiculture/IBeeFactory.java | 39 +- .../forestry/api/apiculture/IBeeHousing.java | 16 +- .../api/apiculture/IBeeHousingInventory.java | 2 +- .../apiculture/IBeeIconColourProvider.java | 1 + .../api/apiculture/IBeeIconProvider.java | 1 + .../forestry/api/apiculture/IBeeListener.java | 2 + .../forestry/api/apiculture/IBeeModifier.java | 11 +- .../forestry/api/apiculture/IBeeMutation.java | 9 +- .../api/apiculture/IBeeMutationCustom.java | 3 +- .../api/apiculture/IBeeMutationFactory.java | 14 +- .../forestry/api/apiculture/IBeeRoot.java | 29 +- .../api/apiculture/IBeekeepingLogic.java | 22 +- .../api/apiculture/IBeekeepingMode.java | 4 +- .../forestry/api/apiculture/IHiveDrop.java | 7 +- .../forestry/api/apiculture/IHiveFrame.java | 7 +- .../api/apiculture/IJubilanceFactory.java | 1 + .../api/apiculture/IJubilanceProvider.java | 4 +- .../apiculture/hives/IHiveDescription.java | 18 +- .../api/apiculture/hives/IHiveGen.java | 7 +- .../api/apiculture/hives/IHiveGenHelper.java | 4 +- .../api/apiculture/hives/IHiveRegistry.java | 3 +- .../api/arboriculture/EnumFruitFamily.java | 6 +- .../api/arboriculture/EnumGermlingType.java | 1 + .../api/arboriculture/EnumTreeChromosome.java | 17 +- .../api/arboriculture/EnumWoodType.java | 2 + .../api/arboriculture/IAlleleLeafEffect.java | 3 +- .../api/arboriculture/IAlleleTreeSpecies.java | 8 +- .../IAlleleTreeSpeciesCustom.java | 3 +- .../api/arboriculture/IArboristTracker.java | 3 +- .../api/arboriculture/IFruitProvider.java | 10 +- .../arboriculture/IGermlingIconProvider.java | 6 +- .../api/arboriculture/IGrowthProvider.java | 16 +- .../api/arboriculture/ILeafIconProvider.java | 9 +- .../api/arboriculture/ILeafTickHandler.java | 1 + .../api/arboriculture/IToolGrafter.java | 7 +- .../forestry/api/arboriculture/ITree.java | 11 +- .../api/arboriculture/ITreeFactory.java | 42 +- .../api/arboriculture/ITreeGenerator.java | 6 +- .../api/arboriculture/ITreeGenome.java | 8 +- .../api/arboriculture/ITreeMutation.java | 14 +- .../arboriculture/ITreeMutationCustom.java | 3 +- .../arboriculture/ITreeMutationFactory.java | 14 +- .../forestry/api/arboriculture/ITreeRoot.java | 12 +- .../api/arboriculture/IWoodItemAccess.java | 1 + .../api/circuits/CircuitSocketType.java | 1 + .../java/forestry/api/circuits/ICircuit.java | 1 + .../forestry/api/circuits/ICircuitBoard.java | 4 +- .../forestry/api/circuits/ICircuitLayout.java | 1 + .../api/circuits/ICircuitLibrary.java | 3 +- .../api/circuits/ICircuitRegistry.java | 1 + .../api/circuits/ICircuitSocketType.java | 5 +- .../java/forestry/api/core/BiomeHelper.java | 6 +- .../java/forestry/api/core/EnumHumidity.java | 11 +- .../forestry/api/core/EnumTemperature.java | 17 +- .../java/forestry/api/core/ForestryAPI.java | 30 +- .../java/forestry/api/core/ForestryEvent.java | 12 +- .../forestry/api/core/IArmorNaturalist.java | 9 +- .../forestry/api/core/IClimateControlled.java | 13 +- .../forestry/api/core/IClimateProvider.java | 1 + .../java/forestry/api/core/IErrorLogic.java | 5 +- .../forestry/api/core/IErrorLogicSource.java | 1 + .../java/forestry/api/core/IErrorSource.java | 1 + .../java/forestry/api/core/IErrorState.java | 5 +- .../api/core/IErrorStateRegistry.java | 1 + .../java/forestry/api/core/IIconProvider.java | 5 +- .../java/forestry/api/core/INBTTagable.java | 1 + .../forestry/api/core/ITextureManager.java | 3 +- .../java/forestry/api/core/IToolPipette.java | 15 +- .../java/forestry/api/core/IToolScoop.java | 3 +- src/main/java/forestry/api/core/Tabs.java | 2 +- .../api/farming/DefaultFarmListener.java | 11 +- .../forestry/api/farming/FarmDirection.java | 1 + .../java/forestry/api/farming/Farmables.java | 1 + src/main/java/forestry/api/farming/ICrop.java | 1 + .../forestry/api/farming/IFarmHousing.java | 8 +- .../forestry/api/farming/IFarmInventory.java | 1 + .../forestry/api/farming/IFarmListener.java | 19 +- .../java/forestry/api/farming/IFarmLogic.java | 6 +- .../java/forestry/api/farming/IFarmable.java | 10 +- .../forestry/api/farming/IFarmableBasic.java | 9 +- .../forestry/api/food/BeverageManager.java | 1 + .../forestry/api/food/IBeverageEffect.java | 1 + .../forestry/api/fuels/EngineBronzeFuel.java | 1 + .../forestry/api/fuels/FermenterFuel.java | 1 + .../java/forestry/api/fuels/FuelManager.java | 2 + .../forestry/api/fuels/MoistenerFuel.java | 1 + .../forestry/api/fuels/RainSubstrate.java | 1 + .../forestry/api/genetics/AlleleManager.java | 5 +- .../java/forestry/api/genetics/IAllele.java | 6 +- .../forestry/api/genetics/IAlleleEffect.java | 8 +- .../forestry/api/genetics/IAlleleFactory.java | 195 +++---- .../forestry/api/genetics/IAlleleHandler.java | 13 +- .../api/genetics/IAllelePlantType.java | 1 + .../api/genetics/IAlleleRegistry.java | 64 +-- .../forestry/api/genetics/IAlleleSpecies.java | 15 +- .../api/genetics/IBreedingTracker.java | 21 +- .../api/genetics/IClassification.java | 1 + .../forestry/api/genetics/IClimateHelper.java | 34 +- .../forestry/api/genetics/IEffectData.java | 1 + .../api/genetics/IFlowerAcceptableRule.java | 5 +- .../api/genetics/IFlowerGrowthHelper.java | 2 + .../api/genetics/IFlowerGrowthRule.java | 13 +- .../api/genetics/IFlowerProvider.java | 14 +- .../api/genetics/IFlowerRegistry.java | 27 +- .../forestry/api/genetics/IFruitBearer.java | 7 +- .../forestry/api/genetics/IIndividual.java | 8 +- .../api/genetics/IIndividualLiving.java | 2 + .../java/forestry/api/genetics/IMutation.java | 3 +- .../api/genetics/IMutationCondition.java | 20 +- .../api/genetics/IMutationCustom.java | 6 +- .../forestry/api/genetics/IPollinatable.java | 10 +- .../forestry/api/genetics/ISpeciesRoot.java | 25 +- .../forestry/api/genetics/ISpeciesType.java | 3 +- .../api/lepidopterology/ButterflyManager.java | 12 +- .../EnumButterflyChromosome.java | 10 +- .../api/lepidopterology/EnumFlutterType.java | 1 + .../IAlleleButterflyEffect.java | 3 +- .../IAlleleButterflySpecies.java | 7 +- .../IAlleleButterflySpeciesCustom.java | 13 +- .../api/lepidopterology/IButterfly.java | 13 +- .../lepidopterology/IButterflyFactory.java | 52 +- .../lepidopterology/IButterflyMutation.java | 1 + .../api/lepidopterology/IButterflyRoot.java | 12 +- .../api/lepidopterology/IEntityButterfly.java | 3 +- .../java/forestry/api/mail/EnumAddressee.java | 1 + .../java/forestry/api/mail/EnumPostage.java | 1 + src/main/java/forestry/api/mail/ILetter.java | 4 +- .../forestry/api/mail/ILetterHandler.java | 1 + .../java/forestry/api/mail/IPostOffice.java | 1 + .../java/forestry/api/mail/IPostRegistry.java | 5 +- .../forestry/api/mail/IPostalCarrier.java | 29 +- .../java/forestry/api/mail/IPostalState.java | 1 + .../java/forestry/api/mail/PostManager.java | 1 + .../forestry/api/mail/TradeStationInfo.java | 8 +- .../api/multiblock/IAlvearyComponent.java | 14 +- .../api/multiblock/IAlvearyController.java | 7 +- .../api/multiblock/IFarmComponent.java | 8 +- .../api/multiblock/IFarmController.java | 7 +- .../api/multiblock/IMultiblockComponent.java | 22 +- .../api/multiblock/IMultiblockController.java | 19 +- .../api/multiblock/IMultiblockLogic.java | 23 +- .../multiblock/IMultiblockLogicAlveary.java | 1 + .../multiblock/IMultiblockLogicFactory.java | 4 +- .../api/multiblock/IMultiblockLogicFarm.java | 1 + .../api/multiblock/MultiblockManager.java | 1 + .../multiblock/MultiblockTileEntityBase.java | 17 +- .../api/recipes/ICarpenterManager.java | 47 +- .../api/recipes/ICarpenterRecipe.java | 8 +- .../api/recipes/ICentrifugeManager.java | 11 +- .../api/recipes/ICentrifugeRecipe.java | 5 +- .../api/recipes/ICraftingProvider.java | 6 +- .../api/recipes/IDescriptiveRecipe.java | 14 +- .../api/recipes/IFabricatorRecipe.java | 4 +- .../recipes/IFabricatorSmeltingManager.java | 18 +- .../recipes/IFabricatorSmeltingRecipe.java | 13 +- .../api/recipes/IFermenterManager.java | 37 +- .../api/recipes/IFermenterRecipe.java | 7 +- .../forestry/api/recipes/IForestryRecipe.java | 3 +- .../api/recipes/IMoistenerManager.java | 14 +- .../api/recipes/IMoistenerRecipe.java | 5 +- .../api/recipes/ISqueezerManager.java | 29 +- .../forestry/api/recipes/ISqueezerRecipe.java | 3 +- .../forestry/api/recipes/IStillManager.java | 14 +- .../forestry/api/recipes/IStillRecipe.java | 1 + .../api/recipes/IVariableFermentable.java | 4 +- .../forestry/api/storage/BackpackEvent.java | 3 +- .../forestry/api/storage/BackpackManager.java | 5 +- .../api/storage/BackpackResupplyEvent.java | 11 +- .../api/storage/BackpackStowEvent.java | 12 +- .../api/storage/IBackpackDefinition.java | 1 + .../api/storage/IBackpackInterface.java | 6 +- .../forestry/api/storage/ICrateRegistry.java | 5 +- .../java/forestry/api/world/ITreeGenData.java | 5 +- .../api/world/IWorldGenInterface.java | 4 +- .../forestry/api/world/WorldGenManager.java | 1 + .../apiculture/AlvearyBeeModifier.java | 13 +- .../apiculture/ApiaryBeeListener.java | 13 +- .../apiculture/ApiaryBeeModifier.java | 13 +- .../apiculture/ArmorApiaristHelper.java | 17 +- .../apiculture/BeeHousingListener.java | 13 +- .../apiculture/BeeHousingModifier.java | 13 +- .../apiculture/BeehouseBeeModifier.java | 13 +- .../forestry/apiculture/BeekeepingLogic.java | 46 +- .../apiculture/FakeBeekeepingLogic.java | 16 +- .../forestry/apiculture/HasFlowersCache.java | 30 +- .../java/forestry/apiculture/IApiary.java | 13 +- .../apiculture/InventoryBeeHousing.java | 16 +- .../forestry/apiculture/MaterialBeehive.java | 12 +- .../SaveEventHandlerApiculture.java | 15 +- .../apiculture/VillageHandlerApiculture.java | 51 +- .../apiculture/blocks/BlockAlveary.java | 48 +- .../apiculture/blocks/BlockApiculture.java | 13 +- .../blocks/BlockApicultureType.java | 19 +- .../apiculture/blocks/BlockBeehives.java | 45 +- .../apiculture/blocks/BlockCandle.java | 80 ++- .../blocks/BlockRegistryApiculture.java | 13 +- .../apiculture/blocks/BlockStump.java | 56 +- .../apiculture/commands/BeeModeHelper.java | 20 +- .../commands/BeeStatsSaveHelper.java | 30 +- .../apiculture/commands/CommandBee.java | 12 +- .../apiculture/commands/CommandBeeGive.java | 36 +- .../apiculture/entities/AIAvoidPlayers.java | 17 +- .../apiculture/entities/EntityBee.java | 21 +- .../apiculture/entities/EntityFXBee.java | 21 +- .../entities/EntityMinecartApiary.java | 31 +- .../EntityMinecartBeeHousingBase.java | 30 +- .../entities/EntityMinecartBeehouse.java | 27 +- .../forestry/apiculture/flowers/Flower.java | 27 +- .../apiculture/flowers/FlowerProvider.java | 24 +- .../apiculture/flowers/FlowerRegistry.java | 80 +-- .../flowers/GrowthRuleDirtGrass.java | 29 +- .../flowers/GrowthRuleFertilize.java | 26 +- .../flowers/GrowthRuleFlowerPot.java | 27 +- .../flowers/GrowthRuleMycelium.java | 23 +- .../apiculture/flowers/GrowthRuleNone.java | 19 +- .../apiculture/flowers/GrowthRuleSnow.java | 23 +- .../apiculture/genetics/ApiaristTracker.java | 17 +- .../forestry/apiculture/genetics/Bee.java | 128 ++--- .../genetics/BeeBranchDefinition.java | 20 +- .../apiculture/genetics/BeeDefinition.java | 280 +++++----- .../apiculture/genetics/BeeFactory.java | 24 +- .../apiculture/genetics/BeeGenome.java | 51 +- .../apiculture/genetics/BeeHelper.java | 39 +- .../apiculture/genetics/BeeMutation.java | 28 +- .../genetics/BeeMutationFactory.java | 16 +- .../apiculture/genetics/BeeVariation.java | 4 +- .../apiculture/genetics/BeekeepingMode.java | 32 +- .../apiculture/genetics/BranchBees.java | 12 +- .../DefaultBeeIconColourProvider.java | 13 +- .../genetics/DefaultBeeIconProvider.java | 20 +- .../apiculture/genetics/HiveDrop.java | 24 +- .../apiculture/genetics/IBeeDefinition.java | 16 +- .../apiculture/genetics/JubilanceDefault.java | 12 +- .../apiculture/genetics/JubilanceFactory.java | 18 +- .../genetics/JubilanceProviderHermit.java | 19 +- .../genetics/JubilanceRequiresResource.java | 23 +- .../genetics/alleles/AlleleBeeSpecies.java | 44 +- .../genetics/alleles/AlleleEffect.java | 42 +- .../alleles/AlleleEffectAggressive.java | 21 +- .../genetics/alleles/AlleleEffectCreeper.java | 22 +- .../alleles/AlleleEffectExploration.java | 18 +- .../genetics/alleles/AlleleEffectFertile.java | 22 +- .../alleles/AlleleEffectFungification.java | 20 +- .../genetics/alleles/AlleleEffectGlacial.java | 19 +- .../genetics/alleles/AlleleEffectHeroic.java | 21 +- .../alleles/AlleleEffectIgnition.java | 23 +- .../alleles/AlleleEffectMisanthrope.java | 20 +- .../genetics/alleles/AlleleEffectNone.java | 13 +- .../genetics/alleles/AlleleEffectPotion.java | 38 +- .../alleles/AlleleEffectRadioactive.java | 28 +- .../alleles/AlleleEffectRepulsion.java | 20 +- .../alleles/AlleleEffectResurrection.java | 25 +- .../genetics/alleles/AlleleEffectSnowing.java | 33 +- .../alleles/AlleleEffectThrottled.java | 16 +- .../genetics/alleles/AlleleFlowers.java | 12 +- .../apiculture/gui/ContainerAlveary.java | 15 +- .../gui/ContainerAlvearyHygroregulator.java | 15 +- .../apiculture/gui/ContainerAlvearySieve.java | 15 +- .../gui/ContainerAlvearySwarmer.java | 15 +- .../apiculture/gui/ContainerBeeHelper.java | 20 +- .../apiculture/gui/ContainerBeeHousing.java | 15 +- .../gui/ContainerHabitatLocator.java | 15 +- .../apiculture/gui/ContainerImprinter.java | 22 +- .../gui/ContainerMinecartBeehouse.java | 16 +- .../forestry/apiculture/gui/GuiAlveary.java | 18 +- .../gui/GuiAlvearyHygroregulator.java | 15 +- .../apiculture/gui/GuiAlvearySieve.java | 15 +- .../apiculture/gui/GuiAlvearySwarmer.java | 15 +- .../apiculture/gui/GuiBeeHousing.java | 16 +- .../forestry/apiculture/gui/GuiBeealyzer.java | 58 +- .../apiculture/gui/GuiHabitatLocator.java | 35 +- .../forestry/apiculture/gui/GuiImprinter.java | 30 +- .../apiculture/gui/IContainerBeeHousing.java | 15 +- .../gui/IGuiBeeHousingInventory.java | 16 +- .../apiculture/gui/widgets/HabitatSlot.java | 34 +- .../inventory/IApiaryInventory.java | 13 +- .../inventory/InventoryAlvearySieve.java | 18 +- .../apiculture/inventory/InventoryApiary.java | 23 +- .../inventory/InventoryHygroregulator.java | 18 +- .../inventory/InventorySwarmer.java | 16 +- .../inventory/ItemInventoryBeealyzer.java | 20 +- .../ItemInventoryHabitatLocator.java | 27 +- .../inventory/ItemInventoryImprinter.java | 51 +- .../apiculture/items/EnumHoneyComb.java | 13 +- .../apiculture/items/EnumHoneyDrop.java | 16 +- .../apiculture/items/EnumPollenCluster.java | 16 +- .../apiculture/items/EnumPropolis.java | 16 +- .../apiculture/items/HabitatLocatorLogic.java | 27 +- .../apiculture/items/ItemArmorApiarist.java | 27 +- .../forestry/apiculture/items/ItemBeeGE.java | 46 +- .../apiculture/items/ItemBeealyzer.java | 18 +- .../apiculture/items/ItemBlockCandle.java | 21 +- .../apiculture/items/ItemHabitatLocator.java | 39 +- .../apiculture/items/ItemHiveFrame.java | 16 +- .../apiculture/items/ItemHoneycomb.java | 23 +- .../apiculture/items/ItemImprinter.java | 18 +- .../items/ItemMinecartBeehouse.java | 54 +- .../apiculture/items/ItemPollenCluster.java | 18 +- .../apiculture/items/ItemPropolis.java | 18 +- .../items/ItemRegistryApiculture.java | 16 +- .../apiculture/items/ItemWaxCast.java | 15 +- .../multiblock/AlvearyController.java | 53 +- .../AlvearyMultiblockSizeLimits.java | 12 +- .../multiblock/FakeAlvearyController.java | 27 +- .../IAlvearyControllerInternal.java | 13 +- .../multiblock/MultiblockLogicAlveary.java | 16 +- .../apiculture/multiblock/TileAlveary.java | 41 +- .../multiblock/TileAlvearyClimatiser.java | 22 +- .../apiculture/multiblock/TileAlvearyFan.java | 12 +- .../multiblock/TileAlvearyHeater.java | 12 +- .../multiblock/TileAlvearyHygroregulator.java | 38 +- .../multiblock/TileAlvearyPlain.java | 34 +- .../multiblock/TileAlvearySieve.java | 18 +- .../multiblock/TileAlvearyStabiliser.java | 13 +- .../multiblock/TileAlvearySwarmer.java | 31 +- .../network/PacketRegistryApiculture.java | 13 +- .../network/packets/PacketActiveUpdate.java | 20 +- .../network/packets/PacketBeeLogicActive.java | 21 +- .../packets/PacketBeeLogicActiveEntity.java | 21 +- .../packets/PacketBeeLogicEntityRequest.java | 20 +- .../network/packets/PacketCandleUpdate.java | 20 +- .../packets/PacketHabitatBiomePointer.java | 20 +- .../PacketImprintSelectionResponse.java | 20 +- .../apiculture/proxy/ProxyApiculture.java | 12 +- .../proxy/ProxyApicultureClient.java | 15 +- .../apiculture/render/ModelAnalyzer.java | 27 +- .../forestry/apiculture/render/ModelBee.java | 16 +- .../apiculture/render/ParticleRenderer.java | 38 +- .../apiculture/render/RenderBeeEntity.java | 15 +- .../apiculture/render/RenderBeeItem.java | 67 +-- .../apiculture/render/RenderCandleBlock.java | 53 +- .../render/TextureHabitatLocator.java | 12 +- .../apiculture/tiles/TileApiaristChest.java | 19 +- .../forestry/apiculture/tiles/TileApiary.java | 31 +- .../apiculture/tiles/TileBeeHousingBase.java | 28 +- .../apiculture/tiles/TileBeehouse.java | 19 +- .../forestry/apiculture/tiles/TileCandle.java | 20 +- .../forestry/apiculture/tiles/TileSwarm.java | 17 +- .../trigger/ApicultureTriggers.java | 13 +- .../trigger/TriggerMissingDrone.java | 21 +- .../trigger/TriggerMissingQueen.java | 21 +- .../apiculture/trigger/TriggerNoFrames.java | 21 +- .../worldgen/ComponentVillageBeeHouse.java | 132 ++--- .../forestry/apiculture/worldgen/Hive.java | 24 +- .../apiculture/worldgen/HiveDecorator.java | 35 +- .../apiculture/worldgen/HiveDescription.java | 34 +- .../worldgen/HiveDescriptionSwarmer.java | 25 +- .../forestry/apiculture/worldgen/HiveGen.java | 18 +- .../apiculture/worldgen/HiveGenGround.java | 13 +- .../apiculture/worldgen/HiveGenHelper.java | 15 +- .../apiculture/worldgen/HiveGenTree.java | 12 +- .../apiculture/worldgen/HiveRegistry.java | 19 +- .../arboriculture/FruitProviderNone.java | 29 +- .../arboriculture/FruitProviderPod.java | 33 +- .../arboriculture/FruitProviderRandom.java | 23 +- .../arboriculture/FruitProviderRipening.java | 20 +- .../forestry/arboriculture/IWoodTyped.java | 13 +- .../arboriculture/LeafDecayHelper.java | 152 +++-- .../VillageHandlerArboriculture.java | 32 +- .../arboriculture/WoodItemAccess.java | 21 +- .../arboriculture/blocks/BlockArbFence.java | 43 +- .../arboriculture/blocks/BlockArbStairs.java | 38 +- .../blocks/BlockArboriculture.java | 13 +- .../blocks/BlockArboricultureType.java | 14 +- .../blocks/BlockForestryLeaves.java | 80 +-- .../arboriculture/blocks/BlockFruitPod.java | 28 +- .../arboriculture/blocks/BlockLog.java | 32 +- .../arboriculture/blocks/BlockPlanks.java | 26 +- .../blocks/BlockRegistryArboriculture.java | 27 +- .../arboriculture/blocks/BlockSapling.java | 49 +- .../arboriculture/blocks/BlockSlab.java | 38 +- .../blocks/BlockTreeContainer.java | 16 +- .../arboriculture/blocks/BlockWood.java | 34 +- .../arboriculture/commands/CommandTree.java | 12 +- .../commands/CommandTreeSpawn.java | 30 +- .../arboriculture/commands/ForestSpawner.java | 12 +- .../arboriculture/commands/ITreeSpawner.java | 12 +- .../arboriculture/commands/TreeGenHelper.java | 20 +- .../commands/TreeModeHelper.java | 20 +- .../arboriculture/commands/TreeSpawner.java | 12 +- .../commands/TreeStatsSaveHelper.java | 24 +- .../genetics/ArboristTracker.java | 15 +- .../arboriculture/genetics/BranchTrees.java | 12 +- .../genetics/GrowthProvider.java | 41 +- .../genetics/GrowthProviderTropical.java | 38 +- .../genetics/ITreeDefinition.java | 16 +- .../forestry/arboriculture/genetics/Tree.java | 82 ++- .../genetics/TreeBranchDefinition.java | 320 ++++++----- .../genetics/TreeDefinition.java | 517 +++++------------- .../arboriculture/genetics/TreeFactory.java | 30 +- .../arboriculture/genetics/TreeGenome.java | 22 +- .../arboriculture/genetics/TreeHelper.java | 63 ++- .../arboriculture/genetics/TreeMutation.java | 26 +- .../genetics/TreeMutationFactory.java | 16 +- .../genetics/TreekeepingMode.java | 23 +- .../genetics/alleles/AlleleFruit.java | 62 ++- .../genetics/alleles/AlleleGrowth.java | 17 +- .../genetics/alleles/AlleleLeafEffect.java | 20 +- .../alleles/AlleleLeafEffectNone.java | 13 +- .../genetics/alleles/AlleleTreeSpecies.java | 39 +- .../pollination/CheckPollinatable.java | 18 +- .../pollination/CheckPollinatableTree.java | 18 +- .../pollination/FakePollinatable.java | 6 +- .../pollination/ICheckPollinatable.java | 19 +- .../arboriculture/gui/GuiTreealyzer.java | 100 ++-- .../inventory/ItemInventoryTreealyzer.java | 20 +- .../arboriculture/items/ItemBlockLeaves.java | 37 +- .../arboriculture/items/ItemBlockWood.java | 63 +-- .../items/ItemBlockWoodSlab.java | 27 +- .../arboriculture/items/ItemGermlingGE.java | 49 +- .../arboriculture/items/ItemGrafter.java | 24 +- .../items/ItemRegistryArboriculture.java | 18 +- .../arboriculture/items/ItemTreealyzer.java | 18 +- .../network/IRipeningPacketReceiver.java | 13 +- .../network/PacketRegistryArboriculture.java | 13 +- .../network/packets/PacketRipeningUpdate.java | 20 +- .../proxy/ProxyArboriculture.java | 12 +- .../proxy/ProxyArboricultureClient.java | 24 +- .../render/IconProviderGermling.java | 17 +- .../render/IconProviderGermlingVanilla.java | 20 +- .../render/IconProviderLeaves.java | 18 +- .../render/IconProviderWood.java | 21 +- .../arboriculture/render/RenderFenceItem.java | 19 +- .../render/RenderFruitPodBlock.java | 25 +- .../render/RenderLeavesBlock.java | 49 +- .../render/RenderLeavesItem.java | 29 +- .../arboriculture/render/RenderLogItem.java | 25 +- .../arboriculture/render/RenderPlankItem.java | 25 +- .../render/RenderSaplingBlock.java | 37 +- .../arboriculture/render/RenderSlabItem.java | 13 +- .../arboriculture/render/RenderStairItem.java | 20 +- .../arboriculture/render/TextureLeaves.java | 19 +- .../tiles/TileArboristChest.java | 13 +- .../arboriculture/tiles/TileFruitPod.java | 32 +- .../arboriculture/tiles/TileLeaves.java | 56 +- .../arboriculture/tiles/TileSapling.java | 19 +- .../tiles/TileTreeContainer.java | 40 +- .../arboriculture/tiles/TileWood.java | 37 +- .../arboriculture/worldgen/BlockTypeLog.java | 13 +- .../worldgen/BlockTypeVanillaStairs.java | 16 +- .../arboriculture/worldgen/BlockTypeWood.java | 19 +- .../worldgen/BlockTypeWoodStairs.java | 13 +- .../worldgen/ITreeBlockType.java | 16 +- .../arboriculture/worldgen/TreeBlockType.java | 17 +- .../worldgen/TreeBlockTypeLeaf.java | 17 +- .../worldgen/TreeBlockTypeLog.java | 16 +- .../worldgen/WorldGenAcacia.java | 41 +- .../worldgen/WorldGenAcaciaVanilla.java | 12 +- .../worldgen/WorldGenArboriculture.java | 68 +-- .../arboriculture/worldgen/WorldGenBalsa.java | 15 +- .../worldgen/WorldGenBaobab.java | 25 +- .../arboriculture/worldgen/WorldGenBirch.java | 12 +- .../worldgen/WorldGenCherry.java | 16 +- .../worldgen/WorldGenChestnut.java | 25 +- .../worldgen/WorldGenCocobolo.java | 16 +- .../worldgen/WorldGenDarkOak.java | 12 +- .../arboriculture/worldgen/WorldGenDate.java | 15 +- .../arboriculture/worldgen/WorldGenEbony.java | 15 +- .../worldgen/WorldGenGiganteum.java | 12 +- .../worldgen/WorldGenGreenheart.java | 15 +- .../arboriculture/worldgen/WorldGenIpe.java | 25 +- .../worldgen/WorldGenJungle.java | 25 +- .../arboriculture/worldgen/WorldGenKapok.java | 25 +- .../arboriculture/worldgen/WorldGenLarch.java | 15 +- .../arboriculture/worldgen/WorldGenLemon.java | 15 +- .../arboriculture/worldgen/WorldGenMahoe.java | 38 +- .../worldgen/WorldGenMahogany.java | 38 +- .../arboriculture/worldgen/WorldGenMaple.java | 38 +- .../arboriculture/worldgen/WorldGenOak.java | 12 +- .../worldgen/WorldGenPadauk.java | 25 +- .../worldgen/WorldGenPapaya.java | 25 +- .../arboriculture/worldgen/WorldGenPine.java | 38 +- .../arboriculture/worldgen/WorldGenPlum.java | 15 +- .../worldgen/WorldGenPoplar.java | 15 +- .../worldgen/WorldGenSequoia.java | 25 +- .../worldgen/WorldGenSilverLime.java | 35 +- .../worldgen/WorldGenSpruce.java | 16 +- .../arboriculture/worldgen/WorldGenTeak.java | 16 +- .../arboriculture/worldgen/WorldGenTree.java | 53 +- .../worldgen/WorldGenTreeVanilla.java | 13 +- .../worldgen/WorldGenWalnut.java | 28 +- .../arboriculture/worldgen/WorldGenWenge.java | 28 +- .../worldgen/WorldGenWillow.java | 15 +- .../worldgen/WorldGenZebrawood.java | 25 +- .../java/forestry/core/ClimateManager.java | 17 +- .../forestry/core/CreativeTabForestry.java | 19 +- .../forestry/core/DefaultClimateProvider.java | 6 +- .../java/forestry/core/EventHandlerCore.java | 31 +- .../java/forestry/core/IPickupHandler.java | 12 +- .../java/forestry/core/IResupplyHandler.java | 12 +- .../java/forestry/core/ISaveEventHandler.java | 12 +- .../java/forestry/core/PickupHandlerCore.java | 19 +- .../forestry/core/SaveEventHandlerCore.java | 12 +- .../forestry/core/TickHandlerCoreClient.java | 19 +- .../forestry/core/TickHandlerCoreServer.java | 30 +- .../forestry/core/access/AccessHandler.java | 37 +- .../java/forestry/core/access/EnumAccess.java | 18 +- .../core/access/FakeAccessHandler.java | 22 +- .../forestry/core/access/IAccessHandler.java | 15 +- .../core/access/IAccessOwnerListener.java | 13 +- .../java/forestry/core/access/IOwnable.java | 15 +- .../core/access/IRestrictedAccess.java | 13 +- .../java/forestry/core/blocks/BlockBase.java | 50 +- .../java/forestry/core/blocks/BlockCore.java | 13 +- .../forestry/core/blocks/BlockCoreType.java | 18 +- .../forestry/core/blocks/BlockForestry.java | 27 +- .../forestry/core/blocks/BlockRegistry.java | 24 +- .../core/blocks/BlockRegistryCore.java | 18 +- .../core/blocks/BlockResourceOre.java | 28 +- .../core/blocks/BlockResourceStorage.java | 14 +- .../java/forestry/core/blocks/BlockSoil.java | 32 +- .../forestry/core/blocks/BlockStructure.java | 32 +- .../java/forestry/core/blocks/IItemTyped.java | 1 + .../core/blocks/IMachineProperties.java | 13 +- .../core/blocks/IMachinePropertiesTESR.java | 13 +- .../java/forestry/core/circuits/Circuit.java | 15 +- .../forestry/core/circuits/CircuitBoard.java | 22 +- .../forestry/core/circuits/CircuitId.java | 13 +- .../forestry/core/circuits/CircuitLayout.java | 12 +- .../core/circuits/CircuitLibrary.java | 15 +- .../forestry/core/circuits/CircuitRecipe.java | 15 +- .../core/circuits/CircuitRegistry.java | 28 +- .../core/circuits/ContainerSolderingIron.java | 20 +- .../core/circuits/EnumCircuitBoardType.java | 13 +- .../core/circuits/GuiSolderingIron.java | 30 +- .../forestry/core/circuits/ISocketable.java | 16 +- .../core/circuits/ISolderingIron.java | 15 +- .../core/circuits/ISpeedUpgradable.java | 13 +- .../core/circuits/ItemCircuitBoard.java | 32 +- .../forestry/core/circuits/SolderManager.java | 21 +- .../core/commands/CommandHelpers.java | 37 +- .../forestry/core/commands/CommandMode.java | 12 +- .../core/commands/CommandModeInfo.java | 19 +- .../core/commands/CommandModeSet.java | 14 +- .../core/commands/CommandPlugins.java | 25 +- .../core/commands/CommandSaveStats.java | 95 ++-- .../core/commands/CommandVersion.java | 17 +- .../core/commands/ICommandModeHelper.java | 13 +- .../core/commands/IForestryCommand.java | 13 +- .../core/commands/IStatsSaveHelper.java | 19 +- .../forestry/core/commands/RootCommand.java | 17 +- .../commands/SpeciesNotFoundException.java | 12 +- .../forestry/core/commands/SubCommand.java | 16 +- .../commands/TemplateNotFoundException.java | 15 +- .../java/forestry/core/config/Config.java | 138 +++-- .../java/forestry/core/config/Constants.java | 15 +- .../core/config/ForestryGuiConfig.java | 22 +- .../core/config/ForestryGuiConfigFactory.java | 17 +- .../java/forestry/core/config/GameMode.java | 25 +- .../core/config/LocalizedConfiguration.java | 34 +- .../forestry/core/config/SessionVars.java | 12 +- .../java/forestry/core/config/Version.java | 58 +- .../entities/EntityFXColoredDropParticle.java | 26 +- .../core/entities/EntityFXHoneydust.java | 12 +- .../core/entities/EntityFXIgnition.java | 32 +- .../forestry/core/entities/EntityFXSnow.java | 40 +- .../EntityMinecartContainerForestry.java | 20 +- .../core/entities/EntityMinecartForestry.java | 33 +- .../core/entities/EntitySelector.java | 13 +- .../forestry/core/errors/EnumErrorCode.java | 25 +- .../java/forestry/core/errors/ErrorLogic.java | 23 +- .../core/errors/ErrorStateRegistry.java | 28 +- .../forestry/core/errors/FakeErrorLogic.java | 20 +- .../forestry/core/errors/FakeErrorSource.java | 14 +- .../core/fluids/BlockForestryFluid.java | 45 +- .../forestry/core/fluids/FakeTankManager.java | 17 +- .../core/fluids/FakeTankUpdateHandler.java | 12 +- .../forestry/core/fluids/FluidHelper.java | 60 +- .../java/forestry/core/fluids/Fluids.java | 43 +- .../forestry/core/fluids/ITankManager.java | 14 +- .../core/fluids/ITankUpdateHandler.java | 13 +- .../core/fluids/LiquidRegistryHelper.java | 28 +- .../forestry/core/fluids/PipetteContents.java | 17 +- .../forestry/core/fluids/TankManager.java | 50 +- .../forestry/core/fluids/tanks/FakeTank.java | 16 +- .../core/fluids/tanks/FilteredTank.java | 26 +- .../core/fluids/tanks/StandardTank.java | 33 +- .../java/forestry/core/genetics/Branch.java | 12 +- .../core/genetics/BreedingTracker.java | 63 +-- .../forestry/core/genetics/Chromosome.java | 18 +- .../core/genetics/Classification.java | 17 +- .../forestry/core/genetics/EffectData.java | 15 +- .../core/genetics/GenericRatings.java | 15 +- .../java/forestry/core/genetics/Genome.java | 92 ++-- .../core/genetics/IBranchDefinition.java | 1 + .../forestry/core/genetics/Individual.java | 19 +- .../core/genetics/IndividualLiving.java | 17 +- .../java/forestry/core/genetics/ItemGE.java | 29 +- .../core/genetics/ItemResearchNote.java | 90 +-- .../forestry/core/genetics/SpeciesRoot.java | 30 +- .../core/genetics/alleles/Allele.java | 15 +- .../core/genetics/alleles/AlleleArea.java | 12 +- .../core/genetics/alleles/AlleleBoolean.java | 12 +- .../genetics/alleles/AlleleCategorized.java | 12 +- .../core/genetics/alleles/AlleleFactory.java | 69 +-- .../core/genetics/alleles/AlleleFloat.java | 12 +- .../core/genetics/alleles/AlleleHelper.java | 101 ++-- .../core/genetics/alleles/AlleleInteger.java | 12 +- .../genetics/alleles/AllelePlantType.java | 20 +- .../core/genetics/alleles/AlleleRegistry.java | 48 +- .../core/genetics/alleles/AlleleSpecies.java | 47 +- .../genetics/alleles/AlleleTolerance.java | 12 +- .../core/genetics/alleles/EnumAllele.java | 18 +- .../core/genetics/alleles/IAlleleHelper.java | 12 +- .../core/genetics/alleles/IAlleleValue.java | 1 + .../genetics/mutations/EnumMutateChance.java | 13 +- .../core/genetics/mutations/Mutation.java | 38 +- .../mutations/MutationConditionBiome.java | 38 +- .../mutations/MutationConditionDaytime.java | 27 +- .../mutations/MutationConditionHumidity.java | 31 +- .../MutationConditionRequiresResource.java | 54 +- ...ationConditionRequiresResourceOreDict.java | 55 +- .../MutationConditionTemperature.java | 30 +- .../MutationConditionTimeLimited.java | 33 +- .../forestry/core/gui/ContainerAlyzer.java | 3 +- .../forestry/core/gui/ContainerAnalyzer.java | 15 +- .../forestry/core/gui/ContainerDummy.java | 13 +- .../forestry/core/gui/ContainerEntity.java | 26 +- .../core/gui/ContainerEscritoire.java | 36 +- .../forestry/core/gui/ContainerForestry.java | 30 +- .../core/gui/ContainerItemInventory.java | 17 +- .../core/gui/ContainerLiquidTanks.java | 15 +- .../core/gui/ContainerLiquidTanksHelper.java | 21 +- .../gui/ContainerLiquidTanksSocketed.java | 17 +- .../gui/ContainerNaturalistInventory.java | 25 +- .../forestry/core/gui/ContainerSocketed.java | 15 +- .../core/gui/ContainerSocketedHelper.java | 19 +- .../java/forestry/core/gui/ContainerTile.java | 23 +- .../java/forestry/core/gui/GuiAlyzer.java | 107 ++-- .../java/forestry/core/gui/GuiAnalyzer.java | 15 +- .../java/forestry/core/gui/GuiEscritoire.java | 25 +- .../java/forestry/core/gui/GuiForestry.java | 51 +- .../forestry/core/gui/GuiForestryTitled.java | 15 +- .../java/forestry/core/gui/GuiHandler.java | 18 +- src/main/java/forestry/core/gui/GuiId.java | 13 +- .../java/forestry/core/gui/GuiIdRegistry.java | 29 +- .../core/gui/GuiNaturalistInventory.java | 47 +- .../java/forestry/core/gui/GuiTextBox.java | 19 +- src/main/java/forestry/core/gui/GuiType.java | 12 +- src/main/java/forestry/core/gui/GuiUtil.java | 50 +- .../forestry/core/gui/IContainerCrafting.java | 13 +- .../core/gui/IContainerLiquidTanks.java | 13 +- .../forestry/core/gui/IContainerSocketed.java | 13 +- .../forestry/core/gui/IGuiHandlerEntity.java | 13 +- .../core/gui/IGuiHandlerForestry.java | 15 +- .../forestry/core/gui/IGuiHandlerItem.java | 13 +- .../forestry/core/gui/IGuiHandlerTile.java | 16 +- .../forestry/core/gui/IGuiSelectable.java | 16 +- .../java/forestry/core/gui/IHintSource.java | 13 +- .../forestry/core/gui/IPagedInventory.java | 12 +- .../forestry/core/gui/TextLayoutHelper.java | 21 +- .../core/gui/buttons/GuiBetterButton.java | 39 +- .../core/gui/buttons/IButtonTextureSet.java | 12 +- .../buttons/StandardButtonTextureSets.java | 14 +- .../core/gui/ledgers/ClimateLedger.java | 21 +- .../core/gui/ledgers/ErrorLedger.java | 15 +- .../forestry/core/gui/ledgers/HintLedger.java | 26 +- .../forestry/core/gui/ledgers/Ledger.java | 43 +- .../core/gui/ledgers/LedgerManager.java | 24 +- .../core/gui/ledgers/OwnerLedger.java | 23 +- .../core/gui/ledgers/PowerLedger.java | 12 +- .../core/gui/slots/SlotCraftMatrix.java | 15 +- .../forestry/core/gui/slots/SlotCrafter.java | 21 +- .../forestry/core/gui/slots/SlotFiltered.java | 20 +- .../core/gui/slots/SlotFilteredInventory.java | 20 +- .../forestry/core/gui/slots/SlotForestry.java | 20 +- .../forestry/core/gui/slots/SlotLocked.java | 12 +- .../forestry/core/gui/slots/SlotOutput.java | 17 +- .../forestry/core/gui/slots/SlotWatched.java | 20 +- .../forestry/core/gui/slots/SlotWorking.java | 12 +- .../core/gui/tooltips/IToolTipProvider.java | 12 +- .../forestry/core/gui/tooltips/ToolTip.java | 15 +- .../core/gui/tooltips/ToolTipLine.java | 12 +- .../core/gui/widgets/GameTokenWidget.java | 27 +- .../core/gui/widgets/ItemStackWidget.java | 13 +- .../core/gui/widgets/ItemStackWidgetBase.java | 18 +- .../core/gui/widgets/ProbeButton.java | 18 +- .../core/gui/widgets/ReservoirWidget.java | 13 +- .../core/gui/widgets/SocketWidget.java | 37 +- .../forestry/core/gui/widgets/TankWidget.java | 36 +- .../forestry/core/gui/widgets/Widget.java | 16 +- .../core/gui/widgets/WidgetManager.java | 19 +- .../inventory/AdjacentInventoryCache.java | 23 +- .../core/inventory/FakeInventoryAdapter.java | 15 +- .../core/inventory/IInventoryAdapter.java | 6 +- .../core/inventory/InventoryAdapter.java | 36 +- .../inventory/InventoryAdapterRestricted.java | 18 +- .../core/inventory/InventoryAdapterTile.java | 15 +- .../core/inventory/InventoryAnalyzer.java | 18 +- .../core/inventory/InventoryEscritoire.java | 19 +- .../inventory/InventoryNaturalistChest.java | 18 +- .../core/inventory/InventoryPlain.java | 17 +- .../core/inventory/ItemInventory.java | 17 +- .../core/inventory/ItemInventoryAlyzer.java | 27 +- .../inventory/ItemInventorySolderingIron.java | 23 +- .../inventory/filters/ArrayStackFilter.java | 15 +- .../core/inventory/filters/IStackFilter.java | 17 +- .../filters/InvertedStackFilter.java | 12 +- .../core/inventory/filters/StackFilter.java | 24 +- .../manipulators/InventoryManipulator.java | 22 +- .../watchers/FakeSlotChangeWatcher.java | 13 +- .../watchers/FakeSlotPickupWatcher.java | 12 +- .../watchers/ISlotChangeWatcher.java | 13 +- .../watchers/ISlotPickupWatcher.java | 13 +- .../core/inventory/wrappers/ChestWrapper.java | 39 +- .../core/inventory/wrappers/IInvSlot.java | 12 +- .../inventory/wrappers/InventoryCopy.java | 19 +- .../inventory/wrappers/InventoryIterator.java | 14 +- .../inventory/wrappers/InventoryMapper.java | 20 +- .../wrappers/SidedInventoryIterator.java | 14 +- .../wrappers/SidedInventoryMapper.java | 16 +- .../core/items/EnumContainerType.java | 13 +- .../forestry/core/items/EnumElectronTube.java | 33 +- .../forestry/core/items/ICraftingPlan.java | 13 +- .../core/items/ItemArmorNaturalist.java | 25 +- .../forestry/core/items/ItemAssemblyKit.java | 21 +- .../core/items/ItemBlockForestry.java | 35 +- .../forestry/core/items/ItemBlockNBT.java | 15 +- .../forestry/core/items/ItemBlockTyped.java | 18 +- .../core/items/ItemCraftingMaterial.java | 27 +- .../java/forestry/core/items/ItemCrated.java | 30 +- .../forestry/core/items/ItemElectronTube.java | 36 +- .../forestry/core/items/ItemForestry.java | 24 +- .../core/items/ItemForestryBonemeal.java | 26 +- .../forestry/core/items/ItemForestryFood.java | 21 +- .../core/items/ItemForestryMultiPass.java | 17 +- .../forestry/core/items/ItemForestryTool.java | 22 +- .../java/forestry/core/items/ItemFruit.java | 30 +- .../core/items/ItemLiquidContainer.java | 49 +- .../java/forestry/core/items/ItemOverlay.java | 28 +- .../java/forestry/core/items/ItemPipette.java | 33 +- .../forestry/core/items/ItemRegistry.java | 16 +- .../forestry/core/items/ItemRegistryCore.java | 18 +- .../core/items/ItemRegistryFluids.java | 22 +- .../java/forestry/core/items/ItemScoop.java | 13 +- .../core/items/ItemSolderingIron.java | 18 +- .../java/forestry/core/items/ItemWithGui.java | 23 +- .../java/forestry/core/items/ItemWrench.java | 30 +- .../multiblock/FakeMultiblockController.java | 32 +- .../IMultiblockControllerInternal.java | 79 +-- .../multiblock/IMultiblockSizeLimits.java | 37 +- .../MultiblockClientTickHandler.java | 3 +- .../multiblock/MultiblockControllerBase.java | 172 +++--- .../MultiblockControllerForestry.java | 25 +- .../multiblock/MultiblockEventHandler.java | 13 +- .../core/multiblock/MultiblockLogic.java | 55 +- .../multiblock/MultiblockLogicFactory.java | 12 +- .../core/multiblock/MultiblockRegistry.java | 39 +- .../MultiblockServerTickHandler.java | 11 +- .../MultiblockTileEntityForestry.java | 27 +- .../core/multiblock/MultiblockUtil.java | 26 +- .../MultiblockValidationException.java | 5 +- .../multiblock/MultiblockWorldRegistry.java | 46 +- .../RectangularMultiblockControllerBase.java | 15 +- .../core/network/DataInputStreamForestry.java | 4 +- .../network/DataOutputStreamForestry.java | 4 +- .../forestry/core/network/ForestryPacket.java | 18 +- .../core/network/IForestryPacket.java | 16 +- .../core/network/IForestryPacketClient.java | 14 +- .../core/network/IForestryPacketServer.java | 14 +- .../forestry/core/network/ILocatedPacket.java | 13 +- .../java/forestry/core/network/IPacketId.java | 13 +- .../core/network/IPacketRegistry.java | 13 +- .../forestry/core/network/IStreamable.java | 13 +- .../forestry/core/network/IStreamableGui.java | 13 +- .../forestry/core/network/PacketHandler.java | 23 +- .../forestry/core/network/PacketIdClient.java | 16 +- .../forestry/core/network/PacketIdServer.java | 16 +- .../forestry/core/network/PacketRegistry.java | 13 +- .../core/network/PacketRegistryCore.java | 13 +- .../core/network/PacketRegistryDummy.java | 13 +- .../network/packets/PacketAccessSwitch.java | 20 +- .../packets/PacketAccessSwitchEntity.java | 20 +- .../network/packets/PacketAccessUpdate.java | 21 +- .../packets/PacketAccessUpdateEntity.java | 21 +- .../network/packets/PacketChipsetClick.java | 22 +- .../network/packets/PacketCoordinates.java | 22 +- .../core/network/packets/PacketDummy.java | 16 +- .../network/packets/PacketDummyClient.java | 19 +- .../network/packets/PacketDummyServer.java | 19 +- .../network/packets/PacketEntityUpdate.java | 21 +- .../network/packets/PacketErrorUpdate.java | 20 +- .../packets/PacketErrorUpdateEntity.java | 21 +- .../core/network/packets/PacketFXSignal.java | 40 +- .../packets/PacketGenomeTrackerSync.java | 22 +- .../core/network/packets/PacketGuiEnergy.java | 18 +- .../packets/PacketGuiLayoutSelect.java | 20 +- .../core/network/packets/PacketGuiSelect.java | 16 +- .../packets/PacketGuiSelectRequest.java | 20 +- .../core/network/packets/PacketGuiUpdate.java | 20 +- .../packets/PacketGuiUpdateEntity.java | 21 +- .../packets/PacketItemStackDisplay.java | 22 +- .../core/network/packets/PacketNBT.java | 18 +- .../network/packets/PacketPipetteClick.java | 20 +- .../core/network/packets/PacketSlotClick.java | 19 +- .../network/packets/PacketSocketUpdate.java | 22 +- .../packets/PacketSolderingIronClick.java | 22 +- .../core/network/packets/PacketString.java | 15 +- .../packets/PacketTankLevelUpdate.java | 22 +- .../network/packets/PacketTileStream.java | 20 +- .../java/forestry/core/proxy/Proxies.java | 13 +- .../java/forestry/core/proxy/ProxyCommon.java | 45 +- .../core/proxy/ProxyCommonClient.java | 23 +- .../forestry/core/proxy/ProxyNetwork.java | 21 +- .../core/proxy/ProxyNetworkClient.java | 15 +- .../java/forestry/core/proxy/ProxyRender.java | 19 +- .../core/proxy/ProxyRenderClient.java | 45 +- .../forestry/core/recipes/RecipeUtil.java | 76 ++- .../core/recipes/ShapedRecipeCustom.java | 19 +- .../craftguide/CraftGuideCustomRecipes.java | 21 +- .../craftguide/CraftGuideIntegration.java | 15 +- .../recipes/nei/CustomOverlayHandler.java | 25 +- .../core/recipes/nei/IRecipeHandlerBase.java | 13 +- .../core/recipes/nei/ItemFilterForestry.java | 18 +- .../core/recipes/nei/ItemFilterGenetic.java | 16 +- .../core/recipes/nei/ItemFilterOther.java | 15 +- .../recipes/nei/NEIIntegrationConfig.java | 21 +- .../forestry/core/recipes/nei/NEIUtils.java | 13 +- .../core/recipes/nei/PositionedFluidTank.java | 47 +- .../core/recipes/nei/PositionedStackAdv.java | 33 +- .../core/recipes/nei/RecipeHandlerBase.java | 63 +-- .../recipes/nei/SetRecipeCommandHandler.java | 14 +- .../forestry/core/render/EnumTankLevel.java | 13 +- .../java/forestry/core/render/FontColour.java | 15 +- .../core/render/ForestryResource.java | 15 +- .../forestry/core/render/IBlockRenderer.java | 13 +- .../forestry/core/render/ModelEscritoire.java | 95 +--- .../forestry/core/render/ParticleHelper.java | 57 +- .../forestry/core/render/RenderAnalyzer.java | 19 +- .../forestry/core/render/RenderBlock.java | 22 +- .../forestry/core/render/RenderCrateItem.java | 39 +- .../core/render/RenderEscritoire.java | 49 +- .../forestry/core/render/RenderMachine.java | 41 +- .../java/forestry/core/render/RenderMill.java | 22 +- .../core/render/RenderNaturalistChest.java | 26 +- .../core/render/RenderOverlayBlock.java | 103 +--- .../forestry/core/render/SpriteSheet.java | 13 +- .../forestry/core/render/TankRenderInfo.java | 18 +- .../forestry/core/render/TextureManager.java | 79 +-- .../core/render/TileRendererIndex.java | 13 +- .../core/tiles/AdjacentTileCache.java | 16 +- .../forestry/core/tiles/EscritoireGame.java | 27 +- .../core/tiles/EscritoireGameBoard.java | 31 +- .../core/tiles/EscritoireGameToken.java | 26 +- .../core/tiles/EscritoireTextSource.java | 23 +- .../forestry/core/tiles/IActivatable.java | 12 +- .../java/forestry/core/tiles/IClimatised.java | 12 +- .../core/tiles/IFilterSlotDelegate.java | 19 +- .../core/tiles/IItemStackDisplay.java | 13 +- .../forestry/core/tiles/ILiquidTankTile.java | 12 +- .../java/forestry/core/tiles/ILocatable.java | 13 +- .../forestry/core/tiles/IPowerHandler.java | 13 +- .../forestry/core/tiles/IRenderableTile.java | 15 +- .../java/forestry/core/tiles/ITitled.java | 1 + .../core/tiles/MachineDefinition.java | 37 +- .../forestry/core/tiles/TemperatureState.java | 13 +- .../forestry/core/tiles/TileAnalyzer.java | 45 +- .../java/forestry/core/tiles/TileBase.java | 21 +- .../java/forestry/core/tiles/TileEngine.java | 39 +- .../forestry/core/tiles/TileEscritoire.java | 33 +- .../forestry/core/tiles/TileForestry.java | 55 +- .../java/forestry/core/tiles/TileMill.java | 15 +- .../core/tiles/TileNaturalistChest.java | 26 +- .../java/forestry/core/tiles/TilePowered.java | 25 +- .../java/forestry/core/tiles/TileUtil.java | 17 +- .../java/forestry/core/triggers/Trigger.java | 17 +- .../java/forestry/core/utils/BlockUtil.java | 66 +-- .../java/forestry/core/utils/ClimateUtil.java | 26 +- .../java/forestry/core/utils/ColourUtil.java | 12 +- .../core/utils/DamageSourceForestry.java | 12 +- .../java/forestry/core/utils/DayMonth.java | 12 +- .../java/forestry/core/utils/EntityUtil.java | 52 +- .../utils/ForestryModEnvWarningCallable.java | 20 +- .../forestry/core/utils/GeneticsUtil.java | 52 +- .../forestry/core/utils/InventoryUtil.java | 152 +++-- .../forestry/core/utils/ItemStackUtil.java | 31 +- src/main/java/forestry/core/utils/Log.java | 19 +- .../java/forestry/core/utils/ModUtil.java | 13 +- .../java/forestry/core/utils/NBTUtil.java | 20 +- .../java/forestry/core/utils/PlayerUtil.java | 23 +- .../java/forestry/core/utils/SlotUtil.java | 34 +- src/main/java/forestry/core/utils/Stack.java | 25 +- .../java/forestry/core/utils/StringUtil.java | 39 +- .../core/utils/datastructures/FluidMap.java | 13 +- .../utils/datastructures/ItemStackMap.java | 13 +- .../utils/datastructures/RevolvingList.java | 15 +- .../core/utils/datastructures/StackMap.java | 12 +- .../java/forestry/core/utils/vect/IVect.java | 16 +- .../forestry/core/utils/vect/MutableVect.java | 18 +- .../java/forestry/core/utils/vect/Vect.java | 19 +- .../forestry/core/utils/vect/VectUtil.java | 13 +- .../forestry/core/worldgen/BlockType.java | 16 +- .../core/worldgen/BlockTypeTileForestry.java | 18 +- .../forestry/core/worldgen/BlockTypeVoid.java | 12 +- .../forestry/core/worldgen/IBlockType.java | 13 +- .../forestry/core/worldgen/WorldGenBase.java | 49 +- .../core/worldgen/WorldGenMinableMeta.java | 16 +- .../core/worldgen/WorldGenerator.java | 50 +- .../java/forestry/energy/EnergyManager.java | 21 +- .../forestry/energy/blocks/BlockEngine.java | 32 +- .../energy/blocks/BlockEngineType.java | 14 +- .../energy/blocks/BlockRegistryEnergy.java | 13 +- .../energy/circuits/CircuitElectricBoost.java | 12 +- .../circuits/CircuitElectricChange.java | 12 +- .../energy/circuits/CircuitElectricChoke.java | 12 +- .../circuits/CircuitElectricEfficiency.java | 12 +- .../energy/gui/ContainerEngineBiogas.java | 17 +- .../energy/gui/ContainerEngineElectric.java | 15 +- .../energy/gui/ContainerEnginePeat.java | 17 +- .../energy/gui/ContainerGenerator.java | 17 +- .../java/forestry/energy/gui/GuiEngine.java | 15 +- .../forestry/energy/gui/GuiEngineBiogas.java | 23 +- .../energy/gui/GuiEngineElectric.java | 15 +- .../forestry/energy/gui/GuiEnginePeat.java | 15 +- .../forestry/energy/gui/GuiGenerator.java | 15 +- .../energy/gui/widgets/BiogasSlot.java | 18 +- .../inventory/InventoryEngineBiogas.java | 18 +- .../energy/inventory/InventoryEnginePeat.java | 16 +- .../energy/inventory/InventoryGenerator.java | 18 +- .../forestry/energy/proxy/ProxyEnergy.java | 13 +- .../energy/proxy/ProxyEnergyClient.java | 12 +- .../forestry/energy/render/RenderEngine.java | 53 +- .../energy/tiles/EngineDefinition.java | 15 +- .../energy/tiles/InventoryEngineElectric.java | 18 +- .../energy/tiles/TileEngineBiogas.java | 39 +- .../energy/tiles/TileEngineClockwork.java | 25 +- .../energy/tiles/TileEngineElectric.java | 29 +- .../forestry/energy/tiles/TileEnginePeat.java | 48 +- .../forestry/energy/tiles/TileGenerator.java | 40 +- .../java/forestry/factory/DummyManagers.java | 43 +- .../factory/blocks/BlockFactoryPlain.java | 13 +- .../factory/blocks/BlockFactoryPlainType.java | 19 +- .../factory/blocks/BlockFactoryTESR.java | 13 +- .../factory/blocks/BlockFactoryTesrType.java | 20 +- .../factory/blocks/BlockRegistryFactory.java | 13 +- .../factory/circuits/CircuitSpeedUpgrade.java | 12 +- .../factory/gui/ContainerBottler.java | 15 +- .../factory/gui/ContainerCarpenter.java | 21 +- .../factory/gui/ContainerCentrifuge.java | 15 +- .../factory/gui/ContainerFabricator.java | 34 +- .../factory/gui/ContainerFermenter.java | 17 +- .../factory/gui/ContainerMoistener.java | 19 +- .../factory/gui/ContainerRaintank.java | 17 +- .../factory/gui/ContainerSqueezer.java | 15 +- .../forestry/factory/gui/ContainerStill.java | 15 +- .../factory/gui/ContainerWorktable.java | 35 +- .../java/forestry/factory/gui/GuiBottler.java | 15 +- .../forestry/factory/gui/GuiCarpenter.java | 22 +- .../forestry/factory/gui/GuiCentrifuge.java | 15 +- .../forestry/factory/gui/GuiFabricator.java | 15 +- .../forestry/factory/gui/GuiFermenter.java | 22 +- .../forestry/factory/gui/GuiMoistener.java | 15 +- .../forestry/factory/gui/GuiRaintank.java | 15 +- .../forestry/factory/gui/GuiSqueezer.java | 15 +- .../java/forestry/factory/gui/GuiStill.java | 22 +- .../forestry/factory/gui/GuiWorktable.java | 37 +- .../factory/gui/widgets/ClearWorktable.java | 12 +- .../gui/widgets/MemorizedRecipeSlot.java | 21 +- .../factory/inventory/InventoryBottler.java | 20 +- .../factory/inventory/InventoryCarpenter.java | 18 +- .../inventory/InventoryCentrifuge.java | 16 +- .../inventory/InventoryCraftingForestry.java | 18 +- .../inventory/InventoryFabricator.java | 16 +- .../factory/inventory/InventoryFermenter.java | 18 +- .../inventory/InventoryGhostCrafting.java | 18 +- .../factory/inventory/InventoryMoistener.java | 18 +- .../factory/inventory/InventoryRainmaker.java | 16 +- .../factory/inventory/InventoryRaintank.java | 16 +- .../factory/inventory/InventorySqueezer.java | 22 +- .../factory/inventory/InventoryStill.java | 18 +- .../factory/inventory/InventoryWorktable.java | 16 +- .../network/PacketRegistryFactory.java | 13 +- .../packets/PacketWorktableMemoryUpdate.java | 20 +- .../packets/PacketWorktableNEISelect.java | 26 +- .../packets/PacketWorktableRecipeUpdate.java | 21 +- .../factory/recipes/BottlerRecipe.java | 18 +- .../factory/recipes/CarpenterRecipe.java | 24 +- .../recipes/CarpenterRecipeManager.java | 43 +- .../factory/recipes/CentrifugeRecipe.java | 18 +- .../recipes/CentrifugeRecipeManager.java | 23 +- .../factory/recipes/FabricatorRecipe.java | 22 +- .../recipes/FabricatorRecipeManager.java | 38 +- .../recipes/FabricatorSmeltingRecipe.java | 15 +- .../FabricatorSmeltingRecipeManager.java | 23 +- .../factory/recipes/FermenterRecipe.java | 21 +- .../recipes/FermenterRecipeManager.java | 29 +- .../recipes/ISqueezerContainerRecipe.java | 16 +- .../factory/recipes/MemorizedRecipe.java | 27 +- .../factory/recipes/MoistenerRecipe.java | 15 +- .../recipes/MoistenerRecipeManager.java | 22 +- .../factory/recipes/RecipeMemory.java | 25 +- .../recipes/SqueezerContainerRecipe.java | 27 +- .../factory/recipes/SqueezerRecipe.java | 21 +- .../recipes/SqueezerRecipeManager.java | 45 +- .../forestry/factory/recipes/StillRecipe.java | 16 +- .../factory/recipes/StillRecipeManager.java | 20 +- .../recipes/craftguide/CraftGuideBottler.java | 26 +- .../craftguide/CraftGuideCarpenter.java | 27 +- .../craftguide/CraftGuideCentrifuge.java | 33 +- .../craftguide/CraftGuideFabricator.java | 25 +- .../craftguide/CraftGuideFermenter.java | 24 +- .../craftguide/CraftGuideSqueezer.java | 27 +- .../recipes/craftguide/CraftGuideStill.java | 21 +- .../recipes/nei/NEIHandlerBottler.java | 34 +- .../recipes/nei/NEIHandlerCarpenter.java | 36 +- .../recipes/nei/NEIHandlerCentrifuge.java | 63 ++- .../recipes/nei/NEIHandlerFabricator.java | 57 +- .../recipes/nei/NEIHandlerFermenter.java | 58 +- .../recipes/nei/NEIHandlerMoistener.java | 32 +- .../recipes/nei/NEIHandlerSqueezer.java | 52 +- .../factory/recipes/nei/NEIHandlerStill.java | 54 +- .../factory/tiles/ICrafterWorktable.java | 1 + .../forestry/factory/tiles/TileBottler.java | 45 +- .../forestry/factory/tiles/TileCarpenter.java | 60 +- .../factory/tiles/TileCentrifuge.java | 48 +- .../factory/tiles/TileFabricator.java | 60 +- .../forestry/factory/tiles/TileFermenter.java | 45 +- .../factory/tiles/TileMillRainmaker.java | 18 +- .../forestry/factory/tiles/TileMoistener.java | 61 +-- .../forestry/factory/tiles/TileRaintank.java | 43 +- .../forestry/factory/tiles/TileSqueezer.java | 35 +- .../forestry/factory/tiles/TileStill.java | 33 +- .../forestry/factory/tiles/TileWorktable.java | 46 +- .../factory/triggers/FactoryTriggers.java | 13 +- .../factory/triggers/TriggerLowFuel.java | 21 +- .../factory/triggers/TriggerLowResource.java | 21 +- .../java/forestry/farming/FarmHelper.java | 34 +- .../java/forestry/farming/FarmTarget.java | 17 +- .../forestry/farming/blocks/BlockFarm.java | 42 +- .../farming/blocks/BlockFarmType.java | 13 +- .../farming/blocks/BlockMushroom.java | 31 +- .../farming/blocks/BlockRegistryFarming.java | 13 +- .../farming/circuits/CircuitFarmLogic.java | 12 +- .../forestry/farming/gui/ContainerFarm.java | 25 +- .../java/forestry/farming/gui/FarmLedger.java | 19 +- .../java/forestry/farming/gui/GuiFarm.java | 15 +- .../farming/gui/IFarmLedgerDelegate.java | 13 +- .../farming/gui/widgets/FarmLogicSlot.java | 29 +- .../forestry/farming/items/ItemBlockFarm.java | 21 +- .../java/forestry/farming/logic/Crop.java | 22 +- .../farming/logic/CropBasicAgriCraft.java | 32 +- .../farming/logic/CropBasicFruit.java | 26 +- .../farming/logic/CropBasicGrowthCraft.java | 28 +- .../farming/logic/CropBasicIC2Crop.java | 7 +- .../forestry/farming/logic/CropBlock.java | 22 +- .../forestry/farming/logic/CropFruit.java | 24 +- .../java/forestry/farming/logic/CropPeat.java | 28 +- .../forestry/farming/logic/CropRubber.java | 24 +- .../forestry/farming/logic/FarmLogic.java | 36 +- .../farming/logic/FarmLogicArboreal.java | 49 +- .../farming/logic/FarmLogicCereal.java | 17 +- .../farming/logic/FarmLogicCocoa.java | 40 +- .../farming/logic/FarmLogicCrops.java | 27 +- .../farming/logic/FarmLogicEnder.java | 28 +- .../farming/logic/FarmLogicGourd.java | 26 +- .../farming/logic/FarmLogicHomogeneous.java | 30 +- .../farming/logic/FarmLogicIC2Crops.java | 13 +- .../farming/logic/FarmLogicInfernal.java | 28 +- .../farming/logic/FarmLogicOrchard.java | 44 +- .../forestry/farming/logic/FarmLogicPeat.java | 27 +- .../farming/logic/FarmLogicReeds.java | 28 +- .../farming/logic/FarmLogicRubber.java | 40 +- .../farming/logic/FarmLogicShroom.java | 24 +- .../farming/logic/FarmLogicSucculent.java | 28 +- .../farming/logic/FarmLogicVegetable.java | 17 +- .../farming/logic/FarmLogicWatered.java | 34 +- .../farming/logic/FarmableBasicAgricraft.java | 21 +- .../farming/logic/FarmableBasicFruit.java | 21 +- .../logic/FarmableBasicGrowthCraft.java | 21 +- .../farming/logic/FarmableBasicIC2Crop.java | 10 +- .../forestry/farming/logic/FarmableCocoa.java | 21 +- .../forestry/farming/logic/FarmableGE.java | 22 +- .../farming/logic/FarmableGenericCrop.java | 19 +- .../farming/logic/FarmableGenericSapling.java | 21 +- .../forestry/farming/logic/FarmableGourd.java | 21 +- .../farming/logic/FarmableReference.java | 16 +- .../farming/logic/FarmableStacked.java | 21 +- .../logic/FarmableVanillaMushroom.java | 23 +- .../farming/logic/FarmableVanillaSapling.java | 23 +- .../multiblock/FakeFarmController.java | 24 +- .../farming/multiblock/FarmController.java | 100 ++-- .../multiblock/FarmFertilizerManager.java | 19 +- .../multiblock/FarmHydrationManager.java | 23 +- .../multiblock/FarmMultiblockSizeLimits.java | 13 +- .../multiblock/IFarmControllerInternal.java | 22 +- .../farming/multiblock/InventoryFarm.java | 36 +- .../multiblock/MultiblockLogicFarm.java | 18 +- .../forestry/farming/proxy/ProxyFarming.java | 12 +- .../farming/proxy/ProxyFarmingClient.java | 21 +- .../farming/render/EnumFarmBlockTexture.java | 23 +- .../farming/render/RenderFarmBlock.java | 27 +- .../farming/render/RenderFarmItem.java | 22 +- .../java/forestry/farming/tiles/TileFarm.java | 40 +- .../farming/tiles/TileFarmControl.java | 21 +- .../farming/tiles/TileFarmGearbox.java | 17 +- .../forestry/farming/tiles/TileFarmHatch.java | 32 +- .../forestry/farming/tiles/TileFarmPlain.java | 20 +- .../forestry/farming/tiles/TileFarmValve.java | 17 +- .../farming/triggers/FarmingTriggers.java | 18 +- .../triggers/TriggerLowFertilizer.java | 28 +- .../farming/triggers/TriggerLowGermlings.java | 28 +- .../farming/triggers/TriggerLowLiquid.java | 29 +- .../farming/triggers/TriggerLowSoil.java | 30 +- .../java/forestry/food/BeverageEffect.java | 34 +- .../forestry/food/BeverageEffectAntidote.java | 12 +- .../forestry/food/BeverageEffectDrunk.java | 12 +- .../java/forestry/food/InfuserIngredient.java | 13 +- .../food/InfuserIngredientManager.java | 21 +- .../java/forestry/food/InfuserMixture.java | 18 +- .../forestry/food/InfuserMixtureManager.java | 18 +- .../forestry/food/gui/ContainerInfuser.java | 15 +- .../java/forestry/food/gui/GuiInfuser.java | 15 +- .../food/inventory/ItemInventoryInfuser.java | 18 +- .../forestry/food/items/EnumBeverage.java | 30 +- .../forestry/food/items/ItemAmbrosia.java | 17 +- .../forestry/food/items/ItemBeverage.java | 34 +- .../java/forestry/food/items/ItemInfuser.java | 18 +- .../forestry/food/items/ItemRegistryFood.java | 19 +- .../lepidopterology/ButterflySpawner.java | 24 +- .../blocks/BlockLepidopterology.java | 13 +- .../blocks/BlockLepidopterologyType.java | 14 +- .../blocks/BlockRegistryLepidopterology.java | 13 +- .../commands/CommandButterfly.java | 17 +- .../entities/AIButterflyBase.java | 21 +- .../entities/AIButterflyFlee.java | 16 +- .../entities/AIButterflyInteract.java | 12 +- .../entities/AIButterflyMate.java | 21 +- .../entities/AIButterflyMovement.java | 12 +- .../entities/AIButterflyPollinate.java | 32 +- .../entities/AIButterflyRest.java | 12 +- .../entities/AIButterflyRise.java | 12 +- .../entities/AIButterflyWander.java | 12 +- .../entities/EntityButterfly.java | 59 +- .../entities/EnumButterflyState.java | 13 +- .../genetics/AlleleButterflyEffect.java | 12 +- .../genetics/AlleleButterflyEffectNone.java | 13 +- .../genetics/AlleleButterflySpecies.java | 46 +- .../genetics/BranchButterflies.java | 16 +- .../lepidopterology/genetics/Butterfly.java | 107 ++-- .../genetics/ButterflyBranchDefinition.java | 45 +- .../genetics/ButterflyDefinition.java | 96 ++-- .../genetics/ButterflyFactory.java | 29 +- .../genetics/ButterflyGenome.java | 23 +- .../genetics/ButterflyHelper.java | 34 +- .../genetics/IButterflyDefinition.java | 16 +- .../genetics/LepidopteristTracker.java | 15 +- .../genetics/MothDefinition.java | 37 +- .../lepidopterology/gui/GuiFlutterlyzer.java | 114 ++-- .../inventory/ItemInventoryFlutterlyzer.java | 20 +- .../items/ItemButterflyGE.java | 72 ++- .../items/ItemFlutterlyzer.java | 18 +- .../items/ItemRegistryLepidopterology.java | 13 +- .../proxy/ProxyLepidopterology.java | 12 +- .../proxy/ProxyLepidopterologyClient.java | 15 +- .../lepidopterology/recipes/MatingRecipe.java | 46 +- .../render/ModelButterfly.java | 13 +- .../render/RenderButterflyEntity.java | 19 +- .../render/RenderButterflyItem.java | 26 +- .../tiles/TileLepidopteristChest.java | 13 +- .../java/forestry/mail/EnumDeliveryState.java | 16 +- .../java/forestry/mail/EnumStationState.java | 16 +- .../forestry/mail/EventHandlerMailAlert.java | 18 +- src/main/java/forestry/mail/Letter.java | 30 +- .../java/forestry/mail/LetterProperties.java | 25 +- src/main/java/forestry/mail/MailAddress.java | 23 +- src/main/java/forestry/mail/POBox.java | 23 +- src/main/java/forestry/mail/POBoxInfo.java | 13 +- src/main/java/forestry/mail/PostOffice.java | 31 +- src/main/java/forestry/mail/PostRegistry.java | 31 +- .../java/forestry/mail/PostalCarrier.java | 31 +- .../forestry/mail/SaveEventHandlerMail.java | 15 +- src/main/java/forestry/mail/TradeStation.java | 55 +- .../java/forestry/mail/blocks/BlockMail.java | 13 +- .../forestry/mail/blocks/BlockMailType.java | 19 +- .../mail/blocks/BlockRegistryMail.java | 13 +- .../forestry/mail/commands/CommandMail.java | 38 +- .../forestry/mail/gui/ContainerCatalogue.java | 36 +- .../forestry/mail/gui/ContainerLetter.java | 37 +- .../forestry/mail/gui/ContainerMailbox.java | 25 +- .../mail/gui/ContainerStampCollector.java | 23 +- .../forestry/mail/gui/ContainerTradeName.java | 15 +- .../forestry/mail/gui/ContainerTrader.java | 62 ++- .../java/forestry/mail/gui/GuiCatalogue.java | 46 +- .../java/forestry/mail/gui/GuiLetter.java | 35 +- .../java/forestry/mail/gui/GuiMailbox.java | 15 +- .../forestry/mail/gui/GuiMailboxInfo.java | 43 +- .../forestry/mail/gui/GuiStampCollector.java | 16 +- .../java/forestry/mail/gui/GuiTradeName.java | 20 +- .../java/forestry/mail/gui/GuiTrader.java | 31 +- .../mail/gui/ILetterInfoReceiver.java | 13 +- .../mail/gui/widgets/AddresseeSlot.java | 21 +- .../inventory/InventoryStampCollector.java | 16 +- .../mail/inventory/InventoryTradeStation.java | 37 +- .../mail/inventory/ItemInventoryLetter.java | 26 +- .../mail/items/EnumStampDefinition.java | 23 +- .../forestry/mail/items/ItemCatalogue.java | 18 +- .../java/forestry/mail/items/ItemLetter.java | 37 +- .../forestry/mail/items/ItemRegistryMail.java | 13 +- .../java/forestry/mail/items/ItemStamps.java | 16 +- .../mail/network/PacketRegistryMail.java | 13 +- .../packets/PacketLetterInfoRequest.java | 18 +- .../packets/PacketLetterInfoResponse.java | 31 +- .../network/packets/PacketLetterTextSet.java | 18 +- .../packets/PacketPOBoxInfoUpdate.java | 18 +- .../packets/PacketTraderAddressRequest.java | 20 +- .../packets/PacketTraderAddressResponse.java | 20 +- .../forestry/mail/tiles/IMailContainer.java | 13 +- .../java/forestry/mail/tiles/TileMailbox.java | 37 +- .../mail/tiles/TileStampCollector.java | 23 +- .../java/forestry/mail/tiles/TileTrader.java | 63 ++- .../forestry/mail/triggers/MailTriggers.java | 13 +- .../forestry/mail/triggers/TriggerBuffer.java | 21 +- .../mail/triggers/TriggerHasMail.java | 21 +- .../mail/triggers/TriggerLowInput.java | 21 +- .../mail/triggers/TriggerLowPaper.java | 21 +- .../mail/triggers/TriggerLowStamps.java | 21 +- .../java/forestry/plugins/ForestryPlugin.java | 35 +- src/main/java/forestry/plugins/Plugin.java | 3 +- .../forestry/plugins/PluginApiculture.java | 255 +++++---- .../forestry/plugins/PluginArboriculture.java | 123 +++-- .../java/forestry/plugins/PluginCore.java | 52 +- .../java/forestry/plugins/PluginEnergy.java | 20 +- .../java/forestry/plugins/PluginFactory.java | 178 +++--- .../java/forestry/plugins/PluginFarming.java | 133 +++-- .../java/forestry/plugins/PluginFluids.java | 78 +-- .../java/forestry/plugins/PluginFood.java | 17 +- .../plugins/PluginLepidopterology.java | 26 +- .../java/forestry/plugins/PluginMail.java | 22 +- .../java/forestry/plugins/PluginManager.java | 59 +- .../java/forestry/plugins/PluginStorage.java | 363 ++++++------ .../plugins/compat/PluginAgriCraft.java | 22 +- .../plugins/compat/PluginBiomesOPlenty.java | 173 +++--- .../plugins/compat/PluginBuildCraftFuels.java | 20 +- .../compat/PluginBuildCraftRecipes.java | 16 +- .../compat/PluginBuildCraftStatements.java | 20 +- .../compat/PluginBuildCraftTransport.java | 17 +- .../forestry/plugins/compat/PluginChisel.java | 21 +- .../plugins/compat/PluginEnderIO.java | 10 +- .../forestry/plugins/compat/PluginErebus.java | 21 +- .../plugins/compat/PluginExtraUtilities.java | 27 +- .../plugins/compat/PluginGrowthCraft.java | 61 ++- .../plugins/compat/PluginHarvestCraft.java | 189 ++++--- .../forestry/plugins/compat/PluginIC2.java | 94 ++-- .../compat/PluginImmersiveEngineering.java | 24 +- .../plugins/compat/PluginMagicalCrops.java | 40 +- .../compat/PluginMineFactoryReloaded.java | 32 +- .../forestry/plugins/compat/PluginNatura.java | 50 +- .../plugins/compat/PluginPlantMegaPack.java | 359 ++++-------- .../plugins/compat/PluginRotaryCraft.java | 24 +- .../plugins/compat/PluginWitchery.java | 67 ++- .../forestry/storage/BackpackDefinition.java | 30 +- .../forestry/storage/BackpackInterface.java | 16 +- .../java/forestry/storage/BackpackMode.java | 12 +- .../java/forestry/storage/CrateRegistry.java | 19 +- .../storage/PickupHandlerStorage.java | 23 +- .../forestry/storage/ResupplyHandler.java | 34 +- .../storage/gui/ContainerBackpack.java | 18 +- .../gui/ContainerNaturalistBackpack.java | 17 +- .../forestry/storage/gui/GuiBackpack.java | 15 +- .../forestry/storage/gui/GuiBackpackT2.java | 12 +- .../inventory/ItemInventoryBackpack.java | 7 +- .../inventory/ItemInventoryBackpackPaged.java | 22 +- .../forestry/storage/items/ItemBackpack.java | 71 +-- .../storage/items/ItemBackpackNaturalist.java | 32 +- .../storage/items/ItemRegistryStorage.java | 58 +- .../forestry/storage/proxy/ProxyStorage.java | 12 +- .../storage/proxy/ProxyStorageClient.java | 15 +- 1282 files changed, 15755 insertions(+), 16296 deletions(-) diff --git a/src/main/java/forestry/Forestry.java b/src/main/java/forestry/Forestry.java index 93aedf8ed..c7fb349a7 100644 --- a/src/main/java/forestry/Forestry.java +++ b/src/main/java/forestry/Forestry.java @@ -1,15 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry; +import java.io.File; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraftforge.common.MinecraftForge; + import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.Mod.EventHandler; @@ -41,10 +45,6 @@ import forestry.core.utils.Log; import forestry.core.utils.StringUtil; import forestry.core.worldgen.WorldGenerator; import forestry.plugins.PluginManager; -import java.io.File; -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraftforge.common.MinecraftForge; /** * Forestry Minecraft Mod @@ -56,8 +56,7 @@ import net.minecraftforge.common.MinecraftForge; name = Constants.MOD, version = Constants.VERSION, guiFactory = "forestry.core.config.ForestryGuiConfigFactory", - dependencies = "required-after:Forge@[10.13.4.1566,);" - + "after:Buildcraft|Core@[6.1.7,);" + dependencies = "required-after:Forge@[10.13.4.1566,);" + "after:Buildcraft|Core@[6.1.7,);" + "after:ExtrabiomesXL;" + "after:BiomesOPlenty;" + "after:IC2@[2.0.140,);" diff --git a/src/main/java/forestry/api/apiculture/BeeManager.java b/src/main/java/forestry/api/apiculture/BeeManager.java index 04eb0ea15..86e9a9b47 100644 --- a/src/main/java/forestry/api/apiculture/BeeManager.java +++ b/src/main/java/forestry/api/apiculture/BeeManager.java @@ -7,6 +7,7 @@ package forestry.api.apiculture; import java.util.ArrayList; import java.util.HashMap; + import net.minecraft.item.ItemStack; /** diff --git a/src/main/java/forestry/api/apiculture/DefaultBeeListener.java b/src/main/java/forestry/api/apiculture/DefaultBeeListener.java index be7bebc52..80064799d 100644 --- a/src/main/java/forestry/api/apiculture/DefaultBeeListener.java +++ b/src/main/java/forestry/api/apiculture/DefaultBeeListener.java @@ -8,11 +8,11 @@ package forestry.api.apiculture; import forestry.api.genetics.IIndividual; /** - * Easily extendable default IBeeListener. - * By itself, this IBeeListener does nothing. - * BeeListeners should inherit from this class unless they need to listen for everything. + * Easily extendable default IBeeListener. By itself, this IBeeListener does nothing. BeeListeners should inherit from + * this class unless they need to listen for everything. */ public class DefaultBeeListener implements IBeeListener { + @Override public void wearOutEquipment(int amount) {} diff --git a/src/main/java/forestry/api/apiculture/DefaultBeeModifier.java b/src/main/java/forestry/api/apiculture/DefaultBeeModifier.java index b6e2bc05c..9beb31b1a 100644 --- a/src/main/java/forestry/api/apiculture/DefaultBeeModifier.java +++ b/src/main/java/forestry/api/apiculture/DefaultBeeModifier.java @@ -6,9 +6,8 @@ package forestry.api.apiculture; /** - * Easily extendable default IBeeModifier. - * By itself, this IBeeModifier does nothing. - * BeeModifiers should inherit from this class unless they modify everything. + * Easily extendable default IBeeModifier. By itself, this IBeeModifier does nothing. BeeModifiers should inherit from + * this class unless they modify everything. */ public class DefaultBeeModifier implements IBeeModifier { diff --git a/src/main/java/forestry/api/apiculture/EnumBeeChromosome.java b/src/main/java/forestry/api/apiculture/EnumBeeChromosome.java index 215ff2730..5b8ea22ad 100644 --- a/src/main/java/forestry/api/apiculture/EnumBeeChromosome.java +++ b/src/main/java/forestry/api/apiculture/EnumBeeChromosome.java @@ -5,6 +5,8 @@ ******************************************************************************/ package forestry.api.apiculture; +import java.util.Locale; + import forestry.api.genetics.IAllele; import forestry.api.genetics.IAlleleArea; import forestry.api.genetics.IAlleleBoolean; @@ -14,7 +16,6 @@ import forestry.api.genetics.IAlleleInteger; import forestry.api.genetics.IAlleleTolerance; import forestry.api.genetics.IChromosomeType; import forestry.api.genetics.ISpeciesRoot; -import java.util.Locale; /** * Enum representing the order of chromosomes in a bee's genome and what they control. @@ -22,6 +23,7 @@ import java.util.Locale; * @author SirSengir */ public enum EnumBeeChromosome implements IChromosomeType { + /** * Species of the bee. Alleles here must implement {@link IAlleleBeeSpecies}. */ @@ -43,11 +45,13 @@ public enum EnumBeeChromosome implements IChromosomeType { */ 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. + * 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. + * Not used / superseded by fixed values for the species. Probably going to be replaced with a boolean for + * FIRE_RESIST. */ @Deprecated HUMIDITY(IAllele.class), diff --git a/src/main/java/forestry/api/apiculture/EnumBeeType.java b/src/main/java/forestry/api/apiculture/EnumBeeType.java index 784ee7018..fff076dd5 100644 --- a/src/main/java/forestry/api/apiculture/EnumBeeType.java +++ b/src/main/java/forestry/api/apiculture/EnumBeeType.java @@ -5,10 +5,12 @@ ******************************************************************************/ package forestry.api.apiculture; -import forestry.api.genetics.ISpeciesType; import java.util.Locale; +import forestry.api.genetics.ISpeciesType; + public enum EnumBeeType implements ISpeciesType { + DRONE, PRINCESS, QUEEN, diff --git a/src/main/java/forestry/api/apiculture/FlowerManager.java b/src/main/java/forestry/api/apiculture/FlowerManager.java index e98a5224a..4aea8fd75 100644 --- a/src/main/java/forestry/api/apiculture/FlowerManager.java +++ b/src/main/java/forestry/api/apiculture/FlowerManager.java @@ -5,13 +5,26 @@ ******************************************************************************/ package forestry.api.apiculture; -import forestry.api.genetics.IFlowerRegistry; import java.util.ArrayList; + import net.minecraft.item.ItemStack; +import forestry.api.genetics.IFlowerRegistry; + public class FlowerManager { + /** - *
e.g. FlowerManager.flowerRegister.registerPlantableFlower(new ItemStack(Blocks.red_flower), 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
+ *
+ * + *
+     * e.g.FlowerManager.flowerRegister.registerPlantableFlower(
+     *         new ItemStack(Blocks.red_flower),
+     *         1.0,
+     *         FlowerManager.FlowerTypeVanilla,
+     *         FlowerManager.FlowerTypeSnow);
+     * 
+ * + *
*/ public static IFlowerRegistry flowerRegistry; @@ -26,8 +39,8 @@ public class FlowerManager { public static final String FlowerTypeGourd = "flowersGourd"; /** - * @deprecated since Forestry 3.4. Use IFlowerRegistry.registerPlantableFlower instead. - * Completely unused since Forestry 4.0, kept for backward compatibility with older mods. + * @deprecated since Forestry 3.4. Use IFlowerRegistry.registerPlantableFlower instead. Completely unused since + * Forestry 4.0, kept for backward compatibility with older mods. */ @Deprecated public static ArrayList plainFlowers = new ArrayList(); diff --git a/src/main/java/forestry/api/apiculture/IAlleleBeeAcceleratableEffect.java b/src/main/java/forestry/api/apiculture/IAlleleBeeAcceleratableEffect.java index fb04a363e..c2d8e58f0 100644 --- a/src/main/java/forestry/api/apiculture/IAlleleBeeAcceleratableEffect.java +++ b/src/main/java/forestry/api/apiculture/IAlleleBeeAcceleratableEffect.java @@ -4,5 +4,6 @@ import forestry.api.genetics.IEffectData; @SuppressWarnings("unused") public interface IAlleleBeeAcceleratableEffect { + IEffectData doEffectAccelerated(IBeeGenome genome, IEffectData storedData, IBeeHousing housing, float did); } diff --git a/src/main/java/forestry/api/apiculture/IAlleleBeeEffect.java b/src/main/java/forestry/api/apiculture/IAlleleBeeEffect.java index cbfa9c5e8..ed0e85924 100644 --- a/src/main/java/forestry/api/apiculture/IAlleleBeeEffect.java +++ b/src/main/java/forestry/api/apiculture/IAlleleBeeEffect.java @@ -13,11 +13,9 @@ 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. + * @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); @@ -26,9 +24,8 @@ public interface IAlleleBeeEffect extends IAlleleEffect { * 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. + * @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/main/java/forestry/api/apiculture/IAlleleBeeSpecies.java b/src/main/java/forestry/api/apiculture/IAlleleBeeSpecies.java index 920d55c8b..0b97f5fba 100644 --- a/src/main/java/forestry/api/apiculture/IAlleleBeeSpecies.java +++ b/src/main/java/forestry/api/apiculture/IAlleleBeeSpecies.java @@ -5,12 +5,14 @@ ******************************************************************************/ 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; -import java.util.Map; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; public interface IAlleleBeeSpecies extends IAlleleSpecies { @@ -36,6 +38,7 @@ public interface IAlleleBeeSpecies extends IAlleleSpecies { /** * Only jubilant bees produce specialities. + * * @return true if the bee is jubilant, false otherwise. */ boolean isJubilant(IBeeGenome genome, IBeeHousing housing); diff --git a/src/main/java/forestry/api/apiculture/IAlleleBeeSpeciesCustom.java b/src/main/java/forestry/api/apiculture/IAlleleBeeSpeciesCustom.java index 017902bbd..44241ce01 100644 --- a/src/main/java/forestry/api/apiculture/IAlleleBeeSpeciesCustom.java +++ b/src/main/java/forestry/api/apiculture/IAlleleBeeSpeciesCustom.java @@ -5,27 +5,26 @@ ******************************************************************************/ package forestry.api.apiculture; -import forestry.api.genetics.IAlleleSpeciesCustom; 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. + * 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. + * 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) + * Set the Jubilance Provider for this bee species. Bees only produce their specialty when they are Jubilant (see + * IJubilanceProvider) */ IAlleleBeeSpeciesCustom setJubilanceProvider(IJubilanceProvider provider); @@ -44,6 +43,8 @@ public interface IAlleleBeeSpeciesCustom extends IAlleleBeeSpecies, IAlleleSpeci /** Use this if you have custom icons for bees. */ IAlleleBeeSpeciesCustom setCustomBeeIconProvider(IBeeIconProvider beeIconProvider); - /** Use this if you have custom icon colours for bees (other than the default static primary + secondary colours). */ + /** + * Use this if you have custom icon colours for bees (other than the default static primary + secondary colours). + */ IAlleleBeeSpeciesCustom setCustomBeeIconColourProvider(IBeeIconColourProvider beeIconColourProvider); } diff --git a/src/main/java/forestry/api/apiculture/IApiaristTracker.java b/src/main/java/forestry/api/apiculture/IApiaristTracker.java index 77a76fcc6..ef25b3da8 100644 --- a/src/main/java/forestry/api/apiculture/IApiaristTracker.java +++ b/src/main/java/forestry/api/apiculture/IApiaristTracker.java @@ -9,7 +9,8 @@ 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. + * Can be used to garner information on bee breeding. See {@link forestry.api.genetics.ISpeciesRoot} for retrieval + * functions. * * @author SirSengir */ @@ -18,8 +19,7 @@ public interface IApiaristTracker extends IBreedingTracker { /** * Register the birth of a queen. Will mark species as discovered. * - * @param queen - * Created queen. + * @param queen Created queen. */ void registerQueen(IIndividual queen); @@ -31,8 +31,7 @@ public interface IApiaristTracker extends IBreedingTracker { /** * Register the birth of a princess. Will mark species as discovered. * - * @param princess - * Created princess. + * @param princess Created princess. */ void registerPrincess(IIndividual princess); @@ -44,8 +43,7 @@ public interface IApiaristTracker extends IBreedingTracker { /** * Register the birth of a drone. Will mark species as discovered. * - * @param drone - * Created drone. + * @param drone Created drone. */ void registerDrone(IIndividual drone); diff --git a/src/main/java/forestry/api/apiculture/IArmorApiarist.java b/src/main/java/forestry/api/apiculture/IArmorApiarist.java index 1d9b4ef48..f1775e80e 100644 --- a/src/main/java/forestry/api/apiculture/IArmorApiarist.java +++ b/src/main/java/forestry/api/apiculture/IArmorApiarist.java @@ -13,12 +13,13 @@ 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 entity Entity being attacked - * @param armor Armor item - * @param cause Optional cause of attack, such as a bee effect identifier + * @param entity Entity 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 */ @@ -27,9 +28,9 @@ 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 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 * @deprecated since Forestry 4.2. Use protectEntity diff --git a/src/main/java/forestry/api/apiculture/IArmorApiaristHelper.java b/src/main/java/forestry/api/apiculture/IArmorApiaristHelper.java index 4238f2b24..bda8be24d 100644 --- a/src/main/java/forestry/api/apiculture/IArmorApiaristHelper.java +++ b/src/main/java/forestry/api/apiculture/IArmorApiaristHelper.java @@ -18,9 +18,10 @@ public interface IArmorApiaristHelper { /** * Called when the apiarist's armor acts as protection against an attack. - * @param stack ItemStack to check - * @param entity Entity being attacked - * @param cause Optional cause of attack, such as a bee effect identifier + * + * @param stack ItemStack to check + * @param entity Entity being attacked + * @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 item is valid Apiarist Armor and should protect the player from that attack * @since Forestry 4.2 @@ -29,8 +30,9 @@ public interface IArmorApiaristHelper { /** * Called when the apiarist's armor acts as protection against an attack. - * @param entity Entity being attacked - * @param cause Optional cause of attack, such as a bee effect identifier + * + * @param entity Entity being attacked + * @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 The number of valid Apiarist Armor pieces the player is wearing that are actually protecting * @since Forestry 4.2 @@ -39,9 +41,10 @@ public interface IArmorApiaristHelper { /** * Called when the apiarist's armor acts as protection against an attack. - * @param stack ItemStack to check - * @param player Player being attacked - * @param cause Optional cause of attack, such as a bee effect identifier + * + * @param stack ItemStack to check + * @param player Player being attacked + * @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 item is valid Apiarist Armor and should protect the player from that attack * @deprecated since Forestry 4.2. use the EntityLivingBase version @@ -51,8 +54,9 @@ public interface IArmorApiaristHelper { /** * Called when the apiarist's armor acts as protection against an attack. - * @param player Player being attacked - * @param cause Optional cause of attack, such as a bee effect identifier + * + * @param player Player being attacked + * @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 The number of valid Apiarist Armor pieces the player is wearing that are actually protecting * @deprecated since Forestry 4.2. use the EntityLivingBase version diff --git a/src/main/java/forestry/api/apiculture/IBee.java b/src/main/java/forestry/api/apiculture/IBee.java index 7d5fd84cb..6a3d1421c 100644 --- a/src/main/java/forestry/api/apiculture/IBee.java +++ b/src/main/java/forestry/api/apiculture/IBee.java @@ -5,14 +5,16 @@ ******************************************************************************/ package forestry.api.apiculture; +import java.util.List; +import java.util.Set; + +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; -import java.util.List; -import java.util.Set; -import net.minecraft.item.ItemStack; -import net.minecraft.world.biome.BiomeGenBase; /** * Other implementations than Forestry's default one are not supported. @@ -43,6 +45,7 @@ public interface IBee extends IIndividualLiving { /** * Set the natural flag on this bee. + * * @param flag */ void setIsNatural(boolean flag); @@ -58,6 +61,7 @@ public interface IBee extends IIndividualLiving { /** * Determines whether the queen can work. + * * @param housing the {@link IBeeHousing} the bee currently resides in. * @return an empty set if the queen can work, a set of error states if the queen can not work */ diff --git a/src/main/java/forestry/api/apiculture/IBeeFactory.java b/src/main/java/forestry/api/apiculture/IBeeFactory.java index 515466ea4..7976764dd 100644 --- a/src/main/java/forestry/api/apiculture/IBeeFactory.java +++ b/src/main/java/forestry/api/apiculture/IBeeFactory.java @@ -10,37 +10,30 @@ 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. + * 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 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 + * @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, + 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(); + * Creates a new bee branch. Must be registered with + * AlleleManager.alleleRegistry.getClassification("family.apidae").addMemberGroup(); * - * @param uid Unique Identifier for this branch + * @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 */ diff --git a/src/main/java/forestry/api/apiculture/IBeeHousing.java b/src/main/java/forestry/api/apiculture/IBeeHousing.java index fb0c182d2..55d7552fd 100644 --- a/src/main/java/forestry/api/apiculture/IBeeHousing.java +++ b/src/main/java/forestry/api/apiculture/IBeeHousing.java @@ -5,25 +5,29 @@ ******************************************************************************/ package forestry.api.apiculture; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + import com.mojang.authlib.GameProfile; + import forestry.api.core.IClimateProvider; import forestry.api.core.IErrorLogicSource; import forestry.api.genetics.IHousing; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; public interface IBeeHousing extends IHousing, IClimateProvider, IErrorLogicSource { /** - * Used by BeeManager.beeRoot.createBeeHousingModifier(IBeeHousing housing) - * to combine bee modifiers from several sources that can change over time. + * Used by BeeManager.beeRoot.createBeeHousingModifier(IBeeHousing housing) to combine bee modifiers from several + * sources that can change over time. + * * @return IBeeModifiers from the housing, frames, etc. */ Iterable getBeeModifiers(); /** - * Used by BeeManager.beeRoot.createBeeHousingListener(IBeeHousing housing) - * to combine bee listeners from several sources that can change over time. + * Used by BeeManager.beeRoot.createBeeHousingListener(IBeeHousing housing) to combine bee listeners from several + * sources that can change over time. + * * @return IBeeListeners from the housing, multiblock parts, etc. */ Iterable getBeeListeners(); diff --git a/src/main/java/forestry/api/apiculture/IBeeHousingInventory.java b/src/main/java/forestry/api/apiculture/IBeeHousingInventory.java index 90f9a4102..d2fb804a1 100644 --- a/src/main/java/forestry/api/apiculture/IBeeHousingInventory.java +++ b/src/main/java/forestry/api/apiculture/IBeeHousingInventory.java @@ -21,7 +21,7 @@ public interface IBeeHousingInventory { * 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 + * @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/main/java/forestry/api/apiculture/IBeeIconColourProvider.java b/src/main/java/forestry/api/apiculture/IBeeIconColourProvider.java index a663e9c5a..97814ec50 100644 --- a/src/main/java/forestry/api/apiculture/IBeeIconColourProvider.java +++ b/src/main/java/forestry/api/apiculture/IBeeIconColourProvider.java @@ -9,5 +9,6 @@ package forestry.api.apiculture; * Custom colour provider for bees with complicated colors. */ public interface IBeeIconColourProvider { + int getIconColour(int renderPass); } diff --git a/src/main/java/forestry/api/apiculture/IBeeIconProvider.java b/src/main/java/forestry/api/apiculture/IBeeIconProvider.java index 1424a0929..b1cf8a324 100644 --- a/src/main/java/forestry/api/apiculture/IBeeIconProvider.java +++ b/src/main/java/forestry/api/apiculture/IBeeIconProvider.java @@ -9,6 +9,7 @@ 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/main/java/forestry/api/apiculture/IBeeListener.java b/src/main/java/forestry/api/apiculture/IBeeListener.java index 8e9e9bcfa..1bc62ee4f 100644 --- a/src/main/java/forestry/api/apiculture/IBeeListener.java +++ b/src/main/java/forestry/api/apiculture/IBeeListener.java @@ -11,6 +11,7 @@ public interface IBeeListener { /** * Called when the bees wear out the housing's equipment. + * * @param amount Integer indicating the amount worn out. */ void wearOutEquipment(int amount); @@ -22,6 +23,7 @@ public interface IBeeListener { /** * Called when the bees have retrieved some pollen. + * * @return true if this bee listener handled the pollen. */ boolean onPollenRetrieved(IIndividual pollen); diff --git a/src/main/java/forestry/api/apiculture/IBeeModifier.java b/src/main/java/forestry/api/apiculture/IBeeModifier.java index 5185848d2..fd44927f9 100644 --- a/src/main/java/forestry/api/apiculture/IBeeModifier.java +++ b/src/main/java/forestry/api/apiculture/IBeeModifier.java @@ -6,30 +6,31 @@ package forestry.api.apiculture; public interface IBeeModifier { + /** - * @param genome Genome of the bee this modifier is called for. + * @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 Genome of the bee mate this modifier is called for. + * @param genome Genome of the bee this modifier is called for. + * @param mate Genome of the bee mate this modifier is called for. * @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 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 genome Genome of the bee this modifier is called for. * @param currentModifier Current modifier. * @return Float modifying the production speed of queens. */ diff --git a/src/main/java/forestry/api/apiculture/IBeeMutation.java b/src/main/java/forestry/api/apiculture/IBeeMutation.java index 38bfbf81f..b27d2a850 100644 --- a/src/main/java/forestry/api/apiculture/IBeeMutation.java +++ b/src/main/java/forestry/api/apiculture/IBeeMutation.java @@ -12,12 +12,9 @@ public interface IBeeMutation extends IMutation { IBeeRoot getRoot(); /** - * @return float representing the chance for mutation to occur. note that this is 0 - 100 based, since it was an integer previously! + * @return float representing the chance for mutation to occur. note that this is 0 - 100 based, since it was an + * integer previously! */ - float getChance( - IBeeHousing housing, - IAlleleBeeSpecies allele0, - IAlleleBeeSpecies allele1, - IBeeGenome genome0, + float getChance(IBeeHousing housing, IAlleleBeeSpecies allele0, IAlleleBeeSpecies allele1, IBeeGenome genome0, IBeeGenome genome1); } diff --git a/src/main/java/forestry/api/apiculture/IBeeMutationCustom.java b/src/main/java/forestry/api/apiculture/IBeeMutationCustom.java index 22b60129d..cf06a483e 100644 --- a/src/main/java/forestry/api/apiculture/IBeeMutationCustom.java +++ b/src/main/java/forestry/api/apiculture/IBeeMutationCustom.java @@ -7,4 +7,5 @@ package forestry.api.apiculture; import forestry.api.genetics.IMutationCustom; -public interface IBeeMutationCustom extends IBeeMutation, IMutationCustom {} +public interface IBeeMutationCustom extends IBeeMutation, IMutationCustom { +} diff --git a/src/main/java/forestry/api/apiculture/IBeeMutationFactory.java b/src/main/java/forestry/api/apiculture/IBeeMutationFactory.java index dd9f1c864..b0a6b62ea 100644 --- a/src/main/java/forestry/api/apiculture/IBeeMutationFactory.java +++ b/src/main/java/forestry/api/apiculture/IBeeMutationFactory.java @@ -8,17 +8,17 @@ 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. + * 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 + * @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); + IBeeMutationCustom createMutation(IAlleleBeeSpecies parentBee0, IAlleleBeeSpecies parentBee1, IAllele[] result, + int chance); } diff --git a/src/main/java/forestry/api/apiculture/IBeeRoot.java b/src/main/java/forestry/api/apiculture/IBeeRoot.java index 0e1480030..f49ed1f32 100644 --- a/src/main/java/forestry/api/apiculture/IBeeRoot.java +++ b/src/main/java/forestry/api/apiculture/IBeeRoot.java @@ -5,15 +5,18 @@ ******************************************************************************/ package forestry.api.apiculture; -import com.mojang.authlib.GameProfile; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.ISpeciesRoot; 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.ISpeciesRoot; + public interface IBeeRoot extends ISpeciesRoot { /** @@ -69,8 +72,7 @@ public interface IBeeRoot extends ISpeciesRoot { boolean isMated(ItemStack stack); /** - * @param genome - * Valid {@link IBeeGenome} + * @param genome Valid {@link IBeeGenome} * @return {@link IBee} from the passed genome */ IBee getBee(World world, IBeeGenome genome); @@ -78,10 +80,8 @@ public interface IBeeRoot extends ISpeciesRoot { /** * 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. + * @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); @@ -109,20 +109,19 @@ public interface IBeeRoot extends ISpeciesRoot { /* MISC */ /** - * Creates beekeepingLogic for a housing. - * Should be used when the housing is created, see IBeekeepingLogic + * Creates beekeepingLogic for a housing. Should be used when the housing is created, see IBeekeepingLogic */ IBeekeepingLogic createBeekeepingLogic(IBeeHousing housing); /** - * Combines multiple modifiers from an IBeeHousing into one. - * Stays up to date with changes to the housing's modifiers. + * Combines multiple modifiers from an IBeeHousing into one. Stays up to date with changes to the housing's + * modifiers. */ IBeeModifier createBeeHousingModifier(IBeeHousing housing); /** - * Combines multiple listeners from an IBeeHousing into one. - * Stays up to date with changes to the housing's listeners. + * Combines multiple listeners from an IBeeHousing into one. Stays up to date with changes to the housing's + * listeners. */ IBeeListener createBeeHousingListener(IBeeHousing housing); } diff --git a/src/main/java/forestry/api/apiculture/IBeekeepingLogic.java b/src/main/java/forestry/api/apiculture/IBeekeepingLogic.java index a28972c5c..4c577d012 100644 --- a/src/main/java/forestry/api/apiculture/IBeekeepingLogic.java +++ b/src/main/java/forestry/api/apiculture/IBeekeepingLogic.java @@ -5,12 +5,12 @@ ******************************************************************************/ package forestry.api.apiculture; -import forestry.api.core.INBTTagable; import net.minecraft.entity.player.EntityPlayerMP; +import forestry.api.core.INBTTagable; + /** - * Stores beekeeping logic for bee housings. - * Get one with BeeManager.beeRoot.createBeekeepingLogic(IBeeHousing housing) + * Stores beekeeping logic for bee housings. Get one with BeeManager.beeRoot.createBeekeepingLogic(IBeeHousing housing) * Save and load it to NBT using the INBTTagable methods. */ public interface IBeekeepingLogic extends INBTTagable { @@ -19,6 +19,7 @@ public interface IBeekeepingLogic extends INBTTagable { /** * Checks that the bees can work, setting error conditions on the housing where needed + * * @return true if no errors are present and doWork should be called */ boolean canWork(); @@ -31,29 +32,26 @@ public interface IBeekeepingLogic extends INBTTagable { /* CLIENT */ /** - * Call this when the housing comes into view of the client. - * (i.e. when tile.getDescriptionPacket() is called) + * Call this when the housing comes into view of the client. (i.e. when tile.getDescriptionPacket() is called) */ void syncToClient(); void syncToClient(EntityPlayerMP player); /** - * Get the progress bar for breeding and production. - * To avoid network spam, this is only available server-side, - * and must be synced manually to the client when a GUI is open. + * Get the progress bar for breeding and production. To avoid network spam, this is only available server-side, and + * must be synced manually to the client when a GUI is open. */ int getBeeProgressPercent(); /** - * Whether bee fx should be active. - * Internally, this is automatically synced to the client. + * Whether bee fx should be active. Internally, this is automatically synced to the client. */ boolean canDoBeeFX(); /** - * Display bee fx. Calls IBee.doFX(IEffectData[] storedData, IBeeHousing housing) on the queen. - * Internally, the queen is automatically synced to the client for the fx. + * Display bee fx. Calls IBee.doFX(IEffectData[] storedData, IBeeHousing housing) on the queen. Internally, the + * queen is automatically synced to the client for the fx. */ void doBeeFX(); } diff --git a/src/main/java/forestry/api/apiculture/IBeekeepingMode.java b/src/main/java/forestry/api/apiculture/IBeekeepingMode.java index 3eae06269..fa420edf3 100644 --- a/src/main/java/forestry/api/apiculture/IBeekeepingMode.java +++ b/src/main/java/forestry/api/apiculture/IBeekeepingMode.java @@ -6,6 +6,7 @@ package forestry.api.apiculture; import java.util.ArrayList; + import net.minecraft.world.World; public interface IBeekeepingMode { @@ -49,7 +50,8 @@ public interface IBeekeepingMode { * @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. + * @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); diff --git a/src/main/java/forestry/api/apiculture/IHiveDrop.java b/src/main/java/forestry/api/apiculture/IHiveDrop.java index c1c338448..c54f73ebf 100644 --- a/src/main/java/forestry/api/apiculture/IHiveDrop.java +++ b/src/main/java/forestry/api/apiculture/IHiveDrop.java @@ -6,6 +6,7 @@ package forestry.api.apiculture; import java.util.Collection; + import net.minecraft.item.ItemStack; import net.minecraft.world.World; @@ -28,9 +29,9 @@ public interface IHiveDrop { * 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. + * @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/main/java/forestry/api/apiculture/IHiveFrame.java b/src/main/java/forestry/api/apiculture/IHiveFrame.java index e0690ba27..4fde6a58a 100644 --- a/src/main/java/forestry/api/apiculture/IHiveFrame.java +++ b/src/main/java/forestry/api/apiculture/IHiveFrame.java @@ -13,9 +13,10 @@ public interface IHiveFrame { * 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. + * @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, or null if it has been broken. */ ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear); diff --git a/src/main/java/forestry/api/apiculture/IJubilanceFactory.java b/src/main/java/forestry/api/apiculture/IJubilanceFactory.java index fcbfcce54..877793127 100644 --- a/src/main/java/forestry/api/apiculture/IJubilanceFactory.java +++ b/src/main/java/forestry/api/apiculture/IJubilanceFactory.java @@ -8,6 +8,7 @@ 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(); diff --git a/src/main/java/forestry/api/apiculture/IJubilanceProvider.java b/src/main/java/forestry/api/apiculture/IJubilanceProvider.java index 8a5a025f5..e99d04a88 100644 --- a/src/main/java/forestry/api/apiculture/IJubilanceProvider.java +++ b/src/main/java/forestry/api/apiculture/IJubilanceProvider.java @@ -8,8 +8,8 @@ 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. + * 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/main/java/forestry/api/apiculture/hives/IHiveDescription.java b/src/main/java/forestry/api/apiculture/hives/IHiveDescription.java index 10ca5004f..a1d0ac9d0 100644 --- a/src/main/java/forestry/api/apiculture/hives/IHiveDescription.java +++ b/src/main/java/forestry/api/apiculture/hives/IHiveDescription.java @@ -5,12 +5,13 @@ ******************************************************************************/ package forestry.api.apiculture.hives; -import forestry.api.core.EnumHumidity; -import forestry.api.core.EnumTemperature; 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 { /** @@ -26,8 +27,8 @@ public interface IHiveDescription { 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. + * 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); @@ -36,15 +37,14 @@ public interface IHiveDescription { 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 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. + * 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/main/java/forestry/api/apiculture/hives/IHiveGen.java b/src/main/java/forestry/api/apiculture/hives/IHiveGen.java index e0be1ddfb..3b3867f4b 100644 --- a/src/main/java/forestry/api/apiculture/hives/IHiveGen.java +++ b/src/main/java/forestry/api/apiculture/hives/IHiveGen.java @@ -10,14 +10,13 @@ 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. + * 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. + * 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); diff --git a/src/main/java/forestry/api/apiculture/hives/IHiveGenHelper.java b/src/main/java/forestry/api/apiculture/hives/IHiveGenHelper.java index 04b0ec82c..23f91a771 100644 --- a/src/main/java/forestry/api/apiculture/hives/IHiveGenHelper.java +++ b/src/main/java/forestry/api/apiculture/hives/IHiveGenHelper.java @@ -10,8 +10,8 @@ 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. + * Returns a hiveGen for a hive that spawns on the ground. validGroundBlocks specifies which block materials it can + * spawn on. */ IHiveGen ground(Block... validGroundBlocks); diff --git a/src/main/java/forestry/api/apiculture/hives/IHiveRegistry.java b/src/main/java/forestry/api/apiculture/hives/IHiveRegistry.java index 20b871a5f..9e598c061 100644 --- a/src/main/java/forestry/api/apiculture/hives/IHiveRegistry.java +++ b/src/main/java/forestry/api/apiculture/hives/IHiveRegistry.java @@ -5,9 +5,10 @@ ******************************************************************************/ package forestry.api.apiculture.hives; -import forestry.api.apiculture.IHiveDrop; import java.util.List; +import forestry.api.apiculture.IHiveDrop; + public interface IHiveRegistry { /* Forestry Hive Names */ diff --git a/src/main/java/forestry/api/arboriculture/EnumFruitFamily.java b/src/main/java/forestry/api/arboriculture/EnumFruitFamily.java index dd1234d21..49c732b9c 100644 --- a/src/main/java/forestry/api/arboriculture/EnumFruitFamily.java +++ b/src/main/java/forestry/api/arboriculture/EnumFruitFamily.java @@ -5,11 +5,13 @@ ******************************************************************************/ package forestry.api.arboriculture; -import forestry.api.genetics.AlleleManager; -import forestry.api.genetics.IFruitFamily; import net.minecraft.util.StatCollector; +import forestry.api.genetics.AlleleManager; +import forestry.api.genetics.IFruitFamily; + public enum EnumFruitFamily implements IFruitFamily { + PRUNES("prunes", "Prunus domestica"), POMES("pomes", "Pomum"), JUNGLE("jungle", "Tropicus"), diff --git a/src/main/java/forestry/api/arboriculture/EnumGermlingType.java b/src/main/java/forestry/api/arboriculture/EnumGermlingType.java index 813da063a..32c0ac8b0 100644 --- a/src/main/java/forestry/api/arboriculture/EnumGermlingType.java +++ b/src/main/java/forestry/api/arboriculture/EnumGermlingType.java @@ -8,6 +8,7 @@ package forestry.api.arboriculture; import forestry.api.genetics.ISpeciesType; public enum EnumGermlingType implements ISpeciesType { + SAPLING("sapling"), BLOSSOM("blossom"), POLLEN("pollen"), diff --git a/src/main/java/forestry/api/arboriculture/EnumTreeChromosome.java b/src/main/java/forestry/api/arboriculture/EnumTreeChromosome.java index 9a30c90ff..e8581ac12 100644 --- a/src/main/java/forestry/api/arboriculture/EnumTreeChromosome.java +++ b/src/main/java/forestry/api/arboriculture/EnumTreeChromosome.java @@ -5,6 +5,10 @@ ******************************************************************************/ package forestry.api.arboriculture; +import java.util.Locale; + +import net.minecraftforge.common.EnumPlantType; + import forestry.api.genetics.IAllele; import forestry.api.genetics.IAlleleArea; import forestry.api.genetics.IAlleleBoolean; @@ -14,14 +18,13 @@ import forestry.api.genetics.IAllelePlantType; import forestry.api.genetics.IChromosomeType; import forestry.api.genetics.IFruitFamily; import forestry.api.genetics.ISpeciesRoot; -import java.util.Locale; -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. + * 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), /** @@ -37,7 +40,8 @@ public enum EnumTreeChromosome implements IChromosomeType { */ FERTILITY(IAlleleFloat.class), /** - * {@link IFruitProvider}, determines if and what fruits are grown on the tree. Limited by the {@link IFruitFamily}s the species supports. + * {@link IFruitProvider}, determines if and what fruits are grown on the tree. Limited by the {@link IFruitFamily}s + * the species supports. */ FRUITS(IAlleleFruit.class), /** @@ -69,8 +73,7 @@ public enum EnumTreeChromosome implements IChromosomeType { /** * Determines if the tree can burn. */ - FIREPROOF(IAlleleBoolean.class), - ; + FIREPROOF(IAlleleBoolean.class),; Class clss; diff --git a/src/main/java/forestry/api/arboriculture/EnumWoodType.java b/src/main/java/forestry/api/arboriculture/EnumWoodType.java index 290f05b41..3f7c816eb 100644 --- a/src/main/java/forestry/api/arboriculture/EnumWoodType.java +++ b/src/main/java/forestry/api/arboriculture/EnumWoodType.java @@ -7,9 +7,11 @@ package forestry.api.arboriculture; import java.util.Locale; import java.util.Random; + import net.minecraft.nbt.NBTTagCompound; public enum EnumWoodType { + LARCH, TEAK, ACACIA, diff --git a/src/main/java/forestry/api/arboriculture/IAlleleLeafEffect.java b/src/main/java/forestry/api/arboriculture/IAlleleLeafEffect.java index 525393824..35387be2a 100644 --- a/src/main/java/forestry/api/arboriculture/IAlleleLeafEffect.java +++ b/src/main/java/forestry/api/arboriculture/IAlleleLeafEffect.java @@ -5,9 +5,10 @@ ******************************************************************************/ package forestry.api.arboriculture; +import net.minecraft.world.World; + import forestry.api.genetics.IAlleleEffect; import forestry.api.genetics.IEffectData; -import net.minecraft.world.World; /** * Simple allele encapsulating a leaf effect. (Not implemented) diff --git a/src/main/java/forestry/api/arboriculture/IAlleleTreeSpecies.java b/src/main/java/forestry/api/arboriculture/IAlleleTreeSpecies.java index 9412a65f7..d57d506ae 100644 --- a/src/main/java/forestry/api/arboriculture/IAlleleTreeSpecies.java +++ b/src/main/java/forestry/api/arboriculture/IAlleleTreeSpecies.java @@ -5,13 +5,15 @@ ******************************************************************************/ package forestry.api.arboriculture; +import java.util.Collection; + +import net.minecraft.util.IIcon; +import net.minecraftforge.common.EnumPlantType; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.genetics.IAlleleSpecies; import forestry.api.genetics.IFruitFamily; -import java.util.Collection; -import net.minecraft.util.IIcon; -import net.minecraftforge.common.EnumPlantType; public interface IAlleleTreeSpecies extends IAlleleSpecies { diff --git a/src/main/java/forestry/api/arboriculture/IAlleleTreeSpeciesCustom.java b/src/main/java/forestry/api/arboriculture/IAlleleTreeSpeciesCustom.java index 088b80670..ce47c6b71 100644 --- a/src/main/java/forestry/api/arboriculture/IAlleleTreeSpeciesCustom.java +++ b/src/main/java/forestry/api/arboriculture/IAlleleTreeSpeciesCustom.java @@ -5,9 +5,10 @@ ******************************************************************************/ package forestry.api.arboriculture; +import net.minecraftforge.common.EnumPlantType; + import forestry.api.genetics.IAlleleSpeciesCustom; import forestry.api.genetics.IFruitFamily; -import net.minecraftforge.common.EnumPlantType; public interface IAlleleTreeSpeciesCustom extends IAlleleSpeciesCustom, IAlleleTreeSpecies { diff --git a/src/main/java/forestry/api/arboriculture/IArboristTracker.java b/src/main/java/forestry/api/arboriculture/IArboristTracker.java index 66329b342..0a5907cbf 100644 --- a/src/main/java/forestry/api/arboriculture/IArboristTracker.java +++ b/src/main/java/forestry/api/arboriculture/IArboristTracker.java @@ -7,4 +7,5 @@ package forestry.api.arboriculture; import forestry.api.genetics.IBreedingTracker; -public interface IArboristTracker extends IBreedingTracker {} +public interface IArboristTracker extends IBreedingTracker { +} diff --git a/src/main/java/forestry/api/arboriculture/IFruitProvider.java b/src/main/java/forestry/api/arboriculture/IFruitProvider.java index fd083c542..c9058ca44 100644 --- a/src/main/java/forestry/api/arboriculture/IFruitProvider.java +++ b/src/main/java/forestry/api/arboriculture/IFruitProvider.java @@ -5,14 +5,15 @@ ******************************************************************************/ package forestry.api.arboriculture; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.genetics.IFruitFamily; 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(); @@ -43,8 +44,7 @@ public interface IFruitProvider { * @param x * @param y * @param z - * @param ripeningTime - * Elapsed ripening time for the fruit. + * @param ripeningTime Elapsed ripening time for the fruit. * @param fancy * @return IIcon index of the texture to overlay on the leaf block. */ diff --git a/src/main/java/forestry/api/arboriculture/IGermlingIconProvider.java b/src/main/java/forestry/api/arboriculture/IGermlingIconProvider.java index c96dea9cc..c2d9db384 100644 --- a/src/main/java/forestry/api/arboriculture/IGermlingIconProvider.java +++ b/src/main/java/forestry/api/arboriculture/IGermlingIconProvider.java @@ -9,11 +9,11 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.util.IIcon; /** - * Provides icons for saplings, pollen, etc. - * You must implement this yourself to use TreeManager.treeFactory.createSpecies() - * There is no default implementation because every sapling has a unique icon. + * Provides icons for saplings, pollen, etc. You must implement this yourself to use + * TreeManager.treeFactory.createSpecies() There is no default implementation because every sapling has a unique icon. */ public interface IGermlingIconProvider { + void registerIcons(IIconRegister register); IIcon getIcon(EnumGermlingType type, int renderPass); diff --git a/src/main/java/forestry/api/arboriculture/IGrowthProvider.java b/src/main/java/forestry/api/arboriculture/IGrowthProvider.java index c3c872241..2c3efadc5 100644 --- a/src/main/java/forestry/api/arboriculture/IGrowthProvider.java +++ b/src/main/java/forestry/api/arboriculture/IGrowthProvider.java @@ -12,17 +12,17 @@ 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 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); + 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); diff --git a/src/main/java/forestry/api/arboriculture/ILeafIconProvider.java b/src/main/java/forestry/api/arboriculture/ILeafIconProvider.java index 43f81159f..9b9d9d1f2 100644 --- a/src/main/java/forestry/api/arboriculture/ILeafIconProvider.java +++ b/src/main/java/forestry/api/arboriculture/ILeafIconProvider.java @@ -8,13 +8,14 @@ package forestry.api.arboriculture; import net.minecraft.util.IIcon; /** - * Provides icons for leaves. Used by TreeManager.treeFactory.createSpecies() - * Get a default Forestry implementation from TreeManager.treeFactory.getLeafIconProvider() or implement your own. + * Provides icons for leaves. Used by TreeManager.treeFactory.createSpecies() Get a default Forestry implementation from + * TreeManager.treeFactory.getLeafIconProvider() or implement your own. * - * If you implement your own, be sure to register the icons. - * Icon registration is not done here because these icons are heavily reused. + * If you implement your own, be sure to register the icons. Icon registration is not done here because these icons are + * heavily reused. */ public interface ILeafIconProvider { + IIcon getIcon(boolean pollinated, boolean fancy); int getColor(boolean pollinated); diff --git a/src/main/java/forestry/api/arboriculture/ILeafTickHandler.java b/src/main/java/forestry/api/arboriculture/ILeafTickHandler.java index e1d596496..99eef2194 100644 --- a/src/main/java/forestry/api/arboriculture/ILeafTickHandler.java +++ b/src/main/java/forestry/api/arboriculture/ILeafTickHandler.java @@ -8,5 +8,6 @@ package forestry.api.arboriculture; import net.minecraft.world.World; public interface ILeafTickHandler { + boolean onRandomLeafTick(ITree tree, World world, int x, int y, int z, boolean isDestroyed); } diff --git a/src/main/java/forestry/api/arboriculture/IToolGrafter.java b/src/main/java/forestry/api/arboriculture/IToolGrafter.java index 205e15dde..cda21c32e 100644 --- a/src/main/java/forestry/api/arboriculture/IToolGrafter.java +++ b/src/main/java/forestry/api/arboriculture/IToolGrafter.java @@ -10,14 +10,15 @@ 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. + * @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/main/java/forestry/api/arboriculture/ITree.java b/src/main/java/forestry/api/arboriculture/ITree.java index 2279da229..1cdf241c2 100644 --- a/src/main/java/forestry/api/arboriculture/ITree.java +++ b/src/main/java/forestry/api/arboriculture/ITree.java @@ -5,16 +5,19 @@ ******************************************************************************/ package forestry.api.arboriculture; -import com.mojang.authlib.GameProfile; -import forestry.api.genetics.IEffectData; -import forestry.api.genetics.IIndividual; -import forestry.api.world.ITreeGenData; 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 com.mojang.authlib.GameProfile; + +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); diff --git a/src/main/java/forestry/api/arboriculture/ITreeFactory.java b/src/main/java/forestry/api/arboriculture/ITreeFactory.java index fbcaf2d5c..963e56e4c 100644 --- a/src/main/java/forestry/api/arboriculture/ITreeFactory.java +++ b/src/main/java/forestry/api/arboriculture/ITreeFactory.java @@ -5,38 +5,32 @@ ******************************************************************************/ package forestry.api.arboriculture; -import forestry.api.genetics.IClassification; import java.awt.Color; +import forestry.api.genetics.IClassification; + public interface ITreeFactory { + /** - * Creates a new tree species. - * Automatically registered with AlleleManager.alleleRegistry.registerAllele() - * See IAlleleTreeSpeciesCustom and IAlleleSpeciesCustom for adding additional properties to the returned species. + * Creates a new tree species. Automatically registered with AlleleManager.alleleRegistry.registerAllele() See + * IAlleleTreeSpeciesCustom and IAlleleSpeciesCustom for adding additional properties to the returned species. * - * @param uid Unique Identifier for this species - * @param unlocalizedName Unlocalized name for this species - * @param authority Authority for the binomial name, e.g. "Sengir" on species of base Forestry. + * @param uid Unique Identifier for this species + * @param unlocalizedName Unlocalized name for this species + * @param authority Authority for the binomial name, e.g. "Sengir" on species of base Forestry. * @param unlocalizedDescription Unlocalized description for this species - * @param dominant Whether this species is genetically dominant (false means it is recessive) - * @param branch Classification of this species - * @param binomial Binomial name of the species sans genus. "humboldti" will have the bee species flavour name be "Apis humboldti". Feel free to use fun names or null. - * @param leafIconProvider The leaf icon provider for this species - * @param germlingIconProvider The germling icon provider for this species - * @param generator The tree generator + * @param dominant Whether this species is genetically dominant (false means it is recessive) + * @param branch Classification of this species + * @param binomial Binomial name of the species sans genus. "humboldti" will have the bee species + * flavour name be "Apis humboldti". Feel free to use fun names or null. + * @param leafIconProvider The leaf icon provider for this species + * @param germlingIconProvider The germling icon provider for this species + * @param generator The tree generator * @return a new tree species allele. */ - IAlleleTreeSpeciesCustom createSpecies( - String uid, - String unlocalizedName, - String authority, - String unlocalizedDescription, - boolean dominant, - IClassification branch, - String binomial, - ILeafIconProvider leafIconProvider, - IGermlingIconProvider germlingIconProvider, - ITreeGenerator generator); + IAlleleTreeSpeciesCustom createSpecies(String uid, String unlocalizedName, String authority, + String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, + ILeafIconProvider leafIconProvider, IGermlingIconProvider germlingIconProvider, ITreeGenerator generator); /** Get one of the built-in Forestry leaf types. Default type is deciduous. */ ILeafIconProvider getLeafIconProvider(EnumLeafType enumLeafType, Color color, Color colorPollinated); diff --git a/src/main/java/forestry/api/arboriculture/ITreeGenerator.java b/src/main/java/forestry/api/arboriculture/ITreeGenerator.java index ff94c3323..4ddecfc16 100644 --- a/src/main/java/forestry/api/arboriculture/ITreeGenerator.java +++ b/src/main/java/forestry/api/arboriculture/ITreeGenerator.java @@ -5,16 +5,18 @@ ******************************************************************************/ package forestry.api.arboriculture; -import com.mojang.authlib.GameProfile; -import forestry.api.world.ITreeGenData; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.common.util.ForgeDirection; +import com.mojang.authlib.GameProfile; +import forestry.api.world.ITreeGenData; + /** * Implements the tree generation for a tree species. */ public interface ITreeGenerator { + WorldGenerator getWorldGenerator(ITreeGenData tree); void setLogBlock(ITreeGenome genome, World world, int x, int y, int z, ForgeDirection facing); diff --git a/src/main/java/forestry/api/arboriculture/ITreeGenome.java b/src/main/java/forestry/api/arboriculture/ITreeGenome.java index 02098945f..32742960b 100644 --- a/src/main/java/forestry/api/arboriculture/ITreeGenome.java +++ b/src/main/java/forestry/api/arboriculture/ITreeGenome.java @@ -5,10 +5,12 @@ ******************************************************************************/ package forestry.api.arboriculture; -import forestry.api.genetics.IGenome; import java.util.EnumSet; + import net.minecraftforge.common.EnumPlantType; +import forestry.api.genetics.IGenome; + public interface ITreeGenome extends IGenome { IAlleleTreeSpecies getPrimary(); @@ -24,8 +26,8 @@ public interface ITreeGenome extends IGenome { 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 + * @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(); diff --git a/src/main/java/forestry/api/arboriculture/ITreeMutation.java b/src/main/java/forestry/api/arboriculture/ITreeMutation.java index ee33b625c..41cb62f27 100644 --- a/src/main/java/forestry/api/arboriculture/ITreeMutation.java +++ b/src/main/java/forestry/api/arboriculture/ITreeMutation.java @@ -5,9 +5,10 @@ ******************************************************************************/ package forestry.api.arboriculture; +import net.minecraft.world.World; + import forestry.api.genetics.IMutation; import forestry.api.genetics.ISpeciesRoot; -import net.minecraft.world.World; public interface ITreeMutation extends IMutation { @@ -20,13 +21,6 @@ public interface ITreeMutation extends IMutation { * @return float representing the percent chance for mutation to occur, from 0.0 to 100.0. * @since Forestry 4.0 */ - float getChance( - World world, - int x, - int y, - int z, - IAlleleTreeSpecies allele0, - IAlleleTreeSpecies allele1, - ITreeGenome genome0, - ITreeGenome genome1); + float getChance(World world, int x, int y, int z, IAlleleTreeSpecies allele0, IAlleleTreeSpecies allele1, + ITreeGenome genome0, ITreeGenome genome1); } diff --git a/src/main/java/forestry/api/arboriculture/ITreeMutationCustom.java b/src/main/java/forestry/api/arboriculture/ITreeMutationCustom.java index fe0e705c5..8c0f19095 100644 --- a/src/main/java/forestry/api/arboriculture/ITreeMutationCustom.java +++ b/src/main/java/forestry/api/arboriculture/ITreeMutationCustom.java @@ -7,4 +7,5 @@ package forestry.api.arboriculture; import forestry.api.genetics.IMutationCustom; -public interface ITreeMutationCustom extends ITreeMutation, IMutationCustom {} +public interface ITreeMutationCustom extends ITreeMutation, IMutationCustom { +} diff --git a/src/main/java/forestry/api/arboriculture/ITreeMutationFactory.java b/src/main/java/forestry/api/arboriculture/ITreeMutationFactory.java index f646ff70b..684a07bc0 100644 --- a/src/main/java/forestry/api/arboriculture/ITreeMutationFactory.java +++ b/src/main/java/forestry/api/arboriculture/ITreeMutationFactory.java @@ -8,17 +8,17 @@ package forestry.api.arboriculture; import forestry.api.genetics.IAllele; public interface ITreeMutationFactory { + /** - * Creates a new tree mutation. - * Automatically registered with TreeManager.treeRoot.registerMutation() - * See ITreeMutationCustom and IMutationCustom for adding additional properties to the returned mutation. + * Creates a new tree mutation. Automatically registered with TreeManager.treeRoot.registerMutation() See + * ITreeMutationCustom and IMutationCustom for adding additional properties to the returned mutation. * * @param parentTree0 A parent tree for this mutation * @param parentTree1 A parent tree for this mutation - * @param result The resulting alleles for this mutation - * @param chance The chance that breeding the two parent trees will result in this mutation + * @param result The resulting alleles for this mutation + * @param chance The chance that breeding the two parent trees will result in this mutation * @return a new tree mutation. */ - ITreeMutationCustom createMutation( - IAlleleTreeSpecies parentTree0, IAlleleTreeSpecies parentTree1, IAllele[] result, int chance); + ITreeMutationCustom createMutation(IAlleleTreeSpecies parentTree0, IAlleleTreeSpecies parentTree1, IAllele[] result, + int chance); } diff --git a/src/main/java/forestry/api/arboriculture/ITreeRoot.java b/src/main/java/forestry/api/arboriculture/ITreeRoot.java index 4b7c7ae54..e1260d670 100644 --- a/src/main/java/forestry/api/arboriculture/ITreeRoot.java +++ b/src/main/java/forestry/api/arboriculture/ITreeRoot.java @@ -5,16 +5,19 @@ ******************************************************************************/ package forestry.api.arboriculture; -import com.mojang.authlib.GameProfile; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IChromosome; -import forestry.api.genetics.ISpeciesRoot; 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.ISpeciesRoot; + public interface ITreeRoot extends ISpeciesRoot { @Override @@ -48,6 +51,7 @@ public interface ITreeRoot extends ISpeciesRoot { /* TREE SPECIFIC */ /** * Register a leaf tick handler. + * * @param handler the {@link ILeafTickHandler} to register. */ void registerLeafTickHandler(ILeafTickHandler handler); diff --git a/src/main/java/forestry/api/arboriculture/IWoodItemAccess.java b/src/main/java/forestry/api/arboriculture/IWoodItemAccess.java index ad5bce076..8835feccd 100644 --- a/src/main/java/forestry/api/arboriculture/IWoodItemAccess.java +++ b/src/main/java/forestry/api/arboriculture/IWoodItemAccess.java @@ -8,6 +8,7 @@ package forestry.api.arboriculture; import net.minecraft.item.ItemStack; public interface IWoodItemAccess { + ItemStack getLog(EnumWoodType woodType, boolean fireproof); ItemStack getPlanks(EnumWoodType woodType, boolean fireproof); diff --git a/src/main/java/forestry/api/circuits/CircuitSocketType.java b/src/main/java/forestry/api/circuits/CircuitSocketType.java index 0fa2ed345..b642f90dd 100644 --- a/src/main/java/forestry/api/circuits/CircuitSocketType.java +++ b/src/main/java/forestry/api/circuits/CircuitSocketType.java @@ -6,6 +6,7 @@ package forestry.api.circuits; public enum CircuitSocketType implements ICircuitSocketType { + NONE("none"), FARM("forestry.farm"), ELECTRIC_ENGINE("forestry.electric.engine"), diff --git a/src/main/java/forestry/api/circuits/ICircuit.java b/src/main/java/forestry/api/circuits/ICircuit.java index 4986dc290..6a944645e 100644 --- a/src/main/java/forestry/api/circuits/ICircuit.java +++ b/src/main/java/forestry/api/circuits/ICircuit.java @@ -8,6 +8,7 @@ package forestry.api.circuits; import java.util.List; public interface ICircuit { + String getUID(); boolean requiresDiscovery(); diff --git a/src/main/java/forestry/api/circuits/ICircuitBoard.java b/src/main/java/forestry/api/circuits/ICircuitBoard.java index 605c21fc6..161eef9ed 100644 --- a/src/main/java/forestry/api/circuits/ICircuitBoard.java +++ b/src/main/java/forestry/api/circuits/ICircuitBoard.java @@ -5,9 +5,10 @@ ******************************************************************************/ package forestry.api.circuits; -import forestry.api.core.INBTTagable; import java.util.List; +import forestry.api.core.INBTTagable; + public interface ICircuitBoard extends INBTTagable { int getPrimaryColor(); @@ -28,6 +29,7 @@ public interface ICircuitBoard extends INBTTagable { /** * Specifies where a circuit can be used. + * * @since Forestry 4.0 */ ICircuitSocketType getSocketType(); diff --git a/src/main/java/forestry/api/circuits/ICircuitLayout.java b/src/main/java/forestry/api/circuits/ICircuitLayout.java index dd25e1c22..8743c1682 100644 --- a/src/main/java/forestry/api/circuits/ICircuitLayout.java +++ b/src/main/java/forestry/api/circuits/ICircuitLayout.java @@ -18,6 +18,7 @@ public interface ICircuitLayout { /** * Specifies where a circuit layout is used. + * * @since Forestry 4.0 */ ICircuitSocketType getSocketType(); diff --git a/src/main/java/forestry/api/circuits/ICircuitLibrary.java b/src/main/java/forestry/api/circuits/ICircuitLibrary.java index 34a1d600f..981a5f2b8 100644 --- a/src/main/java/forestry/api/circuits/ICircuitLibrary.java +++ b/src/main/java/forestry/api/circuits/ICircuitLibrary.java @@ -5,4 +5,5 @@ ******************************************************************************/ package forestry.api.circuits; -public interface ICircuitLibrary {} +public interface ICircuitLibrary { +} diff --git a/src/main/java/forestry/api/circuits/ICircuitRegistry.java b/src/main/java/forestry/api/circuits/ICircuitRegistry.java index 003d552e4..f2b4698c8 100644 --- a/src/main/java/forestry/api/circuits/ICircuitRegistry.java +++ b/src/main/java/forestry/api/circuits/ICircuitRegistry.java @@ -6,6 +6,7 @@ package forestry.api.circuits; import java.util.Map; + import net.minecraft.item.ItemStack; import net.minecraft.world.World; diff --git a/src/main/java/forestry/api/circuits/ICircuitSocketType.java b/src/main/java/forestry/api/circuits/ICircuitSocketType.java index f033058f6..bd5e71d9a 100644 --- a/src/main/java/forestry/api/circuits/ICircuitSocketType.java +++ b/src/main/java/forestry/api/circuits/ICircuitSocketType.java @@ -6,10 +6,11 @@ package forestry.api.circuits; /** - * Specifies where a circuit layout can be used. (i.e. farm, machine, engine, etc) - * See CircuitSocketType for Forestry's uses. + * Specifies where a circuit layout can be used. (i.e. farm, machine, engine, etc) See CircuitSocketType for Forestry's + * uses. */ public interface ICircuitSocketType { + /** unique identifier for this socket type */ String getUid(); diff --git a/src/main/java/forestry/api/core/BiomeHelper.java b/src/main/java/forestry/api/core/BiomeHelper.java index 2ef71c8b2..0a7612fa0 100644 --- a/src/main/java/forestry/api/core/BiomeHelper.java +++ b/src/main/java/forestry/api/core/BiomeHelper.java @@ -2,6 +2,7 @@ package forestry.api.core; import java.util.HashMap; import java.util.Map; + import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.common.BiomeDictionary; @@ -17,8 +18,9 @@ public class BiomeHelper { } /** - * Determines if a given BiomeGenBase is of HELLISH temperature, since it is treated separately from actual temperature values. - * Uses the BiomeDictionary. + * 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. */ diff --git a/src/main/java/forestry/api/core/EnumHumidity.java b/src/main/java/forestry/api/core/EnumHumidity.java index 50594afcf..0f4d6592b 100644 --- a/src/main/java/forestry/api/core/EnumHumidity.java +++ b/src/main/java/forestry/api/core/EnumHumidity.java @@ -6,11 +6,13 @@ 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. + * 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. + * This enum concerns humidity. */ public enum EnumHumidity { + ARID("Arid"), NORMAL("Normal"), DAMP("Damp"); @@ -26,8 +28,9 @@ public enum EnumHumidity { } /** - * Determines the EnumHumidity given a floating point representation of Minecraft Rainfall. - * To check if rainfall is possible in a biome, use BiomeHelper.canRainOrSnow(). + * 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 */ diff --git a/src/main/java/forestry/api/core/EnumTemperature.java b/src/main/java/forestry/api/core/EnumTemperature.java index b183465ff..9bc57eb52 100644 --- a/src/main/java/forestry/api/core/EnumTemperature.java +++ b/src/main/java/forestry/api/core/EnumTemperature.java @@ -5,17 +5,20 @@ ******************************************************************************/ package forestry.api.core; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; 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. + * 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. + * This enum concerns temperature. */ public enum EnumTemperature { + NONE("None", "habitats/ocean"), ICY("Icy", "habitats/snow"), COLD("Cold", "habitats/taiga"), @@ -42,9 +45,9 @@ public enum EnumTemperature { } /** - * Determines the EnumTemperature given a floating point representation of - * Minecraft temperature. Hellish biomes are handled based on their biome - * type - check BiomeHelper.isBiomeHellish. + * 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 */ diff --git a/src/main/java/forestry/api/core/ForestryAPI.java b/src/main/java/forestry/api/core/ForestryAPI.java index 394bac3a9..eb9d5ff95 100644 --- a/src/main/java/forestry/api/core/ForestryAPI.java +++ b/src/main/java/forestry/api/core/ForestryAPI.java @@ -5,27 +5,25 @@ ******************************************************************************/ package forestry.api.core; +import java.util.Set; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import java.util.Set; /** * 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. + * 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. + * .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. + * Note that if Forestry is not present, all these references will be null. */ public class ForestryAPI { @@ -53,15 +51,13 @@ public class ForestryAPI { public static IForestryConstants forestryConstants; /** - * The currently enabled Forestry plugins. - * Can be used to check if certain features are available, for example: + * The currently enabled Forestry plugins. Can be used to check if certain features are available, for example: * ForestryAPI.enabledPlugins.contains("APICULTURE") */ public static Set enabledPlugins; /** - * Instance of the errorStateRegistry for registering errors. - * Also creates new instances of IErrorLogic. + * Instance of the errorStateRegistry for registering errors. Also creates new instances of IErrorLogic. */ public static IErrorStateRegistry errorStateRegistry; } diff --git a/src/main/java/forestry/api/core/ForestryEvent.java b/src/main/java/forestry/api/core/ForestryEvent.java index 629a694a4..a8a521c84 100644 --- a/src/main/java/forestry/api/core/ForestryEvent.java +++ b/src/main/java/forestry/api/core/ForestryEvent.java @@ -5,17 +5,20 @@ ******************************************************************************/ 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; -import net.minecraft.entity.player.EntityPlayer; public abstract class ForestryEvent extends Event { private abstract static class BreedingEvent extends ForestryEvent { + public final ISpeciesRoot root; public final IBreedingTracker tracker; public final GameProfile username; @@ -29,16 +32,18 @@ public abstract class ForestryEvent extends Event { } public static class SpeciesDiscovered extends BreedingEvent { + public final IAlleleSpecies species; - public SpeciesDiscovered( - ISpeciesRoot root, GameProfile username, IAlleleSpecies species, IBreedingTracker tracker) { + 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) { @@ -48,6 +53,7 @@ public abstract class ForestryEvent extends Event { } public static class SyncedBreedingTracker extends ForestryEvent { + public final IBreedingTracker tracker; public final EntityPlayer player; diff --git a/src/main/java/forestry/api/core/IArmorNaturalist.java b/src/main/java/forestry/api/core/IArmorNaturalist.java index ab4766f30..f78481cd6 100644 --- a/src/main/java/forestry/api/core/IArmorNaturalist.java +++ b/src/main/java/forestry/api/core/IArmorNaturalist.java @@ -13,12 +13,9 @@ 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 + * @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/main/java/forestry/api/core/IClimateControlled.java b/src/main/java/forestry/api/core/IClimateControlled.java index 94e9de024..0ae4ae6d1 100644 --- a/src/main/java/forestry/api/core/IClimateControlled.java +++ b/src/main/java/forestry/api/core/IClimateControlled.java @@ -1,16 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.api.core; public interface IClimateControlled { + /** * Change the temperature, but not lower than boundaryDown or higher than boundaryUp. */ diff --git a/src/main/java/forestry/api/core/IClimateProvider.java b/src/main/java/forestry/api/core/IClimateProvider.java index 856e32ff8..039ec86ee 100644 --- a/src/main/java/forestry/api/core/IClimateProvider.java +++ b/src/main/java/forestry/api/core/IClimateProvider.java @@ -3,6 +3,7 @@ package forestry.api.core; import net.minecraft.world.biome.BiomeGenBase; public interface IClimateProvider { + BiomeGenBase getBiome(); EnumTemperature getTemperature(); diff --git a/src/main/java/forestry/api/core/IErrorLogic.java b/src/main/java/forestry/api/core/IErrorLogic.java index 0b4bec3e0..83efbba69 100644 --- a/src/main/java/forestry/api/core/IErrorLogic.java +++ b/src/main/java/forestry/api/core/IErrorLogic.java @@ -10,13 +10,14 @@ import java.io.DataOutputStream; import java.io.IOException; /** - * Keeps track of all the IErrorStates for an object. - * Create a new IErrorLogic instance for your object with ForestryAPI.errorStateRegistry.createErrorLogic(). + * Keeps track of all the IErrorStates for an object. Create a new IErrorLogic instance for your object with + * ForestryAPI.errorStateRegistry.createErrorLogic(). */ public interface IErrorLogic extends IErrorSource { /** * Sets the errorState when condition is true, and unsets it when condition is false. + * * @return condition */ boolean setCondition(boolean condition, IErrorState errorState); diff --git a/src/main/java/forestry/api/core/IErrorLogicSource.java b/src/main/java/forestry/api/core/IErrorLogicSource.java index d0d69d90d..115d336b1 100644 --- a/src/main/java/forestry/api/core/IErrorLogicSource.java +++ b/src/main/java/forestry/api/core/IErrorLogicSource.java @@ -9,5 +9,6 @@ package forestry.api.core; * An IErrorLogicSource uses an instance of IErrorLogic to deal with its errors. */ public interface IErrorLogicSource { + IErrorLogic getErrorLogic(); } diff --git a/src/main/java/forestry/api/core/IErrorSource.java b/src/main/java/forestry/api/core/IErrorSource.java index bde502412..78f1e59ac 100644 --- a/src/main/java/forestry/api/core/IErrorSource.java +++ b/src/main/java/forestry/api/core/IErrorSource.java @@ -8,6 +8,7 @@ package forestry.api.core; import com.google.common.collect.ImmutableSet; public interface IErrorSource { + /** * @return the active error states. An empty Set indicates no errors. */ diff --git a/src/main/java/forestry/api/core/IErrorState.java b/src/main/java/forestry/api/core/IErrorState.java index d50ab35a1..822d61675 100644 --- a/src/main/java/forestry/api/core/IErrorState.java +++ b/src/main/java/forestry/api/core/IErrorState.java @@ -5,11 +5,12 @@ ******************************************************************************/ package forestry.api.core; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; 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 diff --git a/src/main/java/forestry/api/core/IErrorStateRegistry.java b/src/main/java/forestry/api/core/IErrorStateRegistry.java index bc033b9ec..524ef854b 100644 --- a/src/main/java/forestry/api/core/IErrorStateRegistry.java +++ b/src/main/java/forestry/api/core/IErrorStateRegistry.java @@ -8,6 +8,7 @@ package forestry.api.core; import java.util.Set; public interface IErrorStateRegistry { + void registerErrorState(IErrorState state); void addAlias(IErrorState state, String name); diff --git a/src/main/java/forestry/api/core/IIconProvider.java b/src/main/java/forestry/api/core/IIconProvider.java index ae29102ec..c4e20071e 100644 --- a/src/main/java/forestry/api/core/IIconProvider.java +++ b/src/main/java/forestry/api/core/IIconProvider.java @@ -5,11 +5,12 @@ ******************************************************************************/ package forestry.api.core; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; 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. */ diff --git a/src/main/java/forestry/api/core/INBTTagable.java b/src/main/java/forestry/api/core/INBTTagable.java index cd09390ac..fb7d662ed 100644 --- a/src/main/java/forestry/api/core/INBTTagable.java +++ b/src/main/java/forestry/api/core/INBTTagable.java @@ -8,6 +8,7 @@ package forestry.api.core; import net.minecraft.nbt.NBTTagCompound; public interface INBTTagable { + void readFromNBT(NBTTagCompound nbttagcompound); void writeToNBT(NBTTagCompound nbttagcompound); diff --git a/src/main/java/forestry/api/core/ITextureManager.java b/src/main/java/forestry/api/core/ITextureManager.java index 1114ab661..6f1d2af67 100644 --- a/src/main/java/forestry/api/core/ITextureManager.java +++ b/src/main/java/forestry/api/core/ITextureManager.java @@ -5,9 +5,10 @@ ******************************************************************************/ package forestry.api.core; +import net.minecraft.util.IIcon; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.util.IIcon; @SideOnly(Side.CLIENT) public interface ITextureManager { diff --git a/src/main/java/forestry/api/core/IToolPipette.java b/src/main/java/forestry/api/core/IToolPipette.java index 9ef992fdd..91a7e32fd 100644 --- a/src/main/java/forestry/api/core/IToolPipette.java +++ b/src/main/java/forestry/api/core/IToolPipette.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.api.core; @@ -19,8 +17,7 @@ import net.minecraftforge.fluids.FluidStack; public interface IToolPipette { /** - * @param pipette - * ItemStack of the pipette. + * @param pipette ItemStack of the pipette. * @return Capacity of the pipette. */ int getCapacity(ItemStack pipette); diff --git a/src/main/java/forestry/api/core/IToolScoop.java b/src/main/java/forestry/api/core/IToolScoop.java index 1fe6f392b..6263c1e8f 100644 --- a/src/main/java/forestry/api/core/IToolScoop.java +++ b/src/main/java/forestry/api/core/IToolScoop.java @@ -8,4 +8,5 @@ package forestry.api.core; /** * Marks a tool as a scoop. */ -public interface IToolScoop {} +public interface IToolScoop { +} diff --git a/src/main/java/forestry/api/core/Tabs.java b/src/main/java/forestry/api/core/Tabs.java index c11cc250a..8877c52d2 100644 --- a/src/main/java/forestry/api/core/Tabs.java +++ b/src/main/java/forestry/api/core/Tabs.java @@ -8,7 +8,7 @@ package forestry.api.core; import net.minecraft.creativetab.CreativeTabs; /** - * References to the specialised tabs added by Forestry to creative inventory. + * References to the specialised tabs added by Forestry to creative inventory. */ public class Tabs { diff --git a/src/main/java/forestry/api/farming/DefaultFarmListener.java b/src/main/java/forestry/api/farming/DefaultFarmListener.java index 4dcd24937..9cca71082 100644 --- a/src/main/java/forestry/api/farming/DefaultFarmListener.java +++ b/src/main/java/forestry/api/farming/DefaultFarmListener.java @@ -6,14 +6,15 @@ package forestry.api.farming; import java.util.Collection; + import net.minecraft.item.ItemStack; /** - * Easily extendable default farmListener. - * By itself, this farmListener does nothing. - * FarmListeners should inherit from this class unless they need to listen for everything. + * Easily extendable default farmListener. By itself, this farmListener does nothing. FarmListeners should inherit from + * this class unless they need to listen for everything. */ public class DefaultFarmListener implements IFarmListener { + @Override public boolean beforeCropHarvest(ICrop crop) { return false; @@ -29,8 +30,8 @@ public class DefaultFarmListener implements IFarmListener { public void hasCultivated(IFarmLogic logic, int x, int y, int z, FarmDirection direction, int extent) {} @Override - public void hasScheduledHarvest( - Collection harvested, IFarmLogic logic, int x, int y, int z, FarmDirection direction, int extent) {} + public void hasScheduledHarvest(Collection harvested, IFarmLogic logic, int x, int y, int z, + FarmDirection direction, int extent) {} @Override public boolean cancelTask(IFarmLogic logic, FarmDirection direction) { diff --git a/src/main/java/forestry/api/farming/FarmDirection.java b/src/main/java/forestry/api/farming/FarmDirection.java index 051170e54..755583890 100644 --- a/src/main/java/forestry/api/farming/FarmDirection.java +++ b/src/main/java/forestry/api/farming/FarmDirection.java @@ -8,6 +8,7 @@ package forestry.api.farming; import net.minecraftforge.common.util.ForgeDirection; public enum FarmDirection { + NORTH(ForgeDirection.NORTH), EAST(ForgeDirection.EAST), SOUTH(ForgeDirection.SOUTH), diff --git a/src/main/java/forestry/api/farming/Farmables.java b/src/main/java/forestry/api/farming/Farmables.java index 3a864b7b4..3d1711e02 100644 --- a/src/main/java/forestry/api/farming/Farmables.java +++ b/src/main/java/forestry/api/farming/Farmables.java @@ -9,6 +9,7 @@ import java.util.Collection; import java.util.HashMap; public class Farmables { + /** * Can be used to add IFarmables to some of the vanilla farm logics. * diff --git a/src/main/java/forestry/api/farming/ICrop.java b/src/main/java/forestry/api/farming/ICrop.java index c766d57bf..f74b59eed 100644 --- a/src/main/java/forestry/api/farming/ICrop.java +++ b/src/main/java/forestry/api/farming/ICrop.java @@ -6,6 +6,7 @@ package forestry.api.farming; import java.util.Collection; + import net.minecraft.item.ItemStack; public interface ICrop { diff --git a/src/main/java/forestry/api/farming/IFarmHousing.java b/src/main/java/forestry/api/farming/IFarmHousing.java index 0fdb0caf0..f872c987f 100644 --- a/src/main/java/forestry/api/farming/IFarmHousing.java +++ b/src/main/java/forestry/api/farming/IFarmHousing.java @@ -5,10 +5,11 @@ ******************************************************************************/ package forestry.api.farming; -import forestry.api.core.IErrorLogicSource; import net.minecraft.world.World; import net.minecraftforge.fluids.FluidStack; +import forestry.api.core.IErrorLogicSource; + public interface IFarmHousing extends IErrorLogicSource { int[] getCoords(); @@ -29,9 +30,8 @@ public interface IFarmHousing extends IErrorLogicSource { void removeLiquid(FluidStack liquid); /** - * 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. + * 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. * * @return true if planting was successful, false otherwise. */ diff --git a/src/main/java/forestry/api/farming/IFarmInventory.java b/src/main/java/forestry/api/farming/IFarmInventory.java index 10d3f74f5..833cf3860 100644 --- a/src/main/java/forestry/api/farming/IFarmInventory.java +++ b/src/main/java/forestry/api/farming/IFarmInventory.java @@ -9,6 +9,7 @@ import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; public interface IFarmInventory { + boolean hasResources(ItemStack[] resources); void removeResources(ItemStack[] resources); diff --git a/src/main/java/forestry/api/farming/IFarmListener.java b/src/main/java/forestry/api/farming/IFarmListener.java index 9b25f1bb9..87365890f 100644 --- a/src/main/java/forestry/api/farming/IFarmListener.java +++ b/src/main/java/forestry/api/farming/IFarmListener.java @@ -6,6 +6,7 @@ package forestry.api.farming; import java.util.Collection; + import net.minecraft.item.ItemStack; public interface IFarmListener { @@ -21,15 +22,18 @@ public interface IFarmListener { /** * 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} + * @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. + * 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 collected Collection of collected stacks. May be manipulated. Ensure removal of stacks with 0 or less + * items! */ void hasCollected(Collection collected, IFarmLogic logic); @@ -39,10 +43,11 @@ public interface IFarmListener { void hasCultivated(IFarmLogic logic, int x, int y, int z, FarmDirection 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. + * 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. */ - void hasScheduledHarvest( - Collection harvested, IFarmLogic logic, int x, int y, int z, FarmDirection direction, int extent); + void hasScheduledHarvest(Collection harvested, IFarmLogic logic, int x, int y, int z, + FarmDirection direction, int extent); /** * Can be used to cancel farm task on a per side/{@link IFarmLogic} basis. diff --git a/src/main/java/forestry/api/farming/IFarmLogic.java b/src/main/java/forestry/api/farming/IFarmLogic.java index b0ad53afd..8e8028f3c 100644 --- a/src/main/java/forestry/api/farming/IFarmLogic.java +++ b/src/main/java/forestry/api/farming/IFarmLogic.java @@ -5,13 +5,15 @@ ******************************************************************************/ package forestry.api.farming; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; 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; + public interface IFarmLogic { int getFertilizerConsumption(); diff --git a/src/main/java/forestry/api/farming/IFarmable.java b/src/main/java/forestry/api/farming/IFarmable.java index c2fb1c7bc..cd74de8c0 100644 --- a/src/main/java/forestry/api/farming/IFarmable.java +++ b/src/main/java/forestry/api/farming/IFarmable.java @@ -15,7 +15,8 @@ import net.minecraft.world.World; public interface IFarmable { /** - * @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. + * @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); @@ -30,13 +31,14 @@ public interface IFarmable { boolean isGermling(ItemStack 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.) + * @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. + * 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. * * @return true on success, false otherwise. */ diff --git a/src/main/java/forestry/api/farming/IFarmableBasic.java b/src/main/java/forestry/api/farming/IFarmableBasic.java index e6a20f49d..c1d9bdb88 100644 --- a/src/main/java/forestry/api/farming/IFarmableBasic.java +++ b/src/main/java/forestry/api/farming/IFarmableBasic.java @@ -9,12 +9,14 @@ import net.minecraft.block.Block; import net.minecraft.world.World; /** - * A basic form of {@link IFarmable}. It adds one more variant of isSapling, allowing much better runtime performance than otherwise. + * A basic form of {@link IFarmable}. It adds one more variant of isSapling, allowing much better runtime performance + * than otherwise. */ public interface IFarmableBasic extends IFarmable { /** - * @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. + * @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. */ default boolean isSaplingAt(World world, int x, int y, int z) { return world.blockExists(x, y, z) @@ -22,7 +24,8 @@ public interface IFarmableBasic extends IFarmable { } /** - * @return true if given block at the given location is a "sapling" for this type, i.e. a non-harvestable immature version of the crop. + * @return true if given block at the given location is a "sapling" for this type, i.e. a non-harvestable immature + * version of the crop. */ boolean isSapling(Block block, int meta); diff --git a/src/main/java/forestry/api/food/BeverageManager.java b/src/main/java/forestry/api/food/BeverageManager.java index 576a3d7c0..0a14e5137 100644 --- a/src/main/java/forestry/api/food/BeverageManager.java +++ b/src/main/java/forestry/api/food/BeverageManager.java @@ -6,6 +6,7 @@ package forestry.api.food; public class BeverageManager { + public static IBeverageEffect[] effectList = new IBeverageEffect[128]; public static IInfuserManager infuserManager; diff --git a/src/main/java/forestry/api/food/IBeverageEffect.java b/src/main/java/forestry/api/food/IBeverageEffect.java index b452db31d..893e8a2e4 100644 --- a/src/main/java/forestry/api/food/IBeverageEffect.java +++ b/src/main/java/forestry/api/food/IBeverageEffect.java @@ -9,6 +9,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; public interface IBeverageEffect { + int getId(); void doEffect(World world, EntityPlayer player); diff --git a/src/main/java/forestry/api/fuels/EngineBronzeFuel.java b/src/main/java/forestry/api/fuels/EngineBronzeFuel.java index 5c427b1c9..f43e48d32 100644 --- a/src/main/java/forestry/api/fuels/EngineBronzeFuel.java +++ b/src/main/java/forestry/api/fuels/EngineBronzeFuel.java @@ -8,6 +8,7 @@ package forestry.api.fuels; import net.minecraftforge.fluids.Fluid; public class EngineBronzeFuel { + /** * Item that is valid fuel for a biogas engine. */ diff --git a/src/main/java/forestry/api/fuels/FermenterFuel.java b/src/main/java/forestry/api/fuels/FermenterFuel.java index ad2ddfd11..61e0ff55f 100644 --- a/src/main/java/forestry/api/fuels/FermenterFuel.java +++ b/src/main/java/forestry/api/fuels/FermenterFuel.java @@ -8,6 +8,7 @@ package forestry.api.fuels; import net.minecraft.item.ItemStack; public class FermenterFuel { + /** * Item that is a valid fuel for the fermenter (i.e. fertilizer). */ diff --git a/src/main/java/forestry/api/fuels/FuelManager.java b/src/main/java/forestry/api/fuels/FuelManager.java index 606f4b95d..3efd4a827 100644 --- a/src/main/java/forestry/api/fuels/FuelManager.java +++ b/src/main/java/forestry/api/fuels/FuelManager.java @@ -6,10 +6,12 @@ package forestry.api.fuels; import java.util.HashMap; + import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; public class FuelManager { + /** * Add new fuels for the fermenter here (i.e. fertilizer). */ diff --git a/src/main/java/forestry/api/fuels/MoistenerFuel.java b/src/main/java/forestry/api/fuels/MoistenerFuel.java index 15f5ab0fa..a11924038 100644 --- a/src/main/java/forestry/api/fuels/MoistenerFuel.java +++ b/src/main/java/forestry/api/fuels/MoistenerFuel.java @@ -8,6 +8,7 @@ package forestry.api.fuels; import net.minecraft.item.ItemStack; public class MoistenerFuel { + /** * The item to use */ diff --git a/src/main/java/forestry/api/fuels/RainSubstrate.java b/src/main/java/forestry/api/fuels/RainSubstrate.java index 4373719c7..729b3edea 100644 --- a/src/main/java/forestry/api/fuels/RainSubstrate.java +++ b/src/main/java/forestry/api/fuels/RainSubstrate.java @@ -8,6 +8,7 @@ package forestry.api.fuels; import net.minecraft.item.ItemStack; public class RainSubstrate { + /** * Rain substrate capable of activating the rainmaker. */ diff --git a/src/main/java/forestry/api/genetics/AlleleManager.java b/src/main/java/forestry/api/genetics/AlleleManager.java index 977c59d33..c90379e29 100644 --- a/src/main/java/forestry/api/genetics/AlleleManager.java +++ b/src/main/java/forestry/api/genetics/AlleleManager.java @@ -6,18 +6,21 @@ 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. + * 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(); /** diff --git a/src/main/java/forestry/api/genetics/IAllele.java b/src/main/java/forestry/api/genetics/IAllele.java index cdb0d05a4..042154ec7 100644 --- a/src/main/java/forestry/api/genetics/IAllele.java +++ b/src/main/java/forestry/api/genetics/IAllele.java @@ -6,9 +6,11 @@ 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}. + * 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. + * {@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. * diff --git a/src/main/java/forestry/api/genetics/IAlleleEffect.java b/src/main/java/forestry/api/genetics/IAlleleEffect.java index 10aa4bfac..279ccbb50 100644 --- a/src/main/java/forestry/api/genetics/IAlleleEffect.java +++ b/src/main/java/forestry/api/genetics/IAlleleEffect.java @@ -9,14 +9,16 @@ 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. + * @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. + * 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. diff --git a/src/main/java/forestry/api/genetics/IAlleleFactory.java b/src/main/java/forestry/api/genetics/IAlleleFactory.java index 8ce84a04f..6793912eb 100644 --- a/src/main/java/forestry/api/genetics/IAlleleFactory.java +++ b/src/main/java/forestry/api/genetics/IAlleleFactory.java @@ -4,112 +4,93 @@ 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. + * 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] + * The default localization uses: [modId].allele.[valueName] * - * Languages that need category-specific names can override it by defining: - * [modId].allele.[category].[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=????? ?????? + * 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 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 - * @param types allele chromosome type for registration (i.e. EnumTreeChromosome.HEIGHT) + * @param types allele chromosome type for registration (i.e. EnumTreeChromosome.HEIGHT) * @return a new IAlleleFloat, registered with the allele registry. * @since Forestry 4.2 */ - IAlleleFloat createFloat( - String modId, String category, String valueName, float value, boolean isDominant, IChromosomeType... types); + IAlleleFloat createFloat(String modId, String category, String valueName, float value, boolean isDominant, + IChromosomeType... types); /** - * @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 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 - * @param types allele chromosome type for registration (i.e. EnumBeeChromosome.TERRITORY) + * @param types allele chromosome type for registration (i.e. EnumBeeChromosome.TERRITORY) * @return a new IAlleleArea, registered with the allele registry. * @since Forestry 4.2 */ - IAlleleArea createArea( - String modId, - String category, - String valueName, - int xDimValue, - int yDimValue, - int zDimValue, - boolean isDominant, - IChromosomeType... types); + IAlleleArea createArea(String modId, String category, String valueName, int xDimValue, int yDimValue, int zDimValue, + boolean isDominant, IChromosomeType... types); /** - * @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 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 - * @param types allele chromosome type for registration (i.e. EnumBeeChromosome.FERTILITY) + * @param types allele chromosome type for registration (i.e. EnumBeeChromosome.FERTILITY) * @return a new IAlleleInteger, registered with the allele registry. * @since Forestry 4.2 */ - IAlleleInteger createInteger( - String modId, String category, String valueName, int value, boolean isDominant, IChromosomeType... types); - - /** - * @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 - * @param types allele chromosome type for registration (i.e. EnumTreeChromosome.FIREPROOF) - * @return a new IAlleleBoolean, registered with the allele registry. - * Note that valueName will always be "true" or "false" - * @since Forestry 4.2 - */ - IAlleleBoolean createBoolean( - String modId, String category, boolean value, boolean isDominant, IChromosomeType... types); - - /** - * @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 - * @param types allele chromosome type for registration (i.e. EnumBeeChromosome.FLOWER_PROVIDER) - * @return a new IAlleleFlowers, registered with the allele registry. - * IAlleleFlowers localization is handled by the IFlowerProvider.getDescription(), unlike the other alleles. - * @since Forestry 4.2 - */ - IAlleleFlowers createFlowers( - String modId, - String category, - String valueName, - IFlowerProvider value, - boolean isDominant, + IAlleleInteger createInteger(String modId, String category, String valueName, int value, boolean isDominant, IChromosomeType... types); /** - * @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 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 + * @param types allele chromosome type for registration (i.e. EnumTreeChromosome.FIREPROOF) + * @return a new IAlleleBoolean, registered with the allele registry. Note that valueName will always be "true" or + * "false" + * @since Forestry 4.2 + */ + IAlleleBoolean createBoolean(String modId, String category, boolean value, boolean isDominant, + IChromosomeType... types); + + /** + * @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 + * @param types allele chromosome type for registration (i.e. EnumBeeChromosome.FLOWER_PROVIDER) + * @return a new IAlleleFlowers, registered with the allele registry. IAlleleFlowers localization is handled by the + * IFlowerProvider.getDescription(), unlike the other alleles. + * @since Forestry 4.2 + */ + IAlleleFlowers createFlowers(String modId, String category, String valueName, IFlowerProvider value, + boolean isDominant, IChromosomeType... types); + + /** + * @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, registered with the allele registry. * @deprecated since Forestry 4.2. Use the IChromosomeType version. @@ -118,31 +99,25 @@ public interface IAlleleFactory { 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 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, registered with the allele registry. * @deprecated since Forestry 4.2. Use the IChromosomeType version. */ @Deprecated - IAlleleArea createArea( - String modId, - String category, - String valueName, - int xDimValue, - int yDimValue, - int zDimValue, + 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 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, registered with the allele registry. * @deprecated since Forestry 4.2. Use the IChromosomeType version. @@ -151,28 +126,28 @@ public interface IAlleleFactory { 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 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, registered with the allele registry. - * Note that valueName will always be "true" or "false" + * @return a new IAlleleBoolean, registered with the allele registry. Note that valueName will always be "true" or + * "false" * @deprecated since Forestry 4.2. Use the IChromosomeType version. */ @Deprecated 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 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, registered with the allele registry. - * IAlleleFlowers localization is handled by the IFlowerProvider.getDescription(), unlike the other alleles. + * @return a new IAlleleFlowers, registered with the allele registry. IAlleleFlowers localization is handled by the + * IFlowerProvider.getDescription(), unlike the other alleles. * @deprecated since Forestry 4.2. Use the IChromosomeType version. */ @Deprecated - IAlleleFlowers createFlowers( - String modId, String category, String valueName, IFlowerProvider value, boolean isDominant); + IAlleleFlowers createFlowers(String modId, String category, String valueName, IFlowerProvider value, + boolean isDominant); } diff --git a/src/main/java/forestry/api/genetics/IAlleleHandler.java b/src/main/java/forestry/api/genetics/IAlleleHandler.java index e16e359c3..08b492bae 100644 --- a/src/main/java/forestry/api/genetics/IAlleleHandler.java +++ b/src/main/java/forestry/api/genetics/IAlleleHandler.java @@ -8,8 +8,8 @@ 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.) + * 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 { @@ -17,24 +17,21 @@ public interface IAlleleHandler { /** * Called when an allele is registered with {@link IAlleleRegistry}. * - * @param allele - * Allele which was registered. + * @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. + * @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. + * @param family Fruit family which was registered. */ public void onRegisterFruitFamily(IFruitFamily family); } diff --git a/src/main/java/forestry/api/genetics/IAllelePlantType.java b/src/main/java/forestry/api/genetics/IAllelePlantType.java index 9684bf25b..ce9b00b68 100644 --- a/src/main/java/forestry/api/genetics/IAllelePlantType.java +++ b/src/main/java/forestry/api/genetics/IAllelePlantType.java @@ -6,6 +6,7 @@ package forestry.api.genetics; import java.util.EnumSet; + import net.minecraftforge.common.EnumPlantType; public interface IAllelePlantType extends IAllele { diff --git a/src/main/java/forestry/api/genetics/IAlleleRegistry.java b/src/main/java/forestry/api/genetics/IAlleleRegistry.java index af920e8ab..50ea033d1 100644 --- a/src/main/java/forestry/api/genetics/IAlleleRegistry.java +++ b/src/main/java/forestry/api/genetics/IAlleleRegistry.java @@ -5,14 +5,17 @@ ******************************************************************************/ package forestry.api.genetics; -import com.mojang.authlib.GameProfile; -import forestry.api.genetics.IClassification.EnumClassLevel; 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. + * Manages {@link ISpeciesRoot}, {@link IAllele}s, {@link IFruitFamily}s, {@link IClassification}, the blacklist and + * allows creation of research notes. * * @author SirSengir */ @@ -21,6 +24,7 @@ public interface IAlleleRegistry { /* SPECIES ROOT CLASSES */ /** * Register a {@link ISpeciesRoot}. + * * @param root {@link ISpeciesRoot} to register. */ void registerSpeciesRoot(ISpeciesRoot root); @@ -32,6 +36,7 @@ public interface IAlleleRegistry { /** * 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. */ @@ -39,6 +44,7 @@ public interface IAlleleRegistry { /** * 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. */ @@ -46,6 +52,7 @@ public interface IAlleleRegistry { /** * Retrieve a matching {@link ISpeciesRoot} for the given {@link IIndividual}-class. + * * @param clz Class extending {@link IIndividual}. * @return {@link ISpeciesRoot} if found, null otherwise. */ @@ -63,8 +70,7 @@ public interface IAlleleRegistry { /** * Retrieve genetic information from an itemstack. * - * @param stack - * Stack to retrieve genetic information for. + * @param stack Stack to retrieve genetic information for. * @return IIndividual containing genetic information, null if none could be extracted. */ IIndividual getIndividual(ItemStack stack); @@ -88,10 +94,10 @@ public interface IAlleleRegistry { /** * Registers an allele. * - * NOTE: Where possible, it is recommended to use IAlleleFactory instead - * because it has built-in advanced localization support. + * NOTE: Where possible, it is recommended to use IAlleleFactory instead because it has built-in advanced + * localization support. * - * @param allele IAllele to register. + * @param allele IAllele to register. * @param chromosomeTypes valid chromosomeTypes for this allele. * @since Forestry 4.2 */ @@ -105,18 +111,15 @@ public interface IAlleleRegistry { /** * 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. + * @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. + * @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); @@ -136,32 +139,28 @@ public interface IAlleleRegistry { /** * Registers a classification. * - * @param classification - * IClassification to register. + * @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. + * @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); - IClassification createAndRegisterClassification( - EnumClassLevel level, String uid, String scientific, IClassification... members); + IClassification createAndRegisterClassification(EnumClassLevel level, String uid, String scientific, + IClassification... members); /** * Gets a classification. * - * @param uid - * String based unique identifier of the classification to retrieve. + * @param uid String based unique identifier of the classification to retrieve. * @return {@link IClassification} if found, null otherwise. */ IClassification getClassification(String uid); @@ -193,8 +192,7 @@ public interface IAlleleRegistry { /** * Registers a new IAlleleHandler * - * @param handler - * IAlleleHandler to register. + * @param handler IAlleleHandler to register. */ void registerAlleleHandler(IAlleleHandler handler); @@ -202,8 +200,7 @@ public interface IAlleleRegistry { /** * Blacklist an allele identified by its UID from mutation. * - * @param uid - * UID of the allele to blacklist. + * @param uid UID of the allele to blacklist. */ void blacklistAllele(String uid); @@ -213,8 +210,7 @@ public interface IAlleleRegistry { Collection getAlleleBlacklist(); /** - * @param uid - * UID of the species to vet. + * @param uid UID of the species to vet. * @return true if the allele is blacklisted. */ boolean isBlacklisted(String uid); @@ -222,14 +218,14 @@ public interface IAlleleRegistry { /* RESEARCH */ /** * @param researcher Username of the player who researched this note. - * @param species {@link IAlleleSpecies} to encode on the research 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. + * @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/main/java/forestry/api/genetics/IAlleleSpecies.java b/src/main/java/forestry/api/genetics/IAlleleSpecies.java index fbd62eb63..0276fdfa0 100644 --- a/src/main/java/forestry/api/genetics/IAlleleSpecies.java +++ b/src/main/java/forestry/api/genetics/IAlleleSpecies.java @@ -5,14 +5,16 @@ ******************************************************************************/ 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; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; /** * Basic species allele. @@ -30,8 +32,8 @@ public interface IAlleleSpecies extends IAllele { 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. + * 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) */ @@ -51,8 +53,9 @@ public interface IAlleleSpecies extends IAllele { /* 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. + * 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(); diff --git a/src/main/java/forestry/api/genetics/IBreedingTracker.java b/src/main/java/forestry/api/genetics/IBreedingTracker.java index fd1c62fbd..d69f45c34 100644 --- a/src/main/java/forestry/api/genetics/IBreedingTracker.java +++ b/src/main/java/forestry/api/genetics/IBreedingTracker.java @@ -5,10 +5,11 @@ ******************************************************************************/ package forestry.api.genetics; -import forestry.api.apiculture.IBeekeepingMode; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; +import forestry.api.apiculture.IBeekeepingMode; + /** * Keeps track of who bred, discovered, and researched which species in a world. * @@ -62,8 +63,7 @@ public interface IBreedingTracker { /** * Queries the tracker for discovered species. * - * @param mutation - * Mutation to query for. + * @param mutation Mutation to query for. * @return true if the mutation has been discovered. */ boolean isDiscovered(IMutation mutation); @@ -71,17 +71,14 @@ public interface IBreedingTracker { /** * Queries the tracker for discovered species. * - * @param species - * Species to check. + * @param species Species to check. * @return true if the species has been bred. */ boolean isDiscovered(IAlleleSpecies species); /** - * Register a successfully researched mutation. - * Mutations are normally researched in the Escritoire. - * Researched mutations may have bonuses such as occurring at a higher rate. - * Researched mutations count as discovered. + * Register a successfully researched mutation. Mutations are normally researched in the Escritoire. Researched + * mutations may have bonuses such as occurring at a higher rate. Researched mutations count as discovered. */ void researchMutation(IMutation mutation); @@ -91,9 +88,9 @@ public interface IBreedingTracker { boolean isResearched(IMutation mutation); /** - * Synchronizes the tracker to the client side. - * Before Forestry 4.2.1: Should be called before opening any gui needing that information. - * Since Forestry 4.2.1: Breeding tracker should be automatically synced, only Forestry should need to call this. + * Synchronizes the tracker to the client side. Before Forestry 4.2.1: Should be called before opening any gui + * needing that information. Since Forestry 4.2.1: Breeding tracker should be automatically synced, only Forestry + * should need to call this. */ void synchToPlayer(EntityPlayer player); diff --git a/src/main/java/forestry/api/genetics/IClassification.java b/src/main/java/forestry/api/genetics/IClassification.java index fac4850ad..c948e153c 100644 --- a/src/main/java/forestry/api/genetics/IClassification.java +++ b/src/main/java/forestry/api/genetics/IClassification.java @@ -13,6 +13,7 @@ package forestry.api.genetics; public interface IClassification { public enum EnumClassLevel { + DOMAIN(0x777fff, true), KINGDOM(0x77c3ff), PHYLUM(0x77ffb6, true), diff --git a/src/main/java/forestry/api/genetics/IClimateHelper.java b/src/main/java/forestry/api/genetics/IClimateHelper.java index 6e7138fda..e8181ee00 100644 --- a/src/main/java/forestry/api/genetics/IClimateHelper.java +++ b/src/main/java/forestry/api/genetics/IClimateHelper.java @@ -1,27 +1,25 @@ package forestry.api.genetics; +import java.util.Collection; + import forestry.api.core.EnumHumidity; import forestry.api.core.EnumTemperature; -import java.util.Collection; 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. + * @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, EnumHumidity humidity, EnumTemperature baseTemp, + EnumTolerance tolTemp, EnumHumidity baseHumid, EnumTolerance tolHumid); boolean isWithinLimits(EnumTemperature temperature, EnumTemperature baseTemp, EnumTolerance tolTemp); @@ -29,14 +27,17 @@ public interface IClimateHelper { /** * Gets a collection of humidities which fit the given parameters. - * @param prefered Base humidity from which to measure. + * + * @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 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. */ @@ -44,12 +45,15 @@ public interface IClimateHelper { /** * 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. */ diff --git a/src/main/java/forestry/api/genetics/IEffectData.java b/src/main/java/forestry/api/genetics/IEffectData.java index 8493da433..1d12b12dc 100644 --- a/src/main/java/forestry/api/genetics/IEffectData.java +++ b/src/main/java/forestry/api/genetics/IEffectData.java @@ -13,6 +13,7 @@ import forestry.api.core.INBTTagable; * @author SirSengir */ public interface IEffectData extends INBTTagable { + void setInteger(int index, int val); void setFloat(int index, float val); diff --git a/src/main/java/forestry/api/genetics/IFlowerAcceptableRule.java b/src/main/java/forestry/api/genetics/IFlowerAcceptableRule.java index 0b6f2c622..7879770d7 100644 --- a/src/main/java/forestry/api/genetics/IFlowerAcceptableRule.java +++ b/src/main/java/forestry/api/genetics/IFlowerAcceptableRule.java @@ -8,9 +8,10 @@ package forestry.api.genetics; import net.minecraft.world.World; public interface IFlowerAcceptableRule { + /** - * Checks if the flower at this position is accepted by this rule. - * flowerType is passed in case this rule is registered for multiple flower types. + * Checks if the flower at this position is accepted by this rule. flowerType is passed in case this rule is + * registered for multiple flower types. */ boolean isAcceptableFlower(String flowerType, World world, int x, int y, int z); } diff --git a/src/main/java/forestry/api/genetics/IFlowerGrowthHelper.java b/src/main/java/forestry/api/genetics/IFlowerGrowthHelper.java index f17357fe4..287ff6e1e 100644 --- a/src/main/java/forestry/api/genetics/IFlowerGrowthHelper.java +++ b/src/main/java/forestry/api/genetics/IFlowerGrowthHelper.java @@ -8,8 +8,10 @@ package forestry.api.genetics; import net.minecraft.world.World; public interface IFlowerGrowthHelper { + /** * Plants a random flower from flowerType at the specified position. + * * @return true if successful, false if it could not be planted. */ boolean plantRandomFlower(String flowerType, World world, int x, int y, int z); diff --git a/src/main/java/forestry/api/genetics/IFlowerGrowthRule.java b/src/main/java/forestry/api/genetics/IFlowerGrowthRule.java index 1aefce01f..3ea46adc3 100644 --- a/src/main/java/forestry/api/genetics/IFlowerGrowthRule.java +++ b/src/main/java/forestry/api/genetics/IFlowerGrowthRule.java @@ -11,18 +11,19 @@ import net.minecraft.world.World; * Basic condition for flower growing, such as checking that the soil is the correct type. */ public interface IFlowerGrowthRule { + /** - * Checks a position for suitability, and then plants a flower there. - * Returns true on success. - * For implementers, you can plant a random flower using IFlowerGrowthHelper.plantRandomFlower + * Checks a position for suitability, and then plants a flower there. Returns true on success. For implementers, you + * can plant a random flower using IFlowerGrowthHelper.plantRandomFlower + * * @since Forestry 4.0.8 */ boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, int x, int y, int z); /** - * Checks a position for suitability, and then plants a flower there. - * Returns true on success. - * For implementers, get a flower to grow using IFlowerRegistry.getRandomPlantableFlower + * Checks a position for suitability, and then plants a flower there. Returns true on success. For implementers, get + * a flower to grow using IFlowerRegistry.getRandomPlantableFlower + * * @deprecated since Forestry 4.0 Use the IFlowerGrowthHelper version. */ @Deprecated diff --git a/src/main/java/forestry/api/genetics/IFlowerProvider.java b/src/main/java/forestry/api/genetics/IFlowerProvider.java index 44e8e77e5..03a60d6b8 100644 --- a/src/main/java/forestry/api/genetics/IFlowerProvider.java +++ b/src/main/java/forestry/api/genetics/IFlowerProvider.java @@ -6,6 +6,7 @@ package forestry.api.genetics; import java.util.Set; + import net.minecraft.item.ItemStack; import net.minecraft.world.World; @@ -25,15 +26,16 @@ public interface IFlowerProvider { String getDescription(); /** - * Allows the flower provider to affect the produce at the given location. - * If this flowerProvider does not affect the products, it should return the products unchanged. + * Allows the flower provider to affect the produce at the given location. If this flowerProvider does not affect + * the products, it should return the products unchanged. + * * @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 Set of valid flowers for the flower provider. - * Returns an empty set if the flower provider does not have any valid flowers. + * @return Set of valid flowers for the flower provider. Returns an empty set if the flower provider does not have + * any valid flowers. * @deprecated since Forestry 4.0.8 Use more specific methods in IFlowerRegistry. */ @Deprecated @@ -41,8 +43,8 @@ public interface IFlowerProvider { /** * @return True if a flower was planted. - * @deprecated since Forestry 4.0.8 Use IFlowerRegistry.growFlower. - * Implementers can move logic into a IFlowerGrowthRule and register with IFlowerRegistry.registerGrowthRule + * @deprecated since Forestry 4.0.8 Use IFlowerRegistry.growFlower. Implementers can move logic into a + * IFlowerGrowthRule and register with IFlowerRegistry.registerGrowthRule */ @Deprecated boolean growFlower(World world, IIndividual individual, int x, int y, int z); diff --git a/src/main/java/forestry/api/genetics/IFlowerRegistry.java b/src/main/java/forestry/api/genetics/IFlowerRegistry.java index 06ad8029b..64c12d63d 100644 --- a/src/main/java/forestry/api/genetics/IFlowerRegistry.java +++ b/src/main/java/forestry/api/genetics/IFlowerRegistry.java @@ -5,15 +5,17 @@ ******************************************************************************/ package forestry.api.genetics; -import forestry.api.apiculture.IBee; -import forestry.api.apiculture.IBeeHousing; import java.util.Collection; import java.util.Random; import java.util.Set; + import net.minecraft.block.Block; import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; +import forestry.api.apiculture.IBee; +import forestry.api.apiculture.IBeeHousing; + // See {@link forestry.api.apiculture.FlowerManager}.FlowerType___ for basic Forestry flower types. // Each IFlowerProvider has one flower type, and multiple IFlowerProviders may share one type. // "Acceptable flowers" allow nearby bees to do work. @@ -21,9 +23,8 @@ import net.minecraft.world.World; public interface IFlowerRegistry { /** - * Register a new flower growth rule. - * This defines the flower planting logic for the specified flower types. - * Without a flower growth rule, no flowers of that type can be planted. + * Register a new flower growth rule. This defines the flower planting logic for the specified flower types. Without + * a flower growth rule, no flowers of that type can be planted. */ void registerGrowthRule(IFlowerGrowthRule rule, String... flowerTypes); @@ -31,24 +32,26 @@ public interface IFlowerRegistry { * Registers an accepted flower with any meta value. */ void registerAcceptableFlower(Block flowerBlock, String... flowerTypes); + /** * Registers an accepted flower with a specific meta value. */ void registerAcceptableFlower(Block flowerBlock, int flowerMeta, String... flowerTypes); /** - * Registers custom logic for accepted flowers. - * These rules are inefficient compared to ones made with registerAcceptableFlower, but may be necessary for tile entity flowers. - * The flower types built into Forestry can not be used here. + * Registers custom logic for accepted flowers. These rules are inefficient compared to ones made with + * registerAcceptableFlower, but may be necessary for tile entity flowers. The flower types built into Forestry can + * not be used here. + * * @since Forestry 4.0.8 */ void registerAcceptableFlowerRule(IFlowerAcceptableRule flowerAcceptableRule, String... flowerTypes); /** - * Registers a plantable flower. - * The distribution is based on its own weight and the total number of plants for this flowerType. + * 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 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); @@ -70,6 +73,7 @@ public interface IFlowerRegistry { /** * For use by IFlowerGrowthRule implementations + * * @deprecated since Forestry 4.0.8 This will be accessible to IFlowerGrowthRule via IFlowerGrowthHelper */ @Deprecated @@ -77,6 +81,7 @@ public interface IFlowerRegistry { /** * Returns all known flower types. + * * @deprecated since Forestry 4.0.8 This should only be used internally. */ @Deprecated diff --git a/src/main/java/forestry/api/genetics/IFruitBearer.java b/src/main/java/forestry/api/genetics/IFruitBearer.java index d5af699e2..d74297c3c 100644 --- a/src/main/java/forestry/api/genetics/IFruitBearer.java +++ b/src/main/java/forestry/api/genetics/IFruitBearer.java @@ -6,6 +6,7 @@ package forestry.api.genetics; import java.util.Collection; + import net.minecraft.item.ItemStack; /** @@ -28,8 +29,7 @@ public interface IFruitBearer { /** * Picks the fruits of this tile, resetting it to unripe fruits. * - * @param tool - * Tool used in picking the fruits. May be null. + * @param tool Tool used in picking the fruits. May be null. * @return Picked fruits. */ Collection pickFruit(ItemStack tool); @@ -42,8 +42,7 @@ public interface IFruitBearer { /** * Increases the ripeness of the fruit. * - * @param add - * Float to add to the ripeness. Will truncate to valid values. + * @param add Float to add to the ripeness. Will truncate to valid values. */ void addRipeness(float add); } diff --git a/src/main/java/forestry/api/genetics/IIndividual.java b/src/main/java/forestry/api/genetics/IIndividual.java index 9bc13c53a..1d79620d2 100644 --- a/src/main/java/forestry/api/genetics/IIndividual.java +++ b/src/main/java/forestry/api/genetics/IIndividual.java @@ -5,9 +5,10 @@ ******************************************************************************/ package forestry.api.genetics; -import forestry.api.core.INBTTagable; import java.util.List; +import forestry.api.core.INBTTagable; + /** * An actual individual with genetic information. * @@ -23,6 +24,7 @@ public interface IIndividual extends INBTTagable { /** * Call to mark the IIndividual as analyzed. + * * @return true if the IIndividual has not been analyzed previously. */ boolean analyze(); @@ -36,7 +38,9 @@ public interface IIndividual extends INBTTagable { IGenome getGenome(); /** - * Check whether the genetic makeup of two IIndividuals is identical. Ignores additional data like generations, irregular mating, etc.. + * 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. */ diff --git a/src/main/java/forestry/api/genetics/IIndividualLiving.java b/src/main/java/forestry/api/genetics/IIndividualLiving.java index 8a08e46eb..51fc69723 100644 --- a/src/main/java/forestry/api/genetics/IIndividualLiving.java +++ b/src/main/java/forestry/api/genetics/IIndividualLiving.java @@ -26,6 +26,7 @@ public interface IIndividualLiving extends IIndividual { /** * Age the individual. + * * @param world * @param ageModifier */ @@ -33,6 +34,7 @@ public interface IIndividualLiving extends IIndividual { /** * Mate with the given individual. + * * @param individual the {@link IIndividual} to mate this one with. */ void mate(IIndividual individual); diff --git a/src/main/java/forestry/api/genetics/IMutation.java b/src/main/java/forestry/api/genetics/IMutation.java index faf91f0cf..e8ae3b6af 100644 --- a/src/main/java/forestry/api/genetics/IMutation.java +++ b/src/main/java/forestry/api/genetics/IMutation.java @@ -34,7 +34,8 @@ public interface IMutation { /** * @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. + * 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(); diff --git a/src/main/java/forestry/api/genetics/IMutationCondition.java b/src/main/java/forestry/api/genetics/IMutationCondition.java index bc626d19c..fe1be75f4 100644 --- a/src/main/java/forestry/api/genetics/IMutationCondition.java +++ b/src/main/java/forestry/api/genetics/IMutationCondition.java @@ -5,26 +5,18 @@ ******************************************************************************/ package forestry.api.genetics; -import forestry.api.core.IClimateProvider; import net.minecraft.world.World; +import forestry.api.core.IClimateProvider; + 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. + * 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, - IClimateProvider climate); + float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, + IGenome genome1, IClimateProvider climate); /** * A localized description of the mutation condition. (i.e. "A temperature of HOT is required.") diff --git a/src/main/java/forestry/api/genetics/IMutationCustom.java b/src/main/java/forestry/api/genetics/IMutationCustom.java index 122fe9c09..73bfd67ba 100644 --- a/src/main/java/forestry/api/genetics/IMutationCustom.java +++ b/src/main/java/forestry/api/genetics/IMutationCustom.java @@ -5,11 +5,12 @@ ******************************************************************************/ package forestry.api.genetics; -import forestry.api.core.EnumHumidity; -import forestry.api.core.EnumTemperature; 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 { @@ -28,6 +29,7 @@ public interface IMutationCustom extends IMutation { /** * Restrict this mutation to certain types of biomes. + * * @param types The types of biomes this mutation can occur. */ IMutationCustom restrictBiomeType(BiomeDictionary.Type... types); diff --git a/src/main/java/forestry/api/genetics/IPollinatable.java b/src/main/java/forestry/api/genetics/IPollinatable.java index 8d44d2559..cf1df8ecd 100644 --- a/src/main/java/forestry/api/genetics/IPollinatable.java +++ b/src/main/java/forestry/api/genetics/IPollinatable.java @@ -6,6 +6,7 @@ package forestry.api.genetics; import java.util.EnumSet; + import net.minecraftforge.common.EnumPlantType; /** @@ -16,7 +17,8 @@ import net.minecraftforge.common.EnumPlantType; public interface IPollinatable { /** - * @return plant types this pollinatable is classified as. (Can be used by bees to determine whether to interact or not. + * @return plant types this pollinatable is classified as. (Can be used by bees to determine whether to interact or + * not. */ EnumSet getPlantType(); @@ -30,8 +32,7 @@ public interface IPollinatable { * * Must be the one to check genetic equivalency. * - * @param pollen - * IIndividual representing the pollen. + * @param pollen IIndividual representing the pollen. * @return true if mating is possible, false otherwise. */ boolean canMateWith(IIndividual pollen); @@ -39,8 +40,7 @@ public interface IPollinatable { /** * Pollinates this entity. * - * @param pollen - * IIndividual representing the pollen. + * @param pollen IIndividual representing the pollen. */ void mateWith(IIndividual pollen); diff --git a/src/main/java/forestry/api/genetics/ISpeciesRoot.java b/src/main/java/forestry/api/genetics/ISpeciesRoot.java index ea9ef59bd..467b91246 100644 --- a/src/main/java/forestry/api/genetics/ISpeciesRoot.java +++ b/src/main/java/forestry/api/genetics/ISpeciesRoot.java @@ -5,24 +5,28 @@ ******************************************************************************/ package forestry.api.genetics; -import com.mojang.authlib.GameProfile; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Random; + import net.minecraft.entity.player.EntityPlayer; 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. + * 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". + * @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(); @@ -37,22 +41,28 @@ public interface ISpeciesRoot { int getSpeciesCount(); /** - * Used to check whether a given itemstack contains genetic data corresponding to an {@link IIndividual} of this class. + * 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. + * 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.) + * @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. */ @@ -161,7 +171,8 @@ public interface ISpeciesRoot { /** * Sets an item stack as a valid (generic) research catalyst for this class. - * @param itemstack ItemStack to set as suitable. + * + * @param itemstack ItemStack to set as suitable. * @param suitability Float between 0 and 1 to indicate suitability. */ void setResearchSuitability(ItemStack itemstack, float suitability); diff --git a/src/main/java/forestry/api/genetics/ISpeciesType.java b/src/main/java/forestry/api/genetics/ISpeciesType.java index a677a0d44..036b9b8cd 100644 --- a/src/main/java/forestry/api/genetics/ISpeciesType.java +++ b/src/main/java/forestry/api/genetics/ISpeciesType.java @@ -6,4 +6,5 @@ package forestry.api.genetics; /** Species types, implemented by enums and compared with == */ -public interface ISpeciesType {} +public interface ISpeciesType { +} diff --git a/src/main/java/forestry/api/lepidopterology/ButterflyManager.java b/src/main/java/forestry/api/lepidopterology/ButterflyManager.java index 81f224edb..26d599a04 100644 --- a/src/main/java/forestry/api/lepidopterology/ButterflyManager.java +++ b/src/main/java/forestry/api/lepidopterology/ButterflyManager.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.api.lepidopterology; diff --git a/src/main/java/forestry/api/lepidopterology/EnumButterflyChromosome.java b/src/main/java/forestry/api/lepidopterology/EnumButterflyChromosome.java index e4be1fd53..353f8d2cf 100644 --- a/src/main/java/forestry/api/lepidopterology/EnumButterflyChromosome.java +++ b/src/main/java/forestry/api/lepidopterology/EnumButterflyChromosome.java @@ -5,6 +5,8 @@ ******************************************************************************/ package forestry.api.lepidopterology; +import java.util.Locale; + import forestry.api.genetics.IAllele; import forestry.api.genetics.IAlleleArea; import forestry.api.genetics.IAlleleBoolean; @@ -14,9 +16,9 @@ import forestry.api.genetics.IAlleleInteger; import forestry.api.genetics.IAlleleTolerance; import forestry.api.genetics.IChromosomeType; import forestry.api.genetics.ISpeciesRoot; -import java.util.Locale; public enum EnumButterflyChromosome implements IChromosomeType { + /** * Species of the bee. Alleles here must implement {@link IAlleleButterflySpecies}. */ @@ -38,7 +40,8 @@ public enum EnumButterflyChromosome implements IChromosomeType { */ METABOLISM(IAlleleInteger.class), /** - * Determines likelyhood of caterpillars and length of caterpillar/pupation phase. Also: Number of max caterpillars after mating? + * Determines likelyhood of caterpillars and length of caterpillar/pupation phase. Also: Number of max caterpillars + * after mating? */ FERTILITY(IAlleleInteger.class), /** @@ -72,8 +75,7 @@ public enum EnumButterflyChromosome implements IChromosomeType { /** * Not used yet */ - TERRITORY(IAlleleArea.class), - ; + TERRITORY(IAlleleArea.class),; Class clss; diff --git a/src/main/java/forestry/api/lepidopterology/EnumFlutterType.java b/src/main/java/forestry/api/lepidopterology/EnumFlutterType.java index e8e40b631..f90d38545 100644 --- a/src/main/java/forestry/api/lepidopterology/EnumFlutterType.java +++ b/src/main/java/forestry/api/lepidopterology/EnumFlutterType.java @@ -8,6 +8,7 @@ package forestry.api.lepidopterology; import forestry.api.genetics.ISpeciesType; public enum EnumFlutterType implements ISpeciesType { + BUTTERFLY, SERUM, CATERPILLAR, diff --git a/src/main/java/forestry/api/lepidopterology/IAlleleButterflyEffect.java b/src/main/java/forestry/api/lepidopterology/IAlleleButterflyEffect.java index 8617cf7b7..711f366c7 100644 --- a/src/main/java/forestry/api/lepidopterology/IAlleleButterflyEffect.java +++ b/src/main/java/forestry/api/lepidopterology/IAlleleButterflyEffect.java @@ -12,7 +12,8 @@ public interface IAlleleButterflyEffect extends IAlleleEffect { /** * Used by butterflies to trigger effects in the world. - * @param butterfly {@link IEntityButterfly} + * + * @param butterfly {@link IEntityButterfly} * @param storedData * @return {@link forestry.api.genetics.IEffectData} for the next cycle. */ diff --git a/src/main/java/forestry/api/lepidopterology/IAlleleButterflySpecies.java b/src/main/java/forestry/api/lepidopterology/IAlleleButterflySpecies.java index dfa2abd52..74abdacac 100644 --- a/src/main/java/forestry/api/lepidopterology/IAlleleButterflySpecies.java +++ b/src/main/java/forestry/api/lepidopterology/IAlleleButterflySpecies.java @@ -5,12 +5,14 @@ ******************************************************************************/ package forestry.api.lepidopterology; -import forestry.api.genetics.IAlleleSpecies; 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 { /** @@ -41,7 +43,8 @@ public interface IAlleleButterflySpecies extends IAlleleSpecies { float getRarity(); /** - * @return Float representing the distance below which this butterfly will take flight if it detects a player which is not sneaking. + * @return Float representing the distance below which this butterfly will take flight if it detects a player which + * is not sneaking. */ float getFlightDistance(); diff --git a/src/main/java/forestry/api/lepidopterology/IAlleleButterflySpeciesCustom.java b/src/main/java/forestry/api/lepidopterology/IAlleleButterflySpeciesCustom.java index 9c1527197..4709bd645 100644 --- a/src/main/java/forestry/api/lepidopterology/IAlleleButterflySpeciesCustom.java +++ b/src/main/java/forestry/api/lepidopterology/IAlleleButterflySpeciesCustom.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.api.lepidopterology; import forestry.api.genetics.IAlleleSpeciesCustom; public interface IAlleleButterflySpeciesCustom extends IAlleleButterflySpecies, IAlleleSpeciesCustom { + IAlleleButterflySpeciesCustom setRarity(float rarity); IAlleleButterflySpeciesCustom setFlightDistance(float flightDistance); diff --git a/src/main/java/forestry/api/lepidopterology/IButterfly.java b/src/main/java/forestry/api/lepidopterology/IButterfly.java index cbb909c1a..1b3f0aeda 100644 --- a/src/main/java/forestry/api/lepidopterology/IButterfly.java +++ b/src/main/java/forestry/api/lepidopterology/IButterfly.java @@ -5,10 +5,11 @@ ******************************************************************************/ package forestry.api.lepidopterology; -import forestry.api.genetics.IIndividualLiving; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import forestry.api.genetics.IIndividualLiving; + public interface IButterfly extends IIndividualLiving { IButterflyGenome getGenome(); @@ -28,7 +29,8 @@ public interface IButterfly extends IIndividualLiving { * @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.) + * @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); @@ -37,7 +39,8 @@ public interface IButterfly extends IIndividualLiving { * @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.) + * @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); @@ -55,7 +58,7 @@ public interface IButterfly extends IIndividualLiving { /** * @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. + * @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); @@ -63,7 +66,7 @@ public interface IButterfly extends IIndividualLiving { /** * @param nursery * @param playerKill Whether or not the nursery was broken by a player. - * @param lootLevel Fortune level. + * @param lootLevel Fortune level. * @return Array of itemstacks to drop on breaking of the nursery. */ ItemStack[] getCaterpillarDrop(IButterflyNursery nursery, boolean playerKill, int lootLevel); diff --git a/src/main/java/forestry/api/lepidopterology/IButterflyFactory.java b/src/main/java/forestry/api/lepidopterology/IButterflyFactory.java index 2ed88623d..a082662c9 100644 --- a/src/main/java/forestry/api/lepidopterology/IButterflyFactory.java +++ b/src/main/java/forestry/api/lepidopterology/IButterflyFactory.java @@ -1,43 +1,37 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.api.lepidopterology; -import forestry.api.genetics.IClassification; import java.awt.Color; +import forestry.api.genetics.IClassification; + public interface IButterflyFactory { + /** - * Creates a new butterfly species. - * Automatically registered with AlleleManager.alleleRegistry.registerAllele() - * See IAlleleButterflySpeciesCustom and IAlleleSpeciesCustom for adding additional properties to the returned species. + * Creates a new butterfly species. Automatically registered with AlleleManager.alleleRegistry.registerAllele() See + * IAlleleButterflySpeciesCustom and IAlleleSpeciesCustom for adding additional properties to the returned species. * - * @param uid Unique Identifier for this species - * @param unlocalizedName Unlocalized name for this species - * @param authority Authority for the binomial name, e.g. "Sengir" on species of base Forestry. + * @param uid Unique Identifier for this species + * @param unlocalizedName Unlocalized name for this species + * @param authority Authority for the binomial name, e.g. "Sengir" on species of base Forestry. * @param unlocalizedDescription Unlocalized description for this species - * @param texturePath String texture path for this butterfly e.g. "forestry:textures/entities/butterfly/..." - * @param dominant Whether this species is genetically dominant (false means it is recessive) - * @param branch Classification of this species - * @param binomial Binomial name of the species sans genus. "humboldti" will have the bee species flavour name be "Apis humboldti". Feel free to use fun names or null. - * @param serumColour The color of this butterfly's serum. + * @param texturePath String texture path for this butterfly e.g. + * "forestry:textures/entities/butterfly/..." + * @param dominant Whether this species is genetically dominant (false means it is recessive) + * @param branch Classification of this species + * @param binomial Binomial name of the species sans genus. "humboldti" will have the bee species + * flavour name be "Apis humboldti". Feel free to use fun names or null. + * @param serumColour The color of this butterfly's serum. * @return a new butterfly species allele. */ - IAlleleButterflySpeciesCustom createSpecies( - String uid, - String unlocalizedName, - String authority, - String unlocalizedDescription, - String texturePath, - boolean dominant, - IClassification branch, - String binomial, - Color serumColour); + IAlleleButterflySpeciesCustom createSpecies(String uid, String unlocalizedName, String authority, + String unlocalizedDescription, String texturePath, boolean dominant, IClassification branch, + String binomial, Color serumColour); } diff --git a/src/main/java/forestry/api/lepidopterology/IButterflyMutation.java b/src/main/java/forestry/api/lepidopterology/IButterflyMutation.java index 413d21799..8450a413c 100644 --- a/src/main/java/forestry/api/lepidopterology/IButterflyMutation.java +++ b/src/main/java/forestry/api/lepidopterology/IButterflyMutation.java @@ -10,5 +10,6 @@ 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/main/java/forestry/api/lepidopterology/IButterflyRoot.java b/src/main/java/forestry/api/lepidopterology/IButterflyRoot.java index b597b7333..e1b1b981b 100644 --- a/src/main/java/forestry/api/lepidopterology/IButterflyRoot.java +++ b/src/main/java/forestry/api/lepidopterology/IButterflyRoot.java @@ -5,17 +5,20 @@ ******************************************************************************/ package forestry.api.lepidopterology; -import com.mojang.authlib.GameProfile; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IIndividual; -import forestry.api.genetics.ISpeciesRoot; 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 @@ -48,6 +51,7 @@ public interface IButterflyRoot extends ISpeciesRoot { /** * Spawns the given butterfly in the world. + * * @param butterfly * @return butterfly entity on success, null otherwise. */ diff --git a/src/main/java/forestry/api/lepidopterology/IEntityButterfly.java b/src/main/java/forestry/api/lepidopterology/IEntityButterfly.java index 72906889a..2f5420d48 100644 --- a/src/main/java/forestry/api/lepidopterology/IEntityButterfly.java +++ b/src/main/java/forestry/api/lepidopterology/IEntityButterfly.java @@ -5,10 +5,11 @@ ******************************************************************************/ package forestry.api.lepidopterology; -import forestry.api.genetics.IIndividual; 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); diff --git a/src/main/java/forestry/api/mail/EnumAddressee.java b/src/main/java/forestry/api/mail/EnumAddressee.java index 630362da7..2ea0d3dcf 100644 --- a/src/main/java/forestry/api/mail/EnumAddressee.java +++ b/src/main/java/forestry/api/mail/EnumAddressee.java @@ -8,6 +8,7 @@ package forestry.api.mail; import java.util.Locale; public enum EnumAddressee { + PLAYER, TRADER; diff --git a/src/main/java/forestry/api/mail/EnumPostage.java b/src/main/java/forestry/api/mail/EnumPostage.java index 385053bc6..0d1434c2a 100644 --- a/src/main/java/forestry/api/mail/EnumPostage.java +++ b/src/main/java/forestry/api/mail/EnumPostage.java @@ -6,6 +6,7 @@ package forestry.api.mail; public enum EnumPostage { + P_0(0), P_1(1), P_2(2), diff --git a/src/main/java/forestry/api/mail/ILetter.java b/src/main/java/forestry/api/mail/ILetter.java index f53932dbc..449d5d76e 100644 --- a/src/main/java/forestry/api/mail/ILetter.java +++ b/src/main/java/forestry/api/mail/ILetter.java @@ -5,11 +5,13 @@ ******************************************************************************/ package forestry.api.mail; -import forestry.api.core.INBTTagable; 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(); diff --git a/src/main/java/forestry/api/mail/ILetterHandler.java b/src/main/java/forestry/api/mail/ILetterHandler.java index 1df3db80a..15b40c126 100644 --- a/src/main/java/forestry/api/mail/ILetterHandler.java +++ b/src/main/java/forestry/api/mail/ILetterHandler.java @@ -9,5 +9,6 @@ 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/main/java/forestry/api/mail/IPostOffice.java b/src/main/java/forestry/api/mail/IPostOffice.java index 10af3eb0b..d9ce2a967 100644 --- a/src/main/java/forestry/api/mail/IPostOffice.java +++ b/src/main/java/forestry/api/mail/IPostOffice.java @@ -6,6 +6,7 @@ package forestry.api.mail; import java.util.Map; + import net.minecraft.item.ItemStack; import net.minecraft.world.World; diff --git a/src/main/java/forestry/api/mail/IPostRegistry.java b/src/main/java/forestry/api/mail/IPostRegistry.java index 648c4c972..fcd3466b4 100644 --- a/src/main/java/forestry/api/mail/IPostRegistry.java +++ b/src/main/java/forestry/api/mail/IPostRegistry.java @@ -5,11 +5,13 @@ ******************************************************************************/ package forestry.api.mail; -import com.mojang.authlib.GameProfile; import java.util.Map; + import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import com.mojang.authlib.GameProfile; + public interface IPostRegistry { /* POST OFFICE */ @@ -32,6 +34,7 @@ public interface IPostRegistry { /* CARRIERS */ /** * Registers a new {@link IPostalCarrier}. See {@link IPostalCarrier} for details. + * * @param carrier {@link IPostalCarrier} to register. */ void registerCarrier(IPostalCarrier carrier); diff --git a/src/main/java/forestry/api/mail/IPostalCarrier.java b/src/main/java/forestry/api/mail/IPostalCarrier.java index 8afe2680b..5577d4a06 100644 --- a/src/main/java/forestry/api/mail/IPostalCarrier.java +++ b/src/main/java/forestry/api/mail/IPostalCarrier.java @@ -5,18 +5,18 @@ ******************************************************************************/ package forestry.api.mail; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; 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. + * 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. + * The two available carriers in vanilla Forestry are "player" - Delivers mail to individual players. "trader" - Handles + * mail addressed to trade stations. */ public interface IPostalCarrier { @@ -35,13 +35,16 @@ public interface IPostalCarrier { /** * 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. + * + * @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); + IPostalState deliverLetter(World world, IPostOffice office, IMailAddress recipient, ItemStack letterstack, + boolean doDeliver); } diff --git a/src/main/java/forestry/api/mail/IPostalState.java b/src/main/java/forestry/api/mail/IPostalState.java index 97fe77d61..883ef7f94 100644 --- a/src/main/java/forestry/api/mail/IPostalState.java +++ b/src/main/java/forestry/api/mail/IPostalState.java @@ -6,6 +6,7 @@ package forestry.api.mail; public interface IPostalState { + boolean isOk(); String getIdentifier(); diff --git a/src/main/java/forestry/api/mail/PostManager.java b/src/main/java/forestry/api/mail/PostManager.java index 98bd34375..03b8fdb04 100644 --- a/src/main/java/forestry/api/mail/PostManager.java +++ b/src/main/java/forestry/api/mail/PostManager.java @@ -6,5 +6,6 @@ package forestry.api.mail; public class PostManager { + public static IPostRegistry postRegistry; } diff --git a/src/main/java/forestry/api/mail/TradeStationInfo.java b/src/main/java/forestry/api/mail/TradeStationInfo.java index e37dc8474..61692d51a 100644 --- a/src/main/java/forestry/api/mail/TradeStationInfo.java +++ b/src/main/java/forestry/api/mail/TradeStationInfo.java @@ -5,18 +5,20 @@ ******************************************************************************/ package forestry.api.mail; -import com.mojang.authlib.GameProfile; 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) { + public TradeStationInfo(IMailAddress address, GameProfile owner, ItemStack tradegood, ItemStack[] required, + IPostalState state) { if (!address.isTrader()) { throw new IllegalArgumentException("TradeStation address must be a trader"); } diff --git a/src/main/java/forestry/api/multiblock/IAlvearyComponent.java b/src/main/java/forestry/api/multiblock/IAlvearyComponent.java index 1d52f25f9..13a904caa 100644 --- a/src/main/java/forestry/api/multiblock/IAlvearyComponent.java +++ b/src/main/java/forestry/api/multiblock/IAlvearyComponent.java @@ -10,11 +10,12 @@ import forestry.api.apiculture.IBeeModifier; import forestry.api.core.IClimateControlled; /** - * Needs to be implemented by TileEntities that want to be part of an alveary. - * The sub-interfaces can be implemented to alter the operation of the alveary. - * They are automatically detected and handled by the alveary when they join its structure. + * Needs to be implemented by TileEntities that want to be part of an alveary. The sub-interfaces can be implemented to + * alter the operation of the alveary. They are automatically detected and handled by the alveary when they join its + * structure. */ public interface IAlvearyComponent extends IMultiblockComponent { + /** * @return the multiblock logic for this component */ @@ -24,6 +25,7 @@ public interface IAlvearyComponent extends IM * Implemented by alveary parts to apply a beeListener to the completed structure. */ interface BeeListener extends IAlvearyComponent { + IBeeListener getBeeListener(); } @@ -31,6 +33,7 @@ public interface IAlvearyComponent extends IM * Implemented by alveary parts to apply a beeModifier to the completed structure. */ interface BeeModifier extends IAlvearyComponent { + IBeeModifier getBeeModifier(); } @@ -38,10 +41,12 @@ public interface IAlvearyComponent extends IM * Implemented by alveary parts to apply a climate change to the completed structure. */ interface Climatiser extends IAlvearyComponent { + /** * Called every tick by the alveary. + * * @param tickCount the number of ticks in the world - * @param alveary the climate controlled alveary + * @param alveary the climate controlled alveary */ void changeClimate(int tickCount, IClimateControlled alveary); } @@ -50,6 +55,7 @@ public interface IAlvearyComponent extends IM * Implemented by alveary parts to receive ticks from the completed structure. */ interface Active extends IAlvearyComponent { + void updateServer(int tickCount); void updateClient(int tickCount); diff --git a/src/main/java/forestry/api/multiblock/IAlvearyController.java b/src/main/java/forestry/api/multiblock/IAlvearyController.java index cb24ca218..aec43bb09 100644 --- a/src/main/java/forestry/api/multiblock/IAlvearyController.java +++ b/src/main/java/forestry/api/multiblock/IAlvearyController.java @@ -8,7 +8,8 @@ package forestry.api.multiblock; import forestry.api.apiculture.IBeeHousing; /** - * The IAlvearyController provides access to all the IMultiblockController and IBeeHousing methods - * necessary for an IAlvearyComponent to function. + * The IAlvearyController provides access to all the IMultiblockController and IBeeHousing methods necessary for an + * IAlvearyComponent to function. */ -public interface IAlvearyController extends IMultiblockController, IBeeHousing {} +public interface IAlvearyController extends IMultiblockController, IBeeHousing { +} diff --git a/src/main/java/forestry/api/multiblock/IFarmComponent.java b/src/main/java/forestry/api/multiblock/IFarmComponent.java index 890ac13d9..afc9c9ca0 100644 --- a/src/main/java/forestry/api/multiblock/IFarmComponent.java +++ b/src/main/java/forestry/api/multiblock/IFarmComponent.java @@ -8,9 +8,9 @@ package forestry.api.multiblock; import forestry.api.farming.IFarmListener; /** - * Needs to be implemented by TileEntities that want to be part of a farm. - * The sub-interfaces can be implemented to alter the operation of the farm. - * They are automatically detected and handled by the farm when they join its structure. + * Needs to be implemented by TileEntities that want to be part of a farm. The sub-interfaces can be implemented to + * alter the operation of the farm. They are automatically detected and handled by the farm when they join its + * structure. */ public interface IFarmComponent extends IMultiblockComponent { @@ -23,6 +23,7 @@ public interface IFarmComponent extends IMultibl * Implemented by farm parts to apply a farmListener to the completed structure. */ interface Listener extends IFarmComponent { + IFarmListener getFarmListener(); } @@ -30,6 +31,7 @@ public interface IFarmComponent extends IMultibl * Implemented by farm parts to receive ticks from the completed structure. */ interface Active extends IFarmComponent { + void updateServer(int tickCount); void updateClient(int tickCount); diff --git a/src/main/java/forestry/api/multiblock/IFarmController.java b/src/main/java/forestry/api/multiblock/IFarmController.java index 0e6872418..b739da38b 100644 --- a/src/main/java/forestry/api/multiblock/IFarmController.java +++ b/src/main/java/forestry/api/multiblock/IFarmController.java @@ -8,7 +8,8 @@ package forestry.api.multiblock; import forestry.api.farming.IFarmHousing; /** - * The IFarmController provides access to all the IMultiblockController and IFarmHousing methods - * necessary for an IFarmComponent to function. + * The IFarmController provides access to all the IMultiblockController and IFarmHousing methods necessary for an + * IFarmComponent to function. */ -public interface IFarmController extends IMultiblockController, IFarmHousing {} +public interface IFarmController extends IMultiblockController, IFarmHousing { +} diff --git a/src/main/java/forestry/api/multiblock/IMultiblockComponent.java b/src/main/java/forestry/api/multiblock/IMultiblockComponent.java index 6bb0d918d..ef5e5b705 100644 --- a/src/main/java/forestry/api/multiblock/IMultiblockComponent.java +++ b/src/main/java/forestry/api/multiblock/IMultiblockComponent.java @@ -5,17 +5,18 @@ ******************************************************************************/ package forestry.api.multiblock; -import com.mojang.authlib.GameProfile; import net.minecraft.util.ChunkCoordinates; +import com.mojang.authlib.GameProfile; + /** - * Basic interface for a multiblock machine component. - * Implemented by TileEntities. + * Basic interface for a multiblock machine component. Implemented by TileEntities. */ public interface IMultiblockComponent { /** * Returns the location of this tile entity in the world. + * * @return ChunkCoordinates set to the location of this tile entity in the world. */ ChunkCoordinates getCoordinates(); @@ -31,18 +32,17 @@ public interface IMultiblockComponent { IMultiblockLogic getMultiblockLogic(); /** - * Called when a machine is fully assembled from the disassembled state, meaning - * it was constructed by a player/entity action, not by chunks loading. - * Note that, for non-square machines, the min/max coordinates may not actually be part - * of the machine! They form an outer bounding box for the whole machine itself. + * Called when a machine is fully assembled from the disassembled state, meaning it was constructed by a + * player/entity action, not by chunks loading. Note that, for non-square machines, the min/max coordinates may not + * actually be part of the machine! They form an outer bounding box for the whole machine itself. + * * @param multiblockController The controller to which this part is being assembled. */ - void onMachineAssembled( - IMultiblockController multiblockController, ChunkCoordinates minCoord, ChunkCoordinates maxCoord); + void onMachineAssembled(IMultiblockController multiblockController, ChunkCoordinates minCoord, + ChunkCoordinates maxCoord); /** - * Called when the machine is broken for game reasons, e.g. a player removed a block - * or an explosion occurred. + * Called when the machine is broken for game reasons, e.g. a player removed a block or an explosion occurred. */ void onMachineBroken(); } diff --git a/src/main/java/forestry/api/multiblock/IMultiblockController.java b/src/main/java/forestry/api/multiblock/IMultiblockController.java index 07b104e32..408ba59f7 100644 --- a/src/main/java/forestry/api/multiblock/IMultiblockController.java +++ b/src/main/java/forestry/api/multiblock/IMultiblockController.java @@ -6,30 +6,31 @@ package forestry.api.multiblock; import java.util.Collection; + import javax.annotation.Nonnull; /** - * IMultiblockController is used to handle the assembly of Multiblocks. - * This class is created and updated by IMultiblockLogic and Forestry. - * This is a minimal interface to hide the ugly details from the multiblock tile entities. + * IMultiblockController is used to handle the assembly of Multiblocks. This class is created and updated by + * IMultiblockLogic and Forestry. This is a minimal interface to hide the ugly details from the multiblock tile + * entities. */ public interface IMultiblockController { + /** * @return True if this multiblock machine is considered assembled and ready to go. */ boolean isAssembled(); /** - * Call to force the controller to check the multiblock's validity. - * Use when important conditions around the multiblock change - * (i.e. Alveary slabs are removed and the alveary block detects it's neighbor changed) - * Changes to multiblock components are handled automatically and should not call this. + * Call to force the controller to check the multiblock's validity. Use when important conditions around the + * multiblock change (i.e. Alveary slabs are removed and the alveary block detects it's neighbor changed) Changes to + * multiblock components are handled automatically and should not call this. */ void reassemble(); /** - * @return A string representing the last error encountered when trying to assemble this - * multiblock, or null if there is no error. + * @return A string representing the last error encountered when trying to assemble this multiblock, or null if + * there is no error. */ String getLastValidationError(); diff --git a/src/main/java/forestry/api/multiblock/IMultiblockLogic.java b/src/main/java/forestry/api/multiblock/IMultiblockLogic.java index 5183b983f..1b5a5d957 100644 --- a/src/main/java/forestry/api/multiblock/IMultiblockLogic.java +++ b/src/main/java/forestry/api/multiblock/IMultiblockLogic.java @@ -5,16 +5,17 @@ ******************************************************************************/ package forestry.api.multiblock; -import forestry.api.core.INBTTagable; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; +import forestry.api.core.INBTTagable; + /** - * Multiblock Logic implements the basic logic for IMultiblockComponent tile entities. - * Instances must come from MultiblockManager.logicFactory, most of the implementation is hidden. + * Multiblock Logic implements the basic logic for IMultiblockComponent tile entities. Instances must come from + * MultiblockManager.logicFactory, most of the implementation is hidden. * - * IMultiblockComponent tile entities must wire up the methods in the "Updating and Synchronization" section. - * As a starting point, you can use MultiblockTileEntityBase. + * IMultiblockComponent tile entities must wire up the methods in the "Updating and Synchronization" section. As a + * starting point, you can use MultiblockTileEntityBase. */ public interface IMultiblockLogic extends INBTTagable { @@ -46,27 +47,23 @@ public interface IMultiblockLogic extends INBTTagable { void onChunkUnload(World world, IMultiblockComponent part); /** - * Writes data for client synchronization. - * Use this in Tile.getDescriptionPacket() + * Writes data for client synchronization. Use this in Tile.getDescriptionPacket() */ void encodeDescriptionPacket(NBTTagCompound packetData); /** - * Reads data for client synchronization. - * Use this in Tile.onDataPacket() + * Reads data for client synchronization. Use this in Tile.onDataPacket() */ void decodeDescriptionPacket(NBTTagCompound packetData); /** - * Read the logic's data from file. - * Use this in Tile.readFromNBT() + * Read the logic's data from file. Use this in Tile.readFromNBT() */ @Override void readFromNBT(NBTTagCompound nbttagcompound); /** - * Write the logic's data to file. - * Use this in Tile.writeToNBT() + * Write the logic's data to file. Use this in Tile.writeToNBT() */ @Override void writeToNBT(NBTTagCompound nbttagcompound); diff --git a/src/main/java/forestry/api/multiblock/IMultiblockLogicAlveary.java b/src/main/java/forestry/api/multiblock/IMultiblockLogicAlveary.java index 1af46e819..80f7af415 100644 --- a/src/main/java/forestry/api/multiblock/IMultiblockLogicAlveary.java +++ b/src/main/java/forestry/api/multiblock/IMultiblockLogicAlveary.java @@ -6,6 +6,7 @@ package forestry.api.multiblock; public interface IMultiblockLogicAlveary extends IMultiblockLogic { + /** * @return the multiblock controller for this logic */ diff --git a/src/main/java/forestry/api/multiblock/IMultiblockLogicFactory.java b/src/main/java/forestry/api/multiblock/IMultiblockLogicFactory.java index 4ceabb54b..d19a58bfc 100644 --- a/src/main/java/forestry/api/multiblock/IMultiblockLogicFactory.java +++ b/src/main/java/forestry/api/multiblock/IMultiblockLogicFactory.java @@ -6,10 +6,10 @@ package forestry.api.multiblock; /** - * Creates new instances of IMultiblockLogic. - * Each IMultiblockComponent needs its own instance of IMultiblockLogic. + * Creates new instances of IMultiblockLogic. Each IMultiblockComponent needs its own instance of IMultiblockLogic. */ public interface IMultiblockLogicFactory { + IMultiblockLogicAlveary createAlvearyLogic(); IMultiblockLogicFarm createFarmLogic(); diff --git a/src/main/java/forestry/api/multiblock/IMultiblockLogicFarm.java b/src/main/java/forestry/api/multiblock/IMultiblockLogicFarm.java index e32661e2a..b2e05c1b4 100644 --- a/src/main/java/forestry/api/multiblock/IMultiblockLogicFarm.java +++ b/src/main/java/forestry/api/multiblock/IMultiblockLogicFarm.java @@ -6,6 +6,7 @@ package forestry.api.multiblock; public interface IMultiblockLogicFarm extends IMultiblockLogic { + /** * @return the multiblock controller for this logic */ diff --git a/src/main/java/forestry/api/multiblock/MultiblockManager.java b/src/main/java/forestry/api/multiblock/MultiblockManager.java index 9b0017ee9..10e1208e8 100644 --- a/src/main/java/forestry/api/multiblock/MultiblockManager.java +++ b/src/main/java/forestry/api/multiblock/MultiblockManager.java @@ -6,5 +6,6 @@ package forestry.api.multiblock; public class MultiblockManager { + public static IMultiblockLogicFactory logicFactory; } diff --git a/src/main/java/forestry/api/multiblock/MultiblockTileEntityBase.java b/src/main/java/forestry/api/multiblock/MultiblockTileEntityBase.java index 99373542b..9e5b385e6 100644 --- a/src/main/java/forestry/api/multiblock/MultiblockTileEntityBase.java +++ b/src/main/java/forestry/api/multiblock/MultiblockTileEntityBase.java @@ -13,12 +13,12 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChunkCoordinates; /** - * Base logic class for Multiblock-connected tile entities. - * Most multiblock components should derive from this. - * Supply it an IMultiblockLogic from MultiblockManager.logicFactory + * Base logic class for Multiblock-connected tile entities. Most multiblock components should derive from this. Supply + * it an IMultiblockLogic from MultiblockManager.logicFactory */ public abstract class MultiblockTileEntityBase extends TileEntity implements IMultiblockComponent { + private final T multiblockLogic; public MultiblockTileEntityBase(T multiblockLogic) { @@ -36,8 +36,8 @@ public abstract class MultiblockTileEntityBase exten } @Override - public abstract void onMachineAssembled( - IMultiblockController multiblockController, ChunkCoordinates minCoord, ChunkCoordinates maxCoord); + public abstract void onMachineAssembled(IMultiblockController multiblockController, ChunkCoordinates minCoord, + ChunkCoordinates maxCoord); @Override public abstract void onMachineBroken(); @@ -55,9 +55,10 @@ public abstract class MultiblockTileEntityBase exten } /** - * Generally, TileEntities that are part of a multiblock should not subscribe to updates - * from the main game loop. Instead, you should have lists of TileEntities which need to - * be notified during an update() in your Controller and perform callbacks from there. + * Generally, TileEntities that are part of a multiblock should not subscribe to updates from the main game loop. + * Instead, you should have lists of TileEntities which need to be notified during an update() in your Controller + * and perform callbacks from there. + * * @see net.minecraft.tileentity.TileEntity#canUpdate() */ @Override diff --git a/src/main/java/forestry/api/recipes/ICarpenterManager.java b/src/main/java/forestry/api/recipes/ICarpenterManager.java index 13d10fb2e..a37593eed 100644 --- a/src/main/java/forestry/api/recipes/ICarpenterManager.java +++ b/src/main/java/forestry/api/recipes/ICarpenterManager.java @@ -12,8 +12,8 @@ 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. + * 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} * @@ -22,45 +22,40 @@ import net.minecraftforge.fluids.FluidStack; * @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. + * @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. + * @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. + * @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/main/java/forestry/api/recipes/ICarpenterRecipe.java b/src/main/java/forestry/api/recipes/ICarpenterRecipe.java index 287e6a94f..0cb276ecf 100644 --- a/src/main/java/forestry/api/recipes/ICarpenterRecipe.java +++ b/src/main/java/forestry/api/recipes/ICarpenterRecipe.java @@ -6,6 +6,7 @@ package forestry.api.recipes; import javax.annotation.Nullable; + import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; @@ -17,13 +18,14 @@ public interface ICarpenterRecipe extends IForestryRecipe { int getPackagingTime(); /** - * @return the crafting grid recipe. The crafting recipe's getRecipeOutput() is used as the ICarpenterRecipe's output. + * @return the crafting grid recipe. The crafting recipe's getRecipeOutput() is used as the ICarpenterRecipe's + * output. */ IDescriptiveRecipe getCraftingGridRecipe(); /** - * @return the box required for this recipe. return null if there is no required box. - * Examples of boxes are the Forestry cartons and crates. + * @return the box required for this recipe. return null if there is no required box. Examples of boxes are the + * Forestry cartons and crates. */ @Nullable ItemStack getBox(); diff --git a/src/main/java/forestry/api/recipes/ICentrifugeManager.java b/src/main/java/forestry/api/recipes/ICentrifugeManager.java index 8c655dab1..a8ccbccde 100644 --- a/src/main/java/forestry/api/recipes/ICentrifugeManager.java +++ b/src/main/java/forestry/api/recipes/ICentrifugeManager.java @@ -6,13 +6,14 @@ package forestry.api.recipes; import java.util.Map; + 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. + * 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} * @@ -24,9 +25,9 @@ public interface ICentrifugeManager extends ICraftingProvider * Add a recipe to the centrifuge * * @param timePerItem Time to centrifugate one item of the given type. Default is 20. - * @param input ItemStack containing information on item id and damage. Stack size will be ignored. - * @param products Specifies the possible products and the chances of them resulting from centrifuging. - * Chances are from (0.0 to 1.0] + * @param input ItemStack containing information on item id and damage. Stack size will be ignored. + * @param products Specifies the possible products and the chances of them resulting from centrifuging. Chances + * are from (0.0 to 1.0] */ void addRecipe(int timePerItem, ItemStack input, Map products); } diff --git a/src/main/java/forestry/api/recipes/ICentrifugeRecipe.java b/src/main/java/forestry/api/recipes/ICentrifugeRecipe.java index 2f6a7d321..3820fd357 100644 --- a/src/main/java/forestry/api/recipes/ICentrifugeRecipe.java +++ b/src/main/java/forestry/api/recipes/ICentrifugeRecipe.java @@ -8,6 +8,7 @@ package forestry.api.recipes; import java.util.Collection; import java.util.Map; import java.util.Random; + import net.minecraft.item.ItemStack; public interface ICentrifugeRecipe extends IForestryRecipe { @@ -22,8 +23,8 @@ public interface ICentrifugeRecipe extends IForestryRecipe { Collection getProducts(Random random); /** - * Returns a list of all possible products and their estimated probabilities (0.0 to 1.0], - * to help mods that display recipes + * Returns a list of all possible products and their estimated probabilities (0.0 to 1.0], to help mods that display + * recipes **/ Map getAllProducts(); } diff --git a/src/main/java/forestry/api/recipes/ICraftingProvider.java b/src/main/java/forestry/api/recipes/ICraftingProvider.java index e49a168d5..2b63a1e4f 100644 --- a/src/main/java/forestry/api/recipes/ICraftingProvider.java +++ b/src/main/java/forestry/api/recipes/ICraftingProvider.java @@ -9,8 +9,10 @@ import java.util.Collection; import java.util.Map; public interface ICraftingProvider { + /** * Add a new recipe to the crafting provider. + * * @return true if this collection changed as a result of the call * @since Forestry 4.1.0 */ @@ -18,6 +20,7 @@ public interface ICraftingProvider { /** * Remove a specific recipe from the crafting provider. + * * @return true if an element was removed as a result of this call * @since Forestry 4.1.0 */ @@ -32,7 +35,8 @@ 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. + * @return List of the given format where the first array represents inputs and the second outputs. Objects can be + * either ItemStack or LiquidStack. * @deprecated since Forestry 4.1.0. Use recipes() */ @Deprecated diff --git a/src/main/java/forestry/api/recipes/IDescriptiveRecipe.java b/src/main/java/forestry/api/recipes/IDescriptiveRecipe.java index 6020ddc93..6d9fbf9b8 100644 --- a/src/main/java/forestry/api/recipes/IDescriptiveRecipe.java +++ b/src/main/java/forestry/api/recipes/IDescriptiveRecipe.java @@ -10,9 +10,8 @@ import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; /** - * Extension of IRecipe to give better access to the expected crafting inputs. - * It can be matched against regular IInventory instead of just InventoryCrafting. - * Useful for displaying crafting recipes. + * Extension of IRecipe to give better access to the expected crafting inputs. It can be matched against regular + * IInventory instead of just InventoryCrafting. Useful for displaying crafting recipes. */ public interface IDescriptiveRecipe extends IRecipe { @@ -27,14 +26,14 @@ public interface IDescriptiveRecipe extends IRecipe { int getHeight(); /** - * @return array of all the ingredients in the crafting table. - * Ingredients may be null, ItemStack, ItemStack[], or a List of ItemStack + * @return array of all the ingredients in the crafting table. Ingredients may be null, ItemStack, ItemStack[], or a + * List of ItemStack */ Object[] getIngredients(); /** - * @return true if the recipe manager should copy NBT from input items to the output item. - * If true, all input items must have the same NBT for it to succeed. + * @return true if the recipe manager should copy NBT from input items to the output item. If true, all input items + * must have the same NBT for it to succeed. * @deprecated since Forestry 4.2 wood itemStacks use item damage (meta) instead of NBT */ @Deprecated @@ -42,6 +41,7 @@ public interface IDescriptiveRecipe extends IRecipe { /** * Used to check if a recipe matches current crafting inventory + * * @deprecated Since Forestry 4.1. This is handled by Forestry. */ @Deprecated diff --git a/src/main/java/forestry/api/recipes/IFabricatorRecipe.java b/src/main/java/forestry/api/recipes/IFabricatorRecipe.java index cba4871b9..12d678c81 100644 --- a/src/main/java/forestry/api/recipes/IFabricatorRecipe.java +++ b/src/main/java/forestry/api/recipes/IFabricatorRecipe.java @@ -6,6 +6,7 @@ package forestry.api.recipes; import javax.annotation.Nullable; + import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; @@ -52,13 +53,14 @@ public interface IFabricatorRecipe extends IForestryRecipe { /** * Returns an Item that is the result of this recipe + * * @deprecated since Forestry 4.1. Forestry uses getRecipeOutput() and preservesNbt() to determine the result. */ @Deprecated ItemStack getCraftingResult(IInventory craftingInventory); /** - * @param plan The Fabricator plan, the item in the top right slot. + * @param plan The Fabricator plan, the item in the top right slot. * @param resources The resources in the crafting grid. * @return true if the plan and resources match this recipe. * @deprecated since Forestry 4.1. This is handled by Forestry instead. diff --git a/src/main/java/forestry/api/recipes/IFabricatorSmeltingManager.java b/src/main/java/forestry/api/recipes/IFabricatorSmeltingManager.java index 3d752a5c9..c9d763ffe 100644 --- a/src/main/java/forestry/api/recipes/IFabricatorSmeltingManager.java +++ b/src/main/java/forestry/api/recipes/IFabricatorSmeltingManager.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.api.recipes; @@ -14,10 +12,12 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; public interface IFabricatorSmeltingManager extends ICraftingProvider { + /** * Add a smelting recipe to the Fabricator - * @param resource item to be melted down - * @param molten resulting fluid + * + * @param resource item to be melted down + * @param molten resulting fluid * @param meltingPoint temperature at which the item melts. Glass is 1000, Sand is 3000. */ void addSmelting(ItemStack resource, FluidStack molten, int meltingPoint); diff --git a/src/main/java/forestry/api/recipes/IFabricatorSmeltingRecipe.java b/src/main/java/forestry/api/recipes/IFabricatorSmeltingRecipe.java index 88094cd8a..301dfddb5 100644 --- a/src/main/java/forestry/api/recipes/IFabricatorSmeltingRecipe.java +++ b/src/main/java/forestry/api/recipes/IFabricatorSmeltingRecipe.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.api.recipes; @@ -14,6 +12,7 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; public interface IFabricatorSmeltingRecipe extends IForestryRecipe { + /** * @return item to be melted down */ diff --git a/src/main/java/forestry/api/recipes/IFermenterManager.java b/src/main/java/forestry/api/recipes/IFermenterManager.java index a571e1244..5be70d78a 100644 --- a/src/main/java/forestry/api/recipes/IFermenterManager.java +++ b/src/main/java/forestry/api/recipes/IFermenterManager.java @@ -11,9 +11,8 @@ 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. + * 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} * @@ -24,29 +23,27 @@ 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. + * @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); + 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. + * @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/main/java/forestry/api/recipes/IFermenterRecipe.java b/src/main/java/forestry/api/recipes/IFermenterRecipe.java index 7c505d9a7..3ddf16215 100644 --- a/src/main/java/forestry/api/recipes/IFermenterRecipe.java +++ b/src/main/java/forestry/api/recipes/IFermenterRecipe.java @@ -10,6 +10,7 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; public interface IFermenterRecipe extends IForestryRecipe { + /** * @return ItemStack representing the input resource. */ @@ -21,13 +22,13 @@ public interface IFermenterRecipe extends IForestryRecipe { FluidStack getFluidResource(); /** - * @return Value of the given resource, i.e. how much needs to be fermented for the output to be deposited into the product tank. + * @return Value of the given resource, i.e. how much needs to be fermented for the output to be deposited into the + * product tank. */ int getFermentationValue(); /** - * @return Modifies the amount of liquid output per work cycle. - * (water = 1.0f, honey = 1.5f) + * @return Modifies the amount of liquid output per work cycle. (water = 1.0f, honey = 1.5f) */ float getModifier(); diff --git a/src/main/java/forestry/api/recipes/IForestryRecipe.java b/src/main/java/forestry/api/recipes/IForestryRecipe.java index af358ed25..7153ffa0b 100644 --- a/src/main/java/forestry/api/recipes/IForestryRecipe.java +++ b/src/main/java/forestry/api/recipes/IForestryRecipe.java @@ -5,4 +5,5 @@ ******************************************************************************/ package forestry.api.recipes; -public interface IForestryRecipe {} +public interface IForestryRecipe { +} diff --git a/src/main/java/forestry/api/recipes/IMoistenerManager.java b/src/main/java/forestry/api/recipes/IMoistenerManager.java index ca98314fa..e13620ed4 100644 --- a/src/main/java/forestry/api/recipes/IMoistenerManager.java +++ b/src/main/java/forestry/api/recipes/IMoistenerManager.java @@ -10,8 +10,8 @@ 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. + * 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} * @@ -22,12 +22,10 @@ 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. + * @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/main/java/forestry/api/recipes/IMoistenerRecipe.java b/src/main/java/forestry/api/recipes/IMoistenerRecipe.java index c3385d6b9..0febbf9aa 100644 --- a/src/main/java/forestry/api/recipes/IMoistenerRecipe.java +++ b/src/main/java/forestry/api/recipes/IMoistenerRecipe.java @@ -8,8 +8,11 @@ package forestry.api.recipes; import net.minecraft.item.ItemStack; public interface IMoistenerRecipe extends IForestryRecipe { + /** - * Moistener runs at 1 - 4 time ticks per ingame tick depending on light level. For mycelium this value is currently 5000. + * Moistener runs at 1 - 4 time ticks per ingame tick depending on light level. For mycelium this value is currently + * 5000. + * * @return moistener ticks to process one item. */ int getTimePerItem(); diff --git a/src/main/java/forestry/api/recipes/ISqueezerManager.java b/src/main/java/forestry/api/recipes/ISqueezerManager.java index cccb865d8..9b20a07cd 100644 --- a/src/main/java/forestry/api/recipes/ISqueezerManager.java +++ b/src/main/java/forestry/api/recipes/ISqueezerManager.java @@ -6,14 +6,15 @@ package forestry.api.recipes; import javax.annotation.Nullable; + 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. + * 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} * @@ -25,10 +26,11 @@ 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, from 0 to 100. + * @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, from 0 to 100. */ public void addRecipe(int timePerItem, ItemStack[] resources, FluidStack liquid, ItemStack remnants, int chance); @@ -36,19 +38,20 @@ 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 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); /** - * Add a recipe for a fluid container to the squeezer. - * This will add recipes to get all types of liquids out of this type of fluid container. + * Add a recipe for a fluid container to the squeezer. This will add recipes to get all types of liquids out of this + * type of fluid container. * - * @param timePerItem Number of work cycles required to squeeze one set of resources. + * @param timePerItem Number of work cycles required to squeeze one set of resources. * @param emptyContainer The empty version of the fluid container that will be squeezed. - * @param remnants Item stack representing the possible remnants from this recipe. - * @param chance Chance remnants will be produced by a single recipe cycle, from 0 to 1. + * @param remnants Item stack representing the possible remnants from this recipe. + * @param chance Chance remnants will be produced by a single recipe cycle, from 0 to 1. */ void addContainerRecipe(int timePerItem, ItemStack emptyContainer, @Nullable ItemStack remnants, float chance); } diff --git a/src/main/java/forestry/api/recipes/ISqueezerRecipe.java b/src/main/java/forestry/api/recipes/ISqueezerRecipe.java index 23600f706..a6847bef0 100644 --- a/src/main/java/forestry/api/recipes/ISqueezerRecipe.java +++ b/src/main/java/forestry/api/recipes/ISqueezerRecipe.java @@ -11,7 +11,8 @@ import net.minecraftforge.fluids.FluidStack; public interface ISqueezerRecipe extends IForestryRecipe { /** - * @return Array of item stacks representing the required resources for one process. Stack size will be taken into account. + * @return Array of item stacks representing the required resources for one process. Stack size will be taken into + * account. */ ItemStack[] getResources(); diff --git a/src/main/java/forestry/api/recipes/IStillManager.java b/src/main/java/forestry/api/recipes/IStillManager.java index c634ce5a8..98224d709 100644 --- a/src/main/java/forestry/api/recipes/IStillManager.java +++ b/src/main/java/forestry/api/recipes/IStillManager.java @@ -10,8 +10,8 @@ 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. + * 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} * @@ -20,15 +20,13 @@ import net.minecraftforge.fluids.FluidStack; * @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 - * FluidStack representing the input liquid. - * @param output - * FluidStack representing the output liquid + * @param cyclesPerUnit Amount of work cycles required to run through the conversion once. + * @param input FluidStack representing the input liquid. + * @param output FluidStack representing the output liquid */ public void addRecipe(int cyclesPerUnit, FluidStack input, FluidStack output); } diff --git a/src/main/java/forestry/api/recipes/IStillRecipe.java b/src/main/java/forestry/api/recipes/IStillRecipe.java index 35bcbe9c8..be0210b32 100644 --- a/src/main/java/forestry/api/recipes/IStillRecipe.java +++ b/src/main/java/forestry/api/recipes/IStillRecipe.java @@ -8,6 +8,7 @@ package forestry.api.recipes; import net.minecraftforge.fluids.FluidStack; public interface IStillRecipe extends IForestryRecipe { + /** * @return Amount of work cycles required to run through the conversion once. */ diff --git a/src/main/java/forestry/api/recipes/IVariableFermentable.java b/src/main/java/forestry/api/recipes/IVariableFermentable.java index 0469d0427..fa442ca2b 100644 --- a/src/main/java/forestry/api/recipes/IVariableFermentable.java +++ b/src/main/java/forestry/api/recipes/IVariableFermentable.java @@ -8,8 +8,8 @@ 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! + * 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 { diff --git a/src/main/java/forestry/api/storage/BackpackEvent.java b/src/main/java/forestry/api/storage/BackpackEvent.java index 39d30c3a5..081725dba 100644 --- a/src/main/java/forestry/api/storage/BackpackEvent.java +++ b/src/main/java/forestry/api/storage/BackpackEvent.java @@ -5,10 +5,11 @@ ******************************************************************************/ package forestry.api.storage; -import cpw.mods.fml.common.eventhandler.Event; 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; diff --git a/src/main/java/forestry/api/storage/BackpackManager.java b/src/main/java/forestry/api/storage/BackpackManager.java index 54086b858..6902f6334 100644 --- a/src/main/java/forestry/api/storage/BackpackManager.java +++ b/src/main/java/forestry/api/storage/BackpackManager.java @@ -7,11 +7,14 @@ 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 + * 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! */ diff --git a/src/main/java/forestry/api/storage/BackpackResupplyEvent.java b/src/main/java/forestry/api/storage/BackpackResupplyEvent.java index 95e506374..73900d291 100644 --- a/src/main/java/forestry/api/storage/BackpackResupplyEvent.java +++ b/src/main/java/forestry/api/storage/BackpackResupplyEvent.java @@ -5,19 +5,20 @@ ******************************************************************************/ package forestry.api.storage; -import cpw.mods.fml.common.eventhandler.Cancelable; 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. + * 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) { + public BackpackResupplyEvent(EntityPlayer player, IBackpackDefinition backpackDefinition, + IInventory backpackInventory) { super(player, backpackDefinition, backpackInventory); } } diff --git a/src/main/java/forestry/api/storage/BackpackStowEvent.java b/src/main/java/forestry/api/storage/BackpackStowEvent.java index 24bfa1b00..6bf9fc4e4 100644 --- a/src/main/java/forestry/api/storage/BackpackStowEvent.java +++ b/src/main/java/forestry/api/storage/BackpackStowEvent.java @@ -5,24 +5,22 @@ ******************************************************************************/ package forestry.api.storage; -import cpw.mods.fml.common.eventhandler.Cancelable; 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. + * 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, + public BackpackStowEvent(EntityPlayer player, IBackpackDefinition backpackDefinition, IInventory backpackInventory, ItemStack stackToStow) { super(player, backpackDefinition, backpackInventory); this.stackToStow = stackToStow; diff --git a/src/main/java/forestry/api/storage/IBackpackDefinition.java b/src/main/java/forestry/api/storage/IBackpackDefinition.java index fa0085ee5..33241e8a9 100644 --- a/src/main/java/forestry/api/storage/IBackpackDefinition.java +++ b/src/main/java/forestry/api/storage/IBackpackDefinition.java @@ -6,6 +6,7 @@ package forestry.api.storage; import java.util.List; + import net.minecraft.item.ItemStack; public interface IBackpackDefinition { diff --git a/src/main/java/forestry/api/storage/IBackpackInterface.java b/src/main/java/forestry/api/storage/IBackpackInterface.java index e64b0641f..b54a24d20 100644 --- a/src/main/java/forestry/api/storage/IBackpackInterface.java +++ b/src/main/java/forestry/api/storage/IBackpackInterface.java @@ -12,10 +12,8 @@ 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) + * @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/main/java/forestry/api/storage/ICrateRegistry.java b/src/main/java/forestry/api/storage/ICrateRegistry.java index 7c4a0dcf8..1f4859326 100644 --- a/src/main/java/forestry/api/storage/ICrateRegistry.java +++ b/src/main/java/forestry/api/storage/ICrateRegistry.java @@ -12,9 +12,8 @@ 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. + * 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. */ diff --git a/src/main/java/forestry/api/world/ITreeGenData.java b/src/main/java/forestry/api/world/ITreeGenData.java index f42c013f2..394e846ea 100644 --- a/src/main/java/forestry/api/world/ITreeGenData.java +++ b/src/main/java/forestry/api/world/ITreeGenData.java @@ -5,11 +5,12 @@ ******************************************************************************/ package forestry.api.world; -import com.mojang.authlib.GameProfile; -import forestry.api.arboriculture.ITreeGenome; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import com.mojang.authlib.GameProfile; +import forestry.api.arboriculture.ITreeGenome; + public interface ITreeGenData { int getGirth(World world, int x, int y, int z); diff --git a/src/main/java/forestry/api/world/IWorldGenInterface.java b/src/main/java/forestry/api/world/IWorldGenInterface.java index 636895fa2..bec90a25f 100644 --- a/src/main/java/forestry/api/world/IWorldGenInterface.java +++ b/src/main/java/forestry/api/world/IWorldGenInterface.java @@ -18,8 +18,8 @@ public interface IWorldGenInterface { * * 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'. + * @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/main/java/forestry/api/world/WorldGenManager.java b/src/main/java/forestry/api/world/WorldGenManager.java index 927539a01..23bb6842b 100644 --- a/src/main/java/forestry/api/world/WorldGenManager.java +++ b/src/main/java/forestry/api/world/WorldGenManager.java @@ -10,5 +10,6 @@ package forestry.api.world; */ @Deprecated public class WorldGenManager { + public static IWorldGenInterface worldgenInterface; } diff --git a/src/main/java/forestry/apiculture/AlvearyBeeModifier.java b/src/main/java/forestry/apiculture/AlvearyBeeModifier.java index 7cfc14e29..d1a91c7b5 100644 --- a/src/main/java/forestry/apiculture/AlvearyBeeModifier.java +++ b/src/main/java/forestry/apiculture/AlvearyBeeModifier.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture; @@ -14,6 +12,7 @@ import forestry.api.apiculture.DefaultBeeModifier; import forestry.api.apiculture.IBeeGenome; public class AlvearyBeeModifier extends DefaultBeeModifier { + @Override public float getTerritoryModifier(IBeeGenome genome, float currentModifier) { return 2.0f; diff --git a/src/main/java/forestry/apiculture/ApiaryBeeListener.java b/src/main/java/forestry/apiculture/ApiaryBeeListener.java index 6df2f2247..9dfdfe363 100644 --- a/src/main/java/forestry/apiculture/ApiaryBeeListener.java +++ b/src/main/java/forestry/apiculture/ApiaryBeeListener.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture; @@ -14,6 +12,7 @@ import forestry.api.apiculture.DefaultBeeListener; import forestry.apiculture.inventory.IApiaryInventory; public class ApiaryBeeListener extends DefaultBeeListener { + private final IApiary apiary; public ApiaryBeeListener(IApiary apiary) { diff --git a/src/main/java/forestry/apiculture/ApiaryBeeModifier.java b/src/main/java/forestry/apiculture/ApiaryBeeModifier.java index 37acca238..4b516bb17 100644 --- a/src/main/java/forestry/apiculture/ApiaryBeeModifier.java +++ b/src/main/java/forestry/apiculture/ApiaryBeeModifier.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture; @@ -14,6 +12,7 @@ import forestry.api.apiculture.DefaultBeeModifier; import forestry.api.apiculture.IBeeGenome; public class ApiaryBeeModifier extends DefaultBeeModifier { + @Override public float getProductionModifier(IBeeGenome genome, float currentModifier) { return 0.1f; diff --git a/src/main/java/forestry/apiculture/ArmorApiaristHelper.java b/src/main/java/forestry/apiculture/ArmorApiaristHelper.java index f26e5d91c..ba3fca33a 100644 --- a/src/main/java/forestry/apiculture/ArmorApiaristHelper.java +++ b/src/main/java/forestry/apiculture/ArmorApiaristHelper.java @@ -1,22 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture; -import forestry.api.apiculture.IArmorApiarist; -import forestry.api.apiculture.IArmorApiaristHelper; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import forestry.api.apiculture.IArmorApiarist; +import forestry.api.apiculture.IArmorApiaristHelper; + public class ArmorApiaristHelper implements IArmorApiaristHelper { @Override diff --git a/src/main/java/forestry/apiculture/BeeHousingListener.java b/src/main/java/forestry/apiculture/BeeHousingListener.java index 343cba868..41e700f5f 100644 --- a/src/main/java/forestry/apiculture/BeeHousingListener.java +++ b/src/main/java/forestry/apiculture/BeeHousingListener.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture; @@ -15,6 +13,7 @@ import forestry.api.apiculture.IBeeListener; import forestry.api.genetics.IIndividual; public class BeeHousingListener implements IBeeListener { + private final IBeeHousing beeHousing; public BeeHousingListener(IBeeHousing beeHousing) { diff --git a/src/main/java/forestry/apiculture/BeeHousingModifier.java b/src/main/java/forestry/apiculture/BeeHousingModifier.java index 628c8b445..aaeb5b3be 100644 --- a/src/main/java/forestry/apiculture/BeeHousingModifier.java +++ b/src/main/java/forestry/apiculture/BeeHousingModifier.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture; @@ -15,6 +13,7 @@ import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeeModifier; public class BeeHousingModifier implements IBeeModifier { + private final IBeeHousing beeHousing; public BeeHousingModifier(IBeeHousing beeHousing) { diff --git a/src/main/java/forestry/apiculture/BeehouseBeeModifier.java b/src/main/java/forestry/apiculture/BeehouseBeeModifier.java index 37fda3ccc..f4db9bd7a 100644 --- a/src/main/java/forestry/apiculture/BeehouseBeeModifier.java +++ b/src/main/java/forestry/apiculture/BeehouseBeeModifier.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture; @@ -14,6 +12,7 @@ import forestry.api.apiculture.DefaultBeeModifier; import forestry.api.apiculture.IBeeGenome; public class BeehouseBeeModifier extends DefaultBeeModifier { + @Override public float getTerritoryModifier(IBeeGenome genome, float currentModifier) { return 1.0f; diff --git a/src/main/java/forestry/apiculture/BeekeepingLogic.java b/src/main/java/forestry/apiculture/BeekeepingLogic.java index 7de89fd91..21f0a5acf 100755 --- a/src/main/java/forestry/apiculture/BeekeepingLogic.java +++ b/src/main/java/forestry/apiculture/BeekeepingLogic.java @@ -1,15 +1,28 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Set; +import java.util.Stack; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.EnumBeeType; import forestry.api.apiculture.IApiaristTracker; @@ -33,19 +46,6 @@ import forestry.core.network.IStreamable; import forestry.core.proxy.Proxies; import forestry.core.utils.Log; import forestry.plugins.PluginApiculture; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Set; -import java.util.Stack; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; public class BeekeepingLogic implements IBeekeepingLogic, IStreamable { @@ -335,9 +335,7 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable { beeInventory.setQueen(queenStack); // Register the new queen with the breeding tracker - BeeManager.beeRoot - .getBreedingTracker(housing.getWorld(), housing.getOwner()) - .registerQueen(princess); + BeeManager.beeRoot.getBreedingTracker(housing.getWorld(), housing.getOwner()).registerQueen(princess); // Remove drone beeInventory.getDrone().stackSize--; @@ -473,6 +471,7 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable { } private static class QueenCanWorkCache { + private static final int ticksPerCheckQueenCanWork = 10; private Set queenCanWorkCached = Collections.emptySet(); @@ -491,6 +490,7 @@ public class BeekeepingLogic implements IBeekeepingLogic, IStreamable { } private static class PollenHandler { + private static final int MAX_POLLINATION_ATTEMPTS = 20; private IIndividual pollen; diff --git a/src/main/java/forestry/apiculture/FakeBeekeepingLogic.java b/src/main/java/forestry/apiculture/FakeBeekeepingLogic.java index 807777824..079a6510e 100644 --- a/src/main/java/forestry/apiculture/FakeBeekeepingLogic.java +++ b/src/main/java/forestry/apiculture/FakeBeekeepingLogic.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture; -import forestry.api.apiculture.IBeekeepingLogic; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.nbt.NBTTagCompound; +import forestry.api.apiculture.IBeekeepingLogic; + public class FakeBeekeepingLogic implements IBeekeepingLogic { + public static final FakeBeekeepingLogic instance = new FakeBeekeepingLogic(); private FakeBeekeepingLogic() {} diff --git a/src/main/java/forestry/apiculture/HasFlowersCache.java b/src/main/java/forestry/apiculture/HasFlowersCache.java index 8f621f1f1..3ce2bf448 100644 --- a/src/main/java/forestry/apiculture/HasFlowersCache.java +++ b/src/main/java/forestry/apiculture/HasFlowersCache.java @@ -1,15 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture; +import java.util.Random; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.FlowerManager; import forestry.api.apiculture.IBee; @@ -19,12 +23,9 @@ import forestry.api.core.INBTTagable; import forestry.api.genetics.IFlowerProvider; import forestry.core.utils.vect.Vect; import forestry.plugins.PluginApiculture; -import java.util.Random; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; public class HasFlowersCache implements INBTTagable { + private static final String nbtKey = "hasFlowerCache"; private static final Random random = new Random(); private static final int flowerCheckInterval = 128; @@ -74,13 +75,12 @@ public class HasFlowersCache implements INBTTagable { if (!isFlowerCoordInRange(flowerCoords, min, max)) { return false; } - return FlowerManager.flowerRegistry.isAcceptedFlower( - flowerType, world, flowerCoords.posX, flowerCoords.posY, flowerCoords.posZ); + return FlowerManager.flowerRegistry + .isAcceptedFlower(flowerType, world, flowerCoords.posX, flowerCoords.posY, flowerCoords.posZ); } private static boolean isFlowerCoordInRange(ChunkCoordinates flowerCoords, Vect min, Vect max) { - return flowerCoords.posX >= min.x - && flowerCoords.posX <= max.x + return flowerCoords.posX >= min.x && flowerCoords.posX <= max.x && flowerCoords.posY >= min.y && flowerCoords.posY <= max.y && flowerCoords.posZ >= min.z diff --git a/src/main/java/forestry/apiculture/IApiary.java b/src/main/java/forestry/apiculture/IApiary.java index f55eeed9e..a089fd242 100644 --- a/src/main/java/forestry/apiculture/IApiary.java +++ b/src/main/java/forestry/apiculture/IApiary.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture; @@ -14,5 +12,6 @@ import forestry.api.apiculture.IBeeHousing; import forestry.apiculture.inventory.IApiaryInventory; public interface IApiary extends IBeeHousing { + IApiaryInventory getApiaryInventory(); } diff --git a/src/main/java/forestry/apiculture/InventoryBeeHousing.java b/src/main/java/forestry/apiculture/InventoryBeeHousing.java index 24401f399..ddaff98a3 100644 --- a/src/main/java/forestry/apiculture/InventoryBeeHousing.java +++ b/src/main/java/forestry/apiculture/InventoryBeeHousing.java @@ -1,15 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture; +import net.minecraft.item.ItemStack; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.EnumBeeType; import forestry.api.apiculture.IBeeHousingInventory; @@ -17,9 +17,9 @@ import forestry.core.access.IAccessHandler; import forestry.core.inventory.InventoryAdapterRestricted; import forestry.core.utils.InventoryUtil; import forestry.core.utils.SlotUtil; -import net.minecraft.item.ItemStack; public class InventoryBeeHousing extends InventoryAdapterRestricted implements IBeeHousingInventory { + public static final int SLOT_QUEEN = 0; public static final int SLOT_DRONE = 1; public static final int SLOT_PRODUCT_1 = 2; diff --git a/src/main/java/forestry/apiculture/MaterialBeehive.java b/src/main/java/forestry/apiculture/MaterialBeehive.java index 50bf7e9d9..608c9566a 100755 --- a/src/main/java/forestry/apiculture/MaterialBeehive.java +++ b/src/main/java/forestry/apiculture/MaterialBeehive.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture; diff --git a/src/main/java/forestry/apiculture/SaveEventHandlerApiculture.java b/src/main/java/forestry/apiculture/SaveEventHandlerApiculture.java index 16baaa84c..4b1b0a73d 100755 --- a/src/main/java/forestry/apiculture/SaveEventHandlerApiculture.java +++ b/src/main/java/forestry/apiculture/SaveEventHandlerApiculture.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture; +import net.minecraft.world.World; + import forestry.api.apiculture.BeeManager; import forestry.core.ISaveEventHandler; -import net.minecraft.world.World; public class SaveEventHandlerApiculture implements ISaveEventHandler { diff --git a/src/main/java/forestry/apiculture/VillageHandlerApiculture.java b/src/main/java/forestry/apiculture/VillageHandlerApiculture.java index 29931bb85..ce55d2a72 100755 --- a/src/main/java/forestry/apiculture/VillageHandlerApiculture.java +++ b/src/main/java/forestry/apiculture/VillageHandlerApiculture.java @@ -1,25 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture; -import cpw.mods.fml.common.registry.VillagerRegistry.IVillageCreationHandler; -import cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler; -import forestry.api.apiculture.EnumBeeType; -import forestry.apiculture.blocks.BlockApicultureType; -import forestry.apiculture.genetics.BeeDefinition; -import forestry.apiculture.worldgen.ComponentVillageBeeHouse; -import forestry.core.utils.Log; -import forestry.plugins.PluginApiculture; import java.util.List; import java.util.Random; + import net.minecraft.entity.passive.EntityVillager; import net.minecraft.init.Blocks; import net.minecraft.init.Items; @@ -31,6 +22,15 @@ import net.minecraft.world.gen.structure.MapGenStructureIO; import net.minecraft.world.gen.structure.StructureVillagePieces; import net.minecraftforge.oredict.OreDictionary; +import cpw.mods.fml.common.registry.VillagerRegistry.IVillageCreationHandler; +import cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler; +import forestry.api.apiculture.EnumBeeType; +import forestry.apiculture.blocks.BlockApicultureType; +import forestry.apiculture.genetics.BeeDefinition; +import forestry.apiculture.worldgen.ComponentVillageBeeHouse; +import forestry.core.utils.Log; +import forestry.plugins.PluginApiculture; + public class VillageHandlerApiculture implements IVillageCreationHandler, IVillageTradeHandler { public static void registerVillageComponents() { @@ -44,8 +44,10 @@ public class VillageHandlerApiculture implements IVillageCreationHandler, IVilla @SuppressWarnings("unchecked") @Override public void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random) { - ItemStack wildcardPrincess = - new ItemStack(PluginApiculture.items.beePrincessGE, 1, OreDictionary.WILDCARD_VALUE); + ItemStack wildcardPrincess = new ItemStack( + PluginApiculture.items.beePrincessGE, + 1, + OreDictionary.WILDCARD_VALUE); ItemStack wildcardDrone = new ItemStack(PluginApiculture.items.beeDroneGE, 4, OreDictionary.WILDCARD_VALUE); recipeList.add(new MerchantRecipe(wildcardPrincess, new ItemStack(Items.emerald, 1))); @@ -82,7 +84,9 @@ public class VillageHandlerApiculture implements IVillageCreationHandler, IVilla @Override public StructureVillagePieces.PieceWeight getVillagePieceWeight(Random random, int size) { return new StructureVillagePieces.PieceWeight( - ComponentVillageBeeHouse.class, 15, MathHelper.getRandomIntegerInRange(random, size, 1 + size)); + ComponentVillageBeeHouse.class, + 15, + MathHelper.getRandomIntegerInRange(random, size, 1 + size)); } @Override @@ -92,15 +96,8 @@ public class VillageHandlerApiculture implements IVillageCreationHandler, IVilla @SuppressWarnings("rawtypes") @Override - public Object buildComponent( - StructureVillagePieces.PieceWeight villagePiece, - StructureVillagePieces.Start startPiece, - List pieces, - Random random, - int p1, - int p2, - int p3, - int p4, + public Object buildComponent(StructureVillagePieces.PieceWeight villagePiece, + StructureVillagePieces.Start startPiece, List pieces, Random random, int p1, int p2, int p3, int p4, int p5) { return ComponentVillageBeeHouse.buildComponent(startPiece, pieces, random, p1, p2, p3, p4, p5); } diff --git a/src/main/java/forestry/apiculture/blocks/BlockAlveary.java b/src/main/java/forestry/apiculture/blocks/BlockAlveary.java index 6c2515da5..09b743f93 100644 --- a/src/main/java/forestry/apiculture/blocks/BlockAlveary.java +++ b/src/main/java/forestry/apiculture/blocks/BlockAlveary.java @@ -1,15 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.blocks; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.block.Block; +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.tileentity.TileEntity; +import net.minecraft.util.IIcon; +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.core.Tabs; @@ -24,20 +35,11 @@ import forestry.apiculture.multiblock.TileAlvearyStabiliser; import forestry.apiculture.multiblock.TileAlvearySwarmer; import forestry.core.blocks.BlockStructure; import forestry.core.render.TextureManager; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.block.Block; -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.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; public class BlockAlveary extends BlockStructure { + public enum Type { + PLAIN, ENTRANCE, SWARMER, @@ -57,7 +59,7 @@ public class BlockAlveary extends BlockStructure { setHarvestLevel("axe", 0); } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override @SideOnly(Side.CLIENT) public void getSubBlocks(Item item, CreativeTabs tab, List list) { @@ -166,11 +168,9 @@ public class BlockAlveary extends BlockStructure { @SideOnly(Side.CLIENT) @Override public IIcon getIcon(int side, int metadata) { - if ((metadata <= 1 - || metadata == Type.SIEVE.ordinal() - || metadata == Type.SWARMER.ordinal() - || metadata == Type.STABILIZER.ordinal()) - && (side == 1 || side == 0)) { + if ((metadata <= 1 || metadata == Type.SIEVE.ordinal() + || metadata == Type.SWARMER.ordinal() + || metadata == Type.STABILIZER.ordinal()) && (side == 1 || side == 0)) { return icons[BOTTOM]; } diff --git a/src/main/java/forestry/apiculture/blocks/BlockApiculture.java b/src/main/java/forestry/apiculture/blocks/BlockApiculture.java index b243e97a6..6857da673 100644 --- a/src/main/java/forestry/apiculture/blocks/BlockApiculture.java +++ b/src/main/java/forestry/apiculture/blocks/BlockApiculture.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.blocks; @@ -14,6 +12,7 @@ import forestry.api.core.Tabs; import forestry.core.blocks.BlockBase; public class BlockApiculture extends BlockBase { + public BlockApiculture() { super(); setCreativeTab(Tabs.tabApiculture); diff --git a/src/main/java/forestry/apiculture/blocks/BlockApicultureType.java b/src/main/java/forestry/apiculture/blocks/BlockApicultureType.java index 8311659e4..f9d54f6c3 100644 --- a/src/main/java/forestry/apiculture/blocks/BlockApicultureType.java +++ b/src/main/java/forestry/apiculture/blocks/BlockApicultureType.java @@ -1,24 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.blocks; +import java.util.Locale; + +import org.apache.commons.lang3.text.WordUtils; + import forestry.apiculture.tiles.TileApiaristChest; import forestry.apiculture.tiles.TileApiary; import forestry.apiculture.tiles.TileBeehouse; import forestry.core.blocks.IMachineProperties; import forestry.core.tiles.TileForestry; -import java.util.Locale; -import org.apache.commons.lang3.text.WordUtils; public enum BlockApicultureType implements IMachineProperties { + APIARY(TileApiary.class), APIARIST_CHEST_LEGACY(TileApiaristChest.class, "ApiaristChest"), BEEHOUSE(TileBeehouse.class); diff --git a/src/main/java/forestry/apiculture/blocks/BlockBeehives.java b/src/main/java/forestry/apiculture/blocks/BlockBeehives.java index 4c9166daa..a3ce19911 100644 --- a/src/main/java/forestry/apiculture/blocks/BlockBeehives.java +++ b/src/main/java/forestry/apiculture/blocks/BlockBeehives.java @@ -1,15 +1,29 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.blocks; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import net.minecraft.block.BlockContainer; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.Entity; +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.IIcon; +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.apiculture.IHiveDrop; @@ -22,22 +36,9 @@ import forestry.core.render.TextureManager; import forestry.core.utils.InventoryUtil; import forestry.core.utils.ItemStackUtil; import forestry.plugins.PluginApiculture; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import net.minecraft.block.BlockContainer; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.Entity; -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.IIcon; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; public class BlockBeehives extends BlockContainer { + public enum Type { LEGACY, FOREST, @@ -163,7 +164,7 @@ public class BlockBeehives extends BlockContainer { return null; } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void getSubBlocks(Item item, CreativeTabs par2CreativeTabs, List itemList) { itemList.add(new ItemStack(this, 1, 1)); diff --git a/src/main/java/forestry/apiculture/blocks/BlockCandle.java b/src/main/java/forestry/apiculture/blocks/BlockCandle.java index dc7d72f5b..9d1e394c3 100644 --- a/src/main/java/forestry/apiculture/blocks/BlockCandle.java +++ b/src/main/java/forestry/apiculture/blocks/BlockCandle.java @@ -1,24 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.blocks; -import com.google.common.collect.ImmutableMap; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.core.Tabs; -import forestry.apiculture.tiles.TileCandle; -import forestry.core.proxy.Proxies; -import forestry.core.render.TextureManager; -import forestry.core.utils.ItemStackUtil; -import forestry.core.utils.StringUtil; import java.awt.Color; import java.util.ArrayList; import java.util.Arrays; @@ -27,6 +16,7 @@ import java.util.List; import java.util.Map; import java.util.Random; import java.util.Set; + import net.minecraft.block.BlockTorch; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -44,6 +34,17 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; +import com.google.common.collect.ImmutableMap; + +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.core.Tabs; +import forestry.apiculture.tiles.TileCandle; +import forestry.core.proxy.Proxies; +import forestry.core.render.TextureManager; +import forestry.core.utils.ItemStackUtil; +import forestry.core.utils.StringUtil; + public class BlockCandle extends BlockTorch { private static final ImmutableMap colours; @@ -51,27 +52,18 @@ public class BlockCandle extends BlockTorch { public static final String colourTagName = "colour"; static { - colours = ImmutableMap.builder() - .put("dyeWhite", new Color(255, 255, 255).getRGB()) - .put("dyeOrange", new Color(219, 125, 62).getRGB()) - .put("dyeMagenta", new Color(255, 20, 255).getRGB()) + colours = ImmutableMap.builder().put("dyeWhite", new Color(255, 255, 255).getRGB()) + .put("dyeOrange", new Color(219, 125, 62).getRGB()).put("dyeMagenta", new Color(255, 20, 255).getRGB()) .put("dyeLightBlue", new Color(107, 138, 201).getRGB()) - .put("dyeYellow", new Color(255, 255, 20).getRGB()) - .put("dyeLime", new Color(20, 255, 20).getRGB()) - .put("dyePink", new Color(208, 132, 153).getRGB()) - .put("dyeGray", new Color(74, 74, 74).getRGB()) - .put("dyeLightGray", new Color(154, 161, 161).getRGB()) - .put("dyeCyan", new Color(20, 255, 255).getRGB()) - .put("dyePurple", new Color(126, 61, 181).getRGB()) - .put("dyeBlue", new Color(20, 20, 255).getRGB()) - .put("dyeBrown", new Color(79, 50, 31).getRGB()) - .put("dyeGreen", new Color(53, 70, 27).getRGB()) - .put("dyeRed", new Color(150, 52, 48).getRGB()) - .put("dyeBlack", new Color(20, 20, 20).getRGB()) - .build(); + .put("dyeYellow", new Color(255, 255, 20).getRGB()).put("dyeLime", new Color(20, 255, 20).getRGB()) + .put("dyePink", new Color(208, 132, 153).getRGB()).put("dyeGray", new Color(74, 74, 74).getRGB()) + .put("dyeLightGray", new Color(154, 161, 161).getRGB()).put("dyeCyan", new Color(20, 255, 255).getRGB()) + .put("dyePurple", new Color(126, 61, 181).getRGB()).put("dyeBlue", new Color(20, 20, 255).getRGB()) + .put("dyeBrown", new Color(79, 50, 31).getRGB()).put("dyeGreen", new Color(53, 70, 27).getRGB()) + .put("dyeRed", new Color(150, 52, 48).getRGB()).put("dyeBlack", new Color(20, 20, 20).getRGB()).build(); - lightingItems = - new HashSet<>(Arrays.asList(Items.flint_and_steel, Items.flint, Item.getItemFromBlock(Blocks.torch))); + lightingItems = new HashSet<>( + Arrays.asList(Items.flint_and_steel, Items.flint, Item.getItemFromBlock(Blocks.torch))); } @SideOnly(Side.CLIENT) @@ -147,23 +139,15 @@ public class BlockCandle extends BlockTorch { return i; } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void getSubBlocks(Item item, CreativeTabs par2CreativeTabs, List itemList) { itemList.add(new ItemStack(this, 1, 0)); } @Override - public boolean onBlockActivated( - World world, - int x, - int y, - int z, - EntityPlayer player, - int facing, - float facingX, - float facingY, - float facingZ) { + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int facing, float facingX, + float facingY, float facingZ) { TileEntity tileEntity = world.getTileEntity(x, y, z); if (!(tileEntity instanceof TileCandle)) { return false; @@ -235,8 +219,8 @@ public class BlockCandle extends BlockTorch { } /* DROP HANDLING */ - // Hack: When harvesting we need to get the drops in onBlockHarvested, - // because Mojang destroys the block and tile before calling getDrops. + // Hack: When harvesting we need to get the drops in onBlockHarvested, + // because Mojang destroys the block and tile before calling getDrops. private final ThreadLocal drop = new ThreadLocal<>(); @Override diff --git a/src/main/java/forestry/apiculture/blocks/BlockRegistryApiculture.java b/src/main/java/forestry/apiculture/blocks/BlockRegistryApiculture.java index a211c606d..ab45bcefb 100644 --- a/src/main/java/forestry/apiculture/blocks/BlockRegistryApiculture.java +++ b/src/main/java/forestry/apiculture/blocks/BlockRegistryApiculture.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.blocks; @@ -17,6 +15,7 @@ import forestry.core.blocks.BlockRegistry; import forestry.core.items.ItemBlockForestry; public class BlockRegistryApiculture extends BlockRegistry { + public final BlockApiculture apiculture; public final BlockBase apicultureChest; public final BlockBeehives beehives; diff --git a/src/main/java/forestry/apiculture/blocks/BlockStump.java b/src/main/java/forestry/apiculture/blocks/BlockStump.java index edf10bac9..cf9cee96c 100644 --- a/src/main/java/forestry/apiculture/blocks/BlockStump.java +++ b/src/main/java/forestry/apiculture/blocks/BlockStump.java @@ -1,15 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.blocks; +import java.util.List; +import java.util.Random; + +import net.minecraft.block.BlockTorch; +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.world.World; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.core.Tabs; @@ -19,17 +30,6 @@ import forestry.core.render.TextureManager; import forestry.core.utils.ItemStackUtil; import forestry.core.utils.StringUtil; import forestry.plugins.PluginApiculture; -import java.util.List; -import java.util.Random; -import net.minecraft.block.BlockTorch; -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.world.World; public class BlockStump extends BlockTorch { @@ -46,29 +46,19 @@ public class BlockStump extends BlockTorch { this.blockIcon = TextureManager.registerTex(register, StringUtil.cleanBlockName(this)); } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void getSubBlocks(Item item, CreativeTabs par2CreativeTabs, List itemList) { itemList.add(new ItemStack(this, 1, 0)); } @Override - public boolean onBlockActivated( - World world, - int x, - int y, - int z, - EntityPlayer player, - int facing, - float facingX, - float facingY, - float facingZ) { + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int facing, float facingX, + float facingY, float facingZ) { ItemStack held = player.getCurrentEquippedItem(); - if (held != null - && (held.getItem() == Items.flint_and_steel - || held.getItem() == Items.flint - || ItemStackUtil.equals(Blocks.torch, held))) { + if (held != null && (held.getItem() == Items.flint_and_steel || held.getItem() == Items.flint + || ItemStackUtil.equals(Blocks.torch, held))) { world.setBlock( x, y, diff --git a/src/main/java/forestry/apiculture/commands/BeeModeHelper.java b/src/main/java/forestry/apiculture/commands/BeeModeHelper.java index c85c05bc8..a1315b502 100644 --- a/src/main/java/forestry/apiculture/commands/BeeModeHelper.java +++ b/src/main/java/forestry/apiculture/commands/BeeModeHelper.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.commands; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.world.World; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.IBeekeepingMode; import forestry.core.commands.ICommandModeHelper; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.world.World; public class BeeModeHelper implements ICommandModeHelper { diff --git a/src/main/java/forestry/apiculture/commands/BeeStatsSaveHelper.java b/src/main/java/forestry/apiculture/commands/BeeStatsSaveHelper.java index 9ffcd1260..0b82b2594 100644 --- a/src/main/java/forestry/apiculture/commands/BeeStatsSaveHelper.java +++ b/src/main/java/forestry/apiculture/commands/BeeStatsSaveHelper.java @@ -1,16 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.commands; +import java.util.ArrayList; +import java.util.Collection; + +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + import com.mojang.authlib.GameProfile; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.IAlleleBeeSpecies; import forestry.api.apiculture.IApiaristTracker; @@ -20,10 +25,6 @@ import forestry.api.genetics.IAlleleSpecies; import forestry.api.genetics.IBreedingTracker; import forestry.core.commands.IStatsSaveHelper; import forestry.core.utils.StringUtil; -import java.util.ArrayList; -import java.util.Collection; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; public class BeeStatsSaveHelper implements IStatsSaveHelper { @@ -35,8 +36,8 @@ public class BeeStatsSaveHelper implements IStatsSaveHelper { @Override public void addExtraInfo(Collection statistics, IBreedingTracker breedingTracker) { IApiaristTracker tracker = (IApiaristTracker) breedingTracker; - String discoveredLine = - StatCollector.translateToLocal("for.chat.command.forestry.stats.save.key.discovered") + ":"; + String discoveredLine = StatCollector.translateToLocal("for.chat.command.forestry.stats.save.key.discovered") + + ":"; statistics.add(discoveredLine); statistics.add(StringUtil.line(discoveredLine.length())); @@ -52,8 +53,7 @@ public class BeeStatsSaveHelper implements IStatsSaveHelper { @Override public Collection getSpecies() { Collection species = new ArrayList<>(); - for (IAllele allele : - AlleleManager.alleleRegistry.getRegisteredAlleles().values()) { + for (IAllele allele : AlleleManager.alleleRegistry.getRegisteredAlleles().values()) { if (allele instanceof IAlleleBeeSpecies) { species.add((IAlleleBeeSpecies) allele); } diff --git a/src/main/java/forestry/apiculture/commands/CommandBee.java b/src/main/java/forestry/apiculture/commands/CommandBee.java index 19266346a..8b70a4068 100644 --- a/src/main/java/forestry/apiculture/commands/CommandBee.java +++ b/src/main/java/forestry/apiculture/commands/CommandBee.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.commands; diff --git a/src/main/java/forestry/apiculture/commands/CommandBeeGive.java b/src/main/java/forestry/apiculture/commands/CommandBeeGive.java index 4e6f33ea1..95705aec4 100644 --- a/src/main/java/forestry/apiculture/commands/CommandBeeGive.java +++ b/src/main/java/forestry/apiculture/commands/CommandBeeGive.java @@ -1,15 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.commands; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.EnumBeeType; import forestry.api.apiculture.IAlleleBeeSpecies; @@ -21,12 +27,6 @@ import forestry.core.commands.CommandHelpers; import forestry.core.commands.SpeciesNotFoundException; import forestry.core.commands.SubCommand; import forestry.core.commands.TemplateNotFoundException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; -import net.minecraft.command.ICommandSender; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class CommandBeeGive extends SubCommand { @@ -118,8 +118,7 @@ public class CommandBeeGive extends SubCommand { } if (species == null) { - for (IAllele allele : - AlleleManager.alleleRegistry.getRegisteredAlleles().values()) { + for (IAllele allele : AlleleManager.alleleRegistry.getRegisteredAlleles().values()) { if (allele instanceof IAlleleBeeSpecies && allele.getName().equals(speciesName)) { species = (IAlleleBeeSpecies) allele; break; @@ -157,8 +156,7 @@ public class CommandBeeGive extends SubCommand { private static String[] getSpecies() { List species = new ArrayList<>(); - for (IAllele allele : - AlleleManager.alleleRegistry.getRegisteredAlleles().values()) { + for (IAllele allele : AlleleManager.alleleRegistry.getRegisteredAlleles().values()) { if (allele instanceof IAlleleBeeSpecies) { species.add(allele.getName()); } @@ -180,6 +178,8 @@ public class CommandBeeGive extends SubCommand { public void printHelp(ICommandSender sender) { super.printHelp(sender); CommandHelpers.sendLocalizedChatMessage( - sender, "for.chat.command.forestry.beekeeping.give.available", beeTypeHelpString); + sender, + "for.chat.command.forestry.beekeeping.give.available", + beeTypeHelpString); } } diff --git a/src/main/java/forestry/apiculture/entities/AIAvoidPlayers.java b/src/main/java/forestry/apiculture/entities/AIAvoidPlayers.java index 8f5aa5a20..57811c4bf 100644 --- a/src/main/java/forestry/apiculture/entities/AIAvoidPlayers.java +++ b/src/main/java/forestry/apiculture/entities/AIAvoidPlayers.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.entities; @@ -55,7 +53,10 @@ public class AIAvoidPlayers extends EntityAIBase { } Vec3 randomTarget = RandomPositionGenerator.findRandomTargetBlockAwayFrom( - mob, 16, 7, Vec3.createVectorHelper(player.posX, player.posY, player.posZ)); + mob, + 16, + 7, + Vec3.createVectorHelper(player.posX, player.posY, player.posZ)); if (randomTarget == null) { return false; diff --git a/src/main/java/forestry/apiculture/entities/EntityBee.java b/src/main/java/forestry/apiculture/entities/EntityBee.java index 6001a25f2..cd6e9d1c6 100755 --- a/src/main/java/forestry/apiculture/entities/EntityBee.java +++ b/src/main/java/forestry/apiculture/entities/EntityBee.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.entities; +import net.minecraft.entity.EntityCreature; +import net.minecraft.entity.passive.IAnimals; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.apiculture.BeeManager; @@ -18,10 +21,6 @@ import forestry.api.apiculture.IAlleleBeeSpecies; import forestry.api.apiculture.IBee; import forestry.core.config.Constants; import forestry.core.render.ForestryResource; -import net.minecraft.entity.EntityCreature; -import net.minecraft.entity.passive.IAnimals; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; public class EntityBee extends EntityCreature implements IAnimals { diff --git a/src/main/java/forestry/apiculture/entities/EntityFXBee.java b/src/main/java/forestry/apiculture/entities/EntityFXBee.java index 52e3ebead..a871bd7f7 100644 --- a/src/main/java/forestry/apiculture/entities/EntityFXBee.java +++ b/src/main/java/forestry/apiculture/entities/EntityFXBee.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.entities; @@ -15,6 +13,7 @@ import net.minecraft.client.renderer.Tessellator; import net.minecraft.world.World; public class EntityFXBee extends EntityFX { + public EntityFXBee(World world, double x, double y, double z, int color) { super(world, x, y, z, 0.0D, 0.0D, 0.0D); @@ -71,11 +70,11 @@ public class EntityFXBee extends EntityFX { tessellator.setColorRGBA_F(particleRed, particleGreen, particleBlue, 1.0F); tessellator.addVertexWithUV(f11 - f1 * f10 - f4 * f10, f12 - f2 * f10, f13 - f3 * f10 - f5 * f10, maxU, maxV); - tessellator.addVertexWithUV( - (f11 - f1 * f10) + f4 * f10, f12 + f2 * f10, (f13 - f3 * f10) + f5 * f10, maxU, minV); + tessellator + .addVertexWithUV((f11 - f1 * f10) + f4 * f10, f12 + f2 * f10, (f13 - f3 * f10) + f5 * f10, maxU, minV); tessellator.addVertexWithUV(f11 + f1 * f10 + f4 * f10, f12 + f2 * f10, f13 + f3 * f10 + f5 * f10, minU, minV); - tessellator.addVertexWithUV( - (f11 + f1 * f10) - f4 * f10, f12 - f2 * f10, (f13 + f3 * f10) - f5 * f10, minU, maxV); + tessellator + .addVertexWithUV((f11 + f1 * f10) - f4 * f10, f12 - f2 * f10, (f13 + f3 * f10) - f5 * f10, minU, maxV); } @Override diff --git a/src/main/java/forestry/apiculture/entities/EntityMinecartApiary.java b/src/main/java/forestry/apiculture/entities/EntityMinecartApiary.java index 307126f6f..70e91750d 100644 --- a/src/main/java/forestry/apiculture/entities/EntityMinecartApiary.java +++ b/src/main/java/forestry/apiculture/entities/EntityMinecartApiary.java @@ -1,15 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.entities; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +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; + import forestry.api.apiculture.IBeeHousingInventory; import forestry.api.apiculture.IBeeListener; import forestry.api.apiculture.IBeeModifier; @@ -25,16 +33,9 @@ import forestry.apiculture.inventory.InventoryApiary; import forestry.core.config.Config; import forestry.core.inventory.IInventoryAdapter; import forestry.plugins.PluginApiculture; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -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; public class EntityMinecartApiary extends EntityMinecartBeeHousingBase implements IApiary { + private static final IBeeModifier beeModifier = new ApiaryBeeModifier(); private final IBeeListener beeListener = new ApiaryBeeListener(this); private final InventoryApiary inventory = new InventoryApiary(getAccessHandler()); diff --git a/src/main/java/forestry/apiculture/entities/EntityMinecartBeeHousingBase.java b/src/main/java/forestry/apiculture/entities/EntityMinecartBeeHousingBase.java index c2126b44e..3d20224c4 100644 --- a/src/main/java/forestry/apiculture/entities/EntityMinecartBeeHousingBase.java +++ b/src/main/java/forestry/apiculture/entities/EntityMinecartBeeHousingBase.java @@ -1,16 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.entities; +import java.io.IOException; +import java.util.Random; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + import com.mojang.authlib.GameProfile; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeekeepingLogic; @@ -28,16 +36,10 @@ import forestry.core.network.IForestryPacketServer; import forestry.core.network.IStreamableGui; import forestry.core.proxy.Proxies; import forestry.core.tiles.IClimatised; -import java.io.IOException; -import java.util.Random; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; public abstract class EntityMinecartBeeHousingBase extends EntityMinecartContainerForestry implements IBeeHousing, IGuiBeeHousingInventory, IClimatised, IStreamableGui { + private static final Random random = new Random(); private static final int beeFXInterval = 4; private static final int pollenFXInterval = 50; diff --git a/src/main/java/forestry/apiculture/entities/EntityMinecartBeehouse.java b/src/main/java/forestry/apiculture/entities/EntityMinecartBeehouse.java index b935f57df..12d2106d1 100644 --- a/src/main/java/forestry/apiculture/entities/EntityMinecartBeehouse.java +++ b/src/main/java/forestry/apiculture/entities/EntityMinecartBeehouse.java @@ -1,15 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.entities; +import java.util.Collections; +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; + import forestry.api.apiculture.DefaultBeeListener; import forestry.api.apiculture.IBeeHousingInventory; import forestry.api.apiculture.IBeeListener; @@ -22,14 +28,9 @@ import forestry.apiculture.gui.GuiBeeHousing; import forestry.core.config.Config; import forestry.core.inventory.IInventoryAdapter; import forestry.plugins.PluginApiculture; -import java.util.Collections; -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; public class EntityMinecartBeehouse extends EntityMinecartBeeHousingBase { + private static final IBeeModifier beeModifier = new BeehouseBeeModifier(); private static final IBeeListener beeListener = new DefaultBeeListener(); private final InventoryBeeHousing beeInventory = new InventoryBeeHousing(9, getAccessHandler()); diff --git a/src/main/java/forestry/apiculture/flowers/Flower.java b/src/main/java/forestry/apiculture/flowers/Flower.java index a848cf861..78d2478c8 100644 --- a/src/main/java/forestry/apiculture/flowers/Flower.java +++ b/src/main/java/forestry/apiculture/flowers/Flower.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.flowers; -import com.google.common.base.Objects; -import forestry.api.genetics.IFlower; import javax.annotation.Nonnull; + import net.minecraft.block.Block; import net.minecraftforge.oredict.OreDictionary; +import com.google.common.base.Objects; +import forestry.api.genetics.IFlower; + final class Flower implements IFlower { private final Block block; @@ -41,8 +41,7 @@ final class Flower implements IFlower { IFlower flower = (IFlower) obj; return Block.isEqualTo(this.block, flower.getBlock()) - && (this.meta == OreDictionary.WILDCARD_VALUE - || flower.getMeta() == OreDictionary.WILDCARD_VALUE + && (this.meta == OreDictionary.WILDCARD_VALUE || flower.getMeta() == OreDictionary.WILDCARD_VALUE || this.meta == flower.getMeta()); } @@ -78,10 +77,6 @@ final class Flower implements IFlower { @Override public String toString() { - return Objects.toStringHelper(this) - .add("block", block) - .add("meta", meta) - .add("weight", weight) - .toString(); + return Objects.toStringHelper(this).add("block", block).add("meta", meta).add("weight", weight).toString(); } } diff --git a/src/main/java/forestry/apiculture/flowers/FlowerProvider.java b/src/main/java/forestry/apiculture/flowers/FlowerProvider.java index 1d0a333fa..f800ccb7a 100644 --- a/src/main/java/forestry/apiculture/flowers/FlowerProvider.java +++ b/src/main/java/forestry/apiculture/flowers/FlowerProvider.java @@ -1,26 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.flowers; +import java.util.EnumSet; +import java.util.Set; + +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.common.EnumPlantType; + import forestry.api.apiculture.FlowerManager; import forestry.api.genetics.IFlower; import forestry.api.genetics.IFlowerProvider; import forestry.api.genetics.IIndividual; import forestry.api.genetics.IPollinatable; import forestry.core.utils.StringUtil; -import java.util.EnumSet; -import java.util.Set; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.common.EnumPlantType; public class FlowerProvider implements IFlowerProvider { diff --git a/src/main/java/forestry/apiculture/flowers/FlowerRegistry.java b/src/main/java/forestry/apiculture/flowers/FlowerRegistry.java index 73fca4665..4828cf302 100644 --- a/src/main/java/forestry/apiculture/flowers/FlowerRegistry.java +++ b/src/main/java/forestry/apiculture/flowers/FlowerRegistry.java @@ -1,19 +1,39 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.flowers; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; +import java.util.Random; +import java.util.Set; +import java.util.TreeMap; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockFlowerPot; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.tileentity.TileEntityFlowerPot; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; +import net.minecraftforge.common.IPlantable; +import net.minecraftforge.oredict.OreDictionary; + import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.HashMultimap; import com.google.common.collect.ImmutableSet; import com.google.common.collect.Sets; + import cpw.mods.fml.common.registry.GameRegistry; import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.FlowerManager; @@ -32,25 +52,6 @@ import forestry.core.utils.Log; import forestry.core.utils.vect.MutableVect; import forestry.core.utils.vect.Vect; import forestry.plugins.PluginManager; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import java.util.Random; -import java.util.Set; -import java.util.TreeMap; -import net.minecraft.block.Block; -import net.minecraft.block.BlockFlowerPot; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.tileentity.TileEntityFlowerPot; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraftforge.common.IPlantable; -import net.minecraftforge.oredict.OreDictionary; public final class FlowerRegistry implements IFlowerRegistry, IFlowerGrowthHelper { @@ -96,8 +97,10 @@ public final class FlowerRegistry implements IFlowerRegistry, IFlowerGrowthHelpe public void registerAcceptableFlowerRule(IFlowerAcceptableRule acceptableFlower, String... flowerTypes) { for (String flowerType : flowerTypes) { if (defaultFlowerTypes.contains(flowerType)) { - Log.severe("IFlowerAcceptableRules are too slow to be applied to Forestry's built-in flower type: " - + flowerType + "."); + Log.severe( + "IFlowerAcceptableRules are too slow to be applied to Forestry's built-in flower type: " + + flowerType + + "."); } else { registeredRules.put(flowerType, acceptableFlower); } @@ -173,7 +176,13 @@ public final class FlowerRegistry implements IFlowerRegistry, IFlowerGrowthHelpe } if (isAcceptedFlower( - flowerType, acceptedBlocks, acceptedFlowers, world, posBlock.x, posBlock.y, posBlock.z)) { + flowerType, + acceptedBlocks, + acceptedFlowers, + world, + posBlock.x, + posBlock.y, + posBlock.z)) { return new ChunkCoordinates(posBlock.x, posBlock.y, posBlock.z); } } @@ -202,14 +211,8 @@ public final class FlowerRegistry implements IFlowerRegistry, IFlowerGrowthHelpe return isAcceptedFlower(flowerType, acceptedBlocks, acceptedFlowers, world, x, y, z); } - private static boolean isAcceptedFlower( - String flowerType, - Set acceptedBlocks, - Set acceptedFlowers, - World world, - int x, - int y, - int z) { + private static boolean isAcceptedFlower(String flowerType, Set acceptedBlocks, Set acceptedFlowers, + World world, int x, int y, int z) { Block block = world.getBlock(x, y, z); final int meta; @@ -331,7 +334,8 @@ public final class FlowerRegistry implements IFlowerRegistry, IFlowerGrowthHelpe registerGrowthRule(new GrowthRuleMycelium(), FlowerManager.FlowerTypeMushrooms); registerGrowthRule(new GrowthRuleNone(), FlowerManager.FlowerTypeEnd); registerGrowthRule( - new GrowthRuleFertilize(Blocks.melon_stem, Blocks.pumpkin_stem), FlowerManager.FlowerTypeGourd); + new GrowthRuleFertilize(Blocks.melon_stem, Blocks.pumpkin_stem), + FlowerManager.FlowerTypeGourd); registerGrowthRule(new GrowthRuleFertilize(Blocks.wheat), FlowerManager.FlowerTypeWheat); } diff --git a/src/main/java/forestry/apiculture/flowers/GrowthRuleDirtGrass.java b/src/main/java/forestry/apiculture/flowers/GrowthRuleDirtGrass.java index 3d3bb9936..67f62d771 100644 --- a/src/main/java/forestry/apiculture/flowers/GrowthRuleDirtGrass.java +++ b/src/main/java/forestry/apiculture/flowers/GrowthRuleDirtGrass.java @@ -1,36 +1,29 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.flowers; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + import forestry.api.genetics.IFlower; import forestry.api.genetics.IFlowerGrowthHelper; import forestry.api.genetics.IFlowerGrowthRule; import forestry.api.genetics.IFlowerRegistry; import forestry.api.genetics.IIndividual; import forestry.core.config.Constants; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.world.World; public class GrowthRuleDirtGrass implements IFlowerGrowthRule { @Override - public boolean growFlower( - IFlowerRegistry flowerRegistry, - String flowerType, - World world, - IIndividual individual, - int x, - int y, - int z) { + public boolean growFlower(IFlowerRegistry flowerRegistry, String flowerType, World world, IIndividual individual, + int x, int y, int z) { if (!world.isAirBlock(x, y, z)) { return false; } diff --git a/src/main/java/forestry/apiculture/flowers/GrowthRuleFertilize.java b/src/main/java/forestry/apiculture/flowers/GrowthRuleFertilize.java index de6907427..df06b09a0 100644 --- a/src/main/java/forestry/apiculture/flowers/GrowthRuleFertilize.java +++ b/src/main/java/forestry/apiculture/flowers/GrowthRuleFertilize.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.flowers; +import java.util.Arrays; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.world.World; + import forestry.api.genetics.IFlowerGrowthHelper; import forestry.api.genetics.IFlowerGrowthRule; import forestry.api.genetics.IFlowerRegistry; import forestry.api.genetics.IIndividual; -import java.util.Arrays; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.world.World; public class GrowthRuleFertilize implements IFlowerGrowthRule { @@ -28,8 +28,8 @@ public class GrowthRuleFertilize implements IFlowerGrowthRule { } @Override - public boolean growFlower( - IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, int z) { + public boolean growFlower(IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, + int z) { return growFlower(world, x, y, z); } diff --git a/src/main/java/forestry/apiculture/flowers/GrowthRuleFlowerPot.java b/src/main/java/forestry/apiculture/flowers/GrowthRuleFlowerPot.java index 8113c0687..09aadb05f 100644 --- a/src/main/java/forestry/apiculture/flowers/GrowthRuleFlowerPot.java +++ b/src/main/java/forestry/apiculture/flowers/GrowthRuleFlowerPot.java @@ -1,31 +1,30 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.flowers; -import forestry.api.apiculture.FlowerManager; -import forestry.api.genetics.IFlowerGrowthHelper; -import forestry.api.genetics.IFlowerGrowthRule; -import forestry.api.genetics.IFlowerRegistry; -import forestry.api.genetics.IIndividual; import net.minecraft.block.Block; import net.minecraft.block.BlockFlowerPot; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityFlowerPot; import net.minecraft.world.World; +import forestry.api.apiculture.FlowerManager; +import forestry.api.genetics.IFlowerGrowthHelper; +import forestry.api.genetics.IFlowerGrowthRule; +import forestry.api.genetics.IFlowerRegistry; +import forestry.api.genetics.IIndividual; + public class GrowthRuleFlowerPot implements IFlowerGrowthRule { @Override - public boolean growFlower( - IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, int z) { + public boolean growFlower(IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, + int z) { return growFlower(flowerType, world, x, y, z); } diff --git a/src/main/java/forestry/apiculture/flowers/GrowthRuleMycelium.java b/src/main/java/forestry/apiculture/flowers/GrowthRuleMycelium.java index 8e5b8b63a..e730599ba 100644 --- a/src/main/java/forestry/apiculture/flowers/GrowthRuleMycelium.java +++ b/src/main/java/forestry/apiculture/flowers/GrowthRuleMycelium.java @@ -1,30 +1,29 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.flowers; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + import forestry.api.genetics.IFlower; import forestry.api.genetics.IFlowerGrowthHelper; import forestry.api.genetics.IFlowerGrowthRule; import forestry.api.genetics.IFlowerRegistry; import forestry.api.genetics.IIndividual; import forestry.core.config.Constants; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.world.World; public class GrowthRuleMycelium implements IFlowerGrowthRule { @Override - public boolean growFlower( - IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, int z) { + public boolean growFlower(IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, + int z) { if (!world.isAirBlock(x, y, z)) { return false; } diff --git a/src/main/java/forestry/apiculture/flowers/GrowthRuleNone.java b/src/main/java/forestry/apiculture/flowers/GrowthRuleNone.java index 5c00d615b..5e672ca41 100644 --- a/src/main/java/forestry/apiculture/flowers/GrowthRuleNone.java +++ b/src/main/java/forestry/apiculture/flowers/GrowthRuleNone.java @@ -1,26 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.flowers; +import net.minecraft.world.World; + import forestry.api.genetics.IFlowerGrowthHelper; import forestry.api.genetics.IFlowerGrowthRule; import forestry.api.genetics.IFlowerRegistry; import forestry.api.genetics.IIndividual; -import net.minecraft.world.World; public class GrowthRuleNone implements IFlowerGrowthRule { @Override - public boolean growFlower( - IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, int z) { + public boolean growFlower(IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, + int z) { return true; } diff --git a/src/main/java/forestry/apiculture/flowers/GrowthRuleSnow.java b/src/main/java/forestry/apiculture/flowers/GrowthRuleSnow.java index 847ede867..dc38c27a1 100644 --- a/src/main/java/forestry/apiculture/flowers/GrowthRuleSnow.java +++ b/src/main/java/forestry/apiculture/flowers/GrowthRuleSnow.java @@ -1,30 +1,29 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.flowers; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + import forestry.api.genetics.IFlower; import forestry.api.genetics.IFlowerGrowthHelper; import forestry.api.genetics.IFlowerGrowthRule; import forestry.api.genetics.IFlowerRegistry; import forestry.api.genetics.IIndividual; import forestry.core.config.Constants; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.world.World; public class GrowthRuleSnow implements IFlowerGrowthRule { @Override - public boolean growFlower( - IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, int z) { + public boolean growFlower(IFlowerRegistry fr, String flowerType, World world, IIndividual individual, int x, int y, + int z) { if (world.getBlock(x, y, z) != Blocks.snow) { return false; } diff --git a/src/main/java/forestry/apiculture/genetics/ApiaristTracker.java b/src/main/java/forestry/apiculture/genetics/ApiaristTracker.java index 6b8e0e602..7590d9d8d 100755 --- a/src/main/java/forestry/apiculture/genetics/ApiaristTracker.java +++ b/src/main/java/forestry/apiculture/genetics/ApiaristTracker.java @@ -1,15 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.EnumBeeChromosome; import forestry.api.apiculture.IApiaristTracker; @@ -17,8 +18,6 @@ import forestry.api.genetics.IBreedingTracker; import forestry.api.genetics.IIndividual; import forestry.api.genetics.ISpeciesRoot; import forestry.core.genetics.BreedingTracker; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; public class ApiaristTracker extends BreedingTracker implements IApiaristTracker { diff --git a/src/main/java/forestry/apiculture/genetics/Bee.java b/src/main/java/forestry/apiculture/genetics/Bee.java index 4c4dde63e..d0382b1cc 100644 --- a/src/main/java/forestry/apiculture/genetics/Bee.java +++ b/src/main/java/forestry/apiculture/genetics/Bee.java @@ -1,16 +1,31 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Random; +import java.util.Set; + +import net.minecraft.item.EnumRarity; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + import com.mojang.authlib.GameProfile; + import forestry.api.apiculture.*; import forestry.api.core.BiomeHelper; import forestry.api.core.EnumHumidity; @@ -38,20 +53,6 @@ import forestry.core.utils.GeneticsUtil; import forestry.core.utils.Log; import forestry.core.utils.StringUtil; import forestry.core.utils.vect.Vect; -import java.util.ArrayList; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Random; -import java.util.Set; -import net.minecraft.item.EnumRarity; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; public class Bee extends IndividualLiving implements IBee { @@ -280,8 +281,8 @@ public class Bee extends IndividualLiving implements IBee { EnumTemperature beeBaseTemperature = species.getTemperature(); EnumTolerance beeToleranceTemperature = genome.getToleranceTemp(); - if (!AlleleManager.climateHelper.isWithinLimits( - actualTemperature, beeBaseTemperature, beeToleranceTemperature)) { + if (!AlleleManager.climateHelper + .isWithinLimits(actualTemperature, beeBaseTemperature, beeToleranceTemperature)) { if (beeBaseTemperature.ordinal() > actualTemperature.ordinal()) { errorStates.add(EnumErrorCode.TOO_COLD); } else { @@ -368,10 +369,9 @@ public class Bee extends IndividualLiving implements IBee { IAlleleBeeSpecies primary = genome.getPrimary(); IAlleleBeeSpecies secondary = genome.getSecondary(); if (!isPureBred(EnumBeeChromosome.SPECIES)) { - list.add(EnumChatFormatting.BLUE - + StringUtil.localize("bees.hybrid") - .replaceAll("%PRIMARY", primary.getName()) - .replaceAll("%SECONDARY", secondary.getName())); + list.add( + EnumChatFormatting.BLUE + StringUtil.localize("bees.hybrid") + .replaceAll("%PRIMARY", primary.getName()).replaceAll("%SECONDARY", secondary.getName())); } if (generation > 0) { @@ -386,19 +386,18 @@ public class Bee extends IndividualLiving implements IBee { rarity = EnumRarity.common; } - String generationString = - rarity.rarityColor + StringUtil.localizeAndFormat("gui.beealyzer.generations", generation); + String generationString = rarity.rarityColor + + StringUtil.localizeAndFormat("gui.beealyzer.generations", generation); list.add(generationString); } IAllele speedAllele = genome.getActiveAllele(EnumBeeChromosome.SPEED); - IAlleleTolerance tempToleranceAllele = - (IAlleleTolerance) getGenome().getActiveAllele(EnumBeeChromosome.TEMPERATURE_TOLERANCE); - IAlleleTolerance humidToleranceAllele = - (IAlleleTolerance) getGenome().getActiveAllele(EnumBeeChromosome.HUMIDITY_TOLERANCE); + IAlleleTolerance tempToleranceAllele = (IAlleleTolerance) getGenome() + .getActiveAllele(EnumBeeChromosome.TEMPERATURE_TOLERANCE); + IAlleleTolerance humidToleranceAllele = (IAlleleTolerance) getGenome() + .getActiveAllele(EnumBeeChromosome.HUMIDITY_TOLERANCE); - String unlocalizedCustomSpeed = - "tooltip.worker." + speedAllele.getUnlocalizedName().replaceAll("(.*)\\.", ""); + String unlocalizedCustomSpeed = "tooltip.worker." + speedAllele.getUnlocalizedName().replaceAll("(.*)\\.", ""); String speed; if (StringUtil.canTranslate(unlocalizedCustomSpeed)) { speed = StringUtil.localize(unlocalizedCustomSpeed); @@ -406,13 +405,15 @@ public class Bee extends IndividualLiving implements IBee { speed = speedAllele.getName() + ' ' + StringUtil.localize("gui.worker"); } - String lifespan = - genome.getActiveAllele(EnumBeeChromosome.LIFESPAN).getName() + ' ' + StringUtil.localize("gui.life"); + String lifespan = genome.getActiveAllele(EnumBeeChromosome.LIFESPAN).getName() + ' ' + + StringUtil.localize("gui.life"); String tempTolerance = EnumChatFormatting.GREEN + "T: " - + AlleleManager.climateHelper.toDisplay(genome.getPrimary().getTemperature()) + " / " + + AlleleManager.climateHelper.toDisplay(genome.getPrimary().getTemperature()) + + " / " + tempToleranceAllele.getName(); String humidTolerance = EnumChatFormatting.GREEN + "H: " - + AlleleManager.climateHelper.toDisplay(genome.getPrimary().getHumidity()) + " / " + + AlleleManager.climateHelper.toDisplay(genome.getPrimary().getHumidity()) + + " / " + humidToleranceAllele.getName(); String flowers = genome.getFlowerProvider().getDescription(); String jubilance = null; @@ -441,8 +442,8 @@ public class Bee extends IndividualLiving implements IBee { public void age(World world, float housingLifespanModifier) { IBeekeepingMode mode = BeeManager.beeRoot.getBeekeepingMode(world); IBeeModifier beeModifier = mode.getBeeModifier(); - float finalModifier = - housingLifespanModifier * beeModifier.getLifespanModifier(genome, mate, housingLifespanModifier); + float finalModifier = housingLifespanModifier + * beeModifier.getLifespanModifier(genome, mate, housingLifespanModifier); super.age(world, finalModifier); } @@ -530,8 +531,7 @@ public class Bee extends IndividualLiving implements IBee { // / Specialty products if (primary.isJubilant(genome, housing) && secondary.isJubilant(genome, housing)) { - for (Map.Entry entry : - primary.getSpecialtyChances().entrySet()) { + for (Map.Entry entry : primary.getSpecialtyChances().entrySet()) { if (housing.getWorld().rand.nextFloat() < getFinalChance(entry.getValue(), speed, prodModifier, 1f)) { products.add(entry.getKey().copy()); } @@ -540,22 +540,20 @@ public class Bee extends IndividualLiving implements IBee { ItemStack[] productsArray = products.toArray(new ItemStack[products.size()]); ChunkCoordinates housingCoordinates = housing.getCoordinates(); - return genome.getFlowerProvider() - .affectProducts( - housing.getWorld(), - this, - housingCoordinates.posX, - housingCoordinates.posY, - housingCoordinates.posZ, - productsArray); + return genome.getFlowerProvider().affectProducts( + housing.getWorld(), + this, + housingCoordinates.posX, + housingCoordinates.posY, + housingCoordinates.posZ, + productsArray); } public static float getFinalChance(float chance, float beeSpeed, float productionModifier, float t) { chance *= 100f; return (float) (((1f + t / 6f) * Math.sqrt(chance) * 2f * (1f + beeSpeed) - + Math.pow(productionModifier, Math.cbrt(chance)) - - 3f) - / 100f); + + Math.pow(productionModifier, Math.cbrt(chance)) + - 3f) / 100f); } /* REPRODUCTION */ @@ -588,10 +586,12 @@ public class Bee extends IndividualLiving implements IBee { List bees = new ArrayList<>(); ChunkCoordinates housingCoordinates = housing.getCoordinates(); - int toCreate = BeeManager.beeRoot - .getBeekeepingMode(world) - .getFinalFertility( - this, world, housingCoordinates.posX, housingCoordinates.posY, housingCoordinates.posZ); + int toCreate = BeeManager.beeRoot.getBeekeepingMode(world).getFinalFertility( + this, + world, + housingCoordinates.posX, + housingCoordinates.posY, + housingCoordinates.posZ); if (toCreate <= 0) { toCreate = 1; @@ -764,8 +764,8 @@ public class Bee extends IndividualLiving implements IBee { Vect randomPos = Vect.getRandomPositionInArea(random, area); Vect posBlock = Vect.add(housingPos, randomPos, offset); - ICheckPollinatable checkPollinatable = - GeneticsUtil.getCheckPollinatable(world, posBlock.x, posBlock.y, posBlock.z); + ICheckPollinatable checkPollinatable = GeneticsUtil + .getCheckPollinatable(world, posBlock.x, posBlock.y, posBlock.z); if (checkPollinatable == null) { continue; } @@ -777,8 +777,8 @@ public class Bee extends IndividualLiving implements IBee { continue; } - IPollinatable realPollinatable = - GeneticsUtil.getOrCreatePollinatable(housing.getOwner(), world, posBlock.x, posBlock.y, posBlock.z); + IPollinatable realPollinatable = GeneticsUtil + .getOrCreatePollinatable(housing.getOwner(), world, posBlock.x, posBlock.y, posBlock.z); if (realPollinatable != null) { realPollinatable.mateWith(pollen); @@ -814,8 +814,8 @@ public class Bee extends IndividualLiving implements IBee { Vect randomPos = Vect.getRandomPositionInArea(random, area); Vect posBlock = Vect.add(housingPos, randomPos, offset); - if (FlowerManager.flowerRegistry.growFlower( - provider.getFlowerType(), world, this, posBlock.x, posBlock.y, posBlock.z)) { + if (FlowerManager.flowerRegistry + .growFlower(provider.getFlowerType(), world, this, posBlock.x, posBlock.y, posBlock.z)) { break; } } diff --git a/src/main/java/forestry/apiculture/genetics/BeeBranchDefinition.java b/src/main/java/forestry/apiculture/genetics/BeeBranchDefinition.java index 759cf3af1..f2b5765f3 100644 --- a/src/main/java/forestry/apiculture/genetics/BeeBranchDefinition.java +++ b/src/main/java/forestry/apiculture/genetics/BeeBranchDefinition.java @@ -1,5 +1,8 @@ package forestry.apiculture.genetics; +import java.util.Arrays; +import java.util.Locale; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.EnumBeeChromosome; import forestry.api.genetics.IAllele; @@ -8,15 +11,15 @@ import forestry.apiculture.genetics.alleles.AlleleEffect; import forestry.core.genetics.IBranchDefinition; import forestry.core.genetics.alleles.AlleleHelper; import forestry.core.genetics.alleles.EnumAllele; -import java.util.Arrays; -import java.util.Locale; public enum BeeBranchDefinition implements IBranchDefinition { + HONEY("Apis"), NOBLE("Probapis"), INDUSTRIOUS("Industrapis"), HEROIC("Herapis"), INFERNAL("Diapis") { + @Override protected void setBranchProperties(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.DOWN_2); @@ -26,6 +29,7 @@ public enum BeeBranchDefinition implements IBranchDefinition { } }, AUSTERE("Modapis") { + @Override protected void setBranchProperties(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.BOTH_1); @@ -35,6 +39,7 @@ public enum BeeBranchDefinition implements IBranchDefinition { } }, TROPICAL("Caldapis") { + @Override protected void setBranchProperties(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.UP_1); @@ -44,6 +49,7 @@ public enum BeeBranchDefinition implements IBranchDefinition { } }, END("Finapis") { + @Override protected void setBranchProperties(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumBeeChromosome.FERTILITY, EnumAllele.Fertility.LOW); @@ -57,6 +63,7 @@ public enum BeeBranchDefinition implements IBranchDefinition { } }, FROZEN("Coagapis") { + @Override protected void setBranchProperties(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.UP_1); @@ -66,6 +73,7 @@ public enum BeeBranchDefinition implements IBranchDefinition { } }, VENGEFUL("Punapis") { + @Override protected void setBranchProperties(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumBeeChromosome.TERRITORY, EnumAllele.Territory.LARGEST); @@ -73,6 +81,7 @@ public enum BeeBranchDefinition implements IBranchDefinition { } }, FESTIVE("Festapis") { + @Override protected void setBranchProperties(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); @@ -82,6 +91,7 @@ public enum BeeBranchDefinition implements IBranchDefinition { } }, AGRARIAN("Rustapis") { + @Override protected void setBranchProperties(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); @@ -91,6 +101,7 @@ public enum BeeBranchDefinition implements IBranchDefinition { } }, BOGGY("Paludapis") { + @Override protected void setBranchProperties(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumBeeChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.MUSHROOMS); @@ -99,6 +110,7 @@ public enum BeeBranchDefinition implements IBranchDefinition { } }, MONASTIC("Monapis") { + @Override protected void setBranchProperties(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWER); @@ -141,8 +153,8 @@ public enum BeeBranchDefinition implements IBranchDefinition { AlleleHelper.instance.set(defaultTemplate, EnumBeeChromosome.SPEED, EnumAllele.Speed.SLOWEST); AlleleHelper.instance.set(defaultTemplate, EnumBeeChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTER); AlleleHelper.instance.set(defaultTemplate, EnumBeeChromosome.FERTILITY, EnumAllele.Fertility.NORMAL); - AlleleHelper.instance.set( - defaultTemplate, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.NONE); + AlleleHelper.instance + .set(defaultTemplate, EnumBeeChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.NONE); AlleleHelper.instance.set(defaultTemplate, EnumBeeChromosome.NOCTURNAL, false); AlleleHelper.instance.set(defaultTemplate, EnumBeeChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.NONE); AlleleHelper.instance.set(defaultTemplate, EnumBeeChromosome.TOLERANT_FLYER, false); diff --git a/src/main/java/forestry/apiculture/genetics/BeeDefinition.java b/src/main/java/forestry/apiculture/genetics/BeeDefinition.java index 7e05f1eca..9153a7b71 100644 --- a/src/main/java/forestry/apiculture/genetics/BeeDefinition.java +++ b/src/main/java/forestry/apiculture/genetics/BeeDefinition.java @@ -1,15 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics; +import java.awt.Color; +import java.util.Arrays; +import java.util.EnumSet; +import java.util.Locale; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.BiomeDictionary; + +import org.apache.commons.lang3.text.WordUtils; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.EnumBeeChromosome; import forestry.api.apiculture.EnumBeeType; @@ -27,18 +36,12 @@ import forestry.core.genetics.alleles.AlleleHelper; import forestry.core.genetics.alleles.EnumAllele; import forestry.plugins.PluginApiculture; import forestry.plugins.PluginCore; -import java.awt.Color; -import java.util.Arrays; -import java.util.EnumSet; -import java.util.Locale; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.BiomeDictionary; -import org.apache.commons.lang3.text.WordUtils; public enum BeeDefinition implements IBeeDefinition { + /* HONEY BRANCH */ FOREST(BeeBranchDefinition.HONEY, "nigrocincta", true, new Color(0x19d0ec), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.HONEY, 1), 0.30f); @@ -56,6 +59,7 @@ public enum BeeDefinition implements IBeeDefinition { } }, MEADOWS(BeeBranchDefinition.HONEY, "florea", true, new Color(0xef131e), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.HONEY, 1), 0.30f); @@ -72,6 +76,7 @@ public enum BeeDefinition implements IBeeDefinition { } }, COMMON(BeeBranchDefinition.HONEY, "cerana", true, new Color(0xb2b2b2), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.HONEY, 1), 0.35f); @@ -94,6 +99,7 @@ public enum BeeDefinition implements IBeeDefinition { } }, CULTIVATED(BeeBranchDefinition.HONEY, "mellifera", true, new Color(0x5734ec), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.HONEY, 1), 0.40f); @@ -115,6 +121,7 @@ public enum BeeDefinition implements IBeeDefinition { /* NOBLE BRANCH */ NOBLE(BeeBranchDefinition.NOBLE, "nobilis", false, new Color(0xec9a19), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.DRIPPING, 1), 0.20f); @@ -133,6 +140,7 @@ public enum BeeDefinition implements IBeeDefinition { } }, MAJESTIC(BeeBranchDefinition.NOBLE, "regalis", true, new Color(0x7f0000), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.DRIPPING, 1), 0.30f); @@ -151,12 +159,11 @@ public enum BeeDefinition implements IBeeDefinition { } }, IMPERIAL(BeeBranchDefinition.NOBLE, "imperatorius", false, new Color(0xa3e02f), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.DRIPPING, 1), 0.20f) - .addProduct(PluginApiculture.items.royalJelly.getItemStack(), 0.15f) - .setHasEffect(); + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.DRIPPING, 1), 0.20f) + .addProduct(PluginApiculture.items.royalJelly.getItemStack(), 0.15f).setHasEffect(); } @Override @@ -174,6 +181,7 @@ public enum BeeDefinition implements IBeeDefinition { /* INDUSTRIOUS BRANCH */ DILIGENT(BeeBranchDefinition.INDUSTRIOUS, "sedulus", false, new Color(0xc219ec), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.STRINGY, 1), 0.20f); @@ -192,6 +200,7 @@ public enum BeeDefinition implements IBeeDefinition { } }, UNWEARY(BeeBranchDefinition.INDUSTRIOUS, "assiduus", true, new Color(0x19ec5a), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.STRINGY, 1), 0.30f); @@ -209,10 +218,10 @@ public enum BeeDefinition implements IBeeDefinition { } }, INDUSTRIOUS(BeeBranchDefinition.INDUSTRIOUS, "industria", false, new Color(0xffffff), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.STRINGY, 1), 0.20f) + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.STRINGY, 1), 0.20f) .addProduct(PluginApiculture.items.pollenCluster.get(EnumPollenCluster.NORMAL, 1), 0.15f) .setHasEffect(); } @@ -232,11 +241,10 @@ public enum BeeDefinition implements IBeeDefinition { /* HEROIC BRANCH */ STEADFAST(BeeBranchDefinition.HEROIC, "legio", false, new Color(0x4d2b15), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.COCOA, 1), 0.20f) - .setHasEffect(); + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.COCOA, 1), 0.20f).setHasEffect(); } @Override @@ -253,10 +261,10 @@ public enum BeeDefinition implements IBeeDefinition { } }, VALIANT(BeeBranchDefinition.HEROIC, "centurio", true, new Color(0x626bdd), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.COCOA, 1), 0.30f) + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.COCOA, 1), 0.30f) .addSpecialty(new ItemStack(Items.sugar), 0.15f); } @@ -274,11 +282,10 @@ public enum BeeDefinition implements IBeeDefinition { } }, HEROIC(BeeBranchDefinition.HEROIC, "kraphti", false, new Color(0xb3d5e4), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.COCOA, 1), 0.40f) - .setHasEffect(); + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.COCOA, 1), 0.40f).setHasEffect(); } @Override @@ -298,12 +305,11 @@ public enum BeeDefinition implements IBeeDefinition { /* INFERNAL BRANCH */ SINISTER(BeeBranchDefinition.INFERNAL, "caecus", false, new Color(0xb3d5e4), new Color(0x9a2323)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.SIMMERING, 1), 0.45f) - .setTemperature(EnumTemperature.HELLISH) - .setHumidity(EnumHumidity.ARID); + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.SIMMERING, 1), 0.45f) + .setTemperature(EnumTemperature.HELLISH).setHumidity(EnumHumidity.ARID); } @Override @@ -321,12 +327,11 @@ public enum BeeDefinition implements IBeeDefinition { } }, FIENDISH(BeeBranchDefinition.INFERNAL, "diabolus", true, new Color(0xd7bee5), new Color(0x9a2323)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.SIMMERING, 1), 0.55f) - .addProduct(PluginCore.items.ash.getItemStack(), 0.15f) - .setTemperature(EnumTemperature.HELLISH) + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.SIMMERING, 1), 0.55f) + .addProduct(PluginCore.items.ash.getItemStack(), 0.15f).setTemperature(EnumTemperature.HELLISH) .setHumidity(EnumHumidity.ARID); } @@ -345,14 +350,12 @@ public enum BeeDefinition implements IBeeDefinition { } }, DEMONIC(BeeBranchDefinition.INFERNAL, "draco", false, new Color(0xf4e400), new Color(0x9a2323)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.SIMMERING, 1), 0.45f) - .addProduct(new ItemStack(Items.glowstone_dust), 0.15f) - .setHasEffect() - .setTemperature(EnumTemperature.HELLISH) - .setHumidity(EnumHumidity.ARID); + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.SIMMERING, 1), 0.45f) + .addProduct(new ItemStack(Items.glowstone_dust), 0.15f).setHasEffect() + .setTemperature(EnumTemperature.HELLISH).setHumidity(EnumHumidity.ARID); } @Override @@ -370,12 +373,11 @@ public enum BeeDefinition implements IBeeDefinition { /* AUSTERE BRANCH */ MODEST(BeeBranchDefinition.AUSTERE, "modicus", false, new Color(0xc5be86), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.PARCHED, 1), 0.20f) - .setTemperature(EnumTemperature.HOT) - .setHumidity(EnumHumidity.ARID); + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.PARCHED, 1), 0.20f) + .setTemperature(EnumTemperature.HOT).setHumidity(EnumHumidity.ARID); } @Override @@ -390,12 +392,11 @@ public enum BeeDefinition implements IBeeDefinition { } }, FRUGAL(BeeBranchDefinition.AUSTERE, "permodestus", true, new Color(0xe8dcb1), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.PARCHED, 1), 0.30f) - .setTemperature(EnumTemperature.HOT) - .setHumidity(EnumHumidity.ARID); + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.PARCHED, 1), 0.30f) + .setTemperature(EnumTemperature.HOT).setHumidity(EnumHumidity.ARID); } @Override @@ -406,23 +407,19 @@ public enum BeeDefinition implements IBeeDefinition { @Override protected void registerMutations() { - registerMutation(MODEST, SINISTER, 16) - .restrictTemperature(EnumTemperature.HOT, EnumTemperature.HELLISH) + registerMutation(MODEST, SINISTER, 16).restrictTemperature(EnumTemperature.HOT, EnumTemperature.HELLISH) .restrictHumidity(EnumHumidity.ARID); - registerMutation(MODEST, FIENDISH, 10) - .restrictTemperature(EnumTemperature.HOT, EnumTemperature.HELLISH) + registerMutation(MODEST, FIENDISH, 10).restrictTemperature(EnumTemperature.HOT, EnumTemperature.HELLISH) .restrictHumidity(EnumHumidity.ARID); } }, AUSTERE(BeeBranchDefinition.AUSTERE, "correpere", false, new Color(0xfffac2), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.PARCHED, 1), 0.20f) - .addSpecialty(PluginApiculture.items.beeComb.get(EnumHoneyComb.POWDERY, 1), 0.50f) - .setHasEffect() - .setTemperature(EnumTemperature.HOT) - .setHumidity(EnumHumidity.ARID); + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.PARCHED, 1), 0.20f) + .addSpecialty(PluginApiculture.items.beeComb.get(EnumHoneyComb.POWDERY, 1), 0.50f).setHasEffect() + .setTemperature(EnumTemperature.HOT).setHumidity(EnumHumidity.ARID); } @Override @@ -435,20 +432,18 @@ public enum BeeDefinition implements IBeeDefinition { @Override protected void registerMutations() { - registerMutation(MODEST, FRUGAL, 8) - .restrictTemperature(EnumTemperature.HOT, EnumTemperature.HELLISH) + registerMutation(MODEST, FRUGAL, 8).restrictTemperature(EnumTemperature.HOT, EnumTemperature.HELLISH) .restrictHumidity(EnumHumidity.ARID); } }, /* TROPICAL BRANCH */ TROPICAL(BeeBranchDefinition.TROPICAL, "mendelia", false, new Color(0x378020), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.SILKY, 1), 0.20f) - .setTemperature(EnumTemperature.WARM) - .setHumidity(EnumHumidity.DAMP); + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.SILKY, 1), 0.20f) + .setTemperature(EnumTemperature.WARM).setHumidity(EnumHumidity.DAMP); } @Override @@ -463,12 +458,11 @@ public enum BeeDefinition implements IBeeDefinition { } }, EXOTIC(BeeBranchDefinition.TROPICAL, "darwini", true, new Color(0x304903), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.SILKY, 1), 0.30f) - .setTemperature(EnumTemperature.WARM) - .setHumidity(EnumHumidity.DAMP); + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.SILKY, 1), 0.30f) + .setTemperature(EnumTemperature.WARM).setHumidity(EnumHumidity.DAMP); } @Override @@ -483,13 +477,11 @@ public enum BeeDefinition implements IBeeDefinition { } }, EDENIC(BeeBranchDefinition.TROPICAL, "humboldti", false, new Color(0x393d0d), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.SILKY, 1), 0.20f) - .setHasEffect() - .setTemperature(EnumTemperature.WARM) - .setHumidity(EnumHumidity.DAMP); + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.SILKY, 1), 0.20f).setHasEffect() + .setTemperature(EnumTemperature.WARM).setHumidity(EnumHumidity.DAMP); } @Override @@ -508,10 +500,10 @@ public enum BeeDefinition implements IBeeDefinition { /* END BRANCH */ ENDED(BeeBranchDefinition.END, "notchi", false, new Color(0xe079fa), new Color(0xd9de9e)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.MYSTERIOUS, 1), 0.30f) + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.MYSTERIOUS, 1), 0.30f) .setTemperature(EnumTemperature.COLD); } @@ -524,10 +516,10 @@ public enum BeeDefinition implements IBeeDefinition { } }, SPECTRAL(BeeBranchDefinition.END, "idolum", true, new Color(0xa98bed), new Color(0xd9de9e)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.MYSTERIOUS, 1), 0.50f) + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.MYSTERIOUS, 1), 0.50f) .setTemperature(EnumTemperature.COLD); } @@ -542,11 +534,10 @@ public enum BeeDefinition implements IBeeDefinition { } }, PHANTASMAL(BeeBranchDefinition.END, "lemur", false, new Color(0xcc00fa), new Color(0xd9de9e)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.MYSTERIOUS, 1), 0.40f) - .setHasEffect() + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.MYSTERIOUS, 1), 0.40f).setHasEffect() .setTemperature(EnumTemperature.COLD); } @@ -565,10 +556,10 @@ public enum BeeDefinition implements IBeeDefinition { /* FROZEN BRANCH */ WINTRY(BeeBranchDefinition.FROZEN, "brumalis", false, new Color(0xa0ffc8), new Color(0xdaf5f3)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.FROZEN, 1), 0.30f) + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.FROZEN, 1), 0.30f) .setTemperature(EnumTemperature.ICY); } @@ -585,10 +576,10 @@ public enum BeeDefinition implements IBeeDefinition { } }, ICY(BeeBranchDefinition.FROZEN, "coagulis", true, new Color(0xa0ffff), new Color(0xdaf5f3)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.FROZEN, 1), 0.20f) + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.FROZEN, 1), 0.20f) .addProduct(PluginCore.items.craftingMaterial.getIceShard(1), 0.20f) .setTemperature(EnumTemperature.ICY); } @@ -605,13 +596,12 @@ public enum BeeDefinition implements IBeeDefinition { } }, GLACIAL(BeeBranchDefinition.FROZEN, "glacialis", false, new Color(0xefffff), new Color(0xdaf5f3)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.FROZEN, 1), 0.20f) + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.FROZEN, 1), 0.20f) .addProduct(PluginCore.items.craftingMaterial.getIceShard(1), 0.40f) - .setTemperature(EnumTemperature.ICY) - .setHasEffect(); + .setTemperature(EnumTemperature.ICY).setHasEffect(); } @Override @@ -628,10 +618,10 @@ public enum BeeDefinition implements IBeeDefinition { /* VENGEFUL BRANCH */ VINDICTIVE(BeeBranchDefinition.VENGEFUL, "ultio", false, new Color(0xeafff3), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.IRRADIATED, 1), 0.25f) + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.IRRADIATED, 1), 0.25f) .setIsNotCounted(); } @@ -647,10 +637,10 @@ public enum BeeDefinition implements IBeeDefinition { } }, VENGEFUL(BeeBranchDefinition.VENGEFUL, "punire", false, new Color(0xc2de00), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.IRRADIATED, 1), 0.40f) + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.IRRADIATED, 1), 0.40f) .setIsNotCounted(); } @@ -667,11 +657,10 @@ public enum BeeDefinition implements IBeeDefinition { } }, AVENGING(BeeBranchDefinition.VENGEFUL, "hostimentum", false, new Color(0xddff00), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.IRRADIATED, 1), 0.40f) - .setHasEffect() + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.IRRADIATED, 1), 0.40f).setHasEffect() .setIsNotCounted(); } @@ -690,13 +679,11 @@ public enum BeeDefinition implements IBeeDefinition { /* FESTIVE BRANCH */ // Easter LEPORINE(BeeBranchDefinition.FESTIVE, "lepus", false, new Color(0xfeff8f), new Color(0x3cd757)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.SILKY, 1), 0.30f) - .addProduct(new ItemStack(Items.egg), 0.10f) - .setHasEffect() - .setIsNotCounted(); + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.SILKY, 1), 0.30f) + .addProduct(new ItemStack(Items.egg), 0.10f).setHasEffect().setIsNotCounted(); } @Override @@ -706,21 +693,17 @@ public enum BeeDefinition implements IBeeDefinition { @Override protected void registerMutations() { - registerMutation(MEADOWS, FOREST, 10) - .restrictDateRange(3, 29, 4, 15) - .setIsSecret(); + registerMutation(MEADOWS, FOREST, 10).restrictDateRange(3, 29, 4, 15).setIsSecret(); } }, // Christmas MERRY(BeeBranchDefinition.FESTIVE, "feliciter", false, new Color(0xffffff), new Color(0xd40000)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.FROZEN, 1), 0.30f) + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.FROZEN, 1), 0.30f) .addProduct(PluginCore.items.craftingMaterial.getIceShard(1), 0.20f) - .setTemperature(EnumTemperature.ICY) - .setHasEffect() - .setIsNotCounted(); + .setTemperature(EnumTemperature.ICY).setHasEffect().setIsNotCounted(); } @Override @@ -731,21 +714,17 @@ public enum BeeDefinition implements IBeeDefinition { @Override protected void registerMutations() { - registerMutation(WINTRY, FOREST, 10) - .restrictDateRange(12, 21, 12, 27) - .setIsSecret(); + registerMutation(WINTRY, FOREST, 10).restrictDateRange(12, 21, 12, 27).setIsSecret(); } }, // New Year TIPSY(BeeBranchDefinition.FESTIVE, "ebrius", false, new Color(0xffffff), new Color(0xc219ec)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.FROZEN, 1), 0.30f) + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.FROZEN, 1), 0.30f) .addProduct(PluginCore.items.craftingMaterial.getIceShard(1), 0.20f) - .setTemperature(EnumTemperature.ICY) - .setHasEffect() - .setIsNotCounted(); + .setTemperature(EnumTemperature.ICY).setHasEffect().setIsNotCounted(); } @Override @@ -756,25 +735,21 @@ public enum BeeDefinition implements IBeeDefinition { @Override protected void registerMutations() { - registerMutation(WINTRY, MEADOWS, 10) - .restrictDateRange(12, 27, 1, 2) - .setIsSecret(); + registerMutation(WINTRY, MEADOWS, 10).restrictDateRange(12, 27, 1, 2).setIsSecret(); } }, // (missing) Solstice // Halloween TRICKY(BeeBranchDefinition.FESTIVE, "libita", false, new Color(0x49413B), new Color(0xFF6A00)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.HONEY, 1), 0.40f) + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.HONEY, 1), 0.40f) .addProduct(new ItemStack(Items.cookie), 0.15f) .addSpecialty(new ItemStack(Items.skull, 1, 0), 0.02f) .addSpecialty(new ItemStack(Items.skull, 1, 2), 0.02f) .addSpecialty(new ItemStack(Items.skull, 1, 3), 0.02f) - .addSpecialty(new ItemStack(Items.skull, 1, 4), 0.02f) - .setHasEffect() - .setIsNotCounted(); + .addSpecialty(new ItemStack(Items.skull, 1, 4), 0.02f).setHasEffect().setIsNotCounted(); } @Override @@ -786,15 +761,14 @@ public enum BeeDefinition implements IBeeDefinition { @Override protected void registerMutations() { - registerMutation(SINISTER, COMMON, 10) - .restrictDateRange(10, 15, 11, 3) - .setIsSecret(); + registerMutation(SINISTER, COMMON, 10).restrictDateRange(10, 15, 11, 3).setIsSecret(); } }, // (missing) Thanksgiving /* AGRARIAN BRANCH */ RURAL(BeeBranchDefinition.AGRARIAN, "rustico", false, new Color(0xfeff8f), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.WHEATEN, 1), 0.20f); @@ -809,6 +783,7 @@ public enum BeeDefinition implements IBeeDefinition { } }, FARMERLY(BeeBranchDefinition.AGRARIAN, "arator", true, new Color(0xD39728), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.WHEATEN, 1), 0.27f); @@ -826,11 +801,10 @@ public enum BeeDefinition implements IBeeDefinition { } }, AGRARIAN(BeeBranchDefinition.AGRARIAN, "arator", true, new Color(0xFFCA75), new Color(0xFFE047)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.WHEATEN, 1), 0.35f) - .setHasEffect(); + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.WHEATEN, 1), 0.35f).setHasEffect(); } @Override @@ -849,10 +823,10 @@ public enum BeeDefinition implements IBeeDefinition { /* BOGGY BRANCH */ MARSHY(BeeBranchDefinition.BOGGY, "adorasti", true, new Color(0x546626), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.MOSSY, 1), 0.30f) + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.MOSSY, 1), 0.30f) .setHumidity(EnumHumidity.DAMP); } @@ -865,10 +839,10 @@ public enum BeeDefinition implements IBeeDefinition { } }, MIRY(BeeBranchDefinition.BOGGY, "humidium", true, new Color(0x92AF42), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.MOSSY, 1), 0.36f) + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.MOSSY, 1), 0.36f) .setHumidity(EnumHumidity.DAMP); } @@ -881,18 +855,16 @@ public enum BeeDefinition implements IBeeDefinition { @Override protected void registerMutations() { - registerMutation(MARSHY, NOBLE, 15) - .restrictTemperature(EnumTemperature.WARM) + registerMutation(MARSHY, NOBLE, 15).restrictTemperature(EnumTemperature.WARM) .restrictHumidity(EnumHumidity.DAMP); } }, BOGGY(BeeBranchDefinition.BOGGY, "paluster", true, new Color(0x698948), new Color(0xffdc16)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.MOSSY, 1), 0.39f) - .addSpecialty(PluginCore.items.peat.getItemStack(), 0.08f) - .setHumidity(EnumHumidity.DAMP); + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.MOSSY, 1), 0.39f) + .addSpecialty(PluginCore.items.peat.getItemStack(), 0.08f).setHumidity(EnumHumidity.DAMP); } @Override @@ -905,18 +877,17 @@ public enum BeeDefinition implements IBeeDefinition { @Override protected void registerMutations() { - registerMutation(MARSHY, MIRY, 9) - .restrictTemperature(EnumTemperature.WARM) + registerMutation(MARSHY, MIRY, 9).restrictTemperature(EnumTemperature.WARM) .restrictHumidity(EnumHumidity.DAMP); } }, /* MONASTIC BRANCH */ MONASTIC(BeeBranchDefinition.MONASTIC, "monachus", false, new Color(0x42371c), new Color(0xfff7b6)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.WHEATEN, 1), 0.30f) + beeSpecies.addProduct(PluginApiculture.items.beeComb.get(EnumHoneyComb.WHEATEN, 1), 0.30f) .addSpecialty(PluginApiculture.items.beeComb.get(EnumHoneyComb.MELLOW, 1), 0.10f) .setJubilanceProvider(new JubilanceProviderHermit()); } @@ -930,10 +901,10 @@ public enum BeeDefinition implements IBeeDefinition { } }, SECLUDED(BeeBranchDefinition.MONASTIC, "contractus", true, new Color(0x7b6634), new Color(0xfff7b6)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addSpecialty(PluginApiculture.items.beeComb.get(EnumHoneyComb.MELLOW, 1), 0.20f) + beeSpecies.addSpecialty(PluginApiculture.items.beeComb.get(EnumHoneyComb.MELLOW, 1), 0.20f) .setJubilanceProvider(new JubilanceProviderHermit()); } @@ -948,12 +919,11 @@ public enum BeeDefinition implements IBeeDefinition { } }, HERMITIC(BeeBranchDefinition.MONASTIC, "anachoreta", false, new Color(0xffd46c), new Color(0xfff7b6)) { + @Override protected void setSpeciesProperties(IAlleleBeeSpeciesCustom beeSpecies) { - beeSpecies - .addSpecialty(PluginApiculture.items.beeComb.get(EnumHoneyComb.MELLOW, 1), 0.20f) - .setJubilanceProvider(new JubilanceProviderHermit()) - .setHasEffect(); + beeSpecies.addSpecialty(PluginApiculture.items.beeComb.get(EnumHoneyComb.MELLOW, 1), 0.20f) + .setJubilanceProvider(new JubilanceProviderHermit()).setHasEffect(); } @Override @@ -968,8 +938,8 @@ public enum BeeDefinition implements IBeeDefinition { } }; - private static final EnumSet overworldHiveBees = - EnumSet.of(FOREST, MARSHY, MEADOWS, MODEST, TROPICAL, WINTRY); + private static final EnumSet overworldHiveBees = EnumSet + .of(FOREST, MARSHY, MEADOWS, MODEST, TROPICAL, WINTRY); private final BeeBranchDefinition branch; private final IAlleleBeeSpeciesCustom species; diff --git a/src/main/java/forestry/apiculture/genetics/BeeFactory.java b/src/main/java/forestry/apiculture/genetics/BeeFactory.java index 01d1ef2ad..380713ba9 100644 --- a/src/main/java/forestry/apiculture/genetics/BeeFactory.java +++ b/src/main/java/forestry/apiculture/genetics/BeeFactory.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics; @@ -18,16 +16,10 @@ import forestry.api.genetics.IClassification; import forestry.apiculture.genetics.alleles.AlleleBeeSpecies; public class BeeFactory implements IBeeFactory { + @Override - public IAlleleBeeSpeciesCustom createSpecies( - String uid, - boolean dominant, - String authority, - String unlocalizedName, - String unlocalizedDescription, - IClassification branch, - String binomial, - int primaryColor, + public IAlleleBeeSpeciesCustom createSpecies(String uid, boolean dominant, String authority, String unlocalizedName, + String unlocalizedDescription, IClassification branch, String binomial, int primaryColor, int secondaryColor) { IAlleleBeeSpeciesCustom species = new AlleleBeeSpecies( uid, diff --git a/src/main/java/forestry/apiculture/genetics/BeeGenome.java b/src/main/java/forestry/apiculture/genetics/BeeGenome.java index d50bd7499..4562f2e91 100755 --- a/src/main/java/forestry/apiculture/genetics/BeeGenome.java +++ b/src/main/java/forestry/apiculture/genetics/BeeGenome.java @@ -1,18 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics; +import java.util.concurrent.TimeUnit; + +import javax.annotation.Nonnull; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import com.google.common.cache.CacheBuilder; import com.google.common.cache.CacheLoader; import com.google.common.cache.LoadingCache; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.EnumBeeChromosome; import forestry.api.apiculture.IAlleleBeeEffect; @@ -31,32 +37,21 @@ import forestry.core.genetics.alleles.AlleleArea; import forestry.core.genetics.alleles.AlleleBoolean; import forestry.core.genetics.alleles.AlleleTolerance; import forestry.core.utils.vect.Vect; -import java.util.concurrent.TimeUnit; -import javax.annotation.Nonnull; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class BeeGenome extends Genome implements IBeeGenome { + /** - * 0 - Species (determines product) - * 1 - Speed - * 2 - Lifespan - * 3 - Fertility (Maximum number of offspring) - * 4 - Preferred temperature Icy: Snow biomes Cold: Tundra/Steppe, Extreme Mountains/Hills? Normal: Plains, Forests, Mountains Hot: Desert Hellish: Nether - * 5 - Temperature tolerance (Range +/-) - * 6 - Nocturnal - * 7 - Preferred humidity (Arid - Normal - Damp) - * 8 - Humidity tolerance (Range +/-) - * 9 - Flight interference tolerance (stuff falling from the sky/other hindrances -> tolerates dampness + flight interference tolerance => rain resistance) - * 10 - Cave dwelling - * 11 - Required flowers - * 12 - Flower plant chance - * 13 - Territory + * 0 - Species (determines product) 1 - Speed 2 - Lifespan 3 - Fertility (Maximum number of offspring) 4 - Preferred + * temperature Icy: Snow biomes Cold: Tundra/Steppe, Extreme Mountains/Hills? Normal: Plains, Forests, Mountains + * Hot: Desert Hellish: Nether 5 - Temperature tolerance (Range +/-) 6 - Nocturnal 7 - Preferred humidity (Arid - + * Normal - Damp) 8 - Humidity tolerance (Range +/-) 9 - Flight interference tolerance (stuff falling from the + * sky/other hindrances -> tolerates dampness + flight interference tolerance => rain resistance) 10 - Cave dwelling + * 11 - Required flowers 12 - Flower plant chance 13 - Territory */ private static final LoadingCache beeGenomeCache = CacheBuilder.newBuilder() - .maximumSize(128) - .expireAfterAccess(1, TimeUnit.MINUTES) + .maximumSize(128).expireAfterAccess(1, TimeUnit.MINUTES) .build(new CacheLoader() { + @Override public BeeGenome load(@Nonnull NBTTagCompound tagCompound) { return new BeeGenome(tagCompound); @@ -158,7 +153,7 @@ public class BeeGenome extends Genome implements IBeeGenome { @Override public int[] getTerritory() { Vect area = ((AlleleArea) getActiveAllele(EnumBeeChromosome.TERRITORY)).getArea(); - return new int[] {area.x, area.y, area.z}; + return new int[] { area.x, area.y, area.z }; } @Override diff --git a/src/main/java/forestry/apiculture/genetics/BeeHelper.java b/src/main/java/forestry/apiculture/genetics/BeeHelper.java index 628668988..83e58b22a 100755 --- a/src/main/java/forestry/apiculture/genetics/BeeHelper.java +++ b/src/main/java/forestry/apiculture/genetics/BeeHelper.java @@ -1,16 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Locale; +import java.util.Map.Entry; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + import com.mojang.authlib.GameProfile; + import cpw.mods.fml.common.FMLCommonHandler; import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.EnumBeeChromosome; @@ -37,15 +47,6 @@ import forestry.apiculture.BeeHousingModifier; import forestry.apiculture.BeekeepingLogic; import forestry.core.genetics.SpeciesRoot; import forestry.plugins.PluginApiculture; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Locale; -import java.util.Map.Entry; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; public class BeeHelper extends SpeciesRoot implements IBeeRoot { @@ -66,8 +67,7 @@ public class BeeHelper extends SpeciesRoot implements IBeeRoot { public int getSpeciesCount() { if (beeSpeciesCount < 0) { beeSpeciesCount = 0; - for (Entry entry : - AlleleManager.alleleRegistry.getRegisteredAlleles().entrySet()) { + for (Entry entry : AlleleManager.alleleRegistry.getRegisteredAlleles().entrySet()) { if (entry.getValue() instanceof IAlleleBeeSpecies) { if (((IAlleleBeeSpecies) entry.getValue()).isCounted()) { beeSpeciesCount++; @@ -314,8 +314,7 @@ public class BeeHelper extends SpeciesRoot implements IBeeRoot { } } - FMLCommonHandler.instance() - .getFMLLogger() + FMLCommonHandler.instance().getFMLLogger() .debug("Failed to find a beekeeping mode called '%s', reverting to fallback."); return beekeepingModes.get(0); } diff --git a/src/main/java/forestry/apiculture/genetics/BeeMutation.java b/src/main/java/forestry/apiculture/genetics/BeeMutation.java index 054efb8dd..832ee8603 100644 --- a/src/main/java/forestry/apiculture/genetics/BeeMutation.java +++ b/src/main/java/forestry/apiculture/genetics/BeeMutation.java @@ -1,15 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.IAlleleBeeSpecies; import forestry.api.apiculture.IBeeGenome; @@ -19,8 +20,6 @@ import forestry.api.apiculture.IBeeMutationCustom; import forestry.api.apiculture.IBeeRoot; import forestry.api.genetics.IAllele; import forestry.core.genetics.mutations.Mutation; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; public class BeeMutation extends Mutation implements IBeeMutationCustom { @@ -34,12 +33,8 @@ public class BeeMutation extends Mutation implements IBeeMutationCustom { } @Override - public float getChance( - IBeeHousing housing, - IAlleleBeeSpecies allele0, - IAlleleBeeSpecies allele1, - IBeeGenome genome0, - IBeeGenome genome1) { + public float getChance(IBeeHousing housing, IAlleleBeeSpecies allele0, IAlleleBeeSpecies allele1, + IBeeGenome genome0, IBeeGenome genome1) { World world = housing.getWorld(); ChunkCoordinates housingCoordinates = housing.getCoordinates(); int x = housingCoordinates.posX; @@ -52,8 +47,7 @@ public class BeeMutation extends Mutation implements IBeeMutationCustom { } IBeeModifier beeHousingModifier = BeeManager.beeRoot.createBeeHousingModifier(housing); - IBeeModifier beeModeModifier = - BeeManager.beeRoot.getBeekeepingMode(world).getBeeModifier(); + IBeeModifier beeModeModifier = BeeManager.beeRoot.getBeekeepingMode(world).getBeeModifier(); processedChance *= beeHousingModifier.getMutationModifier(genome0, genome1, processedChance); processedChance *= beeModeModifier.getMutationModifier(genome0, genome1, processedChance); diff --git a/src/main/java/forestry/apiculture/genetics/BeeMutationFactory.java b/src/main/java/forestry/apiculture/genetics/BeeMutationFactory.java index e5707d5ca..0e7faa9ef 100644 --- a/src/main/java/forestry/apiculture/genetics/BeeMutationFactory.java +++ b/src/main/java/forestry/apiculture/genetics/BeeMutationFactory.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics; @@ -19,8 +17,8 @@ import forestry.api.genetics.IAllele; public class BeeMutationFactory implements IBeeMutationFactory { @Override - public IBeeMutationCustom createMutation( - IAlleleBeeSpecies parentBee0, IAlleleBeeSpecies parentBee1, IAllele[] result, int chance) { + public IBeeMutationCustom createMutation(IAlleleBeeSpecies parentBee0, IAlleleBeeSpecies parentBee1, + IAllele[] result, int chance) { IBeeMutationCustom mutation = new BeeMutation(parentBee0, parentBee1, result, chance); BeeManager.beeRoot.registerMutation(mutation); return mutation; diff --git a/src/main/java/forestry/apiculture/genetics/BeeVariation.java b/src/main/java/forestry/apiculture/genetics/BeeVariation.java index 31c63612c..1a19b2f23 100644 --- a/src/main/java/forestry/apiculture/genetics/BeeVariation.java +++ b/src/main/java/forestry/apiculture/genetics/BeeVariation.java @@ -1,5 +1,7 @@ package forestry.apiculture.genetics; +import net.minecraft.item.ItemStack; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.EnumBeeChromosome; import forestry.api.apiculture.EnumBeeType; @@ -7,7 +9,6 @@ import forestry.api.apiculture.IBee; import forestry.api.apiculture.IBeeGenome; import forestry.api.genetics.IAllele; import forestry.core.genetics.alleles.AlleleHelper; -import net.minecraft.item.ItemStack; public abstract class BeeVariation implements IBeeDefinition { @@ -44,6 +45,7 @@ public abstract class BeeVariation implements IBeeDefinition { } public static class RainResist extends BeeVariation { + public RainResist(IBeeDefinition bee) { super(bee); } diff --git a/src/main/java/forestry/apiculture/genetics/BeekeepingMode.java b/src/main/java/forestry/apiculture/genetics/BeekeepingMode.java index 31adac378..ca2954901 100755 --- a/src/main/java/forestry/apiculture/genetics/BeekeepingMode.java +++ b/src/main/java/forestry/apiculture/genetics/BeekeepingMode.java @@ -1,15 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics; +import java.util.ArrayList; +import java.util.Locale; +import java.util.Random; + +import net.minecraft.world.World; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.DefaultBeeModifier; import forestry.api.apiculture.IBee; @@ -17,10 +21,6 @@ import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeeModifier; import forestry.api.apiculture.IBeekeepingMode; -import java.util.ArrayList; -import java.util.Locale; -import java.util.Random; -import net.minecraft.world.World; public class BeekeepingMode implements IBeekeepingMode { @@ -36,13 +36,8 @@ public class BeekeepingMode implements IBeekeepingMode { private final boolean canFatigue; private final IBeeModifier beeModifier; - public BeekeepingMode( - String name, - float mutationModifier, - float lifespanModifier, - float speedModifier, - boolean reducesFertility, - boolean canFatigue) { + public BeekeepingMode(String name, float mutationModifier, float lifespanModifier, float speedModifier, + boolean reducesFertility, boolean canFatigue) { this.rand = new Random(); this.name = name; this.reducesFertility = reducesFertility; @@ -138,6 +133,7 @@ public class BeekeepingMode implements IBeekeepingMode { } private static class BeekeepingModeBeeModifier extends DefaultBeeModifier { + private final float mutationModifier; private final float lifespanModifier; private final float speedModifier; diff --git a/src/main/java/forestry/apiculture/genetics/BranchBees.java b/src/main/java/forestry/apiculture/genetics/BranchBees.java index 22fce5155..8579cca63 100755 --- a/src/main/java/forestry/apiculture/genetics/BranchBees.java +++ b/src/main/java/forestry/apiculture/genetics/BranchBees.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics; diff --git a/src/main/java/forestry/apiculture/genetics/DefaultBeeIconColourProvider.java b/src/main/java/forestry/apiculture/genetics/DefaultBeeIconColourProvider.java index 1d363a21a..16c2fce70 100644 --- a/src/main/java/forestry/apiculture/genetics/DefaultBeeIconColourProvider.java +++ b/src/main/java/forestry/apiculture/genetics/DefaultBeeIconColourProvider.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics; import forestry.api.apiculture.IBeeIconColourProvider; public class DefaultBeeIconColourProvider implements IBeeIconColourProvider { + private final int primaryColour; private final int secondaryColour; diff --git a/src/main/java/forestry/apiculture/genetics/DefaultBeeIconProvider.java b/src/main/java/forestry/apiculture/genetics/DefaultBeeIconProvider.java index 8f52e6e57..b358e0988 100644 --- a/src/main/java/forestry/apiculture/genetics/DefaultBeeIconProvider.java +++ b/src/main/java/forestry/apiculture/genetics/DefaultBeeIconProvider.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics; +import java.util.Locale; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.apiculture.EnumBeeType; import forestry.api.apiculture.IBeeIconProvider; import forestry.core.render.TextureManager; -import java.util.Locale; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.util.IIcon; public class DefaultBeeIconProvider implements IBeeIconProvider { diff --git a/src/main/java/forestry/apiculture/genetics/HiveDrop.java b/src/main/java/forestry/apiculture/genetics/HiveDrop.java index af83a2256..74363d5d2 100755 --- a/src/main/java/forestry/apiculture/genetics/HiveDrop.java +++ b/src/main/java/forestry/apiculture/genetics/HiveDrop.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.EnumBeeType; import forestry.api.apiculture.IBee; import forestry.api.apiculture.IHiveDrop; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; public class HiveDrop implements IHiveDrop { diff --git a/src/main/java/forestry/apiculture/genetics/IBeeDefinition.java b/src/main/java/forestry/apiculture/genetics/IBeeDefinition.java index 241b1f7f4..7b43677f8 100644 --- a/src/main/java/forestry/apiculture/genetics/IBeeDefinition.java +++ b/src/main/java/forestry/apiculture/genetics/IBeeDefinition.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics; +import net.minecraft.item.ItemStack; + import forestry.api.apiculture.EnumBeeType; import forestry.api.apiculture.IBee; import forestry.api.apiculture.IBeeGenome; import forestry.core.genetics.IGeneticDefinition; -import net.minecraft.item.ItemStack; public interface IBeeDefinition extends IGeneticDefinition { + @Override IBeeGenome getGenome(); diff --git a/src/main/java/forestry/apiculture/genetics/JubilanceDefault.java b/src/main/java/forestry/apiculture/genetics/JubilanceDefault.java index c8b8acf06..865f7ad53 100755 --- a/src/main/java/forestry/apiculture/genetics/JubilanceDefault.java +++ b/src/main/java/forestry/apiculture/genetics/JubilanceDefault.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics; diff --git a/src/main/java/forestry/apiculture/genetics/JubilanceFactory.java b/src/main/java/forestry/apiculture/genetics/JubilanceFactory.java index 1a2aab9cb..1bac1332b 100644 --- a/src/main/java/forestry/apiculture/genetics/JubilanceFactory.java +++ b/src/main/java/forestry/apiculture/genetics/JubilanceFactory.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics; -import forestry.api.apiculture.IJubilanceFactory; -import forestry.api.apiculture.IJubilanceProvider; import net.minecraft.block.Block; +import forestry.api.apiculture.IJubilanceFactory; +import forestry.api.apiculture.IJubilanceProvider; + public class JubilanceFactory implements IJubilanceFactory { + @Override public IJubilanceProvider getDefault() { return JubilanceDefault.instance; diff --git a/src/main/java/forestry/apiculture/genetics/JubilanceProviderHermit.java b/src/main/java/forestry/apiculture/genetics/JubilanceProviderHermit.java index ccb593243..998c56df2 100755 --- a/src/main/java/forestry/apiculture/genetics/JubilanceProviderHermit.java +++ b/src/main/java/forestry/apiculture/genetics/JubilanceProviderHermit.java @@ -1,27 +1,28 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics; +import java.util.List; + +import net.minecraft.entity.EntityLiving; + import forestry.api.apiculture.IAlleleBeeSpecies; import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeHousing; import forestry.apiculture.genetics.alleles.AlleleEffect; import forestry.core.utils.StringUtil; -import java.util.List; -import net.minecraft.entity.EntityLiving; /** * Hermits will not produce if there are any other living creatures nearby. */ public class JubilanceProviderHermit extends JubilanceDefault { + @Override public boolean isJubilant(IAlleleBeeSpecies species, IBeeGenome genome, IBeeHousing housing) { List list = AlleleEffect.getEntitiesInRange(genome, housing, EntityLiving.class); diff --git a/src/main/java/forestry/apiculture/genetics/JubilanceRequiresResource.java b/src/main/java/forestry/apiculture/genetics/JubilanceRequiresResource.java index 3bc10f502..5fbf7eddc 100644 --- a/src/main/java/forestry/apiculture/genetics/JubilanceRequiresResource.java +++ b/src/main/java/forestry/apiculture/genetics/JubilanceRequiresResource.java @@ -1,15 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; + import forestry.api.apiculture.IAlleleBeeSpecies; import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeHousing; @@ -17,11 +21,6 @@ import forestry.api.apiculture.IJubilanceProvider; import forestry.core.utils.BlockUtil; import forestry.core.utils.InventoryUtil; import forestry.core.utils.StringUtil; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; public class JubilanceRequiresResource implements IJubilanceProvider { diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleBeeSpecies.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleBeeSpecies.java index ed67ef79b..5ad7d1a57 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleBeeSpecies.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleBeeSpecies.java @@ -1,16 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics.alleles; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +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.apiculture.BeeManager; @@ -30,16 +39,9 @@ import forestry.apiculture.genetics.DefaultBeeIconProvider; import forestry.apiculture.genetics.JubilanceDefault; import forestry.core.genetics.alleles.AlleleSpecies; import forestry.core.utils.ItemStackUtil; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; public class AlleleBeeSpecies extends AlleleSpecies implements IAlleleBeeSpeciesCustom { + private final Map productChances = new HashMap<>(); private final Map specialtyChances = new HashMap<>(); @@ -48,16 +50,8 @@ public class AlleleBeeSpecies extends AlleleSpecies implements IAlleleBeeSpecies private IJubilanceProvider jubilanceProvider; private boolean nocturnal = false; - public AlleleBeeSpecies( - String uid, - String unlocalizedName, - String authority, - String unlocalizedDescription, - boolean dominant, - IClassification branch, - String binomial, - int primaryColor, - int secondaryColor) { + public AlleleBeeSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, + boolean dominant, IClassification branch, String binomial, int primaryColor, int secondaryColor) { super(uid, unlocalizedName, authority, unlocalizedDescription, dominant, branch, binomial); beeIconProvider = DefaultBeeIconProvider.instance; diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffect.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffect.java index 082ab879d..7181bce6a 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffect.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffect.java @@ -1,15 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics.alleles; +import java.util.Arrays; +import java.util.List; + +import net.minecraft.entity.Entity; +import net.minecraft.potion.Potion; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.Vec3; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.EnumBeeChromosome; import forestry.api.apiculture.IAlleleBeeEffect; @@ -23,13 +30,6 @@ import forestry.core.proxy.Proxies; import forestry.core.utils.EntityUtil; import forestry.core.utils.vect.MutableVect; import forestry.core.utils.vect.Vect; -import java.util.Arrays; -import java.util.List; -import net.minecraft.entity.Entity; -import net.minecraft.potion.Potion; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.Vec3; public abstract class AlleleEffect extends AlleleCategorized implements IAlleleBeeEffect { @@ -69,10 +69,12 @@ public abstract class AlleleEffect extends AlleleCategorized implements IAlleleB effectFestiveEaster = new AlleleEffectNone("festiveEaster", true), effectSnowing = new AlleleEffectSnowing(), effectDrunkard = new AlleleEffectPotion("drunkard", false, Potion.confusion, 100), - effectReanimation = - new AlleleEffectResurrection("reanimation", AlleleEffectResurrection.getReanimationList()), - effectResurrection = - new AlleleEffectResurrection("resurrection", AlleleEffectResurrection.getResurrectionList()), + effectReanimation = new AlleleEffectResurrection( + "reanimation", + AlleleEffectResurrection.getReanimationList()), + effectResurrection = new AlleleEffectResurrection( + "resurrection", + AlleleEffectResurrection.getResurrectionList()), effectRepulsion = new AlleleEffectRepulsion(), effectFertile = new AlleleEffectFertile(), effectMycophilic = new AlleleEffectFungification()); @@ -158,8 +160,8 @@ public abstract class AlleleEffect extends AlleleCategorized implements IAlleleB return AxisAlignedBB.getBoundingBox(min.x, min.y, min.z, max.x, max.y, max.z); } - public static List getEntitiesInRange( - IBeeGenome genome, IBeeHousing housing, Class entityClass) { + public static List getEntitiesInRange(IBeeGenome genome, IBeeHousing housing, + Class entityClass) { AxisAlignedBB boundingBox = getBounding(genome, housing); return EntityUtil.getEntitiesWithinAABB(housing.getWorld(), entityClass, boundingBox); } diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectAggressive.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectAggressive.java index f0a78ffa3..6d1a3bf0b 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectAggressive.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectAggressive.java @@ -1,25 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics.alleles; +import java.util.List; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.DamageSource; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeHousing; import forestry.api.genetics.IEffectData; import forestry.core.utils.DamageSourceForestry; -import java.util.List; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.DamageSource; public class AlleleEffectAggressive extends AlleleEffectThrottled { + private static final DamageSource damageSourceBeeAggressive = new DamageSourceForestry("bee.aggressive"); public AlleleEffectAggressive() { diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectCreeper.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectCreeper.java index 24eec6dbc..a05187485 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectCreeper.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectCreeper.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics.alleles; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeHousing; import forestry.api.genetics.IEffectData; import forestry.core.genetics.EffectData; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; public class AlleleEffectCreeper extends AlleleEffectThrottled { diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectExploration.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectExploration.java index ad2709c8a..3bf80b055 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectExploration.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectExploration.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics.alleles; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; + import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeHousing; import forestry.api.genetics.IEffectData; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; public class AlleleEffectExploration extends AlleleEffectThrottled { diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectFertile.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectFertile.java index 2c45f77e8..bc2f34739 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectFertile.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectFertile.java @@ -1,26 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics.alleles; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeHousing; -import forestry.api.genetics.IEffectData; -import forestry.core.utils.vect.IVect; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.IGrowable; import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; import net.minecraftforge.common.IPlantable; +import forestry.api.apiculture.IBeeGenome; +import forestry.api.apiculture.IBeeHousing; +import forestry.api.genetics.IEffectData; +import forestry.core.utils.vect.IVect; + public class AlleleEffectFertile extends AlleleEffectThrottled { private static final int MAX_BLOCK_FIND_TRIES = 5; diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectFungification.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectFungification.java index dfcc33ea7..38e102c24 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectFungification.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectFungification.java @@ -1,12 +1,8 @@ package forestry.apiculture.genetics.alleles; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeHousing; -import forestry.api.genetics.IEffectData; -import forestry.core.genetics.EffectData; -import forestry.core.utils.vect.IVect; import java.util.List; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.entity.passive.EntityCow; import net.minecraft.entity.passive.EntityMooshroom; @@ -15,6 +11,12 @@ import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenBigMushroom; +import forestry.api.apiculture.IBeeGenome; +import forestry.api.apiculture.IBeeHousing; +import forestry.api.genetics.IEffectData; +import forestry.core.genetics.EffectData; +import forestry.core.utils.vect.IVect; + public class AlleleEffectFungification extends AlleleEffectThrottled { private static final int MAX_BLOCK_FIND_TRIES = 10; @@ -105,7 +107,13 @@ public class AlleleEffectFungification extends AlleleEffectThrottled { mooshroom.renderYawOffset = cow.renderYawOffset; worldObj.spawnEntityInWorld(mooshroom); worldObj.spawnParticle( - "largeexplode", cow.posX, cow.posY + (double) (cow.height / 2.0F), cow.posZ, 0.0D, 0.0D, 0.0D); + "largeexplode", + cow.posX, + cow.posY + (double) (cow.height / 2.0F), + cow.posZ, + 0.0D, + 0.0D, + 0.0D); } private static void doMushroomGrowth(Block block, World world, int blockX, int blockY, int blockZ) { diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectGlacial.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectGlacial.java index f7d6a2132..e9be0ee72 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectGlacial.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectGlacial.java @@ -1,24 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics.alleles; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; + import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeHousing; import forestry.api.core.EnumTemperature; import forestry.api.genetics.IEffectData; import forestry.core.config.Constants; import forestry.core.utils.vect.Vect; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.world.World; public class AlleleEffectGlacial extends AlleleEffectThrottled { diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectHeroic.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectHeroic.java index a9df650ff..e629f3d97 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectHeroic.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectHeroic.java @@ -1,24 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics.alleles; +import java.util.List; + +import net.minecraft.entity.monster.EntityMob; +import net.minecraft.util.DamageSource; + import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeHousing; import forestry.api.genetics.IEffectData; import forestry.core.utils.DamageSourceForestry; -import java.util.List; -import net.minecraft.entity.monster.EntityMob; -import net.minecraft.util.DamageSource; public class AlleleEffectHeroic extends AlleleEffectThrottled { + private static final DamageSource damageSourceBeeHeroic = new DamageSourceForestry("bee.heroic"); public AlleleEffectHeroic() { diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectIgnition.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectIgnition.java index c52d607cf..6f4c6e253 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectIgnition.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectIgnition.java @@ -1,26 +1,27 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics.alleles; +import java.util.List; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeHousing; import forestry.api.genetics.IEffectData; import forestry.core.proxy.Proxies; -import java.util.List; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; public class AlleleEffectIgnition extends AlleleEffectThrottled { + private static final int ignitionChance = 50; private static final int fireDuration = 500; diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectMisanthrope.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectMisanthrope.java index 88d87a38c..f2c135c2b 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectMisanthrope.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectMisanthrope.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics.alleles; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.DamageSource; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeHousing; import forestry.api.genetics.IEffectData; import forestry.core.utils.DamageSourceForestry; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.DamageSource; public class AlleleEffectMisanthrope extends AlleleEffectThrottled { diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectNone.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectNone.java index 3afccb8be..ebc4929ee 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectNone.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectNone.java @@ -1,16 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics.alleles; public class AlleleEffectNone extends AlleleEffect { + public AlleleEffectNone(String valueName, boolean isDominant) { super(valueName, isDominant); } diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectPotion.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectPotion.java index f347b1b74..4919613e1 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectPotion.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectPotion.java @@ -1,15 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics.alleles; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.entity.monster.IMob; +import net.minecraft.potion.Potion; +import net.minecraft.potion.PotionEffect; +import net.minecraft.potion.PotionHelper; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; + import cpw.mods.fml.relauncher.ReflectionHelper; import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.IBeeGenome; @@ -17,16 +27,6 @@ import forestry.api.apiculture.IBeeHousing; import forestry.api.genetics.IEffectData; import forestry.core.proxy.Proxies; import forestry.core.utils.Log; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.monster.IMob; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.potion.PotionHelper; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; public class AlleleEffectPotion extends AlleleEffectThrottled { @@ -36,8 +36,8 @@ public class AlleleEffectPotion extends AlleleEffectThrottled { private final int duration; private final float chance; - public AlleleEffectPotion( - String name, boolean isDominant, Potion potion, int duration, int throttle, float chance) { + public AlleleEffectPotion(String name, boolean isDominant, Potion potion, int duration, int throttle, + float chance) { super(name, isDominant, throttle, true, false); this.potion = potion; this.isBadEffect = isBadEffect(potion); diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectRadioactive.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectRadioactive.java index f2dbc55a5..43133d34a 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectRadioactive.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectRadioactive.java @@ -1,15 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics.alleles; +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.entity.EntityLivingBase; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.DamageSource; +import net.minecraft.world.World; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeHousing; @@ -17,13 +24,6 @@ import forestry.api.genetics.IEffectData; import forestry.apiculture.blocks.BlockAlveary; import forestry.core.utils.DamageSourceForestry; import forestry.core.utils.vect.Vect; -import java.util.List; -import java.util.Random; -import net.minecraft.block.Block; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.DamageSource; -import net.minecraft.world.World; public class AlleleEffectRadioactive extends AlleleEffectThrottled { diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectRepulsion.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectRepulsion.java index b38b2cc06..c550da719 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectRepulsion.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectRepulsion.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics.alleles; +import java.util.List; + +import net.minecraft.entity.ai.EntityAITasks.EntityAITaskEntry; +import net.minecraft.entity.monster.EntityMob; + import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeHousing; import forestry.api.genetics.IEffectData; import forestry.apiculture.entities.AIAvoidPlayers; -import java.util.List; -import net.minecraft.entity.ai.EntityAITasks.EntityAITaskEntry; -import net.minecraft.entity.monster.EntityMob; public class AlleleEffectRepulsion extends AlleleEffectThrottled { diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectResurrection.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectResurrection.java index f6707d263..8f4aa1e9e 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectResurrection.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectResurrection.java @@ -1,23 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics.alleles; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeHousing; -import forestry.api.genetics.IEffectData; -import forestry.core.utils.EntityUtil; -import forestry.core.utils.ItemStackUtil; import java.util.ArrayList; import java.util.Collections; import java.util.List; + import net.minecraft.entity.EntityLiving; import net.minecraft.entity.boss.EntityDragon; import net.minecraft.entity.item.EntityItem; @@ -33,9 +27,16 @@ import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; +import forestry.api.apiculture.IBeeGenome; +import forestry.api.apiculture.IBeeHousing; +import forestry.api.genetics.IEffectData; +import forestry.core.utils.EntityUtil; +import forestry.core.utils.ItemStackUtil; + public class AlleleEffectResurrection extends AlleleEffectThrottled { public static class Resurrectable { + public final ItemStack res; public final Class risen; diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectSnowing.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectSnowing.java index baa9e564d..a5c9a16db 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectSnowing.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectSnowing.java @@ -1,15 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics.alleles; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeHousing; import forestry.api.core.EnumTemperature; @@ -17,11 +21,6 @@ import forestry.api.genetics.IEffectData; import forestry.core.config.Constants; import forestry.core.proxy.Proxies; import forestry.core.utils.vect.Vect; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class AlleleEffectSnowing extends AlleleEffectThrottled { @@ -65,7 +64,11 @@ public class AlleleEffectSnowing extends AlleleEffectThrottled { int meta = world.getBlockMetadata(posBlock.x, posBlock.y, posBlock.z); if (meta < 7) { world.setBlockMetadataWithNotify( - posBlock.x, posBlock.y, posBlock.z, meta + 1, Constants.FLAG_BLOCK_SYNCH_AND_UPDATE); + posBlock.x, + posBlock.y, + posBlock.z, + meta + 1, + Constants.FLAG_BLOCK_SYNCH_AND_UPDATE); } } else if (block.isReplaceable(world, posBlock.x, posBlock.y, posBlock.z)) { world.setBlock( @@ -90,9 +93,7 @@ public class AlleleEffectSnowing extends AlleleEffectThrottled { ChunkCoordinates coordinates = housing.getCoordinates(); World world = housing.getWorld(); - Vect spawn = Vect.getRandomPositionInArea(world.rand, area) - .add(coordinates) - .add(offset); + Vect spawn = Vect.getRandomPositionInArea(world.rand, area).add(coordinates).add(offset); Proxies.render.addEntitySnowFX(world, spawn.x, spawn.y, spawn.z); return storedData; } else { diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectThrottled.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectThrottled.java index 384e0069e..af1bc1848 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectThrottled.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectThrottled.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics.alleles; @@ -21,8 +19,8 @@ public abstract class AlleleEffectThrottled extends AlleleEffect { private final int throttle; private boolean requiresWorkingQueen = false; - protected AlleleEffectThrottled( - String name, boolean isDominant, int throttle, boolean requiresWorking, boolean isCombinable) { + protected AlleleEffectThrottled(String name, boolean isDominant, int throttle, boolean requiresWorking, + boolean isCombinable) { super(name, isDominant); this.throttle = throttle; this.isCombinable = isCombinable; diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleFlowers.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleFlowers.java index cef2130fd..2027e6f06 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleFlowers.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleFlowers.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.genetics.alleles; diff --git a/src/main/java/forestry/apiculture/gui/ContainerAlveary.java b/src/main/java/forestry/apiculture/gui/ContainerAlveary.java index fbe9a9b0c..ef12124f8 100755 --- a/src/main/java/forestry/apiculture/gui/ContainerAlveary.java +++ b/src/main/java/forestry/apiculture/gui/ContainerAlveary.java @@ -1,19 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.apiculture.multiblock.TileAlveary; import forestry.core.gui.ContainerTile; import forestry.core.network.packets.PacketGuiUpdate; -import net.minecraft.entity.player.InventoryPlayer; public class ContainerAlveary extends ContainerTile { diff --git a/src/main/java/forestry/apiculture/gui/ContainerAlvearyHygroregulator.java b/src/main/java/forestry/apiculture/gui/ContainerAlvearyHygroregulator.java index 5bf50f1fc..edfc80cb6 100755 --- a/src/main/java/forestry/apiculture/gui/ContainerAlvearyHygroregulator.java +++ b/src/main/java/forestry/apiculture/gui/ContainerAlvearyHygroregulator.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.apiculture.inventory.InventoryHygroregulator; import forestry.apiculture.multiblock.TileAlvearyHygroregulator; import forestry.core.gui.ContainerLiquidTanks; import forestry.core.gui.slots.SlotFiltered; -import net.minecraft.entity.player.InventoryPlayer; public class ContainerAlvearyHygroregulator extends ContainerLiquidTanks { diff --git a/src/main/java/forestry/apiculture/gui/ContainerAlvearySieve.java b/src/main/java/forestry/apiculture/gui/ContainerAlvearySieve.java index 4f5a1829a..1c104c06c 100755 --- a/src/main/java/forestry/apiculture/gui/ContainerAlvearySieve.java +++ b/src/main/java/forestry/apiculture/gui/ContainerAlvearySieve.java @@ -1,22 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.apiculture.inventory.InventoryAlvearySieve; import forestry.apiculture.multiblock.TileAlvearySieve; import forestry.core.gui.ContainerTile; import forestry.core.gui.slots.SlotFiltered; import forestry.core.gui.slots.SlotOutput; import forestry.core.inventory.watchers.ISlotPickupWatcher; -import net.minecraft.entity.player.InventoryPlayer; public class ContainerAlvearySieve extends ContainerTile { diff --git a/src/main/java/forestry/apiculture/gui/ContainerAlvearySwarmer.java b/src/main/java/forestry/apiculture/gui/ContainerAlvearySwarmer.java index bcfa41b22..66d714d25 100755 --- a/src/main/java/forestry/apiculture/gui/ContainerAlvearySwarmer.java +++ b/src/main/java/forestry/apiculture/gui/ContainerAlvearySwarmer.java @@ -1,19 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.apiculture.multiblock.TileAlvearySwarmer; import forestry.core.gui.ContainerTile; import forestry.core.gui.slots.SlotFiltered; -import net.minecraft.entity.player.InventoryPlayer; public class ContainerAlvearySwarmer extends ContainerTile { diff --git a/src/main/java/forestry/apiculture/gui/ContainerBeeHelper.java b/src/main/java/forestry/apiculture/gui/ContainerBeeHelper.java index 7b7b1043c..6927707b7 100644 --- a/src/main/java/forestry/apiculture/gui/ContainerBeeHelper.java +++ b/src/main/java/forestry/apiculture/gui/ContainerBeeHelper.java @@ -1,26 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.gui; +import net.minecraft.inventory.IInventory; + import forestry.apiculture.InventoryBeeHousing; import forestry.apiculture.inventory.InventoryApiary; import forestry.core.gui.ContainerForestry; import forestry.core.gui.slots.SlotFiltered; import forestry.core.gui.slots.SlotOutput; import forestry.core.tiles.IFilterSlotDelegate; -import net.minecraft.inventory.IInventory; public abstract class ContainerBeeHelper { - public static void addSlots( - ContainerForestry container, T inventory, boolean hasFrames) { + + public static void addSlots(ContainerForestry container, T inventory, + boolean hasFrames) { // Queen/Princess container.addSlotToContainer(new SlotFiltered(inventory, InventoryBeeHousing.SLOT_QUEEN, 29, 39)); diff --git a/src/main/java/forestry/apiculture/gui/ContainerBeeHousing.java b/src/main/java/forestry/apiculture/gui/ContainerBeeHousing.java index baf0743e9..d0fd8def2 100644 --- a/src/main/java/forestry/apiculture/gui/ContainerBeeHousing.java +++ b/src/main/java/forestry/apiculture/gui/ContainerBeeHousing.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.apiculture.tiles.TileBeeHousingBase; import forestry.core.gui.ContainerTile; import forestry.core.network.IForestryPacketClient; import forestry.core.network.packets.PacketGuiUpdate; -import net.minecraft.entity.player.InventoryPlayer; public class ContainerBeeHousing extends ContainerTile implements IContainerBeeHousing { diff --git a/src/main/java/forestry/apiculture/gui/ContainerHabitatLocator.java b/src/main/java/forestry/apiculture/gui/ContainerHabitatLocator.java index dcda97aa9..5b5f8d554 100755 --- a/src/main/java/forestry/apiculture/gui/ContainerHabitatLocator.java +++ b/src/main/java/forestry/apiculture/gui/ContainerHabitatLocator.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.gui; +import net.minecraft.entity.player.EntityPlayer; + import forestry.apiculture.inventory.ItemInventoryHabitatLocator; import forestry.core.gui.ContainerItemInventory; import forestry.core.gui.slots.SlotFiltered; import forestry.core.gui.slots.SlotOutput; -import net.minecraft.entity.player.EntityPlayer; public class ContainerHabitatLocator extends ContainerItemInventory { diff --git a/src/main/java/forestry/apiculture/gui/ContainerImprinter.java b/src/main/java/forestry/apiculture/gui/ContainerImprinter.java index 439040298..b0d3ea2ad 100755 --- a/src/main/java/forestry/apiculture/gui/ContainerImprinter.java +++ b/src/main/java/forestry/apiculture/gui/ContainerImprinter.java @@ -1,15 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.gui; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.apiculture.inventory.ItemInventoryImprinter; import forestry.apiculture.network.packets.PacketImprintSelectionResponse; import forestry.core.gui.ContainerItemInventory; @@ -18,8 +19,6 @@ import forestry.core.gui.slots.SlotFiltered; import forestry.core.gui.slots.SlotOutput; import forestry.core.network.packets.PacketGuiSelectRequest; import forestry.core.proxy.Proxies; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; public class ContainerImprinter extends ContainerItemInventory implements IGuiSelectable { @@ -48,8 +47,9 @@ public class ContainerImprinter extends ContainerItemInventory implements IContainerBeeHousing { + public ContainerMinecartBeehouse(InventoryPlayer player, EntityMinecartBeeHousingBase entity, boolean hasFrames) { super(entity, player, 8, 108); ContainerBeeHelper.addSlots(this, entity, hasFrames); diff --git a/src/main/java/forestry/apiculture/gui/GuiAlveary.java b/src/main/java/forestry/apiculture/gui/GuiAlveary.java index e31cab8b2..4b6797ce5 100755 --- a/src/main/java/forestry/apiculture/gui/GuiAlveary.java +++ b/src/main/java/forestry/apiculture/gui/GuiAlveary.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.apiculture.multiblock.IAlvearyControllerInternal; import forestry.apiculture.multiblock.TileAlveary; import forestry.core.config.Constants; import forestry.core.gui.GuiForestryTitled; import forestry.core.render.EnumTankLevel; -import net.minecraft.entity.player.InventoryPlayer; public class GuiAlveary extends GuiForestryTitled { @@ -29,8 +28,7 @@ public class GuiAlveary extends GuiForestryTitled protected void drawGuiContainerBackgroundLayer(float var1, int mouseX, int mouseY) { super.drawGuiContainerBackgroundLayer(var1, mouseX, mouseY); - IAlvearyControllerInternal alvearyController = - inventory.getMultiblockLogic().getController(); + IAlvearyControllerInternal alvearyController = inventory.getMultiblockLogic().getController(); drawHealthMeter( guiLeft + 20, guiTop + 37, diff --git a/src/main/java/forestry/apiculture/gui/GuiAlvearyHygroregulator.java b/src/main/java/forestry/apiculture/gui/GuiAlvearyHygroregulator.java index 87060fd84..ef14815b0 100755 --- a/src/main/java/forestry/apiculture/gui/GuiAlvearyHygroregulator.java +++ b/src/main/java/forestry/apiculture/gui/GuiAlvearyHygroregulator.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.apiculture.multiblock.TileAlvearyHygroregulator; import forestry.core.config.Constants; import forestry.core.gui.GuiForestryTitled; import forestry.core.gui.widgets.TankWidget; -import net.minecraft.entity.player.InventoryPlayer; public class GuiAlvearyHygroregulator extends GuiForestryTitled { diff --git a/src/main/java/forestry/apiculture/gui/GuiAlvearySieve.java b/src/main/java/forestry/apiculture/gui/GuiAlvearySieve.java index bac6e66f5..92141a841 100755 --- a/src/main/java/forestry/apiculture/gui/GuiAlvearySieve.java +++ b/src/main/java/forestry/apiculture/gui/GuiAlvearySieve.java @@ -1,19 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.apiculture.multiblock.TileAlvearySieve; import forestry.core.config.Constants; import forestry.core.gui.GuiForestryTitled; -import net.minecraft.entity.player.InventoryPlayer; public class GuiAlvearySieve extends GuiForestryTitled { diff --git a/src/main/java/forestry/apiculture/gui/GuiAlvearySwarmer.java b/src/main/java/forestry/apiculture/gui/GuiAlvearySwarmer.java index 5bca6cacd..271cb97a4 100755 --- a/src/main/java/forestry/apiculture/gui/GuiAlvearySwarmer.java +++ b/src/main/java/forestry/apiculture/gui/GuiAlvearySwarmer.java @@ -1,19 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.apiculture.multiblock.TileAlvearySwarmer; import forestry.core.config.Constants; import forestry.core.gui.GuiForestryTitled; -import net.minecraft.entity.player.InventoryPlayer; public class GuiAlvearySwarmer extends GuiForestryTitled { diff --git a/src/main/java/forestry/apiculture/gui/GuiBeeHousing.java b/src/main/java/forestry/apiculture/gui/GuiBeeHousing.java index 677313264..86b898a42 100644 --- a/src/main/java/forestry/apiculture/gui/GuiBeeHousing.java +++ b/src/main/java/forestry/apiculture/gui/GuiBeeHousing.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.gui; +import net.minecraft.inventory.Container; + import forestry.core.config.Constants; import forestry.core.gui.GuiForestryTitled; import forestry.core.render.EnumTankLevel; -import net.minecraft.inventory.Container; public class GuiBeeHousing extends GuiForestryTitled { public enum Icon { + APIARY("/apiary.png"), BEE_HOUSE("/alveary.png"); diff --git a/src/main/java/forestry/apiculture/gui/GuiBeealyzer.java b/src/main/java/forestry/apiculture/gui/GuiBeealyzer.java index c7670f4ad..eef3cab55 100755 --- a/src/main/java/forestry/apiculture/gui/GuiBeealyzer.java +++ b/src/main/java/forestry/apiculture/gui/GuiBeealyzer.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.gui; +import java.util.ArrayList; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import forestry.api.apiculture.*; import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IAlleleInteger; @@ -22,9 +25,6 @@ import forestry.core.gui.GuiAlyzer; import forestry.core.gui.widgets.ItemStackWidget; import forestry.core.utils.StringUtil; import forestry.plugins.PluginApiculture; -import java.util.ArrayList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class GuiBeealyzer extends GuiAlyzer { @@ -99,9 +99,11 @@ public class GuiBeealyzer extends GuiAlyzer { textLayout.newLine(); { - String customPrimaryBeeKey = "bees.custom.beealyzer." + type.getName() + "." + String customPrimaryBeeKey = "bees.custom.beealyzer." + type.getName() + + "." + bee.getGenome().getPrimary().getUnlocalizedName().replace("bees.species.", ""); - String customSecondaryBeeKey = "bees.custom.beealyzer." + type.getName() + "." + String customSecondaryBeeKey = "bees.custom.beealyzer." + type.getName() + + "." + bee.getGenome().getSecondary().getUnlocalizedName().replace("bees.species.", ""); drawSpeciesRow( @@ -124,8 +126,8 @@ public class GuiBeealyzer extends GuiAlyzer { textLayout.drawLine(StringUtil.localize("gui.fertility"), COLUMN_0); IAlleleInteger primaryFertility = (IAlleleInteger) bee.getGenome().getActiveAllele(EnumBeeChromosome.FERTILITY); - IAlleleInteger secondaryFertility = - (IAlleleInteger) bee.getGenome().getInactiveAllele(EnumBeeChromosome.FERTILITY); + IAlleleInteger secondaryFertility = (IAlleleInteger) bee.getGenome() + .getInactiveAllele(EnumBeeChromosome.FERTILITY); drawFertilityInfo(primaryFertility.getValue(), COLUMN_1, getColorCoding(primaryFertility.isDominant()), 0); drawFertilityInfo(secondaryFertility.getValue(), COLUMN_2, getColorCoding(secondaryFertility.isDominant()), 0); textLayout.newLine(); @@ -150,19 +152,17 @@ public class GuiBeealyzer extends GuiAlyzer { drawRow( StringUtil.localize("gui.climate"), - AlleleManager.climateHelper.toDisplay( - bee.getGenome().getPrimary().getTemperature()), - AlleleManager.climateHelper.toDisplay( - bee.getGenome().getSecondary().getTemperature()), + AlleleManager.climateHelper.toDisplay(bee.getGenome().getPrimary().getTemperature()), + AlleleManager.climateHelper.toDisplay(bee.getGenome().getSecondary().getTemperature()), bee, EnumBeeChromosome.SPECIES); textLayout.newLine(); - IAlleleTolerance tempToleranceActive = - (IAlleleTolerance) bee.getGenome().getActiveAllele(EnumBeeChromosome.TEMPERATURE_TOLERANCE); - IAlleleTolerance tempToleranceInactive = - (IAlleleTolerance) bee.getGenome().getInactiveAllele(EnumBeeChromosome.TEMPERATURE_TOLERANCE); + IAlleleTolerance tempToleranceActive = (IAlleleTolerance) bee.getGenome() + .getActiveAllele(EnumBeeChromosome.TEMPERATURE_TOLERANCE); + IAlleleTolerance tempToleranceInactive = (IAlleleTolerance) bee.getGenome() + .getInactiveAllele(EnumBeeChromosome.TEMPERATURE_TOLERANCE); textLayout.drawLine(" " + StringUtil.localize("gui.tolerance"), COLUMN_0); drawToleranceInfo(tempToleranceActive, COLUMN_1); drawToleranceInfo(tempToleranceInactive, COLUMN_2); @@ -171,19 +171,17 @@ public class GuiBeealyzer extends GuiAlyzer { drawRow( StringUtil.localize("gui.humidity"), - AlleleManager.climateHelper.toDisplay( - bee.getGenome().getPrimary().getHumidity()), - AlleleManager.climateHelper.toDisplay( - bee.getGenome().getSecondary().getHumidity()), + AlleleManager.climateHelper.toDisplay(bee.getGenome().getPrimary().getHumidity()), + AlleleManager.climateHelper.toDisplay(bee.getGenome().getSecondary().getHumidity()), bee, EnumBeeChromosome.SPECIES); textLayout.newLine(); - IAlleleTolerance humidToleranceActive = - (IAlleleTolerance) bee.getGenome().getActiveAllele(EnumBeeChromosome.HUMIDITY_TOLERANCE); - IAlleleTolerance humidToleranceInactive = - (IAlleleTolerance) bee.getGenome().getInactiveAllele(EnumBeeChromosome.HUMIDITY_TOLERANCE); + IAlleleTolerance humidToleranceActive = (IAlleleTolerance) bee.getGenome() + .getActiveAllele(EnumBeeChromosome.HUMIDITY_TOLERANCE); + IAlleleTolerance humidToleranceInactive = (IAlleleTolerance) bee.getGenome() + .getInactiveAllele(EnumBeeChromosome.HUMIDITY_TOLERANCE); textLayout.drawLine(" " + StringUtil.localize("gui.tolerance"), COLUMN_0); drawToleranceInfo(humidToleranceActive, COLUMN_1); drawToleranceInfo(humidToleranceInactive, COLUMN_2); diff --git a/src/main/java/forestry/apiculture/gui/GuiHabitatLocator.java b/src/main/java/forestry/apiculture/gui/GuiHabitatLocator.java index 45ec79e17..811eb2fd9 100755 --- a/src/main/java/forestry/apiculture/gui/GuiHabitatLocator.java +++ b/src/main/java/forestry/apiculture/gui/GuiHabitatLocator.java @@ -1,20 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.gui; -import com.google.common.collect.LinkedListMultimap; -import forestry.apiculture.gui.widgets.HabitatSlot; -import forestry.apiculture.inventory.ItemInventoryHabitatLocator; -import forestry.core.config.Constants; -import forestry.core.gui.GuiForestry; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -22,13 +15,23 @@ import java.util.Collections; import java.util.EnumSet; import java.util.List; import java.util.Set; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.StatCollector; import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.common.BiomeDictionary; + import org.lwjgl.opengl.GL11; +import com.google.common.collect.LinkedListMultimap; + +import forestry.apiculture.gui.widgets.HabitatSlot; +import forestry.apiculture.inventory.ItemInventoryHabitatLocator; +import forestry.core.config.Constants; +import forestry.core.gui.GuiForestry; + public class GuiHabitatLocator extends GuiForestry { + private static final LinkedListMultimap habitats = LinkedListMultimap.create(); static { @@ -80,10 +83,12 @@ public class GuiHabitatLocator extends GuiForestry activeBiomeTypes = EnumSet.noneOf(BiomeDictionary.Type.class); diff --git a/src/main/java/forestry/apiculture/gui/GuiImprinter.java b/src/main/java/forestry/apiculture/gui/GuiImprinter.java index 8bc2adb16..f9be6bee6 100755 --- a/src/main/java/forestry/apiculture/gui/GuiImprinter.java +++ b/src/main/java/forestry/apiculture/gui/GuiImprinter.java @@ -1,15 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.gui; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.item.ItemStack; + import forestry.api.apiculture.IAlleleBeeSpecies; import forestry.apiculture.genetics.BeeGenome; import forestry.apiculture.inventory.ItemInventoryImprinter; @@ -20,12 +26,6 @@ import forestry.core.network.packets.PacketGuiSelectRequest; import forestry.core.proxy.Proxies; import forestry.core.utils.StringUtil; import forestry.plugins.PluginApiculture; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.item.ItemStack; public class GuiImprinter extends GuiForestry { @@ -82,8 +82,8 @@ public class GuiImprinter extends GuiForestry= xPos[l] && i <= xPos[l] + 16 && j >= yPos[l] && j <= yPos[l] + 16) { diff --git a/src/main/java/forestry/apiculture/gui/IContainerBeeHousing.java b/src/main/java/forestry/apiculture/gui/IContainerBeeHousing.java index f3dadd359..b791f3ecc 100644 --- a/src/main/java/forestry/apiculture/gui/IContainerBeeHousing.java +++ b/src/main/java/forestry/apiculture/gui/IContainerBeeHousing.java @@ -1,13 +1,12 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.gui; -public interface IContainerBeeHousing {} +public interface IContainerBeeHousing { +} diff --git a/src/main/java/forestry/apiculture/gui/IGuiBeeHousingInventory.java b/src/main/java/forestry/apiculture/gui/IGuiBeeHousingInventory.java index a0419f464..f13dc6759 100644 --- a/src/main/java/forestry/apiculture/gui/IGuiBeeHousingInventory.java +++ b/src/main/java/forestry/apiculture/gui/IGuiBeeHousingInventory.java @@ -1,19 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.gui; -import forestry.core.tiles.ITitled; import net.minecraft.inventory.IInventory; +import forestry.core.tiles.ITitled; + public interface IGuiBeeHousingInventory extends ITitled, IInventory { + /** Returns scaled queen health or breeding progress */ int getHealthScaled(int i); } diff --git a/src/main/java/forestry/apiculture/gui/widgets/HabitatSlot.java b/src/main/java/forestry/apiculture/gui/widgets/HabitatSlot.java index abd1c14ca..73f14e044 100644 --- a/src/main/java/forestry/apiculture/gui/widgets/HabitatSlot.java +++ b/src/main/java/forestry/apiculture/gui/widgets/HabitatSlot.java @@ -1,36 +1,38 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.gui.widgets; +import java.util.Collection; +import java.util.Collections; +import java.util.Locale; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.IIcon; +import net.minecraftforge.common.BiomeDictionary; + +import org.lwjgl.opengl.GL11; + import forestry.core.gui.widgets.Widget; import forestry.core.gui.widgets.WidgetManager; import forestry.core.proxy.Proxies; import forestry.core.render.SpriteSheet; import forestry.core.render.TextureManager; -import java.util.Collection; -import java.util.Collections; -import java.util.Locale; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.IIcon; -import net.minecraftforge.common.BiomeDictionary; -import org.lwjgl.opengl.GL11; public class HabitatSlot extends Widget { + private final Collection biomes; private final String name; private final String iconIndex; public boolean isActive = false; - public HabitatSlot( - WidgetManager widgetManager, int xPos, int yPos, String name, Collection biomes) { + public HabitatSlot(WidgetManager widgetManager, int xPos, int yPos, String name, + Collection biomes) { super(widgetManager, xPos, yPos); this.biomes = biomes; this.name = name; diff --git a/src/main/java/forestry/apiculture/inventory/IApiaryInventory.java b/src/main/java/forestry/apiculture/inventory/IApiaryInventory.java index 6fcd2d81b..00a8c82cc 100644 --- a/src/main/java/forestry/apiculture/inventory/IApiaryInventory.java +++ b/src/main/java/forestry/apiculture/inventory/IApiaryInventory.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.inventory; @@ -14,5 +12,6 @@ import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeeHousingInventory; public interface IApiaryInventory extends IBeeHousingInventory { + void wearOutFrames(IBeeHousing beeHousing, int amount); } diff --git a/src/main/java/forestry/apiculture/inventory/InventoryAlvearySieve.java b/src/main/java/forestry/apiculture/inventory/InventoryAlvearySieve.java index 4b3497343..e54635c9d 100644 --- a/src/main/java/forestry/apiculture/inventory/InventoryAlvearySieve.java +++ b/src/main/java/forestry/apiculture/inventory/InventoryAlvearySieve.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.inventory; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import forestry.apiculture.multiblock.TileAlvearySieve; import forestry.core.inventory.InventoryAdapterTile; import forestry.core.inventory.watchers.ISlotPickupWatcher; import forestry.core.utils.ItemStackUtil; import forestry.plugins.PluginCore; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class InventoryAlvearySieve extends InventoryAdapterTile implements ISlotPickupWatcher { + public static final int SLOT_POLLEN_1 = 0; public static final int SLOTS_POLLEN_COUNT = 4; public static final int SLOT_SIEVE = 4; diff --git a/src/main/java/forestry/apiculture/inventory/InventoryApiary.java b/src/main/java/forestry/apiculture/inventory/InventoryApiary.java index 6e69e540e..e67efc47e 100644 --- a/src/main/java/forestry/apiculture/inventory/InventoryApiary.java +++ b/src/main/java/forestry/apiculture/inventory/InventoryApiary.java @@ -1,15 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.inventory; +import java.util.ArrayList; +import java.util.Collection; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.IBee; import forestry.api.apiculture.IBeeHousing; @@ -18,12 +22,9 @@ import forestry.api.apiculture.IHiveFrame; import forestry.apiculture.InventoryBeeHousing; import forestry.core.access.IAccessHandler; import forestry.core.utils.SlotUtil; -import java.util.ArrayList; -import java.util.Collection; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; public class InventoryApiary extends InventoryBeeHousing implements IApiaryInventory { + public static final int SLOT_FRAMES_1 = 9; public static final int SLOT_FRAMES_COUNT = 3; diff --git a/src/main/java/forestry/apiculture/inventory/InventoryHygroregulator.java b/src/main/java/forestry/apiculture/inventory/InventoryHygroregulator.java index 49747b10f..f3b24c8ed 100644 --- a/src/main/java/forestry/apiculture/inventory/InventoryHygroregulator.java +++ b/src/main/java/forestry/apiculture/inventory/InventoryHygroregulator.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.inventory; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; + import forestry.apiculture.multiblock.TileAlvearyHygroregulator; import forestry.core.fluids.FluidHelper; import forestry.core.inventory.InventoryAdapterTile; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; public class InventoryHygroregulator extends InventoryAdapterTile { + public static final short SLOT_INPUT = 0; public InventoryHygroregulator(TileAlvearyHygroregulator alvearyHygroregulator) { diff --git a/src/main/java/forestry/apiculture/inventory/InventorySwarmer.java b/src/main/java/forestry/apiculture/inventory/InventorySwarmer.java index f375bd5a7..0172542bf 100644 --- a/src/main/java/forestry/apiculture/inventory/InventorySwarmer.java +++ b/src/main/java/forestry/apiculture/inventory/InventorySwarmer.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.inventory; +import net.minecraft.item.ItemStack; + import forestry.api.apiculture.BeeManager; import forestry.apiculture.multiblock.TileAlvearySwarmer; import forestry.core.inventory.InventoryAdapterTile; import forestry.core.utils.ItemStackUtil; -import net.minecraft.item.ItemStack; public class InventorySwarmer extends InventoryAdapterTile { + public InventorySwarmer(TileAlvearySwarmer alvearySwarmer) { super(alvearySwarmer, 4, "SwarmInv"); } diff --git a/src/main/java/forestry/apiculture/inventory/ItemInventoryBeealyzer.java b/src/main/java/forestry/apiculture/inventory/ItemInventoryBeealyzer.java index cfa6e693e..be88ec8c1 100644 --- a/src/main/java/forestry/apiculture/inventory/ItemInventoryBeealyzer.java +++ b/src/main/java/forestry/apiculture/inventory/ItemInventoryBeealyzer.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.inventory; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import forestry.api.apiculture.BeeManager; import forestry.core.config.Config; import forestry.core.gui.IHintSource; import forestry.core.inventory.ItemInventoryAlyzer; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class ItemInventoryBeealyzer extends ItemInventoryAlyzer implements IHintSource { diff --git a/src/main/java/forestry/apiculture/inventory/ItemInventoryHabitatLocator.java b/src/main/java/forestry/apiculture/inventory/ItemInventoryHabitatLocator.java index 62c460750..5f35e2940 100644 --- a/src/main/java/forestry/apiculture/inventory/ItemInventoryHabitatLocator.java +++ b/src/main/java/forestry/apiculture/inventory/ItemInventoryHabitatLocator.java @@ -1,16 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.inventory; +import java.util.List; +import java.util.Set; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.world.biome.BiomeGenBase; + import com.google.common.collect.ImmutableSet; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.IBee; import forestry.api.core.IErrorSource; @@ -22,12 +29,6 @@ import forestry.core.errors.EnumErrorCode; import forestry.core.gui.IHintSource; import forestry.core.inventory.ItemInventory; import forestry.plugins.PluginApiculture; -import java.util.List; -import java.util.Set; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.biome.BiomeGenBase; public class ItemInventoryHabitatLocator extends ItemInventory implements IErrorSource, IHintSource { diff --git a/src/main/java/forestry/apiculture/inventory/ItemInventoryImprinter.java b/src/main/java/forestry/apiculture/inventory/ItemInventoryImprinter.java index a3807df01..e0ee318aa 100644 --- a/src/main/java/forestry/apiculture/inventory/ItemInventoryImprinter.java +++ b/src/main/java/forestry/apiculture/inventory/ItemInventoryImprinter.java @@ -1,25 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.inventory; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.IAlleleBeeSpecies; import forestry.api.apiculture.IBee; import forestry.apiculture.genetics.Bee; import forestry.core.inventory.ItemInventory; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class ItemInventoryImprinter extends ItemInventory { + private static final short specimenSlot = 0; private static final short imprintedSlot = 1; @@ -63,35 +63,20 @@ public class ItemInventoryImprinter extends ItemInventory { } public IAlleleBeeSpecies getPrimary() { - return BeeManager.beeRoot - .getIndividualTemplates() - .get(primaryIndex) - .getGenome() - .getPrimary(); + return BeeManager.beeRoot.getIndividualTemplates().get(primaryIndex).getGenome().getPrimary(); } public IAlleleBeeSpecies getSecondary() { - return BeeManager.beeRoot - .getIndividualTemplates() - .get(secondaryIndex) - .getGenome() - .getPrimary(); + return BeeManager.beeRoot.getIndividualTemplates().get(secondaryIndex).getGenome().getPrimary(); } public IBee getSelectedBee() { - return new Bee(BeeManager.beeRoot.templateAsGenome( - BeeManager.beeRoot - .getGenomeTemplates() - .get(BeeManager.beeRoot - .getIndividualTemplates() - .get(primaryIndex) - .getIdent()), - BeeManager.beeRoot - .getGenomeTemplates() - .get(BeeManager.beeRoot - .getIndividualTemplates() - .get(secondaryIndex) - .getIdent()))); + return new Bee( + BeeManager.beeRoot.templateAsGenome( + BeeManager.beeRoot.getGenomeTemplates() + .get(BeeManager.beeRoot.getIndividualTemplates().get(primaryIndex).getIdent()), + BeeManager.beeRoot.getGenomeTemplates() + .get(BeeManager.beeRoot.getIndividualTemplates().get(secondaryIndex).getIdent()))); } public int getPrimaryIndex() { diff --git a/src/main/java/forestry/apiculture/items/EnumHoneyComb.java b/src/main/java/forestry/apiculture/items/EnumHoneyComb.java index e487189e5..8247666c6 100644 --- a/src/main/java/forestry/apiculture/items/EnumHoneyComb.java +++ b/src/main/java/forestry/apiculture/items/EnumHoneyComb.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.items; @@ -14,6 +12,7 @@ import java.awt.Color; import java.util.Locale; public enum EnumHoneyComb { + HONEY(new Color(0xe8d56a), new Color(0xffa12b)), COCOA(new Color(0x674016), new Color(0xffb62b), true), SIMMERING(new Color(0x981919), new Color(0xffb62b)), diff --git a/src/main/java/forestry/apiculture/items/EnumHoneyDrop.java b/src/main/java/forestry/apiculture/items/EnumHoneyDrop.java index 8dd705db2..90e2bcaf5 100644 --- a/src/main/java/forestry/apiculture/items/EnumHoneyDrop.java +++ b/src/main/java/forestry/apiculture/items/EnumHoneyDrop.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.items; -import forestry.core.items.ItemOverlay; import java.awt.Color; import java.util.Locale; +import forestry.core.items.ItemOverlay; + public enum EnumHoneyDrop implements ItemOverlay.IOverlayInfo { + HONEY(new Color(0xecb42d), new Color(0xe8c814)), CHARGED(new Color(0x800505), new Color(0x9c0707), true), OMEGA(new Color(0x191919), new Color(0x4a8ca7), true); diff --git a/src/main/java/forestry/apiculture/items/EnumPollenCluster.java b/src/main/java/forestry/apiculture/items/EnumPollenCluster.java index 6d4e04c38..03f7a02b2 100644 --- a/src/main/java/forestry/apiculture/items/EnumPollenCluster.java +++ b/src/main/java/forestry/apiculture/items/EnumPollenCluster.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.items; -import forestry.core.items.ItemOverlay; import java.awt.Color; import java.util.Locale; +import forestry.core.items.ItemOverlay; + public enum EnumPollenCluster implements ItemOverlay.IOverlayInfo { + NORMAL(new Color(0xa28a25), new Color(0xa28a25)), CRYSTALLINE(new Color(0xffffff), new Color(0xc5feff)); diff --git a/src/main/java/forestry/apiculture/items/EnumPropolis.java b/src/main/java/forestry/apiculture/items/EnumPropolis.java index a25e0e72d..1d17f5877 100644 --- a/src/main/java/forestry/apiculture/items/EnumPropolis.java +++ b/src/main/java/forestry/apiculture/items/EnumPropolis.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.items; -import forestry.core.items.ItemOverlay; import java.awt.Color; import java.util.Locale; +import forestry.core.items.ItemOverlay; + public enum EnumPropolis implements ItemOverlay.IOverlayInfo { + NORMAL(new Color(0xc5b24e)), STICKY(new Color(0xc68e57)), PULSATING(new Color(0x2ccdb1), true), diff --git a/src/main/java/forestry/apiculture/items/HabitatLocatorLogic.java b/src/main/java/forestry/apiculture/items/HabitatLocatorLogic.java index 2696fe978..7b3630616 100644 --- a/src/main/java/forestry/apiculture/items/HabitatLocatorLogic.java +++ b/src/main/java/forestry/apiculture/items/HabitatLocatorLogic.java @@ -1,23 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.items; -import forestry.api.apiculture.IBee; -import forestry.apiculture.network.packets.PacketHabitatBiomePointer; -import forestry.core.proxy.Proxies; -import forestry.core.utils.vect.Vect; import java.util.Collection; import java.util.Collections; import java.util.HashSet; import java.util.Set; + import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; @@ -26,7 +21,13 @@ import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; import net.minecraftforge.common.BiomeDictionary; +import forestry.api.apiculture.IBee; +import forestry.apiculture.network.packets.PacketHabitatBiomePointer; +import forestry.core.proxy.Proxies; +import forestry.core.utils.vect.Vect; + public class HabitatLocatorLogic { + private static final int maxChecksPerTick = 100; private static final int maxSearchRadiusIterations = 500; private static final int spacing = 20; @@ -148,8 +149,8 @@ public class HabitatLocatorLogic { return null; } - private static ChunkCoordinates getChunkCoordinates( - Vect pos, World world, Collection biomesToSearch) { + private static ChunkCoordinates getChunkCoordinates(Vect pos, World world, + Collection biomesToSearch) { BiomeGenBase biome; biome = world.getBiomeGenForCoords(pos.x, pos.z); diff --git a/src/main/java/forestry/apiculture/items/ItemArmorApiarist.java b/src/main/java/forestry/apiculture/items/ItemArmorApiarist.java index 71c1375f9..86c23f140 100755 --- a/src/main/java/forestry/apiculture/items/ItemArmorApiarist.java +++ b/src/main/java/forestry/apiculture/items/ItemArmorApiarist.java @@ -1,15 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.items; +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 cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.apiculture.IArmorApiarist; @@ -19,13 +25,6 @@ import forestry.core.config.Constants; import forestry.core.render.TextureManager; import forestry.core.utils.StringUtil; import forestry.plugins.PluginApiculture; -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; public class ItemArmorApiarist extends ItemArmor implements IArmorApiarist, IArmorNaturalist { diff --git a/src/main/java/forestry/apiculture/items/ItemBeeGE.java b/src/main/java/forestry/apiculture/items/ItemBeeGE.java index a1e627763..cd37b5915 100755 --- a/src/main/java/forestry/apiculture/items/ItemBeeGE.java +++ b/src/main/java/forestry/apiculture/items/ItemBeeGE.java @@ -1,15 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.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.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IIcon; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.apiculture.BeeManager; @@ -25,14 +33,6 @@ import forestry.apiculture.genetics.BeeGenome; import forestry.core.config.Config; import forestry.core.genetics.ItemGE; import forestry.core.utils.StringUtil; -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.util.EnumChatFormatting; -import net.minecraft.util.IIcon; public class ItemBeeGE extends ItemGE { @@ -74,7 +74,8 @@ public class ItemBeeGE extends ItemGE { } IBee individual = BeeManager.beeRoot.getMember(itemstack); - String customBeeKey = "bees.custom." + type.getName() + "." + String customBeeKey = "bees.custom." + type.getName() + + "." + individual.getGenome().getPrimary().getUnlocalizedName().replace("bees.species.", ""); if (StringUtil.canTranslate(customBeeKey)) { return StringUtil.localize(customBeeKey); @@ -85,7 +86,7 @@ public class ItemBeeGE extends ItemGE { return beeGrammar.replaceAll("%SPECIES", beeSpecies).replaceAll("%TYPE", beeType); } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean flag) { if (!itemstack.hasTagCompound()) { @@ -95,9 +96,9 @@ public class ItemBeeGE extends ItemGE { if (type != EnumBeeType.DRONE) { IBee individual = BeeManager.beeRoot.getMember(itemstack); if (individual.isNatural()) { - list.add(EnumChatFormatting.YELLOW - + EnumChatFormatting.ITALIC.toString() - + StringUtil.localize("bees.stock.pristine")); + list.add( + EnumChatFormatting.YELLOW + EnumChatFormatting.ITALIC.toString() + + StringUtil.localize("bees.stock.pristine")); } else { list.add(EnumChatFormatting.YELLOW + StringUtil.localize("bees.stock.ignoble")); } @@ -112,7 +113,7 @@ public class ItemBeeGE extends ItemGE { addCreativeItems(itemList, true); } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) public void addCreativeItems(List itemList, boolean hideSecrets) { for (IBee bee : BeeManager.beeRoot.getIndividualTemplates()) { // Don't show secret bees unless ordered to. @@ -161,8 +162,7 @@ public class ItemBeeGE extends ItemGE { @Override @SideOnly(Side.CLIENT) public void registerIcons(IIconRegister register) { - for (IAllele allele : - AlleleManager.alleleRegistry.getRegisteredAlleles().values()) { + for (IAllele allele : AlleleManager.alleleRegistry.getRegisteredAlleles().values()) { if (allele instanceof IAlleleBeeSpecies) { ((IAlleleBeeSpecies) allele).getIconProvider().registerIcons(register); } diff --git a/src/main/java/forestry/apiculture/items/ItemBeealyzer.java b/src/main/java/forestry/apiculture/items/ItemBeealyzer.java index 14bf04ca4..e7a8ed41c 100644 --- a/src/main/java/forestry/apiculture/items/ItemBeealyzer.java +++ b/src/main/java/forestry/apiculture/items/ItemBeealyzer.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.items; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import forestry.api.core.Tabs; import forestry.apiculture.gui.GuiBeealyzer; import forestry.apiculture.inventory.ItemInventoryBeealyzer; import forestry.core.gui.ContainerAlyzer; import forestry.core.items.ItemWithGui; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class ItemBeealyzer extends ItemWithGui { + public ItemBeealyzer() { setCreativeTab(Tabs.tabApiculture); } diff --git a/src/main/java/forestry/apiculture/items/ItemBlockCandle.java b/src/main/java/forestry/apiculture/items/ItemBlockCandle.java index cab02f201..802547aab 100644 --- a/src/main/java/forestry/apiculture/items/ItemBlockCandle.java +++ b/src/main/java/forestry/apiculture/items/ItemBlockCandle.java @@ -1,23 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.items; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.apiculture.blocks.BlockCandle; import forestry.core.items.ItemBlockForestry; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.IIcon; public class ItemBlockCandle extends ItemBlockForestry { diff --git a/src/main/java/forestry/apiculture/items/ItemHabitatLocator.java b/src/main/java/forestry/apiculture/items/ItemHabitatLocator.java index 4b629b003..3808ba8f1 100644 --- a/src/main/java/forestry/apiculture/items/ItemHabitatLocator.java +++ b/src/main/java/forestry/apiculture/items/ItemHabitatLocator.java @@ -1,15 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.items; +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.client.renderer.texture.TextureMap; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.core.EnumHumidity; @@ -22,17 +31,9 @@ import forestry.apiculture.inventory.ItemInventoryHabitatLocator; import forestry.apiculture.render.TextureHabitatLocator; import forestry.core.items.ItemWithGui; import forestry.core.utils.StringUtil; -import java.util.List; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; public class ItemHabitatLocator extends ItemWithGui { + private static final String iconName = "forestry:biomefinder"; private final HabitatLocatorLogic locatorLogic; @@ -65,13 +66,13 @@ public class ItemHabitatLocator extends ItemWithGui { } } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean flag) { BiomeGenBase currentBiome = player.worldObj.getBiomeGenForCoords((int) player.posX, (int) player.posZ); - float temperatureValue = - currentBiome.getFloatTemperature((int) player.posX, (int) player.posY, (int) player.posZ); + float temperatureValue = currentBiome + .getFloatTemperature((int) player.posX, (int) player.posY, (int) player.posZ); EnumTemperature temperature = EnumTemperature.getFromValue(temperatureValue); EnumHumidity humidity = EnumHumidity.getFromValue(currentBiome.rainfall); diff --git a/src/main/java/forestry/apiculture/items/ItemHiveFrame.java b/src/main/java/forestry/apiculture/items/ItemHiveFrame.java index 0753a2dea..25bdb4943 100755 --- a/src/main/java/forestry/apiculture/items/ItemHiveFrame.java +++ b/src/main/java/forestry/apiculture/items/ItemHiveFrame.java @@ -1,15 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.items; +import net.minecraft.item.ItemStack; + import forestry.api.apiculture.DefaultBeeModifier; import forestry.api.apiculture.IBee; import forestry.api.apiculture.IBeeGenome; @@ -18,7 +18,6 @@ import forestry.api.apiculture.IBeeModifier; import forestry.api.apiculture.IHiveFrame; import forestry.api.core.Tabs; import forestry.core.items.ItemForestry; -import net.minecraft.item.ItemStack; public class ItemHiveFrame extends ItemForestry implements IHiveFrame { @@ -48,6 +47,7 @@ public class ItemHiveFrame extends ItemForestry implements IHiveFrame { } private static class HiveFrameBeeModifier extends DefaultBeeModifier { + private final float geneticDecay; public HiveFrameBeeModifier(float geneticDecay) { diff --git a/src/main/java/forestry/apiculture/items/ItemHoneycomb.java b/src/main/java/forestry/apiculture/items/ItemHoneycomb.java index c1d32cb2e..0abac1f5f 100755 --- a/src/main/java/forestry/apiculture/items/ItemHoneycomb.java +++ b/src/main/java/forestry/apiculture/items/ItemHoneycomb.java @@ -1,26 +1,27 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.items; -import forestry.api.core.Tabs; -import forestry.core.config.Config; -import forestry.core.items.ItemForestryMultiPass; import java.util.ArrayList; import java.util.List; import java.util.Random; + import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import forestry.api.core.Tabs; +import forestry.core.config.Config; +import forestry.core.items.ItemForestryMultiPass; + public class ItemHoneycomb extends ItemForestryMultiPass { + public ItemHoneycomb() { super(); setMaxDamage(0); @@ -54,7 +55,7 @@ public class ItemHoneycomb extends ItemForestryMultiPass { } } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { for (int i = 0; i < EnumHoneyComb.VALUES.length; i++) { diff --git a/src/main/java/forestry/apiculture/items/ItemImprinter.java b/src/main/java/forestry/apiculture/items/ItemImprinter.java index d0c6de395..1f4453432 100644 --- a/src/main/java/forestry/apiculture/items/ItemImprinter.java +++ b/src/main/java/forestry/apiculture/items/ItemImprinter.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.items; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import forestry.api.core.Tabs; import forestry.apiculture.gui.ContainerImprinter; import forestry.apiculture.gui.GuiImprinter; import forestry.apiculture.inventory.ItemInventoryImprinter; import forestry.core.items.ItemWithGui; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class ItemImprinter extends ItemWithGui { + public ItemImprinter() { setCreativeTab(Tabs.tabApiculture); } diff --git a/src/main/java/forestry/apiculture/items/ItemMinecartBeehouse.java b/src/main/java/forestry/apiculture/items/ItemMinecartBeehouse.java index 64b1c3aca..d11d35d6a 100644 --- a/src/main/java/forestry/apiculture/items/ItemMinecartBeehouse.java +++ b/src/main/java/forestry/apiculture/items/ItemMinecartBeehouse.java @@ -1,22 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.items; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.apiculture.entities.EntityMinecartApiary; -import forestry.apiculture.entities.EntityMinecartBeeHousingBase; -import forestry.apiculture.entities.EntityMinecartBeehouse; -import forestry.core.render.TextureManager; import java.util.List; + import net.minecraft.block.BlockDispenser; import net.minecraft.block.BlockRailBase; import net.minecraft.client.renderer.texture.IIconRegister; @@ -28,8 +21,16 @@ 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; +import forestry.apiculture.entities.EntityMinecartApiary; +import forestry.apiculture.entities.EntityMinecartBeeHousingBase; +import forestry.apiculture.entities.EntityMinecartBeehouse; +import forestry.core.render.TextureManager; + public class ItemMinecartBeehouse extends ItemMinecart { - private final String[] definition = new String[] {"cart.beehouse", "cart.apiary"}; + + private final String[] definition = new String[] { "cart.beehouse", "cart.apiary" }; public ItemMinecartBeehouse() { super(0); @@ -39,17 +40,8 @@ public class ItemMinecartBeehouse extends ItemMinecart { } @Override - public boolean onItemUse( - ItemStack itemStack, - EntityPlayer player, - World world, - int x, - int y, - int z, - int side, - float facingX, - float facingY, - float facingZ) { + public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, + float facingX, float facingY, float facingZ) { if (!BlockRailBase.func_150051_a(world.getBlock(x, y, z))) { return false; } @@ -58,10 +50,16 @@ public class ItemMinecartBeehouse extends ItemMinecart { EntityMinecartBeeHousingBase entityMinecart; if (itemStack.getItemDamage() == 0) { entityMinecart = new EntityMinecartBeehouse( - world, (double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F)); + world, + (double) ((float) x + 0.5F), + (double) ((float) y + 0.5F), + (double) ((float) z + 0.5F)); } else { entityMinecart = new EntityMinecartApiary( - world, (double) ((float) x + 0.5F), (double) ((float) y + 0.5F), (double) ((float) z + 0.5F)); + world, + (double) ((float) x + 0.5F), + (double) ((float) y + 0.5F), + (double) ((float) z + 0.5F)); } entityMinecart.setOwner(player.getGameProfile()); @@ -107,7 +105,7 @@ public class ItemMinecartBeehouse extends ItemMinecart { } } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { for (int i = 0; i < definition.length; i++) { diff --git a/src/main/java/forestry/apiculture/items/ItemPollenCluster.java b/src/main/java/forestry/apiculture/items/ItemPollenCluster.java index 09b059113..fe85fb601 100644 --- a/src/main/java/forestry/apiculture/items/ItemPollenCluster.java +++ b/src/main/java/forestry/apiculture/items/ItemPollenCluster.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.items; -import forestry.api.core.Tabs; -import forestry.core.items.ItemOverlay; import net.minecraft.item.ItemStack; +import forestry.api.core.Tabs; +import forestry.core.items.ItemOverlay; + public class ItemPollenCluster extends ItemOverlay { + public ItemPollenCluster() { super(Tabs.tabApiculture, EnumPollenCluster.VALUES); } diff --git a/src/main/java/forestry/apiculture/items/ItemPropolis.java b/src/main/java/forestry/apiculture/items/ItemPropolis.java index dfd124e3b..bab122acd 100644 --- a/src/main/java/forestry/apiculture/items/ItemPropolis.java +++ b/src/main/java/forestry/apiculture/items/ItemPropolis.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.items; -import forestry.api.core.Tabs; -import forestry.core.items.ItemOverlay; import net.minecraft.item.ItemStack; +import forestry.api.core.Tabs; +import forestry.core.items.ItemOverlay; + public class ItemPropolis extends ItemOverlay { + public ItemPropolis() { super(Tabs.tabApiculture, EnumPropolis.VALUES); } diff --git a/src/main/java/forestry/apiculture/items/ItemRegistryApiculture.java b/src/main/java/forestry/apiculture/items/ItemRegistryApiculture.java index 3e55e407b..7223aecfd 100644 --- a/src/main/java/forestry/apiculture/items/ItemRegistryApiculture.java +++ b/src/main/java/forestry/apiculture/items/ItemRegistryApiculture.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.items; +import net.minecraftforge.oredict.OreDictionary; + import forestry.api.apiculture.EnumBeeType; import forestry.api.core.Tabs; import forestry.core.items.ItemForestry; import forestry.core.items.ItemOverlay; import forestry.core.items.ItemRegistry; import forestry.core.items.ItemScoop; -import net.minecraftforge.oredict.OreDictionary; public class ItemRegistryApiculture extends ItemRegistry { + public final ItemBeeGE beeQueenGE; public final ItemBeeGE beeDroneGE; public final ItemBeeGE beePrincessGE; diff --git a/src/main/java/forestry/apiculture/items/ItemWaxCast.java b/src/main/java/forestry/apiculture/items/ItemWaxCast.java index 24daf4d2b..dc63f882c 100755 --- a/src/main/java/forestry/apiculture/items/ItemWaxCast.java +++ b/src/main/java/forestry/apiculture/items/ItemWaxCast.java @@ -1,19 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.items; +import net.minecraft.item.ItemStack; + import forestry.api.core.Tabs; import forestry.core.items.ICraftingPlan; import forestry.core.items.ItemForestry; -import net.minecraft.item.ItemStack; public class ItemWaxCast extends ItemForestry implements ICraftingPlan { diff --git a/src/main/java/forestry/apiculture/multiblock/AlvearyController.java b/src/main/java/forestry/apiculture/multiblock/AlvearyController.java index d0adbec31..19a82def1 100644 --- a/src/main/java/forestry/apiculture/multiblock/AlvearyController.java +++ b/src/main/java/forestry/apiculture/multiblock/AlvearyController.java @@ -1,16 +1,28 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.multiblock; +import java.io.IOException; +import java.util.HashSet; +import java.util.Set; + +import net.minecraft.block.Block; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.StatCollector; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + import com.mojang.authlib.GameProfile; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.IBeeHousingInventory; import forestry.api.apiculture.IBeeListener; @@ -34,17 +46,6 @@ import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.proxy.Proxies; import forestry.core.utils.BlockUtil; -import java.io.IOException; -import java.util.HashSet; -import java.util.Set; -import net.minecraft.block.Block; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.StatCollector; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; public class AlvearyController extends RectangularMultiblockControllerBase implements IAlvearyControllerInternal, IClimateControlled { @@ -275,14 +276,14 @@ public class AlvearyController extends RectangularMultiblockControllerBase fxY += upSpread; // display fx on all 4 sides - Proxies.render.addEntitySwarmFX( - worldObj, (fxX - distanceFromCenter), fxY, (fxZ + leftRightSpreadFromCenter)); - Proxies.render.addEntitySwarmFX( - worldObj, (fxX + distanceFromCenter), fxY, (fxZ + leftRightSpreadFromCenter)); - Proxies.render.addEntitySwarmFX( - worldObj, (fxX + leftRightSpreadFromCenter), fxY, (fxZ - distanceFromCenter)); - Proxies.render.addEntitySwarmFX( - worldObj, (fxX + leftRightSpreadFromCenter), fxY, (fxZ + distanceFromCenter)); + Proxies.render + .addEntitySwarmFX(worldObj, (fxX - distanceFromCenter), fxY, (fxZ + leftRightSpreadFromCenter)); + Proxies.render + .addEntitySwarmFX(worldObj, (fxX + distanceFromCenter), fxY, (fxZ + leftRightSpreadFromCenter)); + Proxies.render + .addEntitySwarmFX(worldObj, (fxX + leftRightSpreadFromCenter), fxY, (fxZ - distanceFromCenter)); + Proxies.render + .addEntitySwarmFX(worldObj, (fxX + leftRightSpreadFromCenter), fxY, (fxZ + distanceFromCenter)); } } } diff --git a/src/main/java/forestry/apiculture/multiblock/AlvearyMultiblockSizeLimits.java b/src/main/java/forestry/apiculture/multiblock/AlvearyMultiblockSizeLimits.java index bb4d48a4d..e3f99a30e 100644 --- a/src/main/java/forestry/apiculture/multiblock/AlvearyMultiblockSizeLimits.java +++ b/src/main/java/forestry/apiculture/multiblock/AlvearyMultiblockSizeLimits.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.multiblock; diff --git a/src/main/java/forestry/apiculture/multiblock/FakeAlvearyController.java b/src/main/java/forestry/apiculture/multiblock/FakeAlvearyController.java index a327aa77e..9c7dfdf30 100644 --- a/src/main/java/forestry/apiculture/multiblock/FakeAlvearyController.java +++ b/src/main/java/forestry/apiculture/multiblock/FakeAlvearyController.java @@ -1,16 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.multiblock; +import java.util.Collections; + +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.Vec3; +import net.minecraft.world.biome.BiomeGenBase; + import com.mojang.authlib.GameProfile; + import forestry.api.apiculture.IBeeHousingInventory; import forestry.api.apiculture.IBeeListener; import forestry.api.apiculture.IBeeModifier; @@ -19,13 +25,9 @@ import forestry.apiculture.FakeBeekeepingLogic; import forestry.core.inventory.FakeInventoryAdapter; import forestry.core.inventory.IInventoryAdapter; import forestry.core.multiblock.FakeMultiblockController; -import java.util.Collections; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.Vec3; -import net.minecraft.world.biome.BiomeGenBase; public class FakeAlvearyController extends FakeMultiblockController implements IAlvearyControllerInternal { + public static final FakeAlvearyController instance = new FakeAlvearyController(); private FakeAlvearyController() {} @@ -91,6 +93,7 @@ public class FakeAlvearyController extends FakeMultiblockController implements I } private static class FakeBeeHousingInventory implements IBeeHousingInventory { + public static final FakeBeeHousingInventory instance = new FakeBeeHousingInventory(); private FakeBeeHousingInventory() {} diff --git a/src/main/java/forestry/apiculture/multiblock/IAlvearyControllerInternal.java b/src/main/java/forestry/apiculture/multiblock/IAlvearyControllerInternal.java index 630eed670..a3e41a019 100644 --- a/src/main/java/forestry/apiculture/multiblock/IAlvearyControllerInternal.java +++ b/src/main/java/forestry/apiculture/multiblock/IAlvearyControllerInternal.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.multiblock; @@ -19,6 +17,7 @@ import forestry.core.tiles.IClimatised; public interface IAlvearyControllerInternal extends IAlvearyController, IMultiblockControllerInternal, IClimatised, IRestrictedAccess, IStreamableGui { + IInventoryAdapter getInternalInventory(); int getHealthScaled(int i); diff --git a/src/main/java/forestry/apiculture/multiblock/MultiblockLogicAlveary.java b/src/main/java/forestry/apiculture/multiblock/MultiblockLogicAlveary.java index 457589f97..bb7c4a11b 100644 --- a/src/main/java/forestry/apiculture/multiblock/MultiblockLogicAlveary.java +++ b/src/main/java/forestry/apiculture/multiblock/MultiblockLogicAlveary.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.multiblock; +import net.minecraft.world.World; + import forestry.api.multiblock.IMultiblockLogicAlveary; import forestry.core.multiblock.MultiblockLogic; -import net.minecraft.world.World; public class MultiblockLogicAlveary extends MultiblockLogic implements IMultiblockLogicAlveary { + public MultiblockLogicAlveary() { super(IAlvearyControllerInternal.class); } diff --git a/src/main/java/forestry/apiculture/multiblock/TileAlveary.java b/src/main/java/forestry/apiculture/multiblock/TileAlveary.java index fb34d3c9b..0ce9341cd 100644 --- a/src/main/java/forestry/apiculture/multiblock/TileAlveary.java +++ b/src/main/java/forestry/apiculture/multiblock/TileAlveary.java @@ -1,15 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.multiblock; +import java.io.IOException; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.Vec3; +import net.minecraft.world.biome.BiomeGenBase; + import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeeHousingInventory; import forestry.api.apiculture.IBeeListener; @@ -35,21 +41,10 @@ import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IStreamableGui; import forestry.core.tiles.IClimatised; import forestry.core.tiles.ITitled; -import java.io.IOException; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.Vec3; -import net.minecraft.world.biome.BiomeGenBase; -public abstract class TileAlveary extends MultiblockTileEntityForestry - implements IBeeHousing, - IAlvearyComponent, - IRestrictedAccess, - IStreamableGui, - ITitled, - IClimatised, - IHintSource { +public abstract class TileAlveary extends MultiblockTileEntityForestry implements IBeeHousing, + IAlvearyComponent, IRestrictedAccess, IStreamableGui, ITitled, IClimatised, IHintSource { + private final String unlocalizedTitle; protected TileAlveary() { @@ -67,8 +62,8 @@ public abstract class TileAlveary extends MultiblockTileEntityForestry 0) { workingTime--; climateControlled.addTemperatureChange( - definition.getChangePerTransfer(), definition.getBoundaryDown(), definition.getBoundaryUp()); + definition.getChangePerTransfer(), + definition.getBoundaryDown(), + definition.getBoundaryUp()); } setActive(workingTime > 0); diff --git a/src/main/java/forestry/apiculture/multiblock/TileAlvearyFan.java b/src/main/java/forestry/apiculture/multiblock/TileAlvearyFan.java index 0e7bc0134..28e6f8ebb 100644 --- a/src/main/java/forestry/apiculture/multiblock/TileAlvearyFan.java +++ b/src/main/java/forestry/apiculture/multiblock/TileAlvearyFan.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.multiblock; diff --git a/src/main/java/forestry/apiculture/multiblock/TileAlvearyHeater.java b/src/main/java/forestry/apiculture/multiblock/TileAlvearyHeater.java index 2fa84674e..a7c765ef1 100644 --- a/src/main/java/forestry/apiculture/multiblock/TileAlvearyHeater.java +++ b/src/main/java/forestry/apiculture/multiblock/TileAlvearyHeater.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.multiblock; diff --git a/src/main/java/forestry/apiculture/multiblock/TileAlvearyHygroregulator.java b/src/main/java/forestry/apiculture/multiblock/TileAlvearyHygroregulator.java index 78ba873a7..214cd71b4 100644 --- a/src/main/java/forestry/apiculture/multiblock/TileAlvearyHygroregulator.java +++ b/src/main/java/forestry/apiculture/multiblock/TileAlvearyHygroregulator.java @@ -1,15 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.multiblock; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + import forestry.api.core.IClimateControlled; import forestry.api.multiblock.IAlvearyComponent; import forestry.apiculture.blocks.BlockAlveary; @@ -23,17 +30,10 @@ import forestry.core.fluids.TankManager; import forestry.core.fluids.tanks.FilteredTank; import forestry.core.inventory.IInventoryAdapter; import forestry.core.tiles.ILiquidTankTile; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; public class TileAlvearyHygroregulator extends TileAlveary implements IInventory, ILiquidTankTile, IFluidHandler, IAlvearyComponent.Climatiser { + private final HygroregulatorRecipe[] recipes; private final TankManager tankManager; @@ -56,10 +56,9 @@ public class TileAlvearyHygroregulator extends TileAlveary this.tankManager = new TankManager(this, liquidTank); this.recipes = new HygroregulatorRecipe[] { - new HygroregulatorRecipe(new FluidStack(water, 1), 1, 0.01f, -0.005f), - new HygroregulatorRecipe(new FluidStack(lava, 1), 10, -0.01f, +0.005f), - new HygroregulatorRecipe(new FluidStack(liquidIce, 1), 10, 0.02f, -0.01f) - }; + new HygroregulatorRecipe(new FluidStack(water, 1), 1, 0.01f, -0.005f), + new HygroregulatorRecipe(new FluidStack(lava, 1), 10, -0.01f, +0.005f), + new HygroregulatorRecipe(new FluidStack(liquidIce, 1), 10, 0.02f, -0.01f) }; } @Override @@ -192,6 +191,7 @@ public class TileAlvearyHygroregulator extends TileAlveary } private static class HygroregulatorRecipe { + public final FluidStack liquid; public final int transferTime; public final float humidChange; diff --git a/src/main/java/forestry/apiculture/multiblock/TileAlvearyPlain.java b/src/main/java/forestry/apiculture/multiblock/TileAlvearyPlain.java index e21e87a4b..d6a3b3b0b 100644 --- a/src/main/java/forestry/apiculture/multiblock/TileAlvearyPlain.java +++ b/src/main/java/forestry/apiculture/multiblock/TileAlvearyPlain.java @@ -1,15 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.multiblock; +import java.util.ArrayList; +import java.util.Collection; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChunkCoordinates; +import net.minecraftforge.common.util.ForgeDirection; + import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.ITriggerExternal; import buildcraft.api.statements.ITriggerInternal; @@ -18,18 +23,13 @@ import cpw.mods.fml.common.Optional; import forestry.api.multiblock.IMultiblockController; import forestry.apiculture.blocks.BlockAlveary; import forestry.apiculture.trigger.ApicultureTriggers; -import java.util.ArrayList; -import java.util.Collection; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraftforge.common.util.ForgeDirection; @Optional.Interface(iface = "buildcraft.api.statements.ITriggerProvider", modid = "BuildCraftAPI|statements") public class TileAlvearyPlain extends TileAlveary implements ITriggerProvider { @Override - public void onMachineAssembled( - IMultiblockController multiblockController, ChunkCoordinates minCoord, ChunkCoordinates maxCoord) { + public void onMachineAssembled(IMultiblockController multiblockController, ChunkCoordinates minCoord, + ChunkCoordinates maxCoord) { super.onMachineAssembled(multiblockController, minCoord, maxCoord); if (!worldObj.isRemote) { @@ -38,7 +38,11 @@ public class TileAlvearyPlain extends TileAlveary implements ITriggerProvider { if ((xCoord > minCoord.posX && xCoord < maxCoord.posX) || (zCoord > minCoord.posZ && zCoord < maxCoord.posZ)) { this.worldObj.setBlockMetadataWithNotify( - xCoord, yCoord, zCoord, BlockAlveary.Type.ENTRANCE.ordinal(), 2); + xCoord, + yCoord, + zCoord, + BlockAlveary.Type.ENTRANCE.ordinal(), + 2); } } } diff --git a/src/main/java/forestry/apiculture/multiblock/TileAlvearySieve.java b/src/main/java/forestry/apiculture/multiblock/TileAlvearySieve.java index a776ae03e..017aa7689 100644 --- a/src/main/java/forestry/apiculture/multiblock/TileAlvearySieve.java +++ b/src/main/java/forestry/apiculture/multiblock/TileAlvearySieve.java @@ -1,15 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.multiblock; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import forestry.api.apiculture.DefaultBeeListener; import forestry.api.apiculture.IBeeListener; import forestry.api.arboriculture.EnumGermlingType; @@ -23,8 +24,6 @@ import forestry.apiculture.gui.GuiAlvearySieve; import forestry.apiculture.inventory.InventoryAlvearySieve; import forestry.core.inventory.IInventoryAdapter; import forestry.core.inventory.watchers.ISlotPickupWatcher; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class TileAlvearySieve extends TileAlveary implements IAlvearyComponent.BeeListener { @@ -70,6 +69,7 @@ public class TileAlvearySieve extends TileAlveary implements IAlvearyComponent.B } static class AlvearySieveBeeListener extends DefaultBeeListener { + private final InventoryAlvearySieve inventory; public AlvearySieveBeeListener(InventoryAlvearySieve inventory) { diff --git a/src/main/java/forestry/apiculture/multiblock/TileAlvearyStabiliser.java b/src/main/java/forestry/apiculture/multiblock/TileAlvearyStabiliser.java index 5ebbf4371..7d8795859 100644 --- a/src/main/java/forestry/apiculture/multiblock/TileAlvearyStabiliser.java +++ b/src/main/java/forestry/apiculture/multiblock/TileAlvearyStabiliser.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.multiblock; @@ -36,6 +34,7 @@ public class TileAlvearyStabiliser extends TileAlveary implements IAlvearyCompon } private static class AlvearyStabiliserBeeModifier extends DefaultBeeModifier { + @Override public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) { return 0.0f; diff --git a/src/main/java/forestry/apiculture/multiblock/TileAlvearySwarmer.java b/src/main/java/forestry/apiculture/multiblock/TileAlvearySwarmer.java index d04ad075a..fd82a8c4d 100644 --- a/src/main/java/forestry/apiculture/multiblock/TileAlvearySwarmer.java +++ b/src/main/java/forestry/apiculture/multiblock/TileAlvearySwarmer.java @@ -1,15 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.multiblock; +import java.util.Map.Entry; +import java.util.Stack; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.EnumBeeType; import forestry.api.apiculture.IBee; @@ -28,13 +35,6 @@ import forestry.core.inventory.wrappers.InventoryIterator; import forestry.core.proxy.Proxies; import forestry.core.tiles.IActivatable; import forestry.core.utils.ItemStackUtil; -import java.util.Map.Entry; -import java.util.Stack; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; public class TileAlvearySwarmer extends TileAlveary implements ISidedInventory, IActivatable, IAlvearyComponent.Active { @@ -102,8 +102,7 @@ public class TileAlvearySwarmer extends TileAlveary implements ISidedInventory, public void updateClient(int tickCount) {} private ItemStack getPrincessStack() { - ItemStack princessStack = - getMultiblockLogic().getController().getBeeInventory().getQueen(); + ItemStack princessStack = getMultiblockLogic().getController().getBeeInventory().getQueen(); if (BeeManager.beeRoot.isMated(princessStack)) { return princessStack; diff --git a/src/main/java/forestry/apiculture/network/PacketRegistryApiculture.java b/src/main/java/forestry/apiculture/network/PacketRegistryApiculture.java index 874324ccf..fae0d8f07 100644 --- a/src/main/java/forestry/apiculture/network/PacketRegistryApiculture.java +++ b/src/main/java/forestry/apiculture/network/PacketRegistryApiculture.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.network; @@ -20,6 +18,7 @@ import forestry.apiculture.network.packets.PacketImprintSelectionResponse; import forestry.core.network.PacketRegistry; public class PacketRegistryApiculture extends PacketRegistry { + @Override public void registerPackets() { registerClientPacket(new PacketImprintSelectionResponse()); diff --git a/src/main/java/forestry/apiculture/network/packets/PacketActiveUpdate.java b/src/main/java/forestry/apiculture/network/packets/PacketActiveUpdate.java index 4f923cc72..1fbd7cb86 100644 --- a/src/main/java/forestry/apiculture/network/packets/PacketActiveUpdate.java +++ b/src/main/java/forestry/apiculture/network/packets/PacketActiveUpdate.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; + import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IForestryPacketClient; @@ -17,9 +20,6 @@ import forestry.core.network.PacketIdClient; import forestry.core.network.packets.PacketCoordinates; import forestry.core.proxy.Proxies; import forestry.core.tiles.IActivatable; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; public class PacketActiveUpdate extends PacketCoordinates implements IForestryPacketClient { diff --git a/src/main/java/forestry/apiculture/network/packets/PacketBeeLogicActive.java b/src/main/java/forestry/apiculture/network/packets/PacketBeeLogicActive.java index 5b6550ad8..1328379a9 100644 --- a/src/main/java/forestry/apiculture/network/packets/PacketBeeLogicActive.java +++ b/src/main/java/forestry/apiculture/network/packets/PacketBeeLogicActive.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; + import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeekeepingLogic; import forestry.apiculture.BeekeepingLogic; @@ -19,11 +22,9 @@ import forestry.core.network.IForestryPacketClient; import forestry.core.network.PacketIdClient; import forestry.core.network.packets.PacketCoordinates; import forestry.core.proxy.Proxies; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; public class PacketBeeLogicActive extends PacketCoordinates implements IForestryPacketClient { + private BeekeepingLogic beekeepingLogic; public PacketBeeLogicActive() {} diff --git a/src/main/java/forestry/apiculture/network/packets/PacketBeeLogicActiveEntity.java b/src/main/java/forestry/apiculture/network/packets/PacketBeeLogicActiveEntity.java index 280d50be4..c1e820795 100644 --- a/src/main/java/forestry/apiculture/network/packets/PacketBeeLogicActiveEntity.java +++ b/src/main/java/forestry/apiculture/network/packets/PacketBeeLogicActiveEntity.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.network.packets; +import java.io.IOException; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; + import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeekeepingLogic; import forestry.apiculture.BeekeepingLogic; @@ -19,11 +22,9 @@ import forestry.core.network.IForestryPacketClient; import forestry.core.network.PacketIdClient; import forestry.core.network.packets.PacketEntityUpdate; import forestry.core.proxy.Proxies; -import java.io.IOException; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; public class PacketBeeLogicActiveEntity extends PacketEntityUpdate implements IForestryPacketClient { + private BeekeepingLogic beekeepingLogic; public PacketBeeLogicActiveEntity() {} diff --git a/src/main/java/forestry/apiculture/network/packets/PacketBeeLogicEntityRequest.java b/src/main/java/forestry/apiculture/network/packets/PacketBeeLogicEntityRequest.java index 3a7aa5f0b..9ef485629 100644 --- a/src/main/java/forestry/apiculture/network/packets/PacketBeeLogicEntityRequest.java +++ b/src/main/java/forestry/apiculture/network/packets/PacketBeeLogicEntityRequest.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.network.packets; +import java.io.IOException; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayerMP; + import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeekeepingLogic; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.IForestryPacketServer; import forestry.core.network.PacketIdServer; import forestry.core.network.packets.PacketEntityUpdate; -import java.io.IOException; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayerMP; public class PacketBeeLogicEntityRequest extends PacketEntityUpdate implements IForestryPacketServer { diff --git a/src/main/java/forestry/apiculture/network/packets/PacketCandleUpdate.java b/src/main/java/forestry/apiculture/network/packets/PacketCandleUpdate.java index 48a2a4363..7ceeae3bd 100644 --- a/src/main/java/forestry/apiculture/network/packets/PacketCandleUpdate.java +++ b/src/main/java/forestry/apiculture/network/packets/PacketCandleUpdate.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; + import forestry.apiculture.tiles.TileCandle; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; @@ -17,9 +20,6 @@ import forestry.core.network.IForestryPacketClient; import forestry.core.network.PacketIdClient; import forestry.core.network.packets.PacketCoordinates; import forestry.core.proxy.Proxies; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; public class PacketCandleUpdate extends PacketCoordinates implements IForestryPacketClient { diff --git a/src/main/java/forestry/apiculture/network/packets/PacketHabitatBiomePointer.java b/src/main/java/forestry/apiculture/network/packets/PacketHabitatBiomePointer.java index b986c2225..a3857a91c 100644 --- a/src/main/java/forestry/apiculture/network/packets/PacketHabitatBiomePointer.java +++ b/src/main/java/forestry/apiculture/network/packets/PacketHabitatBiomePointer.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.ChunkCoordinates; + import forestry.core.network.DataInputStreamForestry; import forestry.core.network.IForestryPacketClient; import forestry.core.network.PacketIdClient; import forestry.core.network.packets.PacketCoordinates; import forestry.core.proxy.Proxies; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.ChunkCoordinates; public class PacketHabitatBiomePointer extends PacketCoordinates implements IForestryPacketClient { diff --git a/src/main/java/forestry/apiculture/network/packets/PacketImprintSelectionResponse.java b/src/main/java/forestry/apiculture/network/packets/PacketImprintSelectionResponse.java index 3af290796..866176b11 100644 --- a/src/main/java/forestry/apiculture/network/packets/PacketImprintSelectionResponse.java +++ b/src/main/java/forestry/apiculture/network/packets/PacketImprintSelectionResponse.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; + import forestry.apiculture.gui.ContainerImprinter; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.IForestryPacketClient; import forestry.core.network.PacketIdClient; import forestry.core.network.packets.PacketGuiSelect; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; public class PacketImprintSelectionResponse extends PacketGuiSelect implements IForestryPacketClient { diff --git a/src/main/java/forestry/apiculture/proxy/ProxyApiculture.java b/src/main/java/forestry/apiculture/proxy/ProxyApiculture.java index 78ca88b8b..71e269c3b 100755 --- a/src/main/java/forestry/apiculture/proxy/ProxyApiculture.java +++ b/src/main/java/forestry/apiculture/proxy/ProxyApiculture.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.proxy; diff --git a/src/main/java/forestry/apiculture/proxy/ProxyApicultureClient.java b/src/main/java/forestry/apiculture/proxy/ProxyApicultureClient.java index 20c4793a7..b2878c55f 100644 --- a/src/main/java/forestry/apiculture/proxy/ProxyApicultureClient.java +++ b/src/main/java/forestry/apiculture/proxy/ProxyApicultureClient.java @@ -1,15 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.proxy; +import net.minecraftforge.client.MinecraftForgeClient; + import cpw.mods.fml.client.registry.RenderingRegistry; import forestry.apiculture.entities.EntityBee; import forestry.apiculture.render.RenderBeeEntity; @@ -17,7 +17,6 @@ import forestry.apiculture.render.RenderBeeItem; import forestry.core.render.IBlockRenderer; import forestry.core.render.RenderAnalyzer; import forestry.plugins.PluginApiculture; -import net.minecraftforge.client.MinecraftForgeClient; public class ProxyApicultureClient extends ProxyApiculture { diff --git a/src/main/java/forestry/apiculture/render/ModelAnalyzer.java b/src/main/java/forestry/apiculture/render/ModelAnalyzer.java index 50c250340..36c9e3d1c 100755 --- a/src/main/java/forestry/apiculture/render/ModelAnalyzer.java +++ b/src/main/java/forestry/apiculture/render/ModelAnalyzer.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.render; -import forestry.core.proxy.Proxies; -import forestry.core.render.ForestryResource; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; + import org.lwjgl.opengl.GL11; +import forestry.core.proxy.Proxies; +import forestry.core.render.ForestryResource; + public class ModelAnalyzer extends ModelBase { private final ModelRenderer pedestal; @@ -29,11 +29,8 @@ public class ModelAnalyzer extends ModelBase { public ModelAnalyzer(String gfxBase) { - textures = new ResourceLocation[] { - new ForestryResource(gfxBase + "pedestal.png"), - new ForestryResource(gfxBase + "tower1.png"), - new ForestryResource(gfxBase + "tower2.png"), - }; + textures = new ResourceLocation[] { new ForestryResource(gfxBase + "pedestal.png"), + new ForestryResource(gfxBase + "tower1.png"), new ForestryResource(gfxBase + "tower2.png"), }; pedestal = new ModelRenderer(this, 0, 0); pedestal.addBox(-8F, -8F, -8F, 16, 1, 16); @@ -57,7 +54,7 @@ public class ModelAnalyzer extends ModelBase { GL11.glPushMatrix(); GL11.glTranslatef(posX, posY, posZ); - float[] angle = {0, 0, 0}; + float[] angle = { 0, 0, 0 }; if (orientation == null) { orientation = ForgeDirection.WEST; diff --git a/src/main/java/forestry/apiculture/render/ModelBee.java b/src/main/java/forestry/apiculture/render/ModelBee.java index 2cc94e307..04bc932e7 100755 --- a/src/main/java/forestry/apiculture/render/ModelBee.java +++ b/src/main/java/forestry/apiculture/render/ModelBee.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.render; -import forestry.api.apiculture.EnumBeeType; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.util.MathHelper; + import org.lwjgl.opengl.GL11; +import forestry.api.apiculture.EnumBeeType; + public class ModelBee extends ModelBase { // fields diff --git a/src/main/java/forestry/apiculture/render/ParticleRenderer.java b/src/main/java/forestry/apiculture/render/ParticleRenderer.java index 6c02d7c5e..c9b74840c 100755 --- a/src/main/java/forestry/apiculture/render/ParticleRenderer.java +++ b/src/main/java/forestry/apiculture/render/ParticleRenderer.java @@ -1,24 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.render; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.gameevent.TickEvent; -import cpw.mods.fml.common.gameevent.TickEvent.Phase; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.Iterator; import java.util.List; + import net.minecraft.client.Minecraft; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.ActiveRenderInfo; @@ -28,10 +21,19 @@ import net.minecraft.entity.EntityLivingBase; import net.minecraftforge.client.event.RenderWorldLastEvent; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.world.WorldEvent; + import org.lwjgl.opengl.GL11; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import cpw.mods.fml.common.gameevent.TickEvent; +import cpw.mods.fml.common.gameevent.TickEvent.Phase; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + @SideOnly(Side.CLIENT) public class ParticleRenderer { + private static final String name = "forestry-particles"; // singleton getter >> @@ -91,7 +93,7 @@ public class ParticleRenderer { lazyAdd = true; - for (Iterator it = particles.iterator(); it.hasNext(); ) { + for (Iterator it = particles.iterator(); it.hasNext();) { EntityFX particle = it.next(); particle.onUpdate(); @@ -142,7 +144,13 @@ public class ParticleRenderer { tessellator.setBrightness(particle.getBrightnessForRender(partialTicks)); particle.renderParticle( - tessellator, partialTicks, rotationX, rotationXZ, rotationZ, rotationYZ, rotationXY); + tessellator, + partialTicks, + rotationX, + rotationXZ, + rotationZ, + rotationYZ, + rotationXY); } tessellator.draw(); diff --git a/src/main/java/forestry/apiculture/render/RenderBeeEntity.java b/src/main/java/forestry/apiculture/render/RenderBeeEntity.java index 41634e841..2ce0a674c 100644 --- a/src/main/java/forestry/apiculture/render/RenderBeeEntity.java +++ b/src/main/java/forestry/apiculture/render/RenderBeeEntity.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.render; -import forestry.apiculture.entities.EntityBee; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; +import forestry.apiculture.entities.EntityBee; + public class RenderBeeEntity extends RenderLiving { private final ModelBee beeModel; diff --git a/src/main/java/forestry/apiculture/render/RenderBeeItem.java b/src/main/java/forestry/apiculture/render/RenderBeeItem.java index ad596b105..6db90b335 100644 --- a/src/main/java/forestry/apiculture/render/RenderBeeItem.java +++ b/src/main/java/forestry/apiculture/render/RenderBeeItem.java @@ -1,27 +1,27 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.render; -import forestry.api.apiculture.BeeManager; -import forestry.api.apiculture.IBee; -import forestry.apiculture.entities.EntityBee; -import forestry.core.proxy.Proxies; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.item.ItemStack; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; +import forestry.api.apiculture.BeeManager; +import forestry.api.apiculture.IBee; +import forestry.apiculture.entities.EntityBee; +import forestry.core.proxy.Proxies; + public class RenderBeeItem implements IItemRenderer { private EntityBee entity; @@ -73,30 +73,24 @@ public class RenderBeeItem implements IItemRenderer { entity.setSpecies(bee.getGenome().getPrimary()); entity.setType(BeeManager.beeRoot.getType(item)); /* - if(scaled) - entity.setScale(butterfly.getSize()); - else - entity.setScale(EntityButterfly.DEFAULT_BUTTERFLY_SIZE); + * if(scaled) entity.setScale(butterfly.getSize()); else + * entity.setScale(EntityButterfly.DEFAULT_BUTTERFLY_SIZE); */ return bee; } - /*private void renderBeeHalo() { - - IIcon background = TextureManager.getInstance().getDefault("habitats/desert"); - float xPos = 1.0f; float yPos = 1.0f; - float width = 1f; float height = 1f; - - Proxies.render.bindTexture(SpriteSheet.ITEMS); - Tessellator tessellator = Tessellator.instance; - tessellator.startDrawingQuads(); - tessellator.addVertexWithUV((double)(xPos + 0), (double)(yPos + height), 0f, (double)background.getMinU(), (double)background.getMaxV()); - tessellator.addVertexWithUV((double)(xPos + width), (double)(yPos + height), 0f, (double)background.getMaxU(), (double)background.getMaxV()); - tessellator.addVertexWithUV((double)(xPos + width), (double)(yPos + 0), 0f, (double)background.getMaxU(), (double)background.getMinV()); - tessellator.addVertexWithUV((double)(xPos + 0), (double)(yPos + 0), 0f, (double)background.getMinU(), (double)background.getMinV()); - tessellator.draw(); - }*/ + /* + * private void renderBeeHalo() { IIcon background = TextureManager.getInstance().getDefault("habitats/desert"); + * float xPos = 1.0f; float yPos = 1.0f; float width = 1f; float height = 1f; + * Proxies.render.bindTexture(SpriteSheet.ITEMS); Tessellator tessellator = Tessellator.instance; + * tessellator.startDrawingQuads(); tessellator.addVertexWithUV((double)(xPos + 0), (double)(yPos + height), 0f, + * (double)background.getMinU(), (double)background.getMaxV()); tessellator.addVertexWithUV((double)(xPos + width), + * (double)(yPos + height), 0f, (double)background.getMaxU(), (double)background.getMaxV()); + * tessellator.addVertexWithUV((double)(xPos + width), (double)(yPos + 0), 0f, (double)background.getMaxU(), + * (double)background.getMinV()); tessellator.addVertexWithUV((double)(xPos + 0), (double)(yPos + 0), 0f, + * (double)background.getMinU(), (double)background.getMinV()); tessellator.draw(); } + */ private void renderBeeItem(IBee bee, float translateX, float translateY, float translateZ) { float yaw = 1; @@ -134,15 +128,10 @@ public class RenderBeeItem implements IItemRenderer { private void renderBeeInInventory(IBee bee) { /* - GL11.glPushMatrix(); - //GL11.glTranslatef(-0.3f, -2.5f, 0f); - GL11.glScalef(-1.0f, 1.0f, 1.0f); - //GL11.glScalef((float)Math.PI / 2, 1.0f, 1.0f); - GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); - GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F); - //GL11.glRotatef(-((float) Math.atan((double) (1 / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F); - renderBeeHalo(); - GL11.glPopMatrix(); + * GL11.glPushMatrix(); //GL11.glTranslatef(-0.3f, -2.5f, 0f); GL11.glScalef(-1.0f, 1.0f, 1.0f); + * //GL11.glScalef((float)Math.PI / 2, 1.0f, 1.0f); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + * GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F); //GL11.glRotatef(-((float) Math.atan((double) (1 / 40.0F))) * + * 20.0F, 1.0F, 0.0F, 0.0F); renderBeeHalo(); GL11.glPopMatrix(); */ GL11.glPushAttrib(GL11.GL_ENABLE_BIT); diff --git a/src/main/java/forestry/apiculture/render/RenderCandleBlock.java b/src/main/java/forestry/apiculture/render/RenderCandleBlock.java index 8a9a182f7..7629ccee4 100644 --- a/src/main/java/forestry/apiculture/render/RenderCandleBlock.java +++ b/src/main/java/forestry/apiculture/render/RenderCandleBlock.java @@ -1,19 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.render; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; -import forestry.apiculture.blocks.BlockCandle; -import forestry.apiculture.tiles.TileCandle; -import forestry.core.proxy.Proxies; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; @@ -21,14 +15,19 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import forestry.apiculture.blocks.BlockCandle; +import forestry.apiculture.tiles.TileCandle; +import forestry.core.proxy.Proxies; + public class RenderCandleBlock implements ISimpleBlockRenderingHandler { @Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {} @Override - public boolean renderWorldBlock( - IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, + RenderBlocks renderer) { if (block.getRenderType() == Proxies.render.getCandleRenderId()) { renderBlockCandle(world, x, y, z, (BlockCandle) block); } @@ -86,8 +85,8 @@ public class RenderCandleBlock implements ISimpleBlockRenderingHandler { return true; } - private static void renderCandleAtAngle( - IIcon icon, double x, double y, double z, double par8, double par10, int colour) { + private static void renderCandleAtAngle(IIcon icon, double x, double y, double z, double par8, double par10, + int colour) { Tessellator tessellator = Tessellator.instance; double minU = icon.getMinU(); double minV = icon.getMinV(); @@ -112,13 +111,29 @@ public class RenderCandleBlock implements ISimpleBlockRenderingHandler { tessellator.setColorOpaque_I(colour); // top quad tessellator.addVertexWithUV( - x + par8 * (1.0D - d22) - d21, y + d22, z + par10 * (1.0D - d22) - d21, textureLightTopU, d10); + x + par8 * (1.0D - d22) - d21, + y + d22, + z + par10 * (1.0D - d22) - d21, + textureLightTopU, + d10); tessellator.addVertexWithUV( - x + par8 * (1.0D - d22) - d21, y + d22, z + par10 * (1.0D - d22) + d21, textureLightTopU, d12); + x + par8 * (1.0D - d22) - d21, + y + d22, + z + par10 * (1.0D - d22) + d21, + textureLightTopU, + d12); tessellator.addVertexWithUV( - x + par8 * (1.0D - d22) + d21, y + d22, z + par10 * (1.0D - d22) + d21, textureLightBottomU, d12); + x + par8 * (1.0D - d22) + d21, + y + d22, + z + par10 * (1.0D - d22) + d21, + textureLightBottomU, + d12); tessellator.addVertexWithUV( - x + par8 * (1.0D - d22) + d21, y + d22, z + par10 * (1.0D - d22) - d21, textureLightBottomU, d10); + x + par8 * (1.0D - d22) + d21, + y + d22, + z + par10 * (1.0D - d22) - d21, + textureLightBottomU, + d10); // -x quad tessellator.addVertexWithUV(x - d21, y + 1d, d19, minU, minV); tessellator.addVertexWithUV(x - d21 + par8, y, d19 + par10, minU, maxV); diff --git a/src/main/java/forestry/apiculture/render/TextureHabitatLocator.java b/src/main/java/forestry/apiculture/render/TextureHabitatLocator.java index c98a15051..d794e2514 100644 --- a/src/main/java/forestry/apiculture/render/TextureHabitatLocator.java +++ b/src/main/java/forestry/apiculture/render/TextureHabitatLocator.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.render; diff --git a/src/main/java/forestry/apiculture/tiles/TileApiaristChest.java b/src/main/java/forestry/apiculture/tiles/TileApiaristChest.java index c17a67713..438726a07 100644 --- a/src/main/java/forestry/apiculture/tiles/TileApiaristChest.java +++ b/src/main/java/forestry/apiculture/tiles/TileApiaristChest.java @@ -1,24 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.tiles; +import net.minecraft.block.Block; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + import forestry.api.apiculture.BeeManager; import forestry.core.config.Constants; import forestry.core.inventory.InventoryPlain; import forestry.core.tiles.TileNaturalistChest; import forestry.core.tiles.TileUtil; import forestry.plugins.PluginApiculture; -import net.minecraft.block.Block; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; public class TileApiaristChest extends TileNaturalistChest { diff --git a/src/main/java/forestry/apiculture/tiles/TileApiary.java b/src/main/java/forestry/apiculture/tiles/TileApiary.java index 099f6c26f..0d5b4b222 100644 --- a/src/main/java/forestry/apiculture/tiles/TileApiary.java +++ b/src/main/java/forestry/apiculture/tiles/TileApiary.java @@ -1,15 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.tiles; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import buildcraft.api.statements.ITriggerExternal; import cpw.mods.fml.common.Optional; import forestry.api.apiculture.IBeeHousingInventory; @@ -24,16 +32,9 @@ import forestry.apiculture.gui.GuiBeeHousing; import forestry.apiculture.inventory.IApiaryInventory; import forestry.apiculture.inventory.InventoryApiary; import forestry.apiculture.trigger.ApicultureTriggers; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class TileApiary extends TileBeeHousingBase implements IApiary { + private final IBeeModifier beeModifier = new ApiaryBeeModifier(); private final IBeeListener beeListener = new ApiaryBeeListener(this); private final InventoryApiary inventory = new InventoryApiary(getAccessHandler()); diff --git a/src/main/java/forestry/apiculture/tiles/TileBeeHousingBase.java b/src/main/java/forestry/apiculture/tiles/TileBeeHousingBase.java index e419e2a60..3b5d7d0aa 100644 --- a/src/main/java/forestry/apiculture/tiles/TileBeeHousingBase.java +++ b/src/main/java/forestry/apiculture/tiles/TileBeeHousingBase.java @@ -1,16 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.tiles; +import java.io.IOException; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.util.Vec3; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + import com.mojang.authlib.GameProfile; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.IBeeHousing; import forestry.api.apiculture.IBeekeepingLogic; @@ -23,15 +30,10 @@ import forestry.core.network.IStreamableGui; import forestry.core.proxy.Proxies; import forestry.core.tiles.IClimatised; import forestry.core.tiles.TileBase; -import java.io.IOException; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.Packet; -import net.minecraft.util.Vec3; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; public abstract class TileBeeHousingBase extends TileBase implements IBeeHousing, IClimatised, IGuiBeeHousingInventory, IStreamableGui { + private final IBeekeepingLogic beeLogic; // CLIENT diff --git a/src/main/java/forestry/apiculture/tiles/TileBeehouse.java b/src/main/java/forestry/apiculture/tiles/TileBeehouse.java index 2d4eaddad..5208c354d 100644 --- a/src/main/java/forestry/apiculture/tiles/TileBeehouse.java +++ b/src/main/java/forestry/apiculture/tiles/TileBeehouse.java @@ -1,15 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.tiles; +import java.util.Collections; + +import net.minecraft.entity.player.EntityPlayer; + import forestry.api.apiculture.DefaultBeeListener; import forestry.api.apiculture.IBeeHousingInventory; import forestry.api.apiculture.IBeeListener; @@ -18,10 +20,9 @@ import forestry.apiculture.BeehouseBeeModifier; import forestry.apiculture.InventoryBeeHousing; import forestry.apiculture.gui.ContainerBeeHousing; import forestry.apiculture.gui.GuiBeeHousing; -import java.util.Collections; -import net.minecraft.entity.player.EntityPlayer; public class TileBeehouse extends TileBeeHousingBase { + private static final IBeeModifier beeModifier = new BeehouseBeeModifier(); private final IBeeListener beeListener; diff --git a/src/main/java/forestry/apiculture/tiles/TileCandle.java b/src/main/java/forestry/apiculture/tiles/TileCandle.java index 169da7135..c09fec1c4 100644 --- a/src/main/java/forestry/apiculture/tiles/TileCandle.java +++ b/src/main/java/forestry/apiculture/tiles/TileCandle.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.tiles; -import forestry.apiculture.network.packets.PacketCandleUpdate; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.Packet; import net.minecraft.tileentity.TileEntity; +import forestry.apiculture.network.packets.PacketCandleUpdate; + public class TileCandle extends TileEntity { + private int colour; private boolean lit; @@ -70,7 +70,9 @@ public class TileCandle extends TileEntity { int[] myColour = fromIntColour(this.colour); int[] addColour = fromIntColour(colour2); this.colour = toIntColour( - (addColour[0] + myColour[0]) / 2, (addColour[0] + myColour[0]) / 2, (addColour[2] + myColour[2]) / 2); + (addColour[0] + myColour[0]) / 2, + (addColour[0] + myColour[0]) / 2, + (addColour[2] + myColour[2]) / 2); } private static int[] fromIntColour(int value) { diff --git a/src/main/java/forestry/apiculture/tiles/TileSwarm.java b/src/main/java/forestry/apiculture/tiles/TileSwarm.java index 602e8b24a..ea8b01c56 100644 --- a/src/main/java/forestry/apiculture/tiles/TileSwarm.java +++ b/src/main/java/forestry/apiculture/tiles/TileSwarm.java @@ -1,22 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.tiles; -import forestry.core.inventory.InventoryAdapter; -import forestry.core.utils.InventoryUtil; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.EnumSkyBlock; +import forestry.core.inventory.InventoryAdapter; +import forestry.core.utils.InventoryUtil; + public class TileSwarm extends TileEntity { public final InventoryAdapter contained = new InventoryAdapter(2, "Contained"); diff --git a/src/main/java/forestry/apiculture/trigger/ApicultureTriggers.java b/src/main/java/forestry/apiculture/trigger/ApicultureTriggers.java index 73ee0d616..a89b91bb2 100644 --- a/src/main/java/forestry/apiculture/trigger/ApicultureTriggers.java +++ b/src/main/java/forestry/apiculture/trigger/ApicultureTriggers.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.trigger; import forestry.core.triggers.Trigger; public class ApicultureTriggers { + public static Trigger noFrames; public static Trigger missingQueen; public static Trigger missingDrone; diff --git a/src/main/java/forestry/apiculture/trigger/TriggerMissingDrone.java b/src/main/java/forestry/apiculture/trigger/TriggerMissingDrone.java index f060a7f2b..8929f8c74 100644 --- a/src/main/java/forestry/apiculture/trigger/TriggerMissingDrone.java +++ b/src/main/java/forestry/apiculture/trigger/TriggerMissingDrone.java @@ -1,22 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.trigger; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.IStatementParameter; import forestry.api.core.IErrorLogicSource; import forestry.core.errors.EnumErrorCode; import forestry.core.triggers.Trigger; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class TriggerMissingDrone extends Trigger { @@ -28,8 +27,8 @@ public class TriggerMissingDrone extends Trigger { * Return true if the tile given in parameter activates the trigger, given the parameters. */ @Override - public boolean isTriggerActive( - TileEntity tile, ForgeDirection side, IStatementContainer source, IStatementParameter[] parameters) { + public boolean isTriggerActive(TileEntity tile, ForgeDirection side, IStatementContainer source, + IStatementParameter[] parameters) { if (!(tile instanceof IErrorLogicSource)) { return false; diff --git a/src/main/java/forestry/apiculture/trigger/TriggerMissingQueen.java b/src/main/java/forestry/apiculture/trigger/TriggerMissingQueen.java index f7b02bca4..41837ce78 100644 --- a/src/main/java/forestry/apiculture/trigger/TriggerMissingQueen.java +++ b/src/main/java/forestry/apiculture/trigger/TriggerMissingQueen.java @@ -1,22 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.trigger; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.IStatementParameter; import forestry.api.core.IErrorLogicSource; import forestry.core.errors.EnumErrorCode; import forestry.core.triggers.Trigger; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class TriggerMissingQueen extends Trigger { @@ -28,8 +27,8 @@ public class TriggerMissingQueen extends Trigger { * Return true if the tile given in parameter activates the trigger, given the parameters. */ @Override - public boolean isTriggerActive( - TileEntity tile, ForgeDirection side, IStatementContainer source, IStatementParameter[] parameters) { + public boolean isTriggerActive(TileEntity tile, ForgeDirection side, IStatementContainer source, + IStatementParameter[] parameters) { if (!(tile instanceof IErrorLogicSource)) { return false; diff --git a/src/main/java/forestry/apiculture/trigger/TriggerNoFrames.java b/src/main/java/forestry/apiculture/trigger/TriggerNoFrames.java index 7e4835625..8db971d33 100755 --- a/src/main/java/forestry/apiculture/trigger/TriggerNoFrames.java +++ b/src/main/java/forestry/apiculture/trigger/TriggerNoFrames.java @@ -1,22 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.trigger; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.IStatementParameter; import forestry.apiculture.inventory.InventoryApiary; import forestry.apiculture.tiles.TileApiary; import forestry.core.triggers.Trigger; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class TriggerNoFrames extends Trigger { @@ -28,8 +27,8 @@ public class TriggerNoFrames extends Trigger { * Return true if the tile given in parameter activates the trigger, given the parameters. */ @Override - public boolean isTriggerActive( - TileEntity tile, ForgeDirection side, IStatementContainer source, IStatementParameter[] parameters) { + public boolean isTriggerActive(TileEntity tile, ForgeDirection side, IStatementContainer source, + IStatementParameter[] parameters) { if (!(tile instanceof TileApiary)) { return false; diff --git a/src/main/java/forestry/apiculture/worldgen/ComponentVillageBeeHouse.java b/src/main/java/forestry/apiculture/worldgen/ComponentVillageBeeHouse.java index b47120628..aed8c659c 100755 --- a/src/main/java/forestry/apiculture/worldgen/ComponentVillageBeeHouse.java +++ b/src/main/java/forestry/apiculture/worldgen/ComponentVillageBeeHouse.java @@ -1,15 +1,28 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.worldgen; +import java.util.ArrayList; +import java.util.List; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.gen.structure.StructureBoundingBox; +import net.minecraft.world.gen.structure.StructureComponent; +import net.minecraft.world.gen.structure.StructureVillagePieces; +import net.minecraftforge.common.ChestGenHooks; +import net.minecraftforge.common.util.ForgeDirection; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.EnumBeeType; import forestry.api.apiculture.FlowerManager; @@ -38,19 +51,6 @@ import forestry.core.worldgen.IBlockType; import forestry.plugins.PluginApiculture; import forestry.plugins.PluginCore; import forestry.plugins.PluginManager; -import java.util.ArrayList; -import java.util.List; -import java.util.Random; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraft.world.gen.structure.StructureBoundingBox; -import net.minecraft.world.gen.structure.StructureComponent; -import net.minecraft.world.gen.structure.StructureVillagePieces; -import net.minecraftforge.common.ChestGenHooks; -import net.minecraftforge.common.util.ForgeDirection; public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 { @@ -67,12 +67,8 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 { createBuildingBlocks(random); } - public ComponentVillageBeeHouse( - StructureVillagePieces.Start startPiece, - int componentType, - Random random, - StructureBoundingBox boundingBox, - int coordBaseMode) { + public ComponentVillageBeeHouse(StructureVillagePieces.Start startPiece, int componentType, Random random, + StructureBoundingBox boundingBox, int coordBaseMode) { super(startPiece, componentType, random, boundingBox, coordBaseMode); isInDesert = startPiece.inDesert; @@ -104,17 +100,10 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 { } @SuppressWarnings("rawtypes") - public static ComponentVillageBeeHouse buildComponent( - StructureVillagePieces.Start startPiece, - List par1List, - Random random, - int par3, - int par4, - int par5, - int par6, - int par7) { - StructureBoundingBox bbox = - StructureBoundingBox.getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 10, 9, 11, par6); + public static ComponentVillageBeeHouse buildComponent(StructureVillagePieces.Start startPiece, List par1List, + Random random, int par3, int par4, int par5, int par6, int par7) { + StructureBoundingBox bbox = StructureBoundingBox + .getComponentToAddBoundingBox(par3, par4, par5, 0, 0, 0, 10, 9, 11, par6); if (!canVillageGoDeeper(bbox) || StructureComponent.findIntersecting(par1List, bbox) != null) { return null; } @@ -193,8 +182,9 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 { // Escritoire if (random.nextInt(2) == 0) { - IBlockType escritoireBlock = - new BlockTypeTileForestry(PluginCore.blocks.core, BlockCoreType.ESCRITOIRE.ordinal()); + IBlockType escritoireBlock = new BlockTypeTileForestry( + PluginCore.blocks.core, + BlockCoreType.ESCRITOIRE.ordinal()); escritoireBlock.setDirection(getRotatedDirection(ForgeDirection.EAST)); placeBlockAtCurrentPosition(world, escritoireBlock, 1, 1, 3, structBoundingBox); } @@ -202,7 +192,13 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 { placeBlockAtCurrentPosition(world, Blocks.air, 0, 2, 1, 0, structBoundingBox); placeBlockAtCurrentPosition(world, Blocks.air, 0, 2, 2, 0, structBoundingBox); placeDoorAtCurrentPosition( - world, structBoundingBox, random, 2, 1, 0, getMetadataWithOffset(Blocks.wooden_door, 1)); + world, + structBoundingBox, + random, + 2, + 1, + 0, + getMetadataWithOffset(Blocks.wooden_door, 1)); if (isAirBlockAtCurrentPosition(world, 2, 0, -1, structBoundingBox) && !isAirBlockAtCurrentPosition(world, 2, -1, -1, structBoundingBox)) { @@ -226,7 +222,13 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 { placeBlockAtCurrentPosition(world, Blocks.torch, 0, 6, 3, 1, structBoundingBox); placeDoorAtCurrentPosition( - world, structBoundingBox, random, 6, 1, 5, getMetadataWithOffset(Blocks.wooden_door, 1)); + world, + structBoundingBox, + random, + 6, + 1, + 5, + getMetadataWithOffset(Blocks.wooden_door, 1)); for (int i = 0; i < 5; ++i) { for (int j = 0; j < 9; ++j) { @@ -276,8 +278,8 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 { } } - private void plantFlowerGarden( - World world, StructureBoundingBox box, int minX, int minY, int minZ, int maxX, int maxY, int maxZ) { + private void plantFlowerGarden(World world, StructureBoundingBox box, int minX, int minY, int minZ, int maxX, + int maxY, int maxZ) { if (isInDesert) { placeBlockAtCurrentPosition(world, Blocks.cactus, 0, 4, 1, 7, box); @@ -296,8 +298,8 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 { continue; } - IFlower flower = FlowerManager.flowerRegistry.getRandomPlantableFlower( - FlowerManager.FlowerTypeVanilla, world.rand); + IFlower flower = FlowerManager.flowerRegistry + .getRandomPlantableFlower(FlowerManager.FlowerTypeVanilla, world.rand); placeBlockAtCurrentPosition(world, flower.getBlock(), flower.getMeta(), j, i, k, box); } } @@ -344,9 +346,8 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 { ItemStack randomVillageDrone = getRandomVillageBeeStack(world, xCoord, yCoord, zCoord, EnumBeeType.DRONE); apiary.getBeeInventory().setDrone(randomVillageDrone); - for (int i = InventoryApiary.SLOT_FRAMES_1; - i < InventoryApiary.SLOT_FRAMES_1 + InventoryApiary.SLOT_FRAMES_COUNT; - i++) { + for (int i = InventoryApiary.SLOT_FRAMES_1; i + < InventoryApiary.SLOT_FRAMES_1 + InventoryApiary.SLOT_FRAMES_COUNT; i++) { ItemStack randomFrame = getRandomFrame(world.rand); apiary.setInventorySlotContents(i, randomFrame); } @@ -365,8 +366,8 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 { } } - private static ItemStack getRandomVillageBeeStack( - World world, int xCoord, int yCoord, int zCoord, EnumBeeType beeType) { + private static ItemStack getRandomVillageBeeStack(World world, int xCoord, int yCoord, int zCoord, + EnumBeeType beeType) { IBee randomVillageBee = getRandomVillageBee(world, xCoord, yCoord, zCoord); return BeeManager.beeRoot.getMemberStack(randomVillageBee, beeType.ordinal()); } @@ -377,8 +378,7 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 { BiomeGenBase biome = world.getBiomeGenForCoords(xCoord, zCoord); ArrayList candidates; - if (BeeManager.villageBees[1] != null - && BeeManager.villageBees[1].size() > 0 + if (BeeManager.villageBees[1] != null && BeeManager.villageBees[1].size() > 0 && world.rand.nextDouble() < 0.2) { candidates = BeeManager.villageBees[1]; } else { @@ -398,15 +398,15 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 { // No valid ones found, return any of the common ones. if (valid.isEmpty()) { - return BeeManager.beeRoot.getBee( - world, BeeManager.villageBees[0].get(world.rand.nextInt(BeeManager.villageBees[0].size()))); + return BeeManager.beeRoot + .getBee(world, BeeManager.villageBees[0].get(world.rand.nextInt(BeeManager.villageBees[0].size()))); } return BeeManager.beeRoot.getBee(world, valid.get(world.rand.nextInt(valid.size()))); } - private static boolean checkBiomeHazard( - IBeeGenome genome, EnumTemperature biomeTemperature, EnumHumidity biomeHumidity) { + private static boolean checkBiomeHazard(IBeeGenome genome, EnumTemperature biomeTemperature, + EnumHumidity biomeHumidity) { IAlleleBeeSpecies species = genome.getPrimary(); return AlleleManager.climateHelper.isWithinLimits( biomeTemperature, @@ -417,17 +417,8 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 { genome.getToleranceHumid()); } - private void fillBoxWith( - World world, - StructureBoundingBox box, - int par3, - int par4, - int par5, - int par6, - int par7, - int par8, - IBlockType block, - boolean replace) { + private void fillBoxWith(World world, StructureBoundingBox box, int par3, int par4, int par5, int par6, int par7, + int par8, IBlockType block, boolean replace) { for (int var14 = par4; var14 <= par7; ++var14) { for (int var15 = par3; var15 <= par6; ++var15) { @@ -440,12 +431,7 @@ public class ComponentVillageBeeHouse extends StructureVillagePieces.House1 { } } - private void placeBlockAtCurrentPosition( - World world, - IBlockType block, - int par4, - int par5, - int par6, + private void placeBlockAtCurrentPosition(World world, IBlockType block, int par4, int par5, int par6, StructureBoundingBox par7StructureBoundingBox) { int x = getXWithOffset(par4, par6); int y = getYWithOffset(par5); diff --git a/src/main/java/forestry/apiculture/worldgen/Hive.java b/src/main/java/forestry/apiculture/worldgen/Hive.java index c73312c66..42aa5c93c 100644 --- a/src/main/java/forestry/apiculture/worldgen/Hive.java +++ b/src/main/java/forestry/apiculture/worldgen/Hive.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.worldgen; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + import forestry.api.apiculture.IHiveDrop; import forestry.api.apiculture.hives.IHiveDescription; import forestry.api.core.EnumHumidity; import forestry.api.core.EnumTemperature; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; public final class Hive { diff --git a/src/main/java/forestry/apiculture/worldgen/HiveDecorator.java b/src/main/java/forestry/apiculture/worldgen/HiveDecorator.java index f1e209560..bb62bfd09 100755 --- a/src/main/java/forestry/apiculture/worldgen/HiveDecorator.java +++ b/src/main/java/forestry/apiculture/worldgen/HiveDecorator.java @@ -1,23 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.worldgen; -import forestry.api.core.EnumHumidity; -import forestry.api.core.EnumTemperature; -import forestry.core.config.Config; -import forestry.core.config.Constants; -import forestry.plugins.PluginApiculture; import java.util.Collections; import java.util.List; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; @@ -26,18 +20,19 @@ import net.minecraftforge.common.util.EnumHelper; import net.minecraftforge.event.terraingen.PopulateChunkEvent.Populate.EventType; import net.minecraftforge.event.terraingen.TerrainGen; +import forestry.api.core.EnumHumidity; +import forestry.api.core.EnumTemperature; +import forestry.core.config.Config; +import forestry.core.config.Constants; +import forestry.plugins.PluginApiculture; + public abstract class HiveDecorator { @SuppressWarnings("rawtypes") - private static final EventType EVENT_TYPE = - EnumHelper.addEnum(EventType.class, "FORESTRY_HIVES", new Class[0], new Object[0]); + private static final EventType EVENT_TYPE = EnumHelper + .addEnum(EventType.class, "FORESTRY_HIVES", new Class[0], new Object[0]); - public static void decorateHives( - IChunkProvider chunkProvider, - World world, - Random rand, - int chunkX, - int chunkZ, + public static void decorateHives(IChunkProvider chunkProvider, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated) { if (!TerrainGen.populate(chunkProvider, world, rand, chunkX, chunkZ, hasVillageGenerated, EVENT_TYPE)) { return; diff --git a/src/main/java/forestry/apiculture/worldgen/HiveDescription.java b/src/main/java/forestry/apiculture/worldgen/HiveDescription.java index 437063d2c..573583aed 100644 --- a/src/main/java/forestry/apiculture/worldgen/HiveDescription.java +++ b/src/main/java/forestry/apiculture/worldgen/HiveDescription.java @@ -1,15 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.worldgen; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.BiomeDictionary; + import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.hives.HiveManager; import forestry.api.apiculture.hives.IHiveDescription; @@ -21,28 +25,23 @@ import forestry.api.genetics.AlleleManager; import forestry.api.genetics.EnumTolerance; import forestry.apiculture.genetics.BeeDefinition; import forestry.plugins.PluginApiculture; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary; public enum HiveDescription implements IHiveDescription { + FOREST(1, 3.0f, BeeDefinition.FOREST, HiveManager.genHelper.tree()), MEADOWS(2, 1.0f, BeeDefinition.MEADOWS, HiveManager.genHelper.ground(Blocks.dirt, Blocks.grass)), - DESERT( - 3, - 1.0f, - BeeDefinition.MODEST, + DESERT(3, 1.0f, BeeDefinition.MODEST, HiveManager.genHelper.ground(Blocks.dirt, Blocks.grass, Blocks.sand, Blocks.sandstone)), JUNGLE(4, 4.0f, BeeDefinition.TROPICAL, HiveManager.genHelper.tree()), END(5, 4.0f, BeeDefinition.ENDED, HiveManager.genHelper.ground(Blocks.end_stone)) { + @Override public boolean isGoodBiome(BiomeGenBase biome) { return BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.END); } }, SNOW(6, 2.0f, BeeDefinition.WINTRY, HiveManager.genHelper.ground(Blocks.dirt, Blocks.grass, Blocks.snow)) { + @Override public void postGen(World world, int x, int y, int z) { if (world.isAirBlock(x, y + 1, z)) { @@ -50,8 +49,7 @@ public enum HiveDescription implements IHiveDescription { } } }, - SWAMP(7, 2.0f, BeeDefinition.MARSHY, HiveManager.genHelper.ground(Blocks.dirt, Blocks.grass)), - ; + SWAMP(7, 2.0f, BeeDefinition.MARSHY, HiveManager.genHelper.ground(Blocks.dirt, Blocks.grass)),; private final int meta; private final float genChance; diff --git a/src/main/java/forestry/apiculture/worldgen/HiveDescriptionSwarmer.java b/src/main/java/forestry/apiculture/worldgen/HiveDescriptionSwarmer.java index 233d635b0..301e9b25c 100644 --- a/src/main/java/forestry/apiculture/worldgen/HiveDescriptionSwarmer.java +++ b/src/main/java/forestry/apiculture/worldgen/HiveDescriptionSwarmer.java @@ -1,27 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.worldgen; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + import forestry.api.apiculture.hives.IHiveDescription; import forestry.api.apiculture.hives.IHiveGen; import forestry.api.core.EnumHumidity; import forestry.api.core.EnumTemperature; import forestry.apiculture.tiles.TileSwarm; import forestry.plugins.PluginApiculture; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; public class HiveDescriptionSwarmer implements IHiveDescription { diff --git a/src/main/java/forestry/apiculture/worldgen/HiveGen.java b/src/main/java/forestry/apiculture/worldgen/HiveGen.java index 61e67ee3b..7a61c1e2f 100644 --- a/src/main/java/forestry/apiculture/worldgen/HiveGen.java +++ b/src/main/java/forestry/apiculture/worldgen/HiveGen.java @@ -1,28 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.worldgen; -import forestry.api.apiculture.hives.IHiveGen; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.world.World; +import forestry.api.apiculture.hives.IHiveGen; + public abstract class HiveGen implements IHiveGen { @Override public boolean canReplace(World world, int x, int y, int z) { Block block = world.getBlock(x, y, z); Material material = block.getMaterial(); - return (material.isReplaceable() && !material.isLiquid()) - || material == Material.air + return (material.isReplaceable() && !material.isLiquid()) || material == Material.air || material == Material.plants; } } diff --git a/src/main/java/forestry/apiculture/worldgen/HiveGenGround.java b/src/main/java/forestry/apiculture/worldgen/HiveGenGround.java index 178a9319e..9ffa458e9 100644 --- a/src/main/java/forestry/apiculture/worldgen/HiveGenGround.java +++ b/src/main/java/forestry/apiculture/worldgen/HiveGenGround.java @@ -1,17 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.worldgen; import java.util.HashSet; import java.util.Set; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.world.World; diff --git a/src/main/java/forestry/apiculture/worldgen/HiveGenHelper.java b/src/main/java/forestry/apiculture/worldgen/HiveGenHelper.java index cde38a043..85f5212e2 100644 --- a/src/main/java/forestry/apiculture/worldgen/HiveGenHelper.java +++ b/src/main/java/forestry/apiculture/worldgen/HiveGenHelper.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.worldgen; +import net.minecraft.block.Block; + import forestry.api.apiculture.hives.IHiveGen; import forestry.api.apiculture.hives.IHiveGenHelper; -import net.minecraft.block.Block; public class HiveGenHelper implements IHiveGenHelper { diff --git a/src/main/java/forestry/apiculture/worldgen/HiveGenTree.java b/src/main/java/forestry/apiculture/worldgen/HiveGenTree.java index aa2781dfe..9ab7cee1e 100644 --- a/src/main/java/forestry/apiculture/worldgen/HiveGenTree.java +++ b/src/main/java/forestry/apiculture/worldgen/HiveGenTree.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.worldgen; diff --git a/src/main/java/forestry/apiculture/worldgen/HiveRegistry.java b/src/main/java/forestry/apiculture/worldgen/HiveRegistry.java index a10213dfa..fc6b00692 100644 --- a/src/main/java/forestry/apiculture/worldgen/HiveRegistry.java +++ b/src/main/java/forestry/apiculture/worldgen/HiveRegistry.java @@ -1,24 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.apiculture.worldgen; -import forestry.api.apiculture.IHiveDrop; -import forestry.api.apiculture.hives.IHiveDescription; -import forestry.api.apiculture.hives.IHiveRegistry; import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.List; import java.util.Map; +import forestry.api.apiculture.IHiveDrop; +import forestry.api.apiculture.hives.IHiveDescription; +import forestry.api.apiculture.hives.IHiveRegistry; + public class HiveRegistry implements IHiveRegistry { private final Map hives = new HashMap<>(); diff --git a/src/main/java/forestry/arboriculture/FruitProviderNone.java b/src/main/java/forestry/arboriculture/FruitProviderNone.java index f268d4cb7..817495284 100755 --- a/src/main/java/forestry/arboriculture/FruitProviderNone.java +++ b/src/main/java/forestry/arboriculture/FruitProviderNone.java @@ -1,30 +1,31 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture; +import java.util.HashMap; + +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.arboriculture.IFruitProvider; import forestry.api.arboriculture.ITreeGenome; import forestry.api.genetics.IFruitFamily; import forestry.core.render.TextureManager; -import java.util.HashMap; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.item.ItemStack; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; public class FruitProviderNone implements IFruitProvider { private static class OverlayType { + public final String ident; public final short texUID; @@ -112,8 +113,8 @@ public class FruitProviderNone implements IFruitProvider { } @Override - public short getIconIndex( - ITreeGenome genome, IBlockAccess world, int x, int y, int z, int ripeningTime, boolean fancy) { + public short getIconIndex(ITreeGenome genome, IBlockAccess world, int x, int y, int z, int ripeningTime, + boolean fancy) { if (overlay != null) { return overlay.texUID; } else { diff --git a/src/main/java/forestry/arboriculture/FruitProviderPod.java b/src/main/java/forestry/arboriculture/FruitProviderPod.java index 5b38ffbb9..1b8f690e8 100755 --- a/src/main/java/forestry/arboriculture/FruitProviderPod.java +++ b/src/main/java/forestry/arboriculture/FruitProviderPod.java @@ -1,15 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture; +import java.util.Locale; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.init.Blocks; +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.arboriculture.EnumTreeChromosome; @@ -19,16 +25,11 @@ import forestry.api.arboriculture.TreeManager; import forestry.api.genetics.IFruitFamily; import forestry.core.render.TextureManager; import forestry.core.utils.BlockUtil; -import java.util.Locale; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; public class FruitProviderPod extends FruitProviderNone { public enum EnumPodType { + COCOA((short) 2000, (short) 2001, (short) 2002), DATES((short) 2010, (short) 2011, (short) 2012), PAPAYA((short) 2013, (short) 2014, (short) 2015); // , COCONUT((short)2016, (short)2017, (short)2018); @@ -36,7 +37,7 @@ public class FruitProviderPod extends FruitProviderNone { public final short[] uids; EnumPodType(short stage1, short stage2, short stage3) { - uids = new short[] {stage1, stage2, stage3}; + uids = new short[] { stage1, stage2, stage3 }; } @SideOnly(Side.CLIENT) @@ -107,8 +108,8 @@ public class FruitProviderPod extends FruitProviderNone { } @Override - public short getIconIndex( - ITreeGenome genome, IBlockAccess world, int x, int y, int z, int ripeningTime, boolean fancy) { + public short getIconIndex(ITreeGenome genome, IBlockAccess world, int x, int y, int z, int ripeningTime, + boolean fancy) { return type.uids[0]; } diff --git a/src/main/java/forestry/arboriculture/FruitProviderRandom.java b/src/main/java/forestry/arboriculture/FruitProviderRandom.java index a7b6ff8cd..383c2e5a2 100755 --- a/src/main/java/forestry/arboriculture/FruitProviderRandom.java +++ b/src/main/java/forestry/arboriculture/FruitProviderRandom.java @@ -1,28 +1,29 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture; -import forestry.api.arboriculture.ITreeGenome; -import forestry.api.arboriculture.TreeManager; -import forestry.api.genetics.IFruitFamily; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import java.util.Set; + import net.minecraft.item.ItemStack; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import forestry.api.arboriculture.ITreeGenome; +import forestry.api.arboriculture.TreeManager; +import forestry.api.genetics.IFruitFamily; + /** - * Simple fruit provider which drops from any leaf block according to yield and either marks all leave blocks as fruit leaves or none. + * Simple fruit provider which drops from any leaf block according to yield and either marks all leave blocks as fruit + * leaves or none. */ public class FruitProviderRandom extends FruitProviderNone { diff --git a/src/main/java/forestry/arboriculture/FruitProviderRipening.java b/src/main/java/forestry/arboriculture/FruitProviderRipening.java index 227b07072..df992c2a1 100755 --- a/src/main/java/forestry/arboriculture/FruitProviderRipening.java +++ b/src/main/java/forestry/arboriculture/FruitProviderRipening.java @@ -1,26 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture; -import forestry.api.arboriculture.ITreeGenome; -import forestry.api.arboriculture.TreeManager; -import forestry.api.genetics.IFruitFamily; import java.util.ArrayList; import java.util.HashMap; import java.util.Map; import java.util.Set; + import net.minecraft.item.ItemStack; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import forestry.api.arboriculture.ITreeGenome; +import forestry.api.arboriculture.TreeManager; +import forestry.api.genetics.IFruitFamily; + public class FruitProviderRipening extends FruitProviderNone { private final Map products = new HashMap<>(); diff --git a/src/main/java/forestry/arboriculture/IWoodTyped.java b/src/main/java/forestry/arboriculture/IWoodTyped.java index e5d6a1465..319ec6856 100755 --- a/src/main/java/forestry/arboriculture/IWoodTyped.java +++ b/src/main/java/forestry/arboriculture/IWoodTyped.java @@ -1,16 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture; public interface IWoodTyped { + String getBlockKind(); boolean isFireproof(); diff --git a/src/main/java/forestry/arboriculture/LeafDecayHelper.java b/src/main/java/forestry/arboriculture/LeafDecayHelper.java index 689dc481c..50621f9b4 100644 --- a/src/main/java/forestry/arboriculture/LeafDecayHelper.java +++ b/src/main/java/forestry/arboriculture/LeafDecayHelper.java @@ -6,6 +6,7 @@ import net.minecraft.world.World; /** Based on vanilla leaf decay, but accepts leaves that are connected further from a trunk */ public abstract class LeafDecayHelper { + private static final short SUSTAINS_LEAVES = 0; private static final short NOT_SUSTAINS_LEAVES = -1; private static final short IS_LEAVES = -2; @@ -37,24 +38,21 @@ public abstract class LeafDecayHelper { if (!block.canSustainLeaves(world, x + xOffset, y + yOffset, z + zOffset)) { if (block.isLeaves(world, x + xOffset, y + yOffset, z + zOffset)) { - leafDecayValues[ - (xOffset + arrayOffset) * xArrayMult - + (yOffset + arrayOffset) * yArrayMult - + zOffset - + arrayOffset] = IS_LEAVES; + leafDecayValues[(xOffset + arrayOffset) * xArrayMult + + (yOffset + arrayOffset) * yArrayMult + + zOffset + + arrayOffset] = IS_LEAVES; } else { - leafDecayValues[ - (xOffset + arrayOffset) * xArrayMult - + (yOffset + arrayOffset) * yArrayMult - + zOffset - + arrayOffset] = NOT_SUSTAINS_LEAVES; + leafDecayValues[(xOffset + arrayOffset) * xArrayMult + + (yOffset + arrayOffset) * yArrayMult + + zOffset + + arrayOffset] = NOT_SUSTAINS_LEAVES; } } else { - leafDecayValues[ - (xOffset + arrayOffset) * xArrayMult - + (yOffset + arrayOffset) * yArrayMult - + zOffset - + arrayOffset] = SUSTAINS_LEAVES; + leafDecayValues[(xOffset + arrayOffset) * xArrayMult + + (yOffset + arrayOffset) * yArrayMult + + zOffset + + arrayOffset] = SUSTAINS_LEAVES; } } } @@ -64,88 +62,68 @@ public abstract class LeafDecayHelper { for (int xOffset = -radius; xOffset <= radius; ++xOffset) { for (int yOffset = -radius; yOffset <= radius; ++yOffset) { for (int zOffset = -radius; zOffset <= radius; ++zOffset) { - if (leafDecayValues[ - (xOffset + arrayOffset) * xArrayMult - + (yOffset + arrayOffset) * yArrayMult - + zOffset - + arrayOffset] - == sustainedValue - 1) { - if (leafDecayValues[ - (xOffset + arrayOffset - 1) * xArrayMult - + (yOffset + arrayOffset) * yArrayMult - + zOffset - + arrayOffset] - == IS_LEAVES) { - leafDecayValues[ - (xOffset + arrayOffset - 1) * xArrayMult - + (yOffset + arrayOffset) * yArrayMult - + zOffset - + arrayOffset] = sustainedValue; + if (leafDecayValues[(xOffset + arrayOffset) * xArrayMult + + (yOffset + arrayOffset) * yArrayMult + + zOffset + + arrayOffset] == sustainedValue - 1) { + if (leafDecayValues[(xOffset + arrayOffset - 1) * xArrayMult + + (yOffset + arrayOffset) * yArrayMult + + zOffset + + arrayOffset] == IS_LEAVES) { + leafDecayValues[(xOffset + arrayOffset - 1) * xArrayMult + + (yOffset + arrayOffset) * yArrayMult + + zOffset + + arrayOffset] = sustainedValue; } - if (leafDecayValues[ - (xOffset + arrayOffset + 1) * xArrayMult - + (yOffset + arrayOffset) * yArrayMult - + zOffset - + arrayOffset] - == IS_LEAVES) { - leafDecayValues[ - (xOffset + arrayOffset + 1) * xArrayMult - + (yOffset + arrayOffset) * yArrayMult - + zOffset - + arrayOffset] = sustainedValue; + if (leafDecayValues[(xOffset + arrayOffset + 1) * xArrayMult + + (yOffset + arrayOffset) * yArrayMult + + zOffset + + arrayOffset] == IS_LEAVES) { + leafDecayValues[(xOffset + arrayOffset + 1) * xArrayMult + + (yOffset + arrayOffset) * yArrayMult + + zOffset + + arrayOffset] = sustainedValue; } - if (leafDecayValues[ - (xOffset + arrayOffset) * xArrayMult - + (yOffset + arrayOffset - 1) * yArrayMult - + zOffset - + arrayOffset] - == IS_LEAVES) { - leafDecayValues[ - (xOffset + arrayOffset) * xArrayMult - + (yOffset + arrayOffset - 1) * yArrayMult - + zOffset - + arrayOffset] = sustainedValue; + if (leafDecayValues[(xOffset + arrayOffset) * xArrayMult + + (yOffset + arrayOffset - 1) * yArrayMult + + zOffset + + arrayOffset] == IS_LEAVES) { + leafDecayValues[(xOffset + arrayOffset) * xArrayMult + + (yOffset + arrayOffset - 1) * yArrayMult + + zOffset + + arrayOffset] = sustainedValue; } - if (leafDecayValues[ - (xOffset + arrayOffset) * xArrayMult - + (yOffset + arrayOffset + 1) * yArrayMult - + zOffset - + arrayOffset] - == IS_LEAVES) { - leafDecayValues[ - (xOffset + arrayOffset) * xArrayMult - + (yOffset + arrayOffset + 1) * yArrayMult - + zOffset - + arrayOffset] = sustainedValue; + if (leafDecayValues[(xOffset + arrayOffset) * xArrayMult + + (yOffset + arrayOffset + 1) * yArrayMult + + zOffset + + arrayOffset] == IS_LEAVES) { + leafDecayValues[(xOffset + arrayOffset) * xArrayMult + + (yOffset + arrayOffset + 1) * yArrayMult + + zOffset + + arrayOffset] = sustainedValue; } - if (leafDecayValues[ - (xOffset + arrayOffset) * xArrayMult - + (yOffset + arrayOffset) * yArrayMult - + (zOffset + arrayOffset - 1)] - == IS_LEAVES) { - leafDecayValues[ - (xOffset + arrayOffset) * xArrayMult - + (yOffset + arrayOffset) * yArrayMult - + (zOffset + arrayOffset - 1)] = sustainedValue; + if (leafDecayValues[(xOffset + arrayOffset) * xArrayMult + + (yOffset + arrayOffset) * yArrayMult + + (zOffset + arrayOffset - 1)] == IS_LEAVES) { + leafDecayValues[(xOffset + arrayOffset) * xArrayMult + + (yOffset + arrayOffset) * yArrayMult + + (zOffset + arrayOffset - 1)] = sustainedValue; } - if (leafDecayValues[ - (xOffset + arrayOffset) * xArrayMult - + (yOffset + arrayOffset) * yArrayMult - + zOffset - + arrayOffset - + 1] - == IS_LEAVES) { - leafDecayValues[ - (xOffset + arrayOffset) * xArrayMult - + (yOffset + arrayOffset) * yArrayMult - + zOffset - + arrayOffset - + 1] = sustainedValue; + if (leafDecayValues[(xOffset + arrayOffset) * xArrayMult + + (yOffset + arrayOffset) * yArrayMult + + zOffset + + arrayOffset + + 1] == IS_LEAVES) { + leafDecayValues[(xOffset + arrayOffset) * xArrayMult + + (yOffset + arrayOffset) * yArrayMult + + zOffset + + arrayOffset + + 1] = sustainedValue; } } } diff --git a/src/main/java/forestry/arboriculture/VillageHandlerArboriculture.java b/src/main/java/forestry/arboriculture/VillageHandlerArboriculture.java index 51e5e54f1..045fc2b7e 100755 --- a/src/main/java/forestry/arboriculture/VillageHandlerArboriculture.java +++ b/src/main/java/forestry/arboriculture/VillageHandlerArboriculture.java @@ -1,15 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture; +import java.util.Random; + +import net.minecraft.entity.passive.EntityVillager; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.village.MerchantRecipe; +import net.minecraft.village.MerchantRecipeList; + import cpw.mods.fml.common.registry.VillagerRegistry.IVillageTradeHandler; import forestry.api.arboriculture.EnumGermlingType; import forestry.api.arboriculture.EnumWoodType; @@ -18,12 +24,6 @@ import forestry.api.arboriculture.ITreeGenome; import forestry.api.arboriculture.TreeManager; import forestry.api.genetics.IAllele; import forestry.plugins.PluginArboriculture; -import java.util.Random; -import net.minecraft.entity.passive.EntityVillager; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.village.MerchantRecipe; -import net.minecraft.village.MerchantRecipeList; public class VillageHandlerArboriculture implements IVillageTradeHandler { @@ -36,8 +36,10 @@ public class VillageHandlerArboriculture implements IVillageTradeHandler { ItemStack randomTreeStack = TreeManager.treeRoot.getMemberStack(randomTree, EnumGermlingType.SAPLING.ordinal()); recipeList.add(new MerchantRecipe(new ItemStack(Items.emerald, 8), randomTreeStack)); - recipeList.add(new MerchantRecipe( - new ItemStack(Items.emerald, 2), PluginArboriculture.items.grafterProven.getItemStack())); + recipeList.add( + new MerchantRecipe( + new ItemStack(Items.emerald, 2), + PluginArboriculture.items.grafterProven.getItemStack())); EnumWoodType randomWoodType = EnumWoodType.getRandom(random); ItemStack planks = TreeManager.woodItemAccess.getPlanks(randomWoodType, false); diff --git a/src/main/java/forestry/arboriculture/WoodItemAccess.java b/src/main/java/forestry/arboriculture/WoodItemAccess.java index e19fe8cb1..01d50dbb1 100644 --- a/src/main/java/forestry/arboriculture/WoodItemAccess.java +++ b/src/main/java/forestry/arboriculture/WoodItemAccess.java @@ -1,23 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture; +import java.util.EnumMap; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + import forestry.api.arboriculture.EnumWoodType; import forestry.api.arboriculture.IWoodItemAccess; import forestry.arboriculture.items.ItemBlockWood; -import java.util.EnumMap; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; public class WoodItemAccess implements IWoodItemAccess { + private static final EnumMap logs = new EnumMap<>(EnumWoodType.class); private static final EnumMap logsFireproof = new EnumMap<>(EnumWoodType.class); private static final EnumMap planks = new EnumMap<>(EnumWoodType.class); diff --git a/src/main/java/forestry/arboriculture/blocks/BlockArbFence.java b/src/main/java/forestry/arboriculture/blocks/BlockArbFence.java index f716b56ca..082cdef47 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockArbFence.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockArbFence.java @@ -1,27 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.blocks; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.arboriculture.EnumWoodType; -import forestry.api.arboriculture.TreeManager; -import forestry.api.core.Tabs; -import forestry.arboriculture.IWoodTyped; -import forestry.arboriculture.render.IconProviderWood; -import forestry.arboriculture.tiles.TileWood; -import forestry.core.render.ParticleHelper; -import forestry.plugins.PluginArboriculture; import java.util.ArrayList; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.BlockFence; import net.minecraft.block.BlockFenceGate; @@ -40,6 +29,17 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.arboriculture.EnumWoodType; +import forestry.api.arboriculture.TreeManager; +import forestry.api.core.Tabs; +import forestry.arboriculture.IWoodTyped; +import forestry.arboriculture.render.IconProviderWood; +import forestry.arboriculture.tiles.TileWood; +import forestry.core.render.ParticleHelper; +import forestry.plugins.PluginArboriculture; + public class BlockArbFence extends BlockFence implements IWoodTyped, ITileEntityProvider { private final ParticleHelper.Callback particleCallback; @@ -59,7 +59,7 @@ public class BlockArbFence extends BlockFence implements IWoodTyped, ITileEntity this.particleCallback = new ParticleHelper.DefaultCallback(this); } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void getSubBlocks(Item item, CreativeTabs par2CreativeTabs, List list) { for (EnumWoodType woodType : EnumWoodType.VALUES) { @@ -80,8 +80,7 @@ public class BlockArbFence extends BlockFence implements IWoodTyped, ITileEntity return true; } - return block.getMaterial().isOpaque() - && block.renderAsNormalBlock() + return block.getMaterial().isOpaque() && block.renderAsNormalBlock() && block.getMaterial() != Material.gourd; } else { return true; @@ -125,8 +124,8 @@ public class BlockArbFence extends BlockFence implements IWoodTyped, ITileEntity } /* DROP HANDLING */ - // Hack: When harvesting we need to get the drops in onBlockHarvested, - // because Mojang destroys the block and tile before calling getDrops. + // Hack: When harvesting we need to get the drops in onBlockHarvested, + // because Mojang destroys the block and tile before calling getDrops. private final ThreadLocal> drops = new ThreadLocal<>(); @Override diff --git a/src/main/java/forestry/arboriculture/blocks/BlockArbStairs.java b/src/main/java/forestry/arboriculture/blocks/BlockArbStairs.java index 060832a2a..55f3d5e6a 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockArbStairs.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockArbStairs.java @@ -1,26 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.blocks; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.arboriculture.EnumWoodType; -import forestry.api.arboriculture.TreeManager; -import forestry.api.core.Tabs; -import forestry.arboriculture.IWoodTyped; -import forestry.arboriculture.render.IconProviderWood; -import forestry.arboriculture.tiles.TileWood; -import forestry.core.render.ParticleHelper; import java.util.ArrayList; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.BlockStairs; import net.minecraft.block.ITileEntityProvider; @@ -36,6 +26,16 @@ import net.minecraft.util.MovingObjectPosition; 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.arboriculture.EnumWoodType; +import forestry.api.arboriculture.TreeManager; +import forestry.api.core.Tabs; +import forestry.arboriculture.IWoodTyped; +import forestry.arboriculture.render.IconProviderWood; +import forestry.arboriculture.tiles.TileWood; +import forestry.core.render.ParticleHelper; + public class BlockArbStairs extends BlockStairs implements IWoodTyped, ITileEntityProvider { private final ParticleHelper.Callback particleCallback; @@ -54,7 +54,7 @@ public class BlockArbStairs extends BlockStairs implements IWoodTyped, ITileEnti this.particleCallback = new ParticleHelper.DefaultCallback(this); } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override @SideOnly(Side.CLIENT) public void getSubBlocks(Item item, CreativeTabs tab, List list) { @@ -64,8 +64,8 @@ public class BlockArbStairs extends BlockStairs implements IWoodTyped, ITileEnti } /* DROP HANDLING */ - // Hack: When harvesting we need to get the drops in onBlockHarvested, - // because Mojang destroys the block and tile before calling getDrops. + // Hack: When harvesting we need to get the drops in onBlockHarvested, + // because Mojang destroys the block and tile before calling getDrops. private final ThreadLocal> drops = new ThreadLocal<>(); @Override diff --git a/src/main/java/forestry/arboriculture/blocks/BlockArboriculture.java b/src/main/java/forestry/arboriculture/blocks/BlockArboriculture.java index 500d73969..5bdef3f78 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockArboriculture.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockArboriculture.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.blocks; @@ -14,6 +12,7 @@ import forestry.api.core.Tabs; import forestry.core.blocks.BlockBase; public class BlockArboriculture extends BlockBase { + public BlockArboriculture() { super(true); setCreativeTab(Tabs.tabArboriculture); diff --git a/src/main/java/forestry/arboriculture/blocks/BlockArboricultureType.java b/src/main/java/forestry/arboriculture/blocks/BlockArboricultureType.java index 946a32b7d..8e107404b 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockArboricultureType.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockArboricultureType.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.blocks; @@ -17,7 +15,9 @@ import forestry.core.render.IBlockRenderer; import forestry.core.tiles.TileForestry; public enum BlockArboricultureType implements IMachinePropertiesTESR { + ARBCHEST(TileArboristChest.class, "ArbChest") { + @Override public IBlockRenderer getRenderer() { return Proxies.render.getRenderChest("arbchest"); diff --git a/src/main/java/forestry/arboriculture/blocks/BlockForestryLeaves.java b/src/main/java/forestry/arboriculture/blocks/BlockForestryLeaves.java index dee0dc964..d08856887 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockForestryLeaves.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockForestryLeaves.java @@ -1,16 +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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.blocks; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Random; + +import javax.annotation.Nullable; + +import net.minecraft.block.BlockNewLeaf; +import net.minecraft.block.IGrowable; +import net.minecraft.block.ITileEntityProvider; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.enchantment.EnchantmentHelper; +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.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.util.MovingObjectPosition; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import com.mojang.authlib.GameProfile; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.arboriculture.EnumGermlingType; @@ -31,29 +56,6 @@ import forestry.arboriculture.tiles.TileLeaves; import forestry.core.proxy.Proxies; import forestry.core.utils.ItemStackUtil; import forestry.plugins.PluginArboriculture; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Random; -import javax.annotation.Nullable; -import net.minecraft.block.BlockNewLeaf; -import net.minecraft.block.IGrowable; -import net.minecraft.block.ITileEntityProvider; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.enchantment.EnchantmentHelper; -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.AxisAlignedBB; -import net.minecraft.util.IIcon; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class BlockForestryLeaves extends BlockNewLeaf implements ITileEntityProvider, IGrowable { @@ -77,7 +79,7 @@ public class BlockForestryLeaves extends BlockNewLeaf implements ITileEntityProv @SideOnly(Side.CLIENT) @Override - @SuppressWarnings({"unchecked", "rawtypes"}) + @SuppressWarnings({ "unchecked", "rawtypes" }) public void getSubBlocks(Item item, CreativeTabs tab, List list) { for (ITree tree : TreeManager.treeRoot.getIndividualTemplates()) { @@ -96,8 +98,8 @@ public class BlockForestryLeaves extends BlockNewLeaf implements ITileEntityProv } /* DROP HANDLING */ - // Hack: When harvesting leaves we need to get the drops in onBlockHarvested, - // because Mojang destroys the block and tile before calling getDrops. + // Hack: When harvesting leaves we need to get the drops in onBlockHarvested, + // because Mojang destroys the block and tile before calling getDrops. private final ThreadLocal> drops = new ThreadLocal<>(); @Override @@ -138,8 +140,8 @@ public class BlockForestryLeaves extends BlockNewLeaf implements ITileEntityProv return ret; } - private static ArrayList getLeafDrop( - World world, @Nullable GameProfile playerProfile, int x, int y, int z, float saplingModifier, int fortune) { + private static ArrayList getLeafDrop(World world, @Nullable GameProfile playerProfile, int x, int y, + int z, float saplingModifier, int fortune) { ArrayList prod = new ArrayList<>(); TileLeaves tile = getLeafTile(world, x, y, z); @@ -330,15 +332,15 @@ public class BlockForestryLeaves extends BlockNewLeaf implements ITileEntityProv } @Override - public boolean onBlockActivated( - World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, + float par8, float par9) { ItemStack heldItem = player.getHeldItem(); TileEntity tile = world.getTileEntity(x, y, z); IButterfly caterpillar = tile instanceof TileLeaves ? ((TileLeaves) tile).getCaterpillar() : null; if (heldItem != null && (heldItem.getItem() instanceof IToolScoop) && caterpillar != null) { - ItemStack butterfly = - ButterflyManager.butterflyRoot.getMemberStack(caterpillar, EnumFlutterType.CATERPILLAR.ordinal()); + ItemStack butterfly = ButterflyManager.butterflyRoot + .getMemberStack(caterpillar, EnumFlutterType.CATERPILLAR.ordinal()); ItemStackUtil.dropItemStackAsEntity(butterfly, world, x, y, z); ((TileLeaves) tile).setCaterpillar(null); return true; diff --git a/src/main/java/forestry/arboriculture/blocks/BlockFruitPod.java b/src/main/java/forestry/arboriculture/blocks/BlockFruitPod.java index 14d67fdfb..da4b898a8 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockFruitPod.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockFruitPod.java @@ -1,24 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.blocks; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.arboriculture.tiles.TileFruitPod; -import forestry.core.render.TextureManager; -import forestry.core.utils.BlockUtil; -import forestry.core.utils.ItemStackUtil; -import forestry.plugins.PluginArboriculture; import java.util.ArrayList; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.BlockCocoa; import net.minecraft.client.renderer.texture.IIconRegister; @@ -29,6 +21,14 @@ import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.arboriculture.tiles.TileFruitPod; +import forestry.core.render.TextureManager; +import forestry.core.utils.BlockUtil; +import forestry.core.utils.ItemStackUtil; +import forestry.plugins.PluginArboriculture; + public class BlockFruitPod extends BlockCocoa { public BlockFruitPod() { diff --git a/src/main/java/forestry/arboriculture/blocks/BlockLog.java b/src/main/java/forestry/arboriculture/blocks/BlockLog.java index b129dfdc4..d6044a928 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockLog.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockLog.java @@ -1,22 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.blocks; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.arboriculture.EnumWoodType; -import forestry.api.arboriculture.TreeManager; -import forestry.arboriculture.render.IconProviderWood; -import forestry.arboriculture.tiles.TileWood; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.init.Blocks; @@ -26,6 +19,13 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.arboriculture.EnumWoodType; +import forestry.api.arboriculture.TreeManager; +import forestry.arboriculture.render.IconProviderWood; +import forestry.arboriculture.tiles.TileWood; + public class BlockLog extends BlockWood { public BlockLog(boolean fireproof) { @@ -46,8 +46,8 @@ public class BlockLog extends BlockWood { byte radius = 4; int boundary = radius + 1; - if (world.checkChunksExist( - x - boundary, y - boundary, z - boundary, x + boundary, y + boundary, z + boundary)) { + if (world + .checkChunksExist(x - boundary, y - boundary, z - boundary, x + boundary, y + boundary, z + boundary)) { for (int i = -radius; i <= radius; ++i) { for (int j = -radius; j <= radius; ++j) { for (int k = -radius; k <= radius; ++k) { @@ -81,7 +81,7 @@ public class BlockLog extends BlockWood { return meta | b0; } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void getSubBlocks(Item item, CreativeTabs tab, List list) { for (EnumWoodType woodType : EnumWoodType.VALUES) { diff --git a/src/main/java/forestry/arboriculture/blocks/BlockPlanks.java b/src/main/java/forestry/arboriculture/blocks/BlockPlanks.java index f5972ad08..57aafe8c8 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockPlanks.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockPlanks.java @@ -1,26 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.blocks; +import java.util.List; + +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.arboriculture.EnumWoodType; import forestry.api.arboriculture.TreeManager; import forestry.arboriculture.render.IconProviderWood; import forestry.arboriculture.tiles.TileWood; -import java.util.List; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; public class BlockPlanks extends BlockWood { @@ -30,7 +30,7 @@ public class BlockPlanks extends BlockWood { setHarvestLevel("axe", 0); } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void getSubBlocks(Item item, CreativeTabs par2CreativeTabs, List list) { for (EnumWoodType woodType : EnumWoodType.VALUES) { diff --git a/src/main/java/forestry/arboriculture/blocks/BlockRegistryArboriculture.java b/src/main/java/forestry/arboriculture/blocks/BlockRegistryArboriculture.java index 5ee583a87..005648bba 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockRegistryArboriculture.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockRegistryArboriculture.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.blocks; @@ -17,6 +15,7 @@ import forestry.core.blocks.BlockRegistry; import forestry.core.items.ItemBlockForestry; public class BlockRegistryArboriculture extends BlockRegistry { + public final BlockLog logs; public final BlockPlanks planks; public final BlockSlab slabs; @@ -49,8 +48,12 @@ public class BlockRegistryArboriculture extends BlockRegistry { slabs = registerBlock(blockSlab, ItemBlockWoodSlab.class, "slabs", blockSlabDouble, blockSlab); registerOreDictWildcard("slabWood", slabs); - slabsDouble = - registerBlock(blockSlabDouble, ItemBlockWoodSlab.class, "slabsDouble", blockSlabDouble, blockSlab); + slabsDouble = registerBlock( + blockSlabDouble, + ItemBlockWoodSlab.class, + "slabsDouble", + blockSlabDouble, + blockSlab); fences = registerBlock(new BlockArbFence(false), ItemBlockWood.class, "fences"); registerOreDictWildcard("fenceWood", fences); @@ -84,8 +87,10 @@ public class BlockRegistryArboriculture extends BlockRegistry { fencesFireproof = registerBlock(new BlockArbFence(true), ItemBlockWood.class, "fencesFireproof"); registerOreDictWildcard("fenceWood", fencesFireproof); - stairsFireproof = - registerBlock(new BlockArbStairs(planksFireproof, true), ItemBlockWood.class, "stairsFireproof"); + stairsFireproof = registerBlock( + new BlockArbStairs(planksFireproof, true), + ItemBlockWood.class, + "stairsFireproof"); registerOreDictWildcard("stairWood", stairsFireproof); // Saplings diff --git a/src/main/java/forestry/arboriculture/blocks/BlockSapling.java b/src/main/java/forestry/arboriculture/blocks/BlockSapling.java index 604978a79..0c9e1ec10 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockSapling.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockSapling.java @@ -1,15 +1,29 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.blocks; +import java.util.ArrayList; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.block.IGrowable; +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.tileentity.TileEntity; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.util.IIcon; +import net.minecraft.util.MovingObjectPosition; +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.arboriculture.EnumGermlingType; @@ -23,20 +37,6 @@ import forestry.core.render.TextureManager; import forestry.core.tiles.TileUtil; import forestry.core.utils.ItemStackUtil; import forestry.plugins.PluginArboriculture; -import java.util.ArrayList; -import java.util.Random; -import net.minecraft.block.Block; -import net.minecraft.block.IGrowable; -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.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.IIcon; -import net.minecraft.util.MovingObjectPosition; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; public class BlockSapling extends BlockTreeContainer implements IGrowable { @@ -88,8 +88,7 @@ public class BlockSapling extends BlockTreeContainer implements IGrowable { public void registerBlockIcons(IIconRegister register) { defaultIcon = TextureManager.registerTex(register, "germlings/sapling.treeBalsa"); - for (IAllele allele : - AlleleManager.alleleRegistry.getRegisteredAlleles().values()) { + for (IAllele allele : AlleleManager.alleleRegistry.getRegisteredAlleles().values()) { if (allele instanceof IAlleleTreeSpecies) { ((IAlleleTreeSpecies) allele).getIconProvider().registerIcons(register); } @@ -176,8 +175,8 @@ public class BlockSapling extends BlockTreeContainer implements IGrowable { TileSapling sapling = getSaplingTile(world, x, y, z); if (sapling != null && sapling.getTree() != null) { - ItemStack saplingStack = - TreeManager.treeRoot.getMemberStack(sapling.getTree(), EnumGermlingType.SAPLING.ordinal()); + ItemStack saplingStack = TreeManager.treeRoot + .getMemberStack(sapling.getTree(), EnumGermlingType.SAPLING.ordinal()); ItemStackUtil.dropItemStackAsEntity(saplingStack, world, x, y, z); } } diff --git a/src/main/java/forestry/arboriculture/blocks/BlockSlab.java b/src/main/java/forestry/arboriculture/blocks/BlockSlab.java index d957ef3e5..f36b0e82a 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockSlab.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockSlab.java @@ -1,26 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.blocks; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.arboriculture.EnumWoodType; -import forestry.api.arboriculture.TreeManager; -import forestry.api.core.Tabs; -import forestry.arboriculture.IWoodTyped; -import forestry.arboriculture.render.IconProviderWood; -import forestry.arboriculture.tiles.TileWood; -import forestry.core.render.ParticleHelper; import java.util.ArrayList; import java.util.List; + import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; import net.minecraft.client.particle.EffectRenderer; @@ -37,6 +27,16 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.arboriculture.EnumWoodType; +import forestry.api.arboriculture.TreeManager; +import forestry.api.core.Tabs; +import forestry.arboriculture.IWoodTyped; +import forestry.arboriculture.render.IconProviderWood; +import forestry.arboriculture.tiles.TileWood; +import forestry.core.render.ParticleHelper; + public class BlockSlab extends net.minecraft.block.BlockSlab implements IWoodTyped, ITileEntityProvider { private final ParticleHelper.Callback particleCallback; @@ -92,7 +92,7 @@ public class BlockSlab extends net.minecraft.block.BlockSlab implements IWoodTyp return "SomeSlab"; } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void getSubBlocks(Item item, CreativeTabs par2CreativeTabs, List list) { if (!isDoubleSlab()) { @@ -114,8 +114,8 @@ public class BlockSlab extends net.minecraft.block.BlockSlab implements IWoodTyp } /* DROP HANDLING */ - // Hack: When harvesting we need to get the drops in onBlockHarvested, - // because Mojang destroys the block and tile before calling getDrops. + // Hack: When harvesting we need to get the drops in onBlockHarvested, + // because Mojang destroys the block and tile before calling getDrops. private final ThreadLocal> drops = new ThreadLocal<>(); @Override diff --git a/src/main/java/forestry/arboriculture/blocks/BlockTreeContainer.java b/src/main/java/forestry/arboriculture/blocks/BlockTreeContainer.java index 03c82e867..acd8cfe16 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockTreeContainer.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockTreeContainer.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.blocks; -import forestry.arboriculture.tiles.TileTreeContainer; import java.util.Random; + import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import forestry.arboriculture.tiles.TileTreeContainer; + public abstract class BlockTreeContainer extends BlockContainer { protected BlockTreeContainer(Material material) { diff --git a/src/main/java/forestry/arboriculture/blocks/BlockWood.java b/src/main/java/forestry/arboriculture/blocks/BlockWood.java index 655eb4551..7070c3cac 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockWood.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockWood.java @@ -1,24 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.blocks; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.arboriculture.EnumWoodType; -import forestry.api.core.Tabs; -import forestry.arboriculture.IWoodTyped; -import forestry.arboriculture.render.IconProviderWood; -import forestry.arboriculture.tiles.TileWood; -import forestry.core.render.ParticleHelper; import java.util.ArrayList; + import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.material.Material; @@ -33,6 +24,15 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.arboriculture.EnumWoodType; +import forestry.api.core.Tabs; +import forestry.arboriculture.IWoodTyped; +import forestry.arboriculture.render.IconProviderWood; +import forestry.arboriculture.tiles.TileWood; +import forestry.core.render.ParticleHelper; + public abstract class BlockWood extends Block implements ITileEntityProvider, IWoodTyped { private final ParticleHelper.Callback particleCallback; @@ -77,8 +77,8 @@ public abstract class BlockWood extends Block implements ITileEntityProvider, IW } /* DROP HANDLING */ - // Hack: When harvesting we need to get the drops in onBlockHarvested, - // because Mojang destroys the block and tile before calling getDrops. + // Hack: When harvesting we need to get the drops in onBlockHarvested, + // because Mojang destroys the block and tile before calling getDrops. private final ThreadLocal> drops = new ThreadLocal<>(); @Override diff --git a/src/main/java/forestry/arboriculture/commands/CommandTree.java b/src/main/java/forestry/arboriculture/commands/CommandTree.java index 5712bb3cc..05c6f9b9c 100644 --- a/src/main/java/forestry/arboriculture/commands/CommandTree.java +++ b/src/main/java/forestry/arboriculture/commands/CommandTree.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.commands; diff --git a/src/main/java/forestry/arboriculture/commands/CommandTreeSpawn.java b/src/main/java/forestry/arboriculture/commands/CommandTreeSpawn.java index a236f02e1..ceec23628 100644 --- a/src/main/java/forestry/arboriculture/commands/CommandTreeSpawn.java +++ b/src/main/java/forestry/arboriculture/commands/CommandTreeSpawn.java @@ -1,26 +1,27 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.commands; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.command.ICommandSender; +import net.minecraft.command.PlayerNotFoundException; +import net.minecraft.entity.player.EntityPlayer; + +import org.apache.commons.lang3.StringUtils; + import forestry.api.arboriculture.IAlleleTreeSpecies; import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IAllele; import forestry.core.commands.CommandHelpers; import forestry.core.commands.SubCommand; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.command.ICommandSender; -import net.minecraft.command.PlayerNotFoundException; -import net.minecraft.entity.player.EntityPlayer; -import org.apache.commons.lang3.StringUtils; public final class CommandTreeSpawn extends SubCommand { @@ -72,8 +73,7 @@ public final class CommandTreeSpawn extends SubCommand { private static String[] getSpecies() { List species = new ArrayList<>(); - for (IAllele allele : - AlleleManager.alleleRegistry.getRegisteredAlleles().values()) { + for (IAllele allele : AlleleManager.alleleRegistry.getRegisteredAlleles().values()) { if (allele instanceof IAlleleTreeSpecies) { species.add(allele.getName().replaceAll("\\s", "")); } diff --git a/src/main/java/forestry/arboriculture/commands/ForestSpawner.java b/src/main/java/forestry/arboriculture/commands/ForestSpawner.java index 09148f726..eb8ef8426 100644 --- a/src/main/java/forestry/arboriculture/commands/ForestSpawner.java +++ b/src/main/java/forestry/arboriculture/commands/ForestSpawner.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.commands; diff --git a/src/main/java/forestry/arboriculture/commands/ITreeSpawner.java b/src/main/java/forestry/arboriculture/commands/ITreeSpawner.java index 7c25b1949..a55e10b35 100644 --- a/src/main/java/forestry/arboriculture/commands/ITreeSpawner.java +++ b/src/main/java/forestry/arboriculture/commands/ITreeSpawner.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.commands; diff --git a/src/main/java/forestry/arboriculture/commands/TreeGenHelper.java b/src/main/java/forestry/arboriculture/commands/TreeGenHelper.java index 59c3ec438..df53c30a4 100644 --- a/src/main/java/forestry/arboriculture/commands/TreeGenHelper.java +++ b/src/main/java/forestry/arboriculture/commands/TreeGenHelper.java @@ -1,15 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.commands; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.gen.feature.WorldGenerator; + import forestry.api.arboriculture.IAlleleTreeSpecies; import forestry.api.arboriculture.ITree; import forestry.api.arboriculture.ITreeGenome; @@ -19,8 +20,6 @@ import forestry.api.genetics.IAllele; import forestry.core.commands.SpeciesNotFoundException; import forestry.core.commands.TemplateNotFoundException; import forestry.core.worldgen.WorldGenBase; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.gen.feature.WorldGenerator; public final class TreeGenHelper { @@ -59,8 +58,7 @@ public final class TreeGenHelper { } if (species == null) { - for (IAllele allele : - AlleleManager.alleleRegistry.getRegisteredAlleles().values()) { + for (IAllele allele : AlleleManager.alleleRegistry.getRegisteredAlleles().values()) { if (allele instanceof IAlleleTreeSpecies && allele.getName().replaceAll("\\s", "").equals(speciesName)) { species = (IAlleleTreeSpecies) allele; diff --git a/src/main/java/forestry/arboriculture/commands/TreeModeHelper.java b/src/main/java/forestry/arboriculture/commands/TreeModeHelper.java index afb173690..e4e866434 100644 --- a/src/main/java/forestry/arboriculture/commands/TreeModeHelper.java +++ b/src/main/java/forestry/arboriculture/commands/TreeModeHelper.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.commands; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.world.World; + import forestry.api.arboriculture.ITreekeepingMode; import forestry.api.arboriculture.TreeManager; import forestry.core.commands.ICommandModeHelper; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.world.World; public class TreeModeHelper implements ICommandModeHelper { diff --git a/src/main/java/forestry/arboriculture/commands/TreeSpawner.java b/src/main/java/forestry/arboriculture/commands/TreeSpawner.java index e32000656..0da28e2fe 100644 --- a/src/main/java/forestry/arboriculture/commands/TreeSpawner.java +++ b/src/main/java/forestry/arboriculture/commands/TreeSpawner.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.commands; diff --git a/src/main/java/forestry/arboriculture/commands/TreeStatsSaveHelper.java b/src/main/java/forestry/arboriculture/commands/TreeStatsSaveHelper.java index 90f59fa1e..6d21bdc28 100644 --- a/src/main/java/forestry/arboriculture/commands/TreeStatsSaveHelper.java +++ b/src/main/java/forestry/arboriculture/commands/TreeStatsSaveHelper.java @@ -1,16 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.commands; +import java.util.ArrayList; +import java.util.Collection; + +import net.minecraft.world.World; + import com.mojang.authlib.GameProfile; + import forestry.api.arboriculture.IAlleleTreeSpecies; import forestry.api.arboriculture.TreeManager; import forestry.api.genetics.AlleleManager; @@ -18,9 +22,6 @@ import forestry.api.genetics.IAllele; import forestry.api.genetics.IAlleleSpecies; import forestry.api.genetics.IBreedingTracker; import forestry.core.commands.IStatsSaveHelper; -import java.util.ArrayList; -import java.util.Collection; -import net.minecraft.world.World; public class TreeStatsSaveHelper implements IStatsSaveHelper { @@ -35,8 +36,7 @@ public class TreeStatsSaveHelper implements IStatsSaveHelper { @Override public Collection getSpecies() { Collection species = new ArrayList<>(); - for (IAllele allele : - AlleleManager.alleleRegistry.getRegisteredAlleles().values()) { + for (IAllele allele : AlleleManager.alleleRegistry.getRegisteredAlleles().values()) { if (allele instanceof IAlleleTreeSpecies) { species.add((IAlleleTreeSpecies) allele); } diff --git a/src/main/java/forestry/arboriculture/genetics/ArboristTracker.java b/src/main/java/forestry/arboriculture/genetics/ArboristTracker.java index 84209483a..25e6056d5 100755 --- a/src/main/java/forestry/arboriculture/genetics/ArboristTracker.java +++ b/src/main/java/forestry/arboriculture/genetics/ArboristTracker.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.genetics; +import net.minecraft.entity.player.EntityPlayer; + import forestry.api.arboriculture.IArboristTracker; import forestry.api.arboriculture.TreeManager; import forestry.api.genetics.IBreedingTracker; import forestry.api.genetics.IIndividual; import forestry.core.genetics.BreedingTracker; -import net.minecraft.entity.player.EntityPlayer; public class ArboristTracker extends BreedingTracker implements IArboristTracker { diff --git a/src/main/java/forestry/arboriculture/genetics/BranchTrees.java b/src/main/java/forestry/arboriculture/genetics/BranchTrees.java index da246f04a..a6723cfee 100755 --- a/src/main/java/forestry/arboriculture/genetics/BranchTrees.java +++ b/src/main/java/forestry/arboriculture/genetics/BranchTrees.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.genetics; diff --git a/src/main/java/forestry/arboriculture/genetics/GrowthProvider.java b/src/main/java/forestry/arboriculture/genetics/GrowthProvider.java index 610108e4f..6d54734e4 100755 --- a/src/main/java/forestry/arboriculture/genetics/GrowthProvider.java +++ b/src/main/java/forestry/arboriculture/genetics/GrowthProvider.java @@ -1,15 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.genetics; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + import forestry.api.arboriculture.EnumGrowthConditions; import forestry.api.arboriculture.IGrowthProvider; import forestry.api.arboriculture.ITree; @@ -18,15 +20,12 @@ import forestry.arboriculture.tiles.TileSapling; import forestry.core.utils.BlockUtil; import forestry.core.utils.StringUtil; import forestry.core.utils.vect.Vect; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; public class GrowthProvider implements IGrowthProvider { @Override - public boolean canGrow( - ITreeGenome genome, World world, int xPos, int yPos, int zPos, int expectedGirth, int expectedHeight) { + public boolean canGrow(ITreeGenome genome, World world, int xPos, int yPos, int zPos, int expectedGirth, + int expectedHeight) { if (!hasRoom(world, xPos, yPos, zPos, expectedGirth, expectedHeight)) { return false; } @@ -53,8 +52,8 @@ public class GrowthProvider implements IGrowthProvider { return new String[0]; } - protected static EnumGrowthConditions getConditionsFromRainfall( - World world, int xPos, int yPos, int zPos, float min, float max) { + protected static EnumGrowthConditions getConditionsFromRainfall(World world, int xPos, int yPos, int zPos, + float min, float max) { BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(xPos, zPos); if (biome.rainfall < min || biome.rainfall > max) { @@ -64,8 +63,8 @@ public class GrowthProvider implements IGrowthProvider { return EnumGrowthConditions.EXCELLENT; } - protected static EnumGrowthConditions getConditionsFromTemperature( - World world, int xPos, int yPos, int zPos, float min, float max) { + protected static EnumGrowthConditions getConditionsFromTemperature(World world, int xPos, int yPos, int zPos, + float min, float max) { BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(xPos, zPos); float biomeTemperature = biome.getFloatTemperature(xPos, yPos, zPos); @@ -116,8 +115,8 @@ public class GrowthProvider implements IGrowthProvider { return true; } - private static boolean hasSufficientSaplings( - ITreeGenome genome, World world, int xPos, int yPos, int zPos, int expectedGirth) { + private static boolean hasSufficientSaplings(ITreeGenome genome, World world, int xPos, int yPos, int zPos, + int expectedGirth) { if (expectedGirth == 1) { return true; @@ -138,11 +137,7 @@ public class GrowthProvider implements IGrowthProvider { } ITree tree = ((TileSapling) tile).getTree(); - if (tree == null - || !tree.getGenome() - .getPrimary() - .getUID() - .equals(genome.getPrimary().getUID())) { + if (tree == null || !tree.getGenome().getPrimary().getUID().equals(genome.getPrimary().getUID())) { return false; } } diff --git a/src/main/java/forestry/arboriculture/genetics/GrowthProviderTropical.java b/src/main/java/forestry/arboriculture/genetics/GrowthProviderTropical.java index f41a6c814..3d29d5a22 100755 --- a/src/main/java/forestry/arboriculture/genetics/GrowthProviderTropical.java +++ b/src/main/java/forestry/arboriculture/genetics/GrowthProviderTropical.java @@ -1,34 +1,44 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.genetics; +import java.util.EnumSet; + +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + import forestry.api.arboriculture.EnumGrowthConditions; import forestry.api.arboriculture.ITreeGenome; import forestry.core.utils.StringUtil; -import java.util.EnumSet; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; public class GrowthProviderTropical extends GrowthProvider { @Override public EnumGrowthConditions getGrowthConditions(ITreeGenome genome, World world, int xPos, int yPos, int zPos) { EnumGrowthConditions light = getConditionFromLight(world, xPos, yPos, zPos); - EnumGrowthConditions moisture = - getConditionsFromRainfall(world, xPos, yPos, zPos, BiomeGenBase.jungle.rainfall, 2.0f); + EnumGrowthConditions moisture = getConditionsFromRainfall( + world, + xPos, + yPos, + zPos, + BiomeGenBase.jungle.rainfall, + 2.0f); float jungleTemperature = BiomeGenBase.jungle.getFloatTemperature(xPos, yPos, zPos); float desertTemperature = BiomeGenBase.desert.getFloatTemperature(xPos, yPos, zPos); - EnumGrowthConditions temperature = - getConditionsFromTemperature(world, xPos, yPos, zPos, jungleTemperature, desertTemperature - 0.1f); + EnumGrowthConditions temperature = getConditionsFromTemperature( + world, + xPos, + yPos, + zPos, + jungleTemperature, + desertTemperature - 0.1f); EnumSet conditions = EnumSet.of(light, moisture, temperature); diff --git a/src/main/java/forestry/arboriculture/genetics/ITreeDefinition.java b/src/main/java/forestry/arboriculture/genetics/ITreeDefinition.java index 625bfd3c0..3d60bfb24 100644 --- a/src/main/java/forestry/arboriculture/genetics/ITreeDefinition.java +++ b/src/main/java/forestry/arboriculture/genetics/ITreeDefinition.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.genetics; +import net.minecraft.item.ItemStack; + import forestry.api.arboriculture.EnumGermlingType; import forestry.api.arboriculture.ITree; import forestry.api.arboriculture.ITreeGenome; import forestry.core.genetics.IGeneticDefinition; -import net.minecraft.item.ItemStack; public interface ITreeDefinition extends IGeneticDefinition { + @Override ITreeGenome getGenome(); diff --git a/src/main/java/forestry/arboriculture/genetics/Tree.java b/src/main/java/forestry/arboriculture/genetics/Tree.java index cd622ec23..dfca8ae9b 100755 --- a/src/main/java/forestry/arboriculture/genetics/Tree.java +++ b/src/main/java/forestry/arboriculture/genetics/Tree.java @@ -1,16 +1,34 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.genetics; +import java.util.ArrayList; +import java.util.Collection; +import java.util.EnumSet; +import java.util.List; + +import javax.annotation.Nullable; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; +import net.minecraftforge.common.EnumPlantType; +import net.minecraftforge.common.IPlantable; +import net.minecraftforge.common.util.ForgeDirection; + import com.mojang.authlib.GameProfile; + import forestry.api.arboriculture.EnumGrowthConditions; import forestry.api.arboriculture.EnumTreeChromosome; import forestry.api.arboriculture.IAlleleLeafEffect; @@ -33,22 +51,6 @@ import forestry.core.config.Config; import forestry.core.genetics.Chromosome; import forestry.core.genetics.Individual; import forestry.core.utils.StringUtil; -import java.util.ArrayList; -import java.util.Collection; -import java.util.EnumSet; -import java.util.List; -import javax.annotation.Nullable; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; -import net.minecraft.world.gen.feature.WorldGenerator; -import net.minecraftforge.common.EnumPlantType; -import net.minecraftforge.common.IPlantable; -import net.minecraftforge.common.util.ForgeDirection; public class Tree extends Individual implements ITree, IPlantable { @@ -288,9 +290,7 @@ public class Tree extends Individual implements ITree, IPlantable { @Override public boolean isPureBred(EnumTreeChromosome chromosome) { - return genome.getActiveAllele(chromosome) - .getUID() - .equals(genome.getInactiveAllele(chromosome).getUID()); + return genome.getActiveAllele(chromosome).getUID().equals(genome.getInactiveAllele(chromosome).getUID()); } @Override @@ -311,10 +311,9 @@ public class Tree extends Individual implements ITree, IPlantable { IAlleleTreeSpecies primary = genome.getPrimary(); IAlleleTreeSpecies secondary = genome.getSecondary(); if (!isPureBred(EnumTreeChromosome.SPECIES)) { - list.add(EnumChatFormatting.BLUE - + StringUtil.localize("trees.hybrid") - .replaceAll("%PRIMARY", primary.getName()) - .replaceAll("%SECONDARY", secondary.getName())); + list.add( + EnumChatFormatting.BLUE + StringUtil.localize("trees.hybrid") + .replaceAll("%PRIMARY", primary.getName()).replaceAll("%SECONDARY", secondary.getName())); } String sappiness = EnumChatFormatting.GOLD + "S: " @@ -326,8 +325,7 @@ public class Tree extends Individual implements ITree, IPlantable { String girth = EnumChatFormatting.AQUA + "G: " + String.format("%sx%s", genome.getGirth(), genome.getGirth()); String saplings = EnumChatFormatting.YELLOW + "S: " + genome.getActiveAllele(EnumTreeChromosome.FERTILITY).getName(); - String yield = EnumChatFormatting.WHITE + "Y: " - + genome.getActiveAllele(EnumTreeChromosome.YIELD).getName(); + String yield = EnumChatFormatting.WHITE + "Y: " + genome.getActiveAllele(EnumTreeChromosome.YIELD).getName(); list.add(String.format("%s, %s", saplings, maturation)); list.add(String.format("%s, %s", height, girth)); list.add(String.format("%s, %s", yield, sappiness)); @@ -343,8 +341,10 @@ public class Tree extends Individual implements ITree, IPlantable { if (!canBearFruit()) { strike = EnumChatFormatting.STRIKETHROUGH.toString(); } - list.add(strike + EnumChatFormatting.GREEN + "F: " - + StringUtil.localize(genome.getFruitProvider().getDescription())); + list.add( + strike + EnumChatFormatting.GREEN + + "F: " + + StringUtil.localize(genome.getFruitProvider().getDescription())); } } @@ -392,14 +392,8 @@ public class Tree extends Individual implements ITree, IPlantable { return new Tree(new TreeGenome(chromosomes)); } - private static IChromosome[] mutateSpecies( - World world, - @Nullable GameProfile playerProfile, - int x, - int y, - int z, - ITreeGenome genomeOne, - ITreeGenome genomeTwo) { + private static IChromosome[] mutateSpecies(World world, @Nullable GameProfile playerProfile, int x, int y, int z, + ITreeGenome genomeOne, ITreeGenome genomeTwo) { IChromosome[] parent1 = genomeOne.getChromosomes(); IChromosome[] parent2 = genomeTwo.getChromosomes(); @@ -459,9 +453,7 @@ public class Tree extends Individual implements ITree, IPlantable { /* PRODUCTION */ @Override public boolean canBearFruit() { - return genome.getPrimary() - .getSuitableFruit() - .contains(genome.getFruitProvider().getFamily()); + return genome.getPrimary().getSuitableFruit().contains(genome.getFruitProvider().getFamily()); } @Override diff --git a/src/main/java/forestry/arboriculture/genetics/TreeBranchDefinition.java b/src/main/java/forestry/arboriculture/genetics/TreeBranchDefinition.java index 176c99ade..37122ade3 100644 --- a/src/main/java/forestry/arboriculture/genetics/TreeBranchDefinition.java +++ b/src/main/java/forestry/arboriculture/genetics/TreeBranchDefinition.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.genetics; +import java.util.Arrays; +import java.util.Locale; + +import org.apache.commons.lang3.text.WordUtils; + import forestry.api.arboriculture.EnumTreeChromosome; import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IAllele; @@ -23,11 +26,9 @@ import forestry.core.genetics.IBranchDefinition; import forestry.core.genetics.alleles.AlleleHelper; import forestry.core.genetics.alleles.AllelePlantType; import forestry.core.genetics.alleles.EnumAllele; -import java.util.Arrays; -import java.util.Locale; -import org.apache.commons.lang3.text.WordUtils; public enum TreeBranchDefinition implements IBranchDefinition { + ACACIA, ACER, ADANSONIA, @@ -61,8 +62,7 @@ public enum TreeBranchDefinition implements IBranchDefinition { // unclassified CARICA, - TROPICAL(""), - ; + TROPICAL(""),; private final IClassification branch; @@ -111,152 +111,190 @@ public enum TreeBranchDefinition implements IBranchDefinition { IClassification plantae = alleleRegistry.getClassification("kingdom.plantae"); - plantae.addMemberGroup(alleleRegistry.createAndRegisterClassification( - EnumClassLevel.DIVISION, - "angiosperms", - "Angiosperms", + plantae.addMemberGroup( alleleRegistry.createAndRegisterClassification( - EnumClassLevel.CLASS, - "asterids", - "Asterids", + EnumClassLevel.DIVISION, + "angiosperms", + "Angiosperms", alleleRegistry.createAndRegisterClassification( - EnumClassLevel.ORDER, - "ericales", - "Ericales", + EnumClassLevel.CLASS, + "asterids", + "Asterids", alleleRegistry.createAndRegisterClassification( - EnumClassLevel.FAMILY, "ebenaceae", "Ebenaceae", EBONY.getBranch()), + EnumClassLevel.ORDER, + "ericales", + "Ericales", + alleleRegistry.createAndRegisterClassification( + EnumClassLevel.FAMILY, + "ebenaceae", + "Ebenaceae", + EBONY.getBranch()), + alleleRegistry.createAndRegisterClassification( + EnumClassLevel.FAMILY, + "fabaceae", + "Fabaceae", + ACACIA.getBranch(), + DALBERGIA.getBranch(), + MILLETTIA.getBranch(), + PTEROCARPUS.getBranch())), alleleRegistry.createAndRegisterClassification( - EnumClassLevel.FAMILY, - "fabaceae", - "Fabaceae", - ACACIA.getBranch(), - DALBERGIA.getBranch(), - MILLETTIA.getBranch(), - PTEROCARPUS.getBranch())), + EnumClassLevel.ORDER, + "lamiales", + "Lamiales", + alleleRegistry.createAndRegisterClassification( + EnumClassLevel.FAMILY, + "bignoniaceae", + "Bignoniaceae", + TABEBUIA.getBranch()), + alleleRegistry.createAndRegisterClassification( + EnumClassLevel.FAMILY, + "lamiaceae", + "Lamiaceae", + TECTONA.getBranch()))), alleleRegistry.createAndRegisterClassification( - EnumClassLevel.ORDER, - "lamiales", - "Lamiales", + EnumClassLevel.CLASS, + "commelinids", + "Commelinids", alleleRegistry.createAndRegisterClassification( - EnumClassLevel.FAMILY, "bignoniaceae", "Bignoniaceae", TABEBUIA.getBranch()), - alleleRegistry.createAndRegisterClassification( - EnumClassLevel.FAMILY, "lamiaceae", "Lamiaceae", TECTONA.getBranch()))), - alleleRegistry.createAndRegisterClassification( - EnumClassLevel.CLASS, - "commelinids", - "Commelinids", + EnumClassLevel.ORDER, + "arecales", + "Arecales", + alleleRegistry.createAndRegisterClassification( + EnumClassLevel.FAMILY, + "arecaceae", + "Arecaceae", + PHOENIX.getBranch()))), alleleRegistry.createAndRegisterClassification( - EnumClassLevel.ORDER, - "arecales", - "Arecales", + EnumClassLevel.CLASS, + "rosids", + "Rosids", alleleRegistry.createAndRegisterClassification( - EnumClassLevel.FAMILY, "arecaceae", "Arecaceae", PHOENIX.getBranch()))), - alleleRegistry.createAndRegisterClassification( - EnumClassLevel.CLASS, - "rosids", - "Rosids", - alleleRegistry.createAndRegisterClassification( - EnumClassLevel.ORDER, - "brassicales", - "Brassicales", + EnumClassLevel.ORDER, + "brassicales", + "Brassicales", + alleleRegistry.createAndRegisterClassification( + EnumClassLevel.FAMILY, + "caricaceae", + "Caricaceae")), + alleleRegistry + .createAndRegisterClassification(EnumClassLevel.ORDER, "fabales", "Fabales"), alleleRegistry.createAndRegisterClassification( - EnumClassLevel.FAMILY, "caricaceae", "Caricaceae")), - alleleRegistry.createAndRegisterClassification(EnumClassLevel.ORDER, "fabales", "Fabales"), - alleleRegistry.createAndRegisterClassification( - EnumClassLevel.ORDER, - "fagales", - "Fagales", + EnumClassLevel.ORDER, + "fagales", + "Fagales", + alleleRegistry.createAndRegisterClassification( + EnumClassLevel.FAMILY, + "betulaceae", + "Betulaceae", + BETULA.getBranch()), + alleleRegistry.createAndRegisterClassification( + EnumClassLevel.FAMILY, + "fagaceae", + "Fagaceae", + CASTANEA.getBranch(), + QUERCUS.getBranch()), + alleleRegistry.createAndRegisterClassification( + EnumClassLevel.FAMILY, + "juglandaceae", + "Juglandaceae", + JUGLANS.getBranch())), alleleRegistry.createAndRegisterClassification( - EnumClassLevel.FAMILY, "betulaceae", "Betulaceae", BETULA.getBranch()), + EnumClassLevel.ORDER, + "rosales", + "Rosales", + alleleRegistry.createAndRegisterClassification( + EnumClassLevel.FAMILY, + "rosaceae", + "Rosaceae", + PRUNUS.getBranch())), alleleRegistry.createAndRegisterClassification( - EnumClassLevel.FAMILY, - "fagaceae", - "Fagaceae", - CASTANEA.getBranch(), - QUERCUS.getBranch()), + EnumClassLevel.ORDER, + "malvales", + "Malvales", + alleleRegistry.createAndRegisterClassification( + EnumClassLevel.FAMILY, + "dipterocarpaceae", + "Dipterocarpaceae", + MAHOGANY.getBranch()), + alleleRegistry.createAndRegisterClassification( + EnumClassLevel.FAMILY, + "malvaceae", + "Malvaceae", + ADANSONIA.getBranch(), + CEIBA.getBranch(), + OCHROMA.getBranch(), + TALIPARITI.getBranch(), + TILIA.getBranch())), + alleleRegistry + .createAndRegisterClassification(EnumClassLevel.ORDER, "laurales", "Laurales"), alleleRegistry.createAndRegisterClassification( - EnumClassLevel.FAMILY, "juglandaceae", "Juglandaceae", JUGLANS.getBranch())), - alleleRegistry.createAndRegisterClassification( - EnumClassLevel.ORDER, - "rosales", - "Rosales", + EnumClassLevel.ORDER, + "malpighiales", + "Malpighiales", + alleleRegistry.createAndRegisterClassification( + EnumClassLevel.FAMILY, + "salicaceae", + "Salicaceae", + CHLOROCARDIUM.getBranch(), + POPULUS.getBranch(), + SALIX.getBranch()), + alleleRegistry.createAndRegisterClassification( + EnumClassLevel.FAMILY, + "lauraceae", + "Lauraceae")), alleleRegistry.createAndRegisterClassification( - EnumClassLevel.FAMILY, "rosaceae", "Rosaceae", PRUNUS.getBranch())), - alleleRegistry.createAndRegisterClassification( - EnumClassLevel.ORDER, - "malvales", - "Malvales", - alleleRegistry.createAndRegisterClassification( - EnumClassLevel.FAMILY, - "dipterocarpaceae", - "Dipterocarpaceae", - MAHOGANY.getBranch()), - alleleRegistry.createAndRegisterClassification( - EnumClassLevel.FAMILY, - "malvaceae", - "Malvaceae", - ADANSONIA.getBranch(), - CEIBA.getBranch(), - OCHROMA.getBranch(), - TALIPARITI.getBranch(), - TILIA.getBranch())), - alleleRegistry.createAndRegisterClassification(EnumClassLevel.ORDER, "laurales", "Laurales"), - alleleRegistry.createAndRegisterClassification( - EnumClassLevel.ORDER, - "malpighiales", - "Malpighiales", - alleleRegistry.createAndRegisterClassification( - EnumClassLevel.FAMILY, - "salicaceae", - "Salicaceae", - CHLOROCARDIUM.getBranch(), - POPULUS.getBranch(), - SALIX.getBranch()), - alleleRegistry.createAndRegisterClassification( - EnumClassLevel.FAMILY, "lauraceae", "Lauraceae")), - alleleRegistry.createAndRegisterClassification( - EnumClassLevel.ORDER, - "sapindales", - "Sapindales", - alleleRegistry.createAndRegisterClassification( - EnumClassLevel.FAMILY, "rutaceae", "Rutaceae", CITRUS.getBranch()), - alleleRegistry.createAndRegisterClassification( - EnumClassLevel.FAMILY, "sapindaceae", "Sapindaceae", ACER.getBranch()), - alleleRegistry.createAndRegisterClassification( - EnumClassLevel.FAMILY, - "anacardiaceae", - "Anacardiaceae", - ASTRONIUM.getBranch()))))); + EnumClassLevel.ORDER, + "sapindales", + "Sapindales", + alleleRegistry.createAndRegisterClassification( + EnumClassLevel.FAMILY, + "rutaceae", + "Rutaceae", + CITRUS.getBranch()), + alleleRegistry.createAndRegisterClassification( + EnumClassLevel.FAMILY, + "sapindaceae", + "Sapindaceae", + ACER.getBranch()), + alleleRegistry.createAndRegisterClassification( + EnumClassLevel.FAMILY, + "anacardiaceae", + "Anacardiaceae", + ASTRONIUM.getBranch()))))); - plantae.addMemberGroup(alleleRegistry.createAndRegisterClassification( - EnumClassLevel.DIVISION, - "pinophyta", - "Pinophyta", + plantae.addMemberGroup( alleleRegistry.createAndRegisterClassification( - EnumClassLevel.CLASS, - "pinopsida", - "Pinopsida", + EnumClassLevel.DIVISION, + "pinophyta", + "Pinophyta", alleleRegistry.createAndRegisterClassification( - EnumClassLevel.ORDER, - "pinales", - "Pinales", + EnumClassLevel.CLASS, + "pinopsida", + "Pinopsida", alleleRegistry.createAndRegisterClassification( - EnumClassLevel.FAMILY, - "pinaceae", - "Pinaceae", - PICEA.getBranch(), - PINUS.getBranch(), - LARIX.getBranch()), - alleleRegistry.createAndRegisterClassification( - EnumClassLevel.FAMILY, - "cupressaceae", - "Cupressaceae", - SEQUOIA.getBranch(), - SEQUOIADENDRON.getBranch()))), - alleleRegistry.createAndRegisterClassification( - EnumClassLevel.CLASS, "magnoliopsida", "Magnoliopsida"))); + EnumClassLevel.ORDER, + "pinales", + "Pinales", + alleleRegistry.createAndRegisterClassification( + EnumClassLevel.FAMILY, + "pinaceae", + "Pinaceae", + PICEA.getBranch(), + PINUS.getBranch(), + LARIX.getBranch()), + alleleRegistry.createAndRegisterClassification( + EnumClassLevel.FAMILY, + "cupressaceae", + "Cupressaceae", + SEQUOIA.getBranch(), + SEQUOIADENDRON.getBranch()))), + alleleRegistry.createAndRegisterClassification( + EnumClassLevel.CLASS, + "magnoliopsida", + "Magnoliopsida"))); - plantae.addMemberGroup(alleleRegistry.createAndRegisterClassification( - EnumClassLevel.DIVISION, "magnoliophyta", "Magnoliophyta")); + plantae.addMemberGroup( + alleleRegistry + .createAndRegisterClassification(EnumClassLevel.DIVISION, "magnoliophyta", "Magnoliophyta")); } } diff --git a/src/main/java/forestry/arboriculture/genetics/TreeDefinition.java b/src/main/java/forestry/arboriculture/genetics/TreeDefinition.java index 73d7726b3..d7688381a 100644 --- a/src/main/java/forestry/arboriculture/genetics/TreeDefinition.java +++ b/src/main/java/forestry/arboriculture/genetics/TreeDefinition.java @@ -1,16 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.genetics; +import java.awt.Color; +import java.util.Arrays; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; +import net.minecraftforge.common.util.ForgeDirection; + import com.mojang.authlib.GameProfile; + import forestry.api.arboriculture.EnumFruitFamily; import forestry.api.arboriculture.EnumGermlingType; import forestry.api.arboriculture.EnumLeafType; @@ -76,26 +85,12 @@ import forestry.core.genetics.alleles.AlleleHelper; import forestry.core.genetics.alleles.AllelePlantType; import forestry.core.genetics.alleles.EnumAllele; import forestry.plugins.PluginArboriculture; -import java.awt.Color; -import java.util.Arrays; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraft.world.gen.feature.WorldGenerator; -import net.minecraftforge.common.util.ForgeDirection; public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { - Oak( - TreeBranchDefinition.QUERCUS, - "appleOak", - "robur", - false, - EnumLeafType.DECIDUOUS, - new Color(4764952), - new Color(4764952).brighter(), - 0, - new ItemStack(Blocks.log, 1, 0)) { + + Oak(TreeBranchDefinition.QUERCUS, "appleOak", "robur", false, EnumLeafType.DECIDUOUS, new Color(4764952), + new Color(4764952).brighter(), 0, new ItemStack(Blocks.log, 1, 0)) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenOak(tree); @@ -118,16 +113,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { // vanilla } }, - DarkOak( - TreeBranchDefinition.QUERCUS, - "darkOak", - "velutina", - false, - EnumLeafType.DECIDUOUS, - new Color(4764952), - new Color(4764952).brighter(), - 5, - new ItemStack(Blocks.log2, 1, 1)) { + DarkOak(TreeBranchDefinition.QUERCUS, "darkOak", "velutina", false, EnumLeafType.DECIDUOUS, new Color(4764952), + new Color(4764952).brighter(), 5, new ItemStack(Blocks.log2, 1, 1)) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenDarkOak(tree); @@ -150,16 +138,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { // vanilla } }, - Birch( - TreeBranchDefinition.BETULA, - "silverBirch", - "pendula", - false, - EnumLeafType.DECIDUOUS, - new Color(8431445), - new Color(0xb0c648), - 2, - new ItemStack(Blocks.log, 1, 2)) { + Birch(TreeBranchDefinition.BETULA, "silverBirch", "pendula", false, EnumLeafType.DECIDUOUS, new Color(8431445), + new Color(0xb0c648), 2, new ItemStack(Blocks.log, 1, 2)) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenBirch(tree); @@ -179,15 +160,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { // vanilla } }, - Lime( - TreeBranchDefinition.TILIA, - "silverLime", - "pendula", - true, - EnumLeafType.DECIDUOUS, - new Color(0x5ea107), - new Color(0x5ea107).brighter(), - EnumWoodType.LIME) { + Lime(TreeBranchDefinition.TILIA, "silverLime", "pendula", true, EnumLeafType.DECIDUOUS, new Color(0x5ea107), + new Color(0x5ea107).brighter(), EnumWoodType.LIME) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenSilverLime(tree); @@ -203,9 +178,7 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { @Override protected void setSpeciesProperties(IAlleleTreeSpeciesCustom treeSpecies) { - treeSpecies - .addFruitFamily(EnumFruitFamily.NUX) - .addFruitFamily(EnumFruitFamily.PRUNES) + treeSpecies.addFruitFamily(EnumFruitFamily.NUX).addFruitFamily(EnumFruitFamily.PRUNES) .addFruitFamily(EnumFruitFamily.POMES); } @@ -214,15 +187,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(Birch, Oak, 15); } }, - Walnut( - TreeBranchDefinition.JUGLANS, - "commonWalnut", - "regia", - true, - EnumLeafType.DECIDUOUS, - new Color(0x798c55), - new Color(0xb0c648), - EnumWoodType.WALNUT) { + Walnut(TreeBranchDefinition.JUGLANS, "commonWalnut", "regia", true, EnumLeafType.DECIDUOUS, new Color(0x798c55), + new Color(0xb0c648), EnumWoodType.WALNUT) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenWalnut(tree); @@ -230,9 +197,7 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { @Override protected void setSpeciesProperties(IAlleleTreeSpeciesCustom treeSpecies) { - treeSpecies - .addFruitFamily(EnumFruitFamily.NUX) - .addFruitFamily(EnumFruitFamily.PRUNES) + treeSpecies.addFruitFamily(EnumFruitFamily.NUX).addFruitFamily(EnumFruitFamily.PRUNES) .addFruitFamily(EnumFruitFamily.POMES); } @@ -251,15 +216,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(Lime, Cherry, 10); } }, - Chestnut( - TreeBranchDefinition.CASTANEA, - "sweetChestnut", - "sativa", - true, - EnumLeafType.DECIDUOUS, - new Color(0x5ea107), - new Color(0xb0c648), - EnumWoodType.CHESTNUT) { + Chestnut(TreeBranchDefinition.CASTANEA, "sweetChestnut", "sativa", true, EnumLeafType.DECIDUOUS, + new Color(0x5ea107), new Color(0xb0c648), EnumWoodType.CHESTNUT) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenChestnut(tree); @@ -267,9 +226,7 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { @Override protected void setSpeciesProperties(IAlleleTreeSpeciesCustom treeSpecies) { - treeSpecies - .addFruitFamily(EnumFruitFamily.NUX) - .addFruitFamily(EnumFruitFamily.PRUNES) + treeSpecies.addFruitFamily(EnumFruitFamily.NUX).addFruitFamily(EnumFruitFamily.PRUNES) .addFruitFamily(EnumFruitFamily.POMES); } @@ -288,15 +245,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(Walnut, Cherry, 10); } }, - Cherry( - TreeBranchDefinition.PRUNUS, - "hillCherry", - "serrulata", - true, - EnumLeafType.DECIDUOUS, - new Color(0xe691da), - new Color(0xe63e59), - EnumWoodType.CHERRY) { + Cherry(TreeBranchDefinition.PRUNUS, "hillCherry", "serrulata", true, EnumLeafType.DECIDUOUS, new Color(0xe691da), + new Color(0xe63e59), EnumWoodType.CHERRY) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenCherry(tree); @@ -322,15 +273,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(Lime, Birch, 10); } }, - Lemon( - TreeBranchDefinition.CITRUS, - "lemon", - "limon", - true, - EnumLeafType.DECIDUOUS, - new Color(0x88af54), - new Color(0xa3b850), - EnumWoodType.CITRUS) { + Lemon(TreeBranchDefinition.CITRUS, "lemon", "limon", true, EnumLeafType.DECIDUOUS, new Color(0x88af54), + new Color(0xa3b850), EnumWoodType.CITRUS) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenLemon(tree); @@ -354,15 +299,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(Lime, Cherry, 5); } }, - Plum( - TreeBranchDefinition.PRUNUS, - "plum", - "domestica", - true, - EnumLeafType.DECIDUOUS, - new Color(0x589246), - new Color(0xa3b850), - EnumWoodType.PLUM) { + Plum(TreeBranchDefinition.PRUNUS, "plum", "domestica", true, EnumLeafType.DECIDUOUS, new Color(0x589246), + new Color(0xa3b850), EnumWoodType.PLUM) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenPlum(tree); @@ -386,15 +325,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(Lemon, Cherry, 5); } }, - Maple( - TreeBranchDefinition.ACER, - "sugarMaple", - "saccharum", - true, - EnumLeafType.MAPLE, - new Color(0xd4f425), - new Color(0x619a3c), - EnumWoodType.MAPLE) { + Maple(TreeBranchDefinition.ACER, "sugarMaple", "saccharum", true, EnumLeafType.MAPLE, new Color(0xd4f425), + new Color(0x619a3c), EnumWoodType.MAPLE) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenMaple(tree); @@ -417,16 +350,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(Spruce, Larch, 5); } }, - Spruce( - TreeBranchDefinition.PICEA, - "redSpruce", - "abies", - false, - EnumLeafType.CONIFERS, - new Color(6396257), - new Color(0x539d12), - 1, - new ItemStack(Blocks.log, 1, 1)) { + Spruce(TreeBranchDefinition.PICEA, "redSpruce", "abies", false, EnumLeafType.CONIFERS, new Color(6396257), + new Color(0x539d12), 1, new ItemStack(Blocks.log, 1, 1)) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenSpruce(tree); @@ -447,15 +373,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { // vanilla } }, - Larch( - TreeBranchDefinition.LARIX, - "mundaneLarch", - "decidua", - true, - EnumLeafType.CONIFERS, - new Color(0x698f90), - new Color(0x569896), - EnumWoodType.LARCH) { + Larch(TreeBranchDefinition.LARIX, "mundaneLarch", "decidua", true, EnumLeafType.CONIFERS, new Color(0x698f90), + new Color(0x569896), EnumWoodType.LARCH) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenLarch(tree); @@ -477,15 +397,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(Spruce, Oak, 10); } }, - Pine( - TreeBranchDefinition.PINUS, - "bullPine", - "sabiniana", - true, - EnumLeafType.CONIFERS, - new Color(0xfeff8f), - new Color(0xffd98f), - EnumWoodType.PINE) { + Pine(TreeBranchDefinition.PINUS, "bullPine", "sabiniana", true, EnumLeafType.CONIFERS, new Color(0xfeff8f), + new Color(0xffd98f), EnumWoodType.PINE) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenPine(tree); @@ -506,15 +420,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(Spruce, Larch, 10); } }, - Sequioa( - TreeBranchDefinition.SEQUOIA, - "coastSequoia", - "sempervirens", - false, - EnumLeafType.CONIFERS, - new Color(0x418e71), - new Color(0x569896), - EnumWoodType.SEQUOIA) { + Sequioa(TreeBranchDefinition.SEQUOIA, "coastSequoia", "sempervirens", false, EnumLeafType.CONIFERS, + new Color(0x418e71), new Color(0x569896), EnumWoodType.SEQUOIA) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenSequoia(tree); @@ -537,15 +445,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(Larch, Pine, 5); } }, - Gigant( - TreeBranchDefinition.SEQUOIADENDRON, - "giantSequoia", - "giganteum", - false, - EnumLeafType.CONIFERS, - new Color(0x738434), - new Color(0x738434).brighter(), - EnumWoodType.GIGANTEUM) { + Gigant(TreeBranchDefinition.SEQUOIADENDRON, "giantSequoia", "giganteum", false, EnumLeafType.CONIFERS, + new Color(0x738434), new Color(0x738434).brighter(), EnumWoodType.GIGANTEUM) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenGiganteum(tree); @@ -568,16 +470,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(Sequioa, Baobab, 1); } }, - Jungle( - TreeBranchDefinition.TROPICAL, - "jungle", - "tectona", - false, - EnumLeafType.JUNGLE, - new Color(4764952), - new Color(0x658917), - 3, - new ItemStack(Blocks.log, 1, 3)) { + Jungle(TreeBranchDefinition.TROPICAL, "jungle", "tectona", false, EnumLeafType.JUNGLE, new Color(4764952), + new Color(0x658917), 3, new ItemStack(Blocks.log, 1, 3)) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenJungle(tree); @@ -600,15 +495,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { // vanilla } }, - Teak( - TreeBranchDefinition.TECTONA, - "teak", - "grandis", - true, - EnumLeafType.JUNGLE, - new Color(0xfeff8f), - new Color(0xffd98f), - EnumWoodType.TEAK) { + Teak(TreeBranchDefinition.TECTONA, "teak", "grandis", true, EnumLeafType.JUNGLE, new Color(0xfeff8f), + new Color(0xffd98f), EnumWoodType.TEAK) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenTeak(tree); @@ -629,15 +518,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(DarkOak, Jungle, 10); } }, - Ipe( - TreeBranchDefinition.TABEBUIA, - "ipe", - "serratifolia", - true, - EnumLeafType.JUNGLE, - new Color(0xfdd207), - new Color(0xad8f04), - EnumWoodType.IPE) { + Ipe(TreeBranchDefinition.TABEBUIA, "ipe", "serratifolia", true, EnumLeafType.JUNGLE, new Color(0xfdd207), + new Color(0xad8f04), EnumWoodType.IPE) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenIpe(tree); @@ -660,15 +543,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(Teak, DarkOak, 10); } }, - Kapok( - TreeBranchDefinition.CEIBA, - "kapok", - "pentandra", - true, - EnumLeafType.JUNGLE, - new Color(0x89987b), - new Color(0x89aa9e), - EnumWoodType.KAPOK) { + Kapok(TreeBranchDefinition.CEIBA, "kapok", "pentandra", true, EnumLeafType.JUNGLE, new Color(0x89987b), + new Color(0x89aa9e), EnumWoodType.KAPOK) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenKapok(tree); @@ -691,15 +568,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(Jungle, Teak, 10); } }, - Ebony( - TreeBranchDefinition.EBONY, - "myrtleEbony", - "pentamera", - true, - EnumLeafType.JUNGLE, - new Color(0xa2d24a), - new Color(0xc4d24a), - EnumWoodType.EBONY) { + Ebony(TreeBranchDefinition.EBONY, "myrtleEbony", "pentamera", true, EnumLeafType.JUNGLE, new Color(0xa2d24a), + new Color(0xc4d24a), EnumWoodType.EBONY) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenEbony(tree); @@ -723,15 +594,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(DarkOak, Kapok, 10); } }, - Zebrawood( - TreeBranchDefinition.ASTRONIUM, - "zebrawood", - "graveolens", - false, - EnumLeafType.JUNGLE, - new Color(0xa2d24a), - new Color(0xc4d24a), - EnumWoodType.ZEBRAWOOD) { + Zebrawood(TreeBranchDefinition.ASTRONIUM, "zebrawood", "graveolens", false, EnumLeafType.JUNGLE, + new Color(0xa2d24a), new Color(0xc4d24a), EnumWoodType.ZEBRAWOOD) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenZebrawood(tree); @@ -753,15 +618,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(Ebony, Poplar, 5); } }, - Mahogony( - TreeBranchDefinition.MAHOGANY, - "yellowMeranti", - "gibbosa", - true, - EnumLeafType.JUNGLE, - new Color(0x8ab154), - new Color(0xa9b154), - EnumWoodType.MAHOGANY) { + Mahogony(TreeBranchDefinition.MAHOGANY, "yellowMeranti", "gibbosa", true, EnumLeafType.JUNGLE, new Color(0x8ab154), + new Color(0xa9b154), EnumWoodType.MAHOGANY) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenMahogany(tree); @@ -785,16 +644,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(Kapok, Ebony, 10); } }, - AcaciaVanilla( - TreeBranchDefinition.ACACIA, - "acacia", - "aneura", - true, - EnumLeafType.DECIDUOUS, - new Color(0x616101), - new Color(0xb3b302), - 4, - new ItemStack(Blocks.log2, 1, 0)) { + AcaciaVanilla(TreeBranchDefinition.ACACIA, "acacia", "aneura", true, EnumLeafType.DECIDUOUS, new Color(0x616101), + new Color(0xb3b302), 4, new ItemStack(Blocks.log2, 1, 0)) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenAcaciaVanilla(tree); @@ -813,15 +665,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { // vanilla } }, - Acacia( - TreeBranchDefinition.ACACIA, - "desertAcacia", - "erioloba", - true, - EnumLeafType.DECIDUOUS, - new Color(0x748C1C), - new Color(0xb3b302), - EnumWoodType.ACACIA) { + Acacia(TreeBranchDefinition.ACACIA, "desertAcacia", "erioloba", true, EnumLeafType.DECIDUOUS, new Color(0x748C1C), + new Color(0xb3b302), EnumWoodType.ACACIA) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenAcacia(tree); @@ -842,15 +688,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(Teak, Balsa, 10); } }, - Padauk( - TreeBranchDefinition.PTEROCARPUS, - "padauk", - "soyauxii", - true, - EnumLeafType.DECIDUOUS, - new Color(0xd0df8c), - new Color(0x435c32), - EnumWoodType.PADAUK) { + Padauk(TreeBranchDefinition.PTEROCARPUS, "padauk", "soyauxii", true, EnumLeafType.DECIDUOUS, new Color(0xd0df8c), + new Color(0x435c32), EnumWoodType.PADAUK) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenPadauk(tree); @@ -872,15 +712,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(AcaciaVanilla, Jungle, 10); } }, - Balsa( - TreeBranchDefinition.OCHROMA, - "balsa", - "pyramidale", - true, - EnumLeafType.DECIDUOUS, - new Color(0x59ac00), - new Color(0xfeff8f), - EnumWoodType.BALSA) { + Balsa(TreeBranchDefinition.OCHROMA, "balsa", "pyramidale", true, EnumLeafType.DECIDUOUS, new Color(0x59ac00), + new Color(0xfeff8f), EnumWoodType.BALSA) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenBalsa(tree); @@ -903,15 +737,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(Teak, AcaciaVanilla, 10); } }, - Cocobolo( - TreeBranchDefinition.DALBERGIA, - "cocobolo", - "retusa", - false, - EnumLeafType.DECIDUOUS, - new Color(0x6aa17a), - new Color(0x487d4c), - EnumWoodType.COCOBOLO) { + Cocobolo(TreeBranchDefinition.DALBERGIA, "cocobolo", "retusa", false, EnumLeafType.DECIDUOUS, new Color(0x6aa17a), + new Color(0x487d4c), EnumWoodType.COCOBOLO) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenCocobolo(tree); @@ -932,15 +760,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(Acacia, DarkOak, 10); } }, - Wenge( - TreeBranchDefinition.MILLETTIA, - "wenge", - "laurentii", - true, - EnumLeafType.DECIDUOUS, - new Color(0xada157), - new Color(0xad8a57), - EnumWoodType.WENGE) { + Wenge(TreeBranchDefinition.MILLETTIA, "wenge", "laurentii", true, EnumLeafType.DECIDUOUS, new Color(0xada157), + new Color(0xad8a57), EnumWoodType.WENGE) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenWenge(tree); @@ -962,15 +784,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(Cocobolo, Balsa, 10); } }, - Baobab( - TreeBranchDefinition.ADANSONIA, - "grandidierBaobab", - "digitata", - true, - EnumLeafType.DECIDUOUS, - new Color(0xfeff8f), - new Color(0xffd98f), - EnumWoodType.BAOBAB) { + Baobab(TreeBranchDefinition.ADANSONIA, "grandidierBaobab", "digitata", true, EnumLeafType.DECIDUOUS, + new Color(0xfeff8f), new Color(0xffd98f), EnumWoodType.BAOBAB) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenBaobab(tree); @@ -995,15 +811,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(Balsa, Wenge, 10); } }, - Mahoe( - TreeBranchDefinition.TALIPARITI, - "blueMahoe", - "elatum", - true, - EnumLeafType.DECIDUOUS, - new Color(0xa0ba1b), - new Color(0x79a175), - EnumWoodType.MAHOE) { + Mahoe(TreeBranchDefinition.TALIPARITI, "blueMahoe", "elatum", true, EnumLeafType.DECIDUOUS, new Color(0xa0ba1b), + new Color(0x79a175), EnumWoodType.MAHOE) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenMahoe(tree); @@ -1011,9 +821,7 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { @Override protected void setSpeciesProperties(IAlleleTreeSpeciesCustom treeSpecies) { - treeSpecies - .addFruitFamily(EnumFruitFamily.JUNGLE) - .addFruitFamily(EnumFruitFamily.POMES) + treeSpecies.addFruitFamily(EnumFruitFamily.JUNGLE).addFruitFamily(EnumFruitFamily.POMES) .addFruitFamily(EnumFruitFamily.PRUNES); } @@ -1029,15 +837,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(Balsa, Acacia, 5); } }, - Willow( - TreeBranchDefinition.SALIX, - "whiteWillow", - "alba", - true, - EnumLeafType.WILLOW, - new Color(0xa3b8a5), - new Color(0xa3b850), - EnumWoodType.WILLOW) { + Willow(TreeBranchDefinition.SALIX, "whiteWillow", "alba", true, EnumLeafType.WILLOW, new Color(0xa3b8a5), + new Color(0xa3b850), EnumWoodType.WILLOW) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenWillow(tree); @@ -1045,9 +847,7 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { @Override protected void setSpeciesProperties(IAlleleTreeSpeciesCustom treeSpecies) { - treeSpecies - .addFruitFamily(EnumFruitFamily.NUX) - .addFruitFamily(EnumFruitFamily.PRUNES) + treeSpecies.addFruitFamily(EnumFruitFamily.NUX).addFruitFamily(EnumFruitFamily.PRUNES) .addFruitFamily(EnumFruitFamily.POMES); } @@ -1060,26 +860,17 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { @Override protected void registerMutations() { - registerMutation(Oak, Birch, 10) - .restrictTemperature(EnumTemperature.WARM, EnumTemperature.HOT) + registerMutation(Oak, Birch, 10).restrictTemperature(EnumTemperature.WARM, EnumTemperature.HOT) .restrictHumidity(EnumHumidity.DAMP); - registerMutation(Oak, Lime, 10) - .restrictTemperature(EnumTemperature.WARM, EnumTemperature.HOT) + registerMutation(Oak, Lime, 10).restrictTemperature(EnumTemperature.WARM, EnumTemperature.HOT) .restrictHumidity(EnumHumidity.DAMP); - registerMutation(Lime, Birch, 10) - .restrictTemperature(EnumTemperature.WARM, EnumTemperature.HOT) + registerMutation(Lime, Birch, 10).restrictTemperature(EnumTemperature.WARM, EnumTemperature.HOT) .restrictHumidity(EnumHumidity.DAMP); } }, - Sipiri( - TreeBranchDefinition.CHLOROCARDIUM, - "sipiri", - "rodiei", - true, - EnumLeafType.DECIDUOUS, - new Color(0x678911), - new Color(0x79a175), - EnumWoodType.GREENHEART) { + Sipiri(TreeBranchDefinition.CHLOROCARDIUM, "sipiri", "rodiei", true, EnumLeafType.DECIDUOUS, new Color(0x678911), + new Color(0x79a175), EnumWoodType.GREENHEART) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenGreenheart(tree); @@ -1100,20 +891,13 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { @Override protected void registerMutations() { - registerMutation(Kapok, Mahogony, 10) - .restrictTemperature(EnumTemperature.WARM, EnumTemperature.HOT) + registerMutation(Kapok, Mahogony, 10).restrictTemperature(EnumTemperature.WARM, EnumTemperature.HOT) .restrictHumidity(EnumHumidity.DAMP); } }, - Papaya( - TreeBranchDefinition.CARICA, - "papaya", - "papaya", - true, - EnumLeafType.PALM, - new Color(0x6d9f58), - new Color(0x75E675), - EnumWoodType.PAPAYA) { + Papaya(TreeBranchDefinition.CARICA, "papaya", "papaya", true, EnumLeafType.PALM, new Color(0x6d9f58), + new Color(0x75E675), EnumWoodType.PAPAYA) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenPapaya(tree); @@ -1137,15 +921,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(Jungle, Cherry, 5); } }, - Date( - TreeBranchDefinition.PHOENIX, - "datePalm", - "dactylifera", - true, - EnumLeafType.PALM, - new Color(0xcbcd79), - new Color(0xB3F370), - EnumWoodType.PALM) { + Date(TreeBranchDefinition.PHOENIX, "datePalm", "dactylifera", true, EnumLeafType.PALM, new Color(0xcbcd79), + new Color(0xB3F370), EnumWoodType.PALM) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenDate(tree); @@ -1170,15 +948,9 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { registerMutation(Jungle, Papaya, 5); } }, - Poplar( - TreeBranchDefinition.POPULUS, - "whitePoplar", - "alba", - true, - EnumLeafType.DECIDUOUS, - new Color(0xa3b8a5), - new Color(0x539d12), - EnumWoodType.POPLAR) { + Poplar(TreeBranchDefinition.POPULUS, "whitePoplar", "alba", true, EnumLeafType.DECIDUOUS, new Color(0xa3b8a5), + new Color(0x539d12), EnumWoodType.POPLAR) { + @Override public WorldGenerator getWorldGenerator(ITreeGenData tree) { return new WorldGenPoplar(tree); @@ -1214,16 +986,8 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { private ITreeGenome genome; // vanilla tree constructor - TreeDefinition( - TreeBranchDefinition branch, - String speciesName, - String binomial, - boolean dominant, - EnumLeafType leafType, - Color primary, - Color secondary, - int vanillaMeta, - ItemStack vanillaWood) { + TreeDefinition(TreeBranchDefinition branch, String speciesName, String binomial, boolean dominant, + EnumLeafType leafType, Color primary, Color secondary, int vanillaMeta, ItemStack vanillaWood) { String uid = "forestry.tree" + this; String unlocalizedDescription = "for.description.tree" + this; String unlocalizedName = "for.trees.species." + speciesName; @@ -1249,15 +1013,8 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { } // forestry tree constructor - TreeDefinition( - TreeBranchDefinition branch, - String speciesName, - String binomial, - boolean dominant, - EnumLeafType leafType, - Color primary, - Color secondary, - EnumWoodType woodType) { + TreeDefinition(TreeBranchDefinition branch, String speciesName, String binomial, boolean dominant, + EnumLeafType leafType, Color primary, Color secondary, EnumWoodType woodType) { String uid = "forestry.tree" + this; String unlocalizedDescription = "for.description.tree" + this; String unlocalizedName = "for.trees.species." + speciesName; @@ -1323,8 +1080,8 @@ public enum TreeDefinition implements ITreeDefinition, ITreeGenerator { @Override public void setLeaves(ITreeGenome genome, World world, GameProfile owner, int x, int y, int z, boolean decorative) { - boolean placed = - world.setBlock(x, y, z, PluginArboriculture.blocks.leaves, 0, Constants.FLAG_BLOCK_SYNCH_AND_UPDATE); + boolean placed = world + .setBlock(x, y, z, PluginArboriculture.blocks.leaves, 0, Constants.FLAG_BLOCK_SYNCH_AND_UPDATE); if (!placed) { return; } diff --git a/src/main/java/forestry/arboriculture/genetics/TreeFactory.java b/src/main/java/forestry/arboriculture/genetics/TreeFactory.java index 4a97e5ef7..fcfe0f106 100644 --- a/src/main/java/forestry/arboriculture/genetics/TreeFactory.java +++ b/src/main/java/forestry/arboriculture/genetics/TreeFactory.java @@ -1,15 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.genetics; +import java.awt.Color; + import forestry.api.arboriculture.EnumLeafType; import forestry.api.arboriculture.EnumTreeChromosome; import forestry.api.arboriculture.IAlleleTreeSpeciesCustom; @@ -21,21 +21,13 @@ import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IClassification; import forestry.arboriculture.genetics.alleles.AlleleTreeSpecies; import forestry.arboriculture.render.IconProviderLeaves; -import java.awt.Color; public class TreeFactory implements ITreeFactory { + @Override - public IAlleleTreeSpeciesCustom createSpecies( - String uid, - String unlocalizedName, - String authority, - String unlocalizedDescription, - boolean dominant, - IClassification branch, - String binomial, - ILeafIconProvider leafIconProvider, - IGermlingIconProvider germlingIconProvider, - ITreeGenerator generator) { + public IAlleleTreeSpeciesCustom createSpecies(String uid, String unlocalizedName, String authority, + String unlocalizedDescription, boolean dominant, IClassification branch, String binomial, + ILeafIconProvider leafIconProvider, IGermlingIconProvider germlingIconProvider, ITreeGenerator generator) { IAlleleTreeSpeciesCustom treeSpecies = new AlleleTreeSpecies( uid, unlocalizedName, diff --git a/src/main/java/forestry/arboriculture/genetics/TreeGenome.java b/src/main/java/forestry/arboriculture/genetics/TreeGenome.java index 05c48ff63..1c3d1edad 100755 --- a/src/main/java/forestry/arboriculture/genetics/TreeGenome.java +++ b/src/main/java/forestry/arboriculture/genetics/TreeGenome.java @@ -1,15 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.genetics; +import java.util.EnumSet; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.EnumPlantType; + import forestry.api.arboriculture.EnumTreeChromosome; import forestry.api.arboriculture.IAlleleFruit; import forestry.api.arboriculture.IAlleleGrowth; @@ -26,10 +30,6 @@ import forestry.api.genetics.IChromosome; import forestry.api.genetics.ISpeciesRoot; import forestry.core.genetics.Genome; import forestry.core.genetics.alleles.AllelePlantType; -import java.util.EnumSet; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.EnumPlantType; public class TreeGenome extends Genome implements ITreeGenome { diff --git a/src/main/java/forestry/arboriculture/genetics/TreeHelper.java b/src/main/java/forestry/arboriculture/genetics/TreeHelper.java index de7083a83..7f8ddf27b 100755 --- a/src/main/java/forestry/arboriculture/genetics/TreeHelper.java +++ b/src/main/java/forestry/arboriculture/genetics/TreeHelper.java @@ -1,16 +1,32 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.genetics; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedList; +import java.util.List; +import java.util.Locale; +import java.util.Map.Entry; + +import net.minecraft.block.Block; +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.world.World; +import net.minecraftforge.oredict.OreDictionary; + import com.mojang.authlib.GameProfile; + import cpw.mods.fml.common.FMLCommonHandler; import forestry.api.arboriculture.EnumGermlingType; import forestry.api.arboriculture.EnumTreeChromosome; @@ -36,21 +52,6 @@ import forestry.core.config.Constants; import forestry.core.genetics.SpeciesRoot; import forestry.core.utils.BlockUtil; import forestry.plugins.PluginArboriculture; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.LinkedList; -import java.util.List; -import java.util.Locale; -import java.util.Map.Entry; -import net.minecraft.block.Block; -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.world.World; -import net.minecraftforge.oredict.OreDictionary; public class TreeHelper extends SpeciesRoot implements ITreeRoot { @@ -79,8 +80,7 @@ public class TreeHelper extends SpeciesRoot implements ITreeRoot { public int getSpeciesCount() { if (treeSpeciesCount < 0) { treeSpeciesCount = 0; - for (Entry entry : - AlleleManager.alleleRegistry.getRegisteredAlleles().entrySet()) { + for (Entry entry : AlleleManager.alleleRegistry.getRegisteredAlleles().entrySet()) { if (entry.getValue() instanceof IAlleleTreeSpecies) { if (((IAlleleTreeSpecies) entry.getValue()).isCounted()) { treeSpeciesCount++; @@ -187,8 +187,8 @@ public class TreeHelper extends SpeciesRoot implements ITreeRoot { @Override public boolean plantSapling(World world, ITree tree, GameProfile owner, int x, int y, int z) { - boolean placed = - world.setBlock(x, y, z, PluginArboriculture.blocks.saplingGE, 0, Constants.FLAG_BLOCK_SYNCH_AND_UPDATE); + boolean placed = world + .setBlock(x, y, z, PluginArboriculture.blocks.saplingGE, 0, Constants.FLAG_BLOCK_SYNCH_AND_UPDATE); if (!placed) { return false; } @@ -212,16 +212,16 @@ public class TreeHelper extends SpeciesRoot implements ITreeRoot { } @Override - public boolean setFruitBlock( - World world, IAlleleFruit allele, float sappiness, short[] indices, int x, int y, int z) { + public boolean setFruitBlock(World world, IAlleleFruit allele, float sappiness, short[] indices, int x, int y, + int z) { int direction = BlockUtil.getDirectionalMetadata(world, x, y, z); if (direction < 0) { return false; } - boolean placed = world.setBlock( - x, y, z, PluginArboriculture.blocks.pods, direction, Constants.FLAG_BLOCK_SYNCH_AND_UPDATE); + boolean placed = world + .setBlock(x, y, z, PluginArboriculture.blocks.pods, direction, Constants.FLAG_BLOCK_SYNCH_AND_UPDATE); if (!placed) { return false; } @@ -325,8 +325,7 @@ public class TreeHelper extends SpeciesRoot implements ITreeRoot { } } - FMLCommonHandler.instance() - .getFMLLogger() + FMLCommonHandler.instance().getFMLLogger() .debug("Failed to find a Treekeeping mode called '%s', reverting to fallback."); return treekeepingModes.get(0); } diff --git a/src/main/java/forestry/arboriculture/genetics/TreeMutation.java b/src/main/java/forestry/arboriculture/genetics/TreeMutation.java index d7fee7e1d..94eb3fda0 100755 --- a/src/main/java/forestry/arboriculture/genetics/TreeMutation.java +++ b/src/main/java/forestry/arboriculture/genetics/TreeMutation.java @@ -1,15 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.genetics; +import net.minecraft.world.World; + import forestry.api.arboriculture.IAlleleTreeSpecies; import forestry.api.arboriculture.ITreeGenome; import forestry.api.arboriculture.ITreeMutationCustom; @@ -18,7 +18,6 @@ import forestry.api.arboriculture.TreeManager; import forestry.api.core.ForestryAPI; import forestry.api.genetics.IAllele; import forestry.core.genetics.mutations.Mutation; -import net.minecraft.world.World; public class TreeMutation extends Mutation implements ITreeMutationCustom { @@ -32,15 +31,8 @@ public class TreeMutation extends Mutation implements ITreeMutationCustom { } @Override - public float getChance( - World world, - int x, - int y, - int z, - IAlleleTreeSpecies allele0, - IAlleleTreeSpecies allele1, - ITreeGenome genome0, - ITreeGenome genome1) { + public float getChance(World world, int x, int y, int z, IAlleleTreeSpecies allele0, IAlleleTreeSpecies allele1, + ITreeGenome genome0, ITreeGenome genome1) { float processedChance = super.getChance( world, x, diff --git a/src/main/java/forestry/arboriculture/genetics/TreeMutationFactory.java b/src/main/java/forestry/arboriculture/genetics/TreeMutationFactory.java index dd58d0966..3dd3bc5e3 100644 --- a/src/main/java/forestry/arboriculture/genetics/TreeMutationFactory.java +++ b/src/main/java/forestry/arboriculture/genetics/TreeMutationFactory.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.genetics; @@ -19,8 +17,8 @@ import forestry.api.genetics.IAllele; public class TreeMutationFactory implements ITreeMutationFactory { @Override - public ITreeMutationCustom createMutation( - IAlleleTreeSpecies parent0, IAlleleTreeSpecies parent1, IAllele[] result, int chance) { + public ITreeMutationCustom createMutation(IAlleleTreeSpecies parent0, IAlleleTreeSpecies parent1, IAllele[] result, + int chance) { ITreeMutationCustom mutation = new TreeMutation(parent0, parent1, result, chance); TreeManager.treeRoot.registerMutation(mutation); return mutation; diff --git a/src/main/java/forestry/arboriculture/genetics/TreekeepingMode.java b/src/main/java/forestry/arboriculture/genetics/TreekeepingMode.java index 9fa66024f..c7097e2d2 100755 --- a/src/main/java/forestry/arboriculture/genetics/TreekeepingMode.java +++ b/src/main/java/forestry/arboriculture/genetics/TreekeepingMode.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.genetics; -import forestry.api.arboriculture.ITreeGenome; -import forestry.api.arboriculture.ITreekeepingMode; import java.util.ArrayList; import java.util.Locale; +import forestry.api.arboriculture.ITreeGenome; +import forestry.api.arboriculture.ITreekeepingMode; + public class TreekeepingMode implements ITreekeepingMode { public static final ITreekeepingMode easy = new TreekeepingMode("EASY", 1.4f, 1.3f, 1.2f, 1.2f); @@ -29,11 +28,7 @@ public class TreekeepingMode implements ITreekeepingMode { private final float maturationModifier; private final float mutationModifier; - public TreekeepingMode( - String name, - float yieldModifier, - float sappinessModifier, - float maturationModifier, + public TreekeepingMode(String name, float yieldModifier, float sappinessModifier, float maturationModifier, float mutationModifier) { this.name = name; this.yieldModifier = yieldModifier; diff --git a/src/main/java/forestry/arboriculture/genetics/alleles/AlleleFruit.java b/src/main/java/forestry/arboriculture/genetics/alleles/AlleleFruit.java index 5aa4fc16e..ce5e68ed5 100644 --- a/src/main/java/forestry/arboriculture/genetics/alleles/AlleleFruit.java +++ b/src/main/java/forestry/arboriculture/genetics/alleles/AlleleFruit.java @@ -1,15 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.genetics.alleles; +import java.util.Arrays; +import java.util.List; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + import forestry.api.arboriculture.EnumFruitFamily; import forestry.api.arboriculture.EnumTreeChromosome; import forestry.api.arboriculture.IAlleleFruit; @@ -21,10 +25,6 @@ import forestry.arboriculture.FruitProviderRandom; import forestry.arboriculture.FruitProviderRipening; import forestry.core.genetics.alleles.AlleleCategorized; import forestry.core.items.ItemFruit; -import java.util.Arrays; -import java.util.List; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; public class AlleleFruit extends AlleleCategorized implements IAlleleFruit { @@ -47,8 +47,7 @@ public class AlleleFruit extends AlleleCategorized implements IAlleleFruit { fruitApple = new AlleleFruit( "apple", new FruitProviderRandom("apple", EnumFruitFamily.POMES, new ItemStack(Items.apple), 1.0f) - .setColour(0xff2e2e) - .setOverlay("pomes")), + .setColour(0xff2e2e).setOverlay("pomes")), fruitCocoa = new AlleleFruit( "cocoa", new FruitProviderPod("cocoa", EnumFruitFamily.JUNGLE, FruitProviderPod.EnumPodType.COCOA)), @@ -56,25 +55,26 @@ public class AlleleFruit extends AlleleCategorized implements IAlleleFruit { fruitChestnut = new AlleleFruit( "chestnut", new FruitProviderRipening( - "chestnut", EnumFruitFamily.NUX, ItemFruit.EnumFruit.CHESTNUT.getStack(), 1.0f) - .setRipeningPeriod(6) - .setColours(0x7f333d, 0xc4d24a) - .setOverlay("nuts"), + "chestnut", + EnumFruitFamily.NUX, + ItemFruit.EnumFruit.CHESTNUT.getStack(), + 1.0f).setRipeningPeriod(6).setColours(0x7f333d, 0xc4d24a).setOverlay("nuts"), true), fruitWalnut = new AlleleFruit( "walnut", new FruitProviderRipening( - "walnut", EnumFruitFamily.NUX, ItemFruit.EnumFruit.WALNUT.getStack(), 1.0f) - .setRipeningPeriod(8) - .setColours(0xfba248, 0xc4d24a) - .setOverlay("nuts"), + "walnut", + EnumFruitFamily.NUX, + ItemFruit.EnumFruit.WALNUT.getStack(), + 1.0f).setRipeningPeriod(8).setColours(0xfba248, 0xc4d24a).setOverlay("nuts"), true), fruitCherry = new AlleleFruit( "cherry", new FruitProviderRipening( - "cherry", EnumFruitFamily.PRUNES, ItemFruit.EnumFruit.CHERRY.getStack(), 1.0f) - .setColours(0xff2e2e, 0xc4d24a) - .setOverlay("berries"), + "cherry", + EnumFruitFamily.PRUNES, + ItemFruit.EnumFruit.CHERRY.getStack(), + 1.0f).setColours(0xff2e2e, 0xc4d24a).setOverlay("berries"), true), fruitDates = new AlleleFruit( "dates", @@ -93,16 +93,18 @@ public class AlleleFruit extends AlleleCategorized implements IAlleleFruit { fruitLemon = new AlleleFruit( "lemon", new FruitProviderRipening( - "lemon", EnumFruitFamily.PRUNES, ItemFruit.EnumFruit.LEMON.getStack(), 1.0f) - .setColours(0xeeee00, 0x99ff00) - .setOverlay("citrus"), + "lemon", + EnumFruitFamily.PRUNES, + ItemFruit.EnumFruit.LEMON.getStack(), + 1.0f).setColours(0xeeee00, 0x99ff00).setOverlay("citrus"), true), fruitPlum = new AlleleFruit( "plum", new FruitProviderRipening( - "plum", EnumFruitFamily.PRUNES, ItemFruit.EnumFruit.PLUM.getStack(), 1.0f) - .setColours(0x663446, 0xeeff1a) - .setOverlay("plums"), + "plum", + EnumFruitFamily.PRUNES, + ItemFruit.EnumFruit.PLUM.getStack(), + 1.0f).setColours(0x663446, 0xeeff1a).setOverlay("plums"), true)); for (IAlleleFruit fruitAllele : fruitAlleles) { diff --git a/src/main/java/forestry/arboriculture/genetics/alleles/AlleleGrowth.java b/src/main/java/forestry/arboriculture/genetics/alleles/AlleleGrowth.java index db2d3bd55..a1d18cabd 100644 --- a/src/main/java/forestry/arboriculture/genetics/alleles/AlleleGrowth.java +++ b/src/main/java/forestry/arboriculture/genetics/alleles/AlleleGrowth.java @@ -1,15 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.genetics.alleles; +import java.util.Arrays; +import java.util.List; + import forestry.api.arboriculture.EnumTreeChromosome; import forestry.api.arboriculture.IAlleleGrowth; import forestry.api.arboriculture.IGrowthProvider; @@ -17,8 +18,6 @@ import forestry.api.genetics.AlleleManager; import forestry.arboriculture.genetics.GrowthProvider; import forestry.arboriculture.genetics.GrowthProviderTropical; import forestry.core.genetics.alleles.AlleleCategorized; -import java.util.Arrays; -import java.util.List; public class AlleleGrowth extends AlleleCategorized implements IAlleleGrowth { diff --git a/src/main/java/forestry/arboriculture/genetics/alleles/AlleleLeafEffect.java b/src/main/java/forestry/arboriculture/genetics/alleles/AlleleLeafEffect.java index 7f47dddc4..adf060ed9 100644 --- a/src/main/java/forestry/arboriculture/genetics/alleles/AlleleLeafEffect.java +++ b/src/main/java/forestry/arboriculture/genetics/alleles/AlleleLeafEffect.java @@ -1,15 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.genetics.alleles; +import net.minecraft.util.AxisAlignedBB; +import net.minecraft.world.World; + import forestry.api.arboriculture.EnumTreeChromosome; import forestry.api.arboriculture.IAlleleLeafEffect; import forestry.api.arboriculture.ITreeGenome; @@ -18,11 +19,10 @@ import forestry.api.genetics.IEffectData; import forestry.core.genetics.alleles.Allele; import forestry.core.genetics.alleles.AlleleCategorized; import forestry.core.utils.vect.Vect; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; public class AlleleLeafEffect extends AlleleCategorized implements IAlleleLeafEffect { - private static final int[] DEFAULT_EFFECT_AREA = new int[] {12, 12, 12}; + + private static final int[] DEFAULT_EFFECT_AREA = new int[] { 12, 12, 12 }; public static Allele leavesNone; diff --git a/src/main/java/forestry/arboriculture/genetics/alleles/AlleleLeafEffectNone.java b/src/main/java/forestry/arboriculture/genetics/alleles/AlleleLeafEffectNone.java index f086507a4..67ff88865 100644 --- a/src/main/java/forestry/arboriculture/genetics/alleles/AlleleLeafEffectNone.java +++ b/src/main/java/forestry/arboriculture/genetics/alleles/AlleleLeafEffectNone.java @@ -1,16 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.genetics.alleles; public class AlleleLeafEffectNone extends AlleleLeafEffect { + public AlleleLeafEffectNone() { super("none", true); } diff --git a/src/main/java/forestry/arboriculture/genetics/alleles/AlleleTreeSpecies.java b/src/main/java/forestry/arboriculture/genetics/alleles/AlleleTreeSpecies.java index 2278146b1..a71fcd788 100644 --- a/src/main/java/forestry/arboriculture/genetics/alleles/AlleleTreeSpecies.java +++ b/src/main/java/forestry/arboriculture/genetics/alleles/AlleleTreeSpecies.java @@ -1,15 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.genetics.alleles; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; +import net.minecraftforge.common.EnumPlantType; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.arboriculture.EnumGermlingType; @@ -24,13 +29,9 @@ import forestry.api.genetics.IClassification; import forestry.api.genetics.IFruitFamily; import forestry.core.genetics.alleles.AlleleSpecies; import forestry.core.render.TextureManager; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.util.IIcon; -import net.minecraftforge.common.EnumPlantType; public class AlleleTreeSpecies extends AlleleSpecies implements IAlleleTreeSpeciesCustom, IIconProvider { + private final ITreeGenerator generator; private final IGermlingIconProvider germlingIconProvider; private final ILeafIconProvider leafIconProvider; @@ -38,17 +39,9 @@ public class AlleleTreeSpecies extends AlleleSpecies implements IAlleleTreeSpeci private EnumPlantType nativeType = EnumPlantType.Plains; - public AlleleTreeSpecies( - String uid, - String unlocalizedName, - String authority, - String unlocalizedDescription, - boolean isDominant, - IClassification branch, - String binomial, - ILeafIconProvider leafIconProvider, - IGermlingIconProvider germlingIconProvider, - ITreeGenerator generator) { + public AlleleTreeSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, + boolean isDominant, IClassification branch, String binomial, ILeafIconProvider leafIconProvider, + IGermlingIconProvider germlingIconProvider, ITreeGenerator generator) { super(uid, unlocalizedName, authority, unlocalizedDescription, isDominant, branch, binomial); this.generator = generator; diff --git a/src/main/java/forestry/arboriculture/genetics/pollination/CheckPollinatable.java b/src/main/java/forestry/arboriculture/genetics/pollination/CheckPollinatable.java index 4ededf226..6b198fac2 100644 --- a/src/main/java/forestry/arboriculture/genetics/pollination/CheckPollinatable.java +++ b/src/main/java/forestry/arboriculture/genetics/pollination/CheckPollinatable.java @@ -1,19 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.genetics.pollination; +import java.util.EnumSet; + +import net.minecraftforge.common.EnumPlantType; + import forestry.api.genetics.IIndividual; import forestry.api.genetics.IPollinatable; -import java.util.EnumSet; -import net.minecraftforge.common.EnumPlantType; public class CheckPollinatable implements ICheckPollinatable { diff --git a/src/main/java/forestry/arboriculture/genetics/pollination/CheckPollinatableTree.java b/src/main/java/forestry/arboriculture/genetics/pollination/CheckPollinatableTree.java index 1daceedb9..404850c81 100644 --- a/src/main/java/forestry/arboriculture/genetics/pollination/CheckPollinatableTree.java +++ b/src/main/java/forestry/arboriculture/genetics/pollination/CheckPollinatableTree.java @@ -1,19 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.genetics.pollination; +import java.util.EnumSet; + +import net.minecraftforge.common.EnumPlantType; + import forestry.api.arboriculture.ITree; import forestry.api.genetics.IIndividual; -import java.util.EnumSet; -import net.minecraftforge.common.EnumPlantType; public class CheckPollinatableTree implements ICheckPollinatable { diff --git a/src/main/java/forestry/arboriculture/genetics/pollination/FakePollinatable.java b/src/main/java/forestry/arboriculture/genetics/pollination/FakePollinatable.java index 80ab2bf8b..b90bd0b49 100644 --- a/src/main/java/forestry/arboriculture/genetics/pollination/FakePollinatable.java +++ b/src/main/java/forestry/arboriculture/genetics/pollination/FakePollinatable.java @@ -1,9 +1,11 @@ package forestry.arboriculture.genetics.pollination; +import java.util.EnumSet; + +import net.minecraftforge.common.EnumPlantType; + import forestry.api.genetics.IIndividual; import forestry.api.genetics.IPollinatable; -import java.util.EnumSet; -import net.minecraftforge.common.EnumPlantType; public class FakePollinatable implements IPollinatable { diff --git a/src/main/java/forestry/arboriculture/genetics/pollination/ICheckPollinatable.java b/src/main/java/forestry/arboriculture/genetics/pollination/ICheckPollinatable.java index ac2cd99ac..af0e124b6 100644 --- a/src/main/java/forestry/arboriculture/genetics/pollination/ICheckPollinatable.java +++ b/src/main/java/forestry/arboriculture/genetics/pollination/ICheckPollinatable.java @@ -1,24 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.genetics.pollination; -import forestry.api.genetics.IIndividual; import java.util.EnumSet; + import net.minecraftforge.common.EnumPlantType; +import forestry.api.genetics.IIndividual; + /** Just like IPollinatible but for checking only, it can't be mated */ public interface ICheckPollinatable { /** - * @return plant types this pollinatable is classified as. (Can be used by bees to determine whether to interact or not. + * @return plant types this pollinatable is classified as. (Can be used by bees to determine whether to interact or + * not. */ EnumSet getPlantType(); diff --git a/src/main/java/forestry/arboriculture/gui/GuiTreealyzer.java b/src/main/java/forestry/arboriculture/gui/GuiTreealyzer.java index 87da50b03..ad8446816 100755 --- a/src/main/java/forestry/arboriculture/gui/GuiTreealyzer.java +++ b/src/main/java/forestry/arboriculture/gui/GuiTreealyzer.java @@ -1,15 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.gui; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Locale; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.common.EnumPlantType; + import forestry.api.arboriculture.EnumGermlingType; import forestry.api.arboriculture.EnumTreeChromosome; import forestry.api.arboriculture.IAlleleFruit; @@ -29,14 +37,6 @@ import forestry.core.gui.ContainerAlyzer; import forestry.core.gui.GuiAlyzer; import forestry.core.utils.StringUtil; import forestry.plugins.PluginArboriculture; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Locale; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraftforge.common.EnumPlantType; public class GuiTreealyzer extends GuiAlyzer { @@ -110,9 +110,11 @@ public class GuiTreealyzer extends GuiAlyzer { textLayout.newLine(); { - String customPrimaryTreeKey = "trees.custom.treealyzer." + type.getName() + "." + String customPrimaryTreeKey = "trees.custom.treealyzer." + type.getName() + + "." + tree.getGenome().getPrimary().getUnlocalizedName().replace("trees.species.", ""); - String customSecondaryTreeKey = "trees.custom.treealyzer." + type.getName() + "." + String customSecondaryTreeKey = "trees.custom.treealyzer." + type.getName() + + "." + tree.getGenome().getSecondary().getUnlocalizedName().replace("trees.species.", ""); drawSpeciesRow( @@ -158,8 +160,8 @@ public class GuiTreealyzer extends GuiAlyzer { String no = StringUtil.localize("no"); AlleleBoolean primaryFireproof = (AlleleBoolean) tree.getGenome().getActiveAllele(EnumTreeChromosome.FIREPROOF); - AlleleBoolean secondaryFireproof = - (AlleleBoolean) tree.getGenome().getInactiveAllele(EnumTreeChromosome.FIREPROOF); + AlleleBoolean secondaryFireproof = (AlleleBoolean) tree.getGenome() + .getInactiveAllele(EnumTreeChromosome.FIREPROOF); textLayout.drawLine(StringUtil.localize("gui.fireproof"), COLUMN_0); drawLine( @@ -203,8 +205,7 @@ public class GuiTreealyzer extends GuiAlyzer { EnumTreeChromosome.GROWTH, false); drawLine( - ((IAlleleGrowth) tree.getGenome().getInactiveAllele(EnumTreeChromosome.GROWTH)) - .getProvider() + ((IAlleleGrowth) tree.getGenome().getInactiveAllele(EnumTreeChromosome.GROWTH)).getProvider() .getDescription(), COLUMN_2, tree, @@ -215,21 +216,13 @@ public class GuiTreealyzer extends GuiAlyzer { textLayout.drawLine(StringUtil.localize("gui.native"), COLUMN_0); textLayout.drawLine( - StringUtil.localize("gui." - + tree.getGenome() - .getPrimary() - .getPlantType() - .toString() - .toLowerCase(Locale.ENGLISH)), + StringUtil.localize( + "gui." + tree.getGenome().getPrimary().getPlantType().toString().toLowerCase(Locale.ENGLISH)), COLUMN_1, speciesDominance0); textLayout.drawLine( - StringUtil.localize("gui." - + tree.getGenome() - .getSecondary() - .getPlantType() - .toString() - .toLowerCase(Locale.ENGLISH)), + StringUtil.localize( + "gui." + tree.getGenome().getSecondary().getPlantType().toString().toLowerCase(Locale.ENGLISH)), COLUMN_2, speciesDominance1); @@ -252,8 +245,7 @@ public class GuiTreealyzer extends GuiAlyzer { } if (activeTolerated.size() > i) { drawLine( - StringUtil.localize( - "gui." + activeTolerated.get(i).toString().toLowerCase(Locale.ENGLISH)), + StringUtil.localize("gui." + activeTolerated.get(i).toString().toLowerCase(Locale.ENGLISH)), COLUMN_1, tree, EnumTreeChromosome.PLANT, @@ -261,8 +253,7 @@ public class GuiTreealyzer extends GuiAlyzer { } if (inactiveTolerated.size() > i) { drawLine( - StringUtil.localize( - "gui." + inactiveTolerated.get(i).toString().toLowerCase(Locale.ENGLISH)), + StringUtil.localize("gui." + inactiveTolerated.get(i).toString().toLowerCase(Locale.ENGLISH)), COLUMN_2, tree, EnumTreeChromosome.PLANT, @@ -273,10 +264,8 @@ public class GuiTreealyzer extends GuiAlyzer { // FRUITS textLayout.drawLine(StringUtil.localize("gui.supports"), COLUMN_0); - List families0 = - new ArrayList<>(tree.getGenome().getPrimary().getSuitableFruit()); - List families1 = - new ArrayList<>(tree.getGenome().getSecondary().getSuitableFruit()); + List families0 = new ArrayList<>(tree.getGenome().getPrimary().getSuitableFruit()); + List families1 = new ArrayList<>(tree.getGenome().getSecondary().getSuitableFruit()); max = Math.max(families0.size(), families1.size()); for (int i = 0; i < max; i++) { @@ -295,8 +284,7 @@ public class GuiTreealyzer extends GuiAlyzer { textLayout.newLine(); textLayout.newLine(); - int fruitDominance0 = getColorCoding( - tree.getGenome().getActiveAllele(EnumTreeChromosome.FRUITS).isDominant()); + int fruitDominance0 = getColorCoding(tree.getGenome().getActiveAllele(EnumTreeChromosome.FRUITS).isDominant()); int fruitDominance1 = getColorCoding( tree.getGenome().getInactiveAllele(EnumTreeChromosome.FRUITS).isDominant()); @@ -313,17 +301,12 @@ public class GuiTreealyzer extends GuiAlyzer { strike = ""; IAllele fruit1 = tree.getGenome().getInactiveAllele(EnumTreeChromosome.FRUITS); - if (!tree.getGenome() - .getSecondary() - .getSuitableFruit() - .contains(((IAlleleFruit) fruit1).getProvider().getFamily()) - && fruit1 != AlleleFruit.fruitNone) { + if (!tree.getGenome().getSecondary().getSuitableFruit() + .contains(((IAlleleFruit) fruit1).getProvider().getFamily()) && fruit1 != AlleleFruit.fruitNone) { strike = EnumChatFormatting.STRIKETHROUGH.toString(); } textLayout.drawLine( - strike - + StringUtil.localize( - ((IAlleleFruit) fruit1).getProvider().getDescription()), + strike + StringUtil.localize(((IAlleleFruit) fruit1).getProvider().getDescription()), COLUMN_2, fruitDominance1); @@ -332,8 +315,7 @@ public class GuiTreealyzer extends GuiAlyzer { textLayout.drawLine(StringUtil.localize("gui.family"), COLUMN_0); IFruitFamily primary = tree.getGenome().getFruitProvider().getFamily(); IFruitFamily secondary = ((IAlleleFruit) tree.getGenome().getInactiveAllele(EnumTreeChromosome.FRUITS)) - .getProvider() - .getFamily(); + .getProvider().getFamily(); if (primary != null) { textLayout.drawLine(primary.getName(), COLUMN_1, fruitDominance0); @@ -355,7 +337,11 @@ public class GuiTreealyzer extends GuiAlyzer { int x = COLUMN_0; for (ItemStack stack : tree.getProduceList()) { itemRender.renderItemIntoGUI( - fontRendererObj, mc.renderEngine, stack, guiLeft + x, guiTop + textLayout.getLineY()); + fontRendererObj, + mc.renderEngine, + stack, + guiLeft + x, + guiTop + textLayout.getLineY()); x += 18; if (x > 148) { x = COLUMN_0; @@ -374,7 +360,11 @@ public class GuiTreealyzer extends GuiAlyzer { x = COLUMN_0; for (ItemStack stack : tree.getSpecialtyList()) { itemRender.renderItemIntoGUI( - fontRendererObj, mc.renderEngine, stack, guiLeft + x, guiTop + textLayout.getLineY()); + fontRendererObj, + mc.renderEngine, + stack, + guiLeft + x, + guiTop + textLayout.getLineY()); x += 18; if (x > 148) { x = COLUMN_0; diff --git a/src/main/java/forestry/arboriculture/inventory/ItemInventoryTreealyzer.java b/src/main/java/forestry/arboriculture/inventory/ItemInventoryTreealyzer.java index b73127513..18dfbe33a 100644 --- a/src/main/java/forestry/arboriculture/inventory/ItemInventoryTreealyzer.java +++ b/src/main/java/forestry/arboriculture/inventory/ItemInventoryTreealyzer.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.inventory; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import forestry.api.arboriculture.TreeManager; import forestry.core.config.Config; import forestry.core.gui.IHintSource; import forestry.core.inventory.ItemInventoryAlyzer; import forestry.core.utils.GeneticsUtil; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class ItemInventoryTreealyzer extends ItemInventoryAlyzer implements IHintSource { diff --git a/src/main/java/forestry/arboriculture/items/ItemBlockLeaves.java b/src/main/java/forestry/arboriculture/items/ItemBlockLeaves.java index 515b60c6e..311d6ccd0 100644 --- a/src/main/java/forestry/arboriculture/items/ItemBlockLeaves.java +++ b/src/main/java/forestry/arboriculture/items/ItemBlockLeaves.java @@ -1,25 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.items; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; + import forestry.arboriculture.tiles.TileLeaves; import forestry.core.items.ItemBlockForestry; import forestry.core.proxy.Proxies; import forestry.core.utils.StringUtil; import forestry.plugins.PluginArboriculture; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; public class ItemBlockLeaves extends ItemBlockForestry { @@ -63,18 +62,8 @@ public class ItemBlockLeaves extends ItemBlockForestry { } @Override - public boolean placeBlockAt( - ItemStack itemStack, - EntityPlayer player, - World world, - int x, - int y, - int z, - int side, - float hitX, - float hitY, - float hitZ, - int metadata) { + public boolean placeBlockAt(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, + float hitX, float hitY, float hitZ, int metadata) { if (!itemStack.hasTagCompound()) { return false; } diff --git a/src/main/java/forestry/arboriculture/items/ItemBlockWood.java b/src/main/java/forestry/arboriculture/items/ItemBlockWood.java index 4d27f9388..d908988f0 100644 --- a/src/main/java/forestry/arboriculture/items/ItemBlockWood.java +++ b/src/main/java/forestry/arboriculture/items/ItemBlockWood.java @@ -1,15 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.items; +import javax.annotation.Nullable; + +import net.minecraft.block.Block; +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.IIcon; +import net.minecraft.world.World; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.arboriculture.EnumWoodType; @@ -20,41 +29,25 @@ import forestry.arboriculture.tiles.TileWood; import forestry.core.config.Constants; import forestry.core.items.ItemBlockForestry; import forestry.core.utils.StringUtil; -import javax.annotation.Nullable; -import net.minecraft.block.Block; -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.IIcon; -import net.minecraft.world.World; public class ItemBlockWood extends ItemBlockForestry { + private static final String LEGACY_WOOD_TYPE_KEY = "WoodType"; public ItemBlockWood(Block block) { super(block); } - public static boolean placeWood( - ItemStack stack, @Nullable EntityPlayer player, World world, int x, int y, int z, int metadata) { + public static boolean placeWood(ItemStack stack, @Nullable EntityPlayer player, World world, int x, int y, int z, + int metadata) { EnumWoodType woodType = getWoodType(stack); Block block = Block.getBlockFromItem(stack.getItem()); return placeWood(stack, woodType, block, player, world, x, y, z, metadata); } - public static boolean placeWood( - ItemStack stack, - EnumWoodType woodType, - Block block, - @Nullable EntityPlayer player, - World world, - int x, - int y, - int z, - int metadata) { + public static boolean placeWood(ItemStack stack, EnumWoodType woodType, Block block, @Nullable EntityPlayer player, + World world, int x, int y, int z, int metadata) { boolean placed = world.setBlock(x, y, z, block, metadata, Constants.FLAG_BLOCK_SYNCH_AND_UPDATE); if (!placed) { return false; @@ -137,18 +130,8 @@ public class ItemBlockWood extends ItemBlockForestry { } @Override - 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) { + 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) { return placeWood(stack, player, world, x, y, z, metadata); } diff --git a/src/main/java/forestry/arboriculture/items/ItemBlockWoodSlab.java b/src/main/java/forestry/arboriculture/items/ItemBlockWoodSlab.java index 262297b28..4b0b5a7a5 100644 --- a/src/main/java/forestry/arboriculture/items/ItemBlockWoodSlab.java +++ b/src/main/java/forestry/arboriculture/items/ItemBlockWoodSlab.java @@ -1,17 +1,19 @@ package forestry.arboriculture.items; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.arboriculture.EnumWoodType; import forestry.arboriculture.blocks.BlockSlab; import forestry.arboriculture.tiles.TileWood; import forestry.core.tiles.TileUtil; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; public class ItemBlockWoodSlab extends ItemBlockWood { + private final BlockSlab slab; private final BlockSlab doubleSlab; private final boolean isDoubleSlab; @@ -24,17 +26,8 @@ public class ItemBlockWoodSlab extends ItemBlockWood { } @Override - public boolean onItemUse( - ItemStack itemStack, - EntityPlayer player, - World world, - int x, - int y, - int z, - int side, - float hitX, - float hitY, - float hitZ) { + public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, + float hitX, float hitY, float hitZ) { if (isDoubleSlab) { return super.onItemUse(itemStack, player, world, x, y, z, side, hitX, hitY, hitZ); } else if (itemStack.stackSize == 0) { @@ -138,8 +131,8 @@ public class ItemBlockWoodSlab extends ItemBlockWood { } } - private boolean func_150946_a( - ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side) { + private boolean func_150946_a(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, + int side) { if (side == 0) { --y; } diff --git a/src/main/java/forestry/arboriculture/items/ItemGermlingGE.java b/src/main/java/forestry/arboriculture/items/ItemGermlingGE.java index 08b8e73dc..9e0fe0161 100755 --- a/src/main/java/forestry/arboriculture/items/ItemGermlingGE.java +++ b/src/main/java/forestry/arboriculture/items/ItemGermlingGE.java @@ -1,15 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.items; +import java.util.List; + +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.world.World; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.arboriculture.EnumGermlingType; @@ -33,13 +40,6 @@ import forestry.core.render.SpriteSheet; import forestry.core.utils.BlockUtil; import forestry.core.utils.GeneticsUtil; import forestry.core.utils.StringUtil; -import java.util.List; -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.world.World; public class ItemGermlingGE extends ItemGE implements IVariableFermentable { @@ -86,13 +86,13 @@ public class ItemGermlingGE extends ItemGE implements IVariableFermentable { } IAlleleSpecies species = getSpecies(itemstack); - String customTreeKey = "trees.custom." + type.getName() + "." + String customTreeKey = "trees.custom." + type.getName() + + "." + species.getUnlocalizedName().replace("trees.species.", ""); if (StringUtil.canTranslate(customTreeKey)) { return StringUtil.localize(customTreeKey); } - return StringUtil.localize("trees.grammar." + type.getName()) - .replaceAll("%SPECIES", species.getName()) + return StringUtil.localize("trees.grammar." + type.getName()).replaceAll("%SPECIES", species.getName()) .replaceAll("%TYPE", StringUtil.localize("trees.grammar." + type.getName() + ".type")); } @@ -102,7 +102,7 @@ public class ItemGermlingGE extends ItemGE implements IVariableFermentable { addCreativeItems(itemList, true); } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) public void addCreativeItems(List itemList, boolean hideSecrets) { for (IIndividual individual : TreeManager.treeRoot.getIndividualTemplates()) { // Don't show secrets unless ordered to. @@ -149,17 +149,8 @@ public class ItemGermlingGE extends ItemGE implements IVariableFermentable { } @Override - public boolean onItemUse( - ItemStack itemstack, - EntityPlayer player, - World world, - int x, - int y, - int z, - int par7, - float facingX, - float facingY, - float facingZ) { + public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int par7, + float facingX, float facingY, float facingZ) { ITree tree = TreeManager.treeRoot.getMember(itemstack); if (tree == null) { return false; diff --git a/src/main/java/forestry/arboriculture/items/ItemGrafter.java b/src/main/java/forestry/arboriculture/items/ItemGrafter.java index 001c1388f..9a8973ea0 100755 --- a/src/main/java/forestry/arboriculture/items/ItemGrafter.java +++ b/src/main/java/forestry/arboriculture/items/ItemGrafter.java @@ -1,18 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.items; -import forestry.api.arboriculture.IToolGrafter; -import forestry.api.core.Tabs; -import forestry.core.items.ItemForestryTool; import net.minecraft.block.Block; import net.minecraft.block.BlockLeaves; import net.minecraft.block.material.Material; @@ -21,7 +16,12 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import forestry.api.arboriculture.IToolGrafter; +import forestry.api.core.Tabs; +import forestry.core.items.ItemForestryTool; + public class ItemGrafter extends ItemForestryTool implements IToolGrafter { + public ItemGrafter(int maxDamage) { super(null); setMaxDamage(maxDamage); @@ -40,8 +40,8 @@ public class ItemGrafter extends ItemForestryTool implements IToolGrafter { } @Override - public boolean onBlockDestroyed( - ItemStack itemstack, World world, Block block, int j, int k, int l, EntityLivingBase entityliving) { + public boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, int j, int k, int l, + EntityLivingBase entityliving) { // damage is done by the harvested leaves return true; } diff --git a/src/main/java/forestry/arboriculture/items/ItemRegistryArboriculture.java b/src/main/java/forestry/arboriculture/items/ItemRegistryArboriculture.java index dfbb9c1bd..2e5ebb67b 100644 --- a/src/main/java/forestry/arboriculture/items/ItemRegistryArboriculture.java +++ b/src/main/java/forestry/arboriculture/items/ItemRegistryArboriculture.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.items; -import forestry.api.arboriculture.EnumGermlingType; -import forestry.core.items.ItemRegistry; import net.minecraftforge.oredict.OreDictionary; +import forestry.api.arboriculture.EnumGermlingType; +import forestry.core.items.ItemRegistry; + public class ItemRegistryArboriculture extends ItemRegistry { + public final ItemGermlingGE sapling; public final ItemGermlingGE pollenFertile; public final ItemTreealyzer treealyzer; diff --git a/src/main/java/forestry/arboriculture/items/ItemTreealyzer.java b/src/main/java/forestry/arboriculture/items/ItemTreealyzer.java index 39918aa55..e0228dc5b 100644 --- a/src/main/java/forestry/arboriculture/items/ItemTreealyzer.java +++ b/src/main/java/forestry/arboriculture/items/ItemTreealyzer.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.items; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import forestry.api.core.Tabs; import forestry.arboriculture.gui.GuiTreealyzer; import forestry.arboriculture.inventory.ItemInventoryTreealyzer; import forestry.core.gui.ContainerAlyzer; import forestry.core.items.ItemWithGui; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class ItemTreealyzer extends ItemWithGui { + public ItemTreealyzer() { setCreativeTab(Tabs.tabArboriculture); } diff --git a/src/main/java/forestry/arboriculture/network/IRipeningPacketReceiver.java b/src/main/java/forestry/arboriculture/network/IRipeningPacketReceiver.java index c6ffd1188..21629bb7e 100644 --- a/src/main/java/forestry/arboriculture/network/IRipeningPacketReceiver.java +++ b/src/main/java/forestry/arboriculture/network/IRipeningPacketReceiver.java @@ -1,15 +1,14 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.network; public interface IRipeningPacketReceiver { + void fromRipeningPacket(int ripeningValue); } diff --git a/src/main/java/forestry/arboriculture/network/PacketRegistryArboriculture.java b/src/main/java/forestry/arboriculture/network/PacketRegistryArboriculture.java index e64a3d3e9..62132a0b2 100644 --- a/src/main/java/forestry/arboriculture/network/PacketRegistryArboriculture.java +++ b/src/main/java/forestry/arboriculture/network/PacketRegistryArboriculture.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.network; @@ -14,6 +12,7 @@ import forestry.arboriculture.network.packets.PacketRipeningUpdate; import forestry.core.network.PacketRegistry; public class PacketRegistryArboriculture extends PacketRegistry { + @Override public void registerPackets() { registerClientPacket(new PacketRipeningUpdate()); diff --git a/src/main/java/forestry/arboriculture/network/packets/PacketRipeningUpdate.java b/src/main/java/forestry/arboriculture/network/packets/PacketRipeningUpdate.java index c91b3a583..64f05b29c 100644 --- a/src/main/java/forestry/arboriculture/network/packets/PacketRipeningUpdate.java +++ b/src/main/java/forestry/arboriculture/network/packets/PacketRipeningUpdate.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; + import forestry.arboriculture.network.IRipeningPacketReceiver; import forestry.arboriculture.tiles.TileFruitPod; import forestry.arboriculture.tiles.TileLeaves; @@ -19,9 +22,6 @@ import forestry.core.network.IForestryPacketClient; import forestry.core.network.PacketIdClient; import forestry.core.network.packets.PacketCoordinates; import forestry.core.proxy.Proxies; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; public class PacketRipeningUpdate extends PacketCoordinates implements IForestryPacketClient { diff --git a/src/main/java/forestry/arboriculture/proxy/ProxyArboriculture.java b/src/main/java/forestry/arboriculture/proxy/ProxyArboriculture.java index e2706691a..7e18f40ac 100755 --- a/src/main/java/forestry/arboriculture/proxy/ProxyArboriculture.java +++ b/src/main/java/forestry/arboriculture/proxy/ProxyArboriculture.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.proxy; diff --git a/src/main/java/forestry/arboriculture/proxy/ProxyArboricultureClient.java b/src/main/java/forestry/arboriculture/proxy/ProxyArboricultureClient.java index 184805dee..e2d36bae6 100644 --- a/src/main/java/forestry/arboriculture/proxy/ProxyArboricultureClient.java +++ b/src/main/java/forestry/arboriculture/proxy/ProxyArboricultureClient.java @@ -1,15 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.proxy; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.world.ColorizerFoliage; +import net.minecraftforge.client.IItemRenderer; +import net.minecraftforge.client.MinecraftForgeClient; + import cpw.mods.fml.client.registry.RenderingRegistry; import forestry.arboriculture.render.RenderFenceItem; import forestry.arboriculture.render.RenderFruitPodBlock; @@ -21,13 +25,9 @@ import forestry.arboriculture.render.RenderSaplingBlock; import forestry.arboriculture.render.RenderSlabItem; import forestry.arboriculture.render.RenderStairItem; import forestry.plugins.PluginArboriculture; -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.world.ColorizerFoliage; -import net.minecraftforge.client.IItemRenderer; -import net.minecraftforge.client.MinecraftForgeClient; public class ProxyArboricultureClient extends ProxyArboriculture { + @Override public void initializeRendering() { PluginArboriculture.modelIdSaplings = RenderingRegistry.getNextAvailableRenderId(); diff --git a/src/main/java/forestry/arboriculture/render/IconProviderGermling.java b/src/main/java/forestry/arboriculture/render/IconProviderGermling.java index ac7d87c0f..de6c8fcb3 100644 --- a/src/main/java/forestry/arboriculture/render/IconProviderGermling.java +++ b/src/main/java/forestry/arboriculture/render/IconProviderGermling.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.render; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; + import forestry.api.arboriculture.EnumGermlingType; import forestry.api.arboriculture.IGermlingIconProvider; import forestry.core.render.TextureManager; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.util.IIcon; public class IconProviderGermling implements IGermlingIconProvider { diff --git a/src/main/java/forestry/arboriculture/render/IconProviderGermlingVanilla.java b/src/main/java/forestry/arboriculture/render/IconProviderGermlingVanilla.java index 9ee9f1e15..5697afc21 100644 --- a/src/main/java/forestry/arboriculture/render/IconProviderGermlingVanilla.java +++ b/src/main/java/forestry/arboriculture/render/IconProviderGermlingVanilla.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.render; -import forestry.api.arboriculture.EnumGermlingType; -import forestry.api.arboriculture.IGermlingIconProvider; -import forestry.core.render.TextureManager; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.init.Blocks; import net.minecraft.util.IIcon; +import forestry.api.arboriculture.EnumGermlingType; +import forestry.api.arboriculture.IGermlingIconProvider; +import forestry.core.render.TextureManager; + public class IconProviderGermlingVanilla implements IGermlingIconProvider { + private final int vanillaMap; private IIcon icon; diff --git a/src/main/java/forestry/arboriculture/render/IconProviderLeaves.java b/src/main/java/forestry/arboriculture/render/IconProviderLeaves.java index 41b0d949c..ec95e6d83 100644 --- a/src/main/java/forestry/arboriculture/render/IconProviderLeaves.java +++ b/src/main/java/forestry/arboriculture/render/IconProviderLeaves.java @@ -1,19 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.render; +import java.awt.Color; + +import net.minecraft.util.IIcon; + import forestry.api.arboriculture.EnumLeafType; import forestry.api.arboriculture.ILeafIconProvider; -import java.awt.Color; -import net.minecraft.util.IIcon; public class IconProviderLeaves implements ILeafIconProvider { diff --git a/src/main/java/forestry/arboriculture/render/IconProviderWood.java b/src/main/java/forestry/arboriculture/render/IconProviderWood.java index 2429873bd..a6061b55f 100644 --- a/src/main/java/forestry/arboriculture/render/IconProviderWood.java +++ b/src/main/java/forestry/arboriculture/render/IconProviderWood.java @@ -1,24 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.render; +import java.util.Locale; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.arboriculture.EnumWoodType; import forestry.core.render.TextureManager; -import java.util.Locale; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.util.IIcon; public abstract class IconProviderWood { + @SideOnly(Side.CLIENT) private static IIcon[][] icons; diff --git a/src/main/java/forestry/arboriculture/render/RenderFenceItem.java b/src/main/java/forestry/arboriculture/render/RenderFenceItem.java index 39cb2fda4..cfdf4159d 100644 --- a/src/main/java/forestry/arboriculture/render/RenderFenceItem.java +++ b/src/main/java/forestry/arboriculture/render/RenderFenceItem.java @@ -1,26 +1,27 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.render; -import forestry.api.arboriculture.EnumWoodType; -import forestry.arboriculture.items.ItemBlockWood; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.opengl.GL11; +import forestry.api.arboriculture.EnumWoodType; +import forestry.arboriculture.items.ItemBlockWood; + public class RenderFenceItem implements IItemRenderer { + @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { switch (type) { diff --git a/src/main/java/forestry/arboriculture/render/RenderFruitPodBlock.java b/src/main/java/forestry/arboriculture/render/RenderFruitPodBlock.java index eb20c23d4..dbe8cffdd 100644 --- a/src/main/java/forestry/arboriculture/render/RenderFruitPodBlock.java +++ b/src/main/java/forestry/arboriculture/render/RenderFruitPodBlock.java @@ -1,19 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.render; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; -import forestry.arboriculture.blocks.BlockFruitPod; -import forestry.arboriculture.tiles.TileFruitPod; -import forestry.plugins.PluginArboriculture; import net.minecraft.block.Block; import net.minecraft.block.BlockDirectional; import net.minecraft.client.renderer.RenderBlocks; @@ -21,14 +15,19 @@ import net.minecraft.client.renderer.Tessellator; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import forestry.arboriculture.blocks.BlockFruitPod; +import forestry.arboriculture.tiles.TileFruitPod; +import forestry.plugins.PluginArboriculture; + public class RenderFruitPodBlock implements ISimpleBlockRenderingHandler { @Override public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {} @Override - public boolean renderWorldBlock( - IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, + RenderBlocks renderer) { int maturity = 0; diff --git a/src/main/java/forestry/arboriculture/render/RenderLeavesBlock.java b/src/main/java/forestry/arboriculture/render/RenderLeavesBlock.java index 469010615..c341b1a23 100644 --- a/src/main/java/forestry/arboriculture/render/RenderLeavesBlock.java +++ b/src/main/java/forestry/arboriculture/render/RenderLeavesBlock.java @@ -1,25 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.render; -import forestry.arboriculture.blocks.BlockForestryLeaves; -import forestry.arboriculture.tiles.TileLeaves; -import forestry.core.render.RenderOverlayBlock; -import forestry.plugins.PluginArboriculture; import net.minecraft.block.Block; import net.minecraft.client.renderer.EntityRenderer; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; +import forestry.arboriculture.blocks.BlockForestryLeaves; +import forestry.arboriculture.tiles.TileLeaves; +import forestry.core.render.RenderOverlayBlock; +import forestry.plugins.PluginArboriculture; + /** * Ugly but serviceable renderer for leaves, taking fruits into account. */ @@ -31,8 +30,8 @@ public class RenderLeavesBlock extends RenderOverlayBlock { } @Override - public boolean renderWorldBlock( - IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, + RenderBlocks renderer) { TileLeaves tile = BlockForestryLeaves.getLeafTile(world, x, y, z); if (tile == null) { @@ -63,15 +62,8 @@ public class RenderLeavesBlock extends RenderOverlayBlock { return PluginArboriculture.modelIdLeaves; } - private static boolean renderFruitOverlay( - IBlockAccess world, - Block block, - int x, - int y, - int z, - RenderBlocks renderer, - IIcon texture, - int multiplier) { + private static boolean renderFruitOverlay(IBlockAccess world, Block block, int x, int y, int z, + RenderBlocks renderer, IIcon texture, int multiplier) { float mR = (multiplier >> 16 & 255) / 255.0F; float mG = (multiplier >> 8 & 255) / 255.0F; @@ -86,17 +78,8 @@ public class RenderLeavesBlock extends RenderOverlayBlock { return renderFruitOverlayWithColorMultiplier(world, block, x, y, z, mR, mG, mB, renderer, texture); } - private static boolean renderFruitOverlayWithColorMultiplier( - IBlockAccess world, - Block block, - int x, - int y, - int z, - float r, - float g, - float b, - RenderBlocks renderer, - IIcon texture) { + private static boolean renderFruitOverlayWithColorMultiplier(IBlockAccess world, Block block, int x, int y, int z, + float r, float g, float b, RenderBlocks renderer, IIcon texture) { int mixedBrightness = block.getMixedBrightnessForBlock(world, x, y, z); diff --git a/src/main/java/forestry/arboriculture/render/RenderLeavesItem.java b/src/main/java/forestry/arboriculture/render/RenderLeavesItem.java index 25ca3804d..1e0564c8d 100644 --- a/src/main/java/forestry/arboriculture/render/RenderLeavesItem.java +++ b/src/main/java/forestry/arboriculture/render/RenderLeavesItem.java @@ -1,29 +1,30 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.render; -import forestry.arboriculture.genetics.TreeHelper; -import forestry.arboriculture.items.ItemBlockLeaves; -import forestry.arboriculture.tiles.TileLeaves; -import forestry.core.proxy.Proxies; -import forestry.core.utils.ItemStackUtil; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.opengl.GL11; +import forestry.arboriculture.genetics.TreeHelper; +import forestry.arboriculture.items.ItemBlockLeaves; +import forestry.arboriculture.tiles.TileLeaves; +import forestry.core.proxy.Proxies; +import forestry.core.utils.ItemStackUtil; + public class RenderLeavesItem implements IItemRenderer { + protected static final double OVERLAY_SHIFT = 0.001; @Override @@ -40,8 +41,8 @@ public class RenderLeavesItem implements IItemRenderer { } @Override - public boolean shouldUseRenderHelper( - IItemRenderer.ItemRenderType type, ItemStack item, IItemRenderer.ItemRendererHelper helper) { + public boolean shouldUseRenderHelper(IItemRenderer.ItemRenderType type, ItemStack item, + IItemRenderer.ItemRendererHelper helper) { return true; } diff --git a/src/main/java/forestry/arboriculture/render/RenderLogItem.java b/src/main/java/forestry/arboriculture/render/RenderLogItem.java index 5bf8b769a..0abb9e795 100644 --- a/src/main/java/forestry/arboriculture/render/RenderLogItem.java +++ b/src/main/java/forestry/arboriculture/render/RenderLogItem.java @@ -1,27 +1,28 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.render; -import forestry.api.arboriculture.EnumWoodType; -import forestry.arboriculture.items.ItemBlockWood; -import forestry.core.utils.ItemStackUtil; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.opengl.GL11; +import forestry.api.arboriculture.EnumWoodType; +import forestry.arboriculture.items.ItemBlockWood; +import forestry.core.utils.ItemStackUtil; + public class RenderLogItem implements IItemRenderer { + @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { switch (type) { @@ -57,8 +58,8 @@ public class RenderLogItem implements IItemRenderer { } } - private static void renderItem( - RenderBlocks renderer, ItemStack itemStack, float x, float y, float z, boolean fullBlock) { + private static void renderItem(RenderBlocks renderer, ItemStack itemStack, float x, float y, float z, + boolean fullBlock) { Tessellator tessellator = Tessellator.instance; Block block = ItemStackUtil.getBlock(itemStack); diff --git a/src/main/java/forestry/arboriculture/render/RenderPlankItem.java b/src/main/java/forestry/arboriculture/render/RenderPlankItem.java index 73206e46c..1c745f3ee 100644 --- a/src/main/java/forestry/arboriculture/render/RenderPlankItem.java +++ b/src/main/java/forestry/arboriculture/render/RenderPlankItem.java @@ -1,27 +1,28 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.render; -import forestry.api.arboriculture.EnumWoodType; -import forestry.arboriculture.items.ItemBlockWood; -import forestry.core.utils.ItemStackUtil; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.opengl.GL11; +import forestry.api.arboriculture.EnumWoodType; +import forestry.arboriculture.items.ItemBlockWood; +import forestry.core.utils.ItemStackUtil; + public class RenderPlankItem implements IItemRenderer { + @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { switch (type) { @@ -57,8 +58,8 @@ public class RenderPlankItem implements IItemRenderer { } } - private static void renderItem( - RenderBlocks renderer, ItemStack itemStack, float x, float y, float z, boolean fullBlock) { + private static void renderItem(RenderBlocks renderer, ItemStack itemStack, float x, float y, float z, + boolean fullBlock) { Tessellator tessellator = Tessellator.instance; Block block = ItemStackUtil.getBlock(itemStack); diff --git a/src/main/java/forestry/arboriculture/render/RenderSaplingBlock.java b/src/main/java/forestry/arboriculture/render/RenderSaplingBlock.java index 026d72a0c..46fc9970b 100644 --- a/src/main/java/forestry/arboriculture/render/RenderSaplingBlock.java +++ b/src/main/java/forestry/arboriculture/render/RenderSaplingBlock.java @@ -1,27 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.render; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.EntityRenderer; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.client.renderer.Tessellator; +import net.minecraft.util.IIcon; +import net.minecraft.world.IBlockAccess; + import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import forestry.api.arboriculture.EnumGermlingType; import forestry.api.arboriculture.IAlleleTreeSpecies; import forestry.arboriculture.blocks.BlockSapling; import forestry.arboriculture.tiles.TileSapling; import forestry.plugins.PluginArboriculture; -import net.minecraft.block.Block; -import net.minecraft.client.renderer.EntityRenderer; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.client.renderer.Tessellator; -import net.minecraft.util.IIcon; -import net.minecraft.world.IBlockAccess; public class RenderSaplingBlock implements ISimpleBlockRenderingHandler { @@ -31,8 +30,8 @@ public class RenderSaplingBlock implements ISimpleBlockRenderingHandler { public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {} @Override - public boolean renderWorldBlock( - IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, + RenderBlocks renderer) { if (modelId != this.getRenderId()) { return false; @@ -63,8 +62,8 @@ public class RenderSaplingBlock implements ISimpleBlockRenderingHandler { return PluginArboriculture.modelIdSaplings; } - private static boolean renderCrossedSquares( - IAlleleTreeSpecies species, IBlockAccess world, Block block, int x, int y, int z) { + private static boolean renderCrossedSquares(IAlleleTreeSpecies species, IBlockAccess world, Block block, int x, + int y, int z) { Tessellator tess = Tessellator.instance; @@ -86,8 +85,8 @@ public class RenderSaplingBlock implements ISimpleBlockRenderingHandler { return true; } - private static void drawCrossedSquares( - IAlleleTreeSpecies species, double par3, double par5, double par7, float mod) { + private static void drawCrossedSquares(IAlleleTreeSpecies species, double par3, double par5, double par7, + float mod) { Tessellator tess = Tessellator.instance; IIcon icon = species.getGermlingIcon(EnumGermlingType.SAPLING, renderLayer); diff --git a/src/main/java/forestry/arboriculture/render/RenderSlabItem.java b/src/main/java/forestry/arboriculture/render/RenderSlabItem.java index d6883d42a..5c6e0f5cc 100644 --- a/src/main/java/forestry/arboriculture/render/RenderSlabItem.java +++ b/src/main/java/forestry/arboriculture/render/RenderSlabItem.java @@ -1,17 +1,20 @@ package forestry.arboriculture.render; -import forestry.api.arboriculture.EnumWoodType; -import forestry.arboriculture.items.ItemBlockWood; -import forestry.core.utils.ItemStackUtil; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.opengl.GL11; +import forestry.api.arboriculture.EnumWoodType; +import forestry.arboriculture.items.ItemBlockWood; +import forestry.core.utils.ItemStackUtil; + public class RenderSlabItem implements IItemRenderer { + @Override public boolean handleRenderType(ItemStack item, ItemRenderType type) { switch (type) { @@ -47,8 +50,8 @@ public class RenderSlabItem implements IItemRenderer { } } - private static void renderItem( - RenderBlocks renderer, ItemStack itemStack, float x, float y, float z, boolean fullBlock) { + private static void renderItem(RenderBlocks renderer, ItemStack itemStack, float x, float y, float z, + boolean fullBlock) { Tessellator tessellator = Tessellator.instance; Block block = ItemStackUtil.getBlock(itemStack); diff --git a/src/main/java/forestry/arboriculture/render/RenderStairItem.java b/src/main/java/forestry/arboriculture/render/RenderStairItem.java index eb44cacae..fa209e98a 100644 --- a/src/main/java/forestry/arboriculture/render/RenderStairItem.java +++ b/src/main/java/forestry/arboriculture/render/RenderStairItem.java @@ -1,26 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.render; -import forestry.api.arboriculture.EnumWoodType; -import forestry.arboriculture.items.ItemBlockWood; -import forestry.core.utils.ItemStackUtil; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.opengl.GL11; +import forestry.api.arboriculture.EnumWoodType; +import forestry.arboriculture.items.ItemBlockWood; +import forestry.core.utils.ItemStackUtil; + public class RenderStairItem implements IItemRenderer { @Override diff --git a/src/main/java/forestry/arboriculture/render/TextureLeaves.java b/src/main/java/forestry/arboriculture/render/TextureLeaves.java index 11b230210..48261f39f 100644 --- a/src/main/java/forestry/arboriculture/render/TextureLeaves.java +++ b/src/main/java/forestry/arboriculture/render/TextureLeaves.java @@ -1,24 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.render; -import forestry.api.arboriculture.EnumLeafType; -import forestry.core.render.TextureManager; import java.util.EnumMap; import java.util.Locale; import java.util.Map; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.util.IIcon; +import forestry.api.arboriculture.EnumLeafType; +import forestry.core.render.TextureManager; + public class TextureLeaves { + private static final Map leafTextures = new EnumMap<>(EnumLeafType.class); static { diff --git a/src/main/java/forestry/arboriculture/tiles/TileArboristChest.java b/src/main/java/forestry/arboriculture/tiles/TileArboristChest.java index 372edea85..ccdb1380d 100644 --- a/src/main/java/forestry/arboriculture/tiles/TileArboristChest.java +++ b/src/main/java/forestry/arboriculture/tiles/TileArboristChest.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.tiles; @@ -14,6 +12,7 @@ import forestry.api.arboriculture.TreeManager; import forestry.core.tiles.TileNaturalistChest; public class TileArboristChest extends TileNaturalistChest { + public TileArboristChest() { super(TreeManager.treeRoot); } diff --git a/src/main/java/forestry/arboriculture/tiles/TileFruitPod.java b/src/main/java/forestry/arboriculture/tiles/TileFruitPod.java index f67a1452b..0fe2288c3 100644 --- a/src/main/java/forestry/arboriculture/tiles/TileFruitPod.java +++ b/src/main/java/forestry/arboriculture/tiles/TileFruitPod.java @@ -1,15 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.tiles; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.arboriculture.IAlleleFruit; @@ -25,15 +34,6 @@ import forestry.core.network.IStreamable; import forestry.core.network.packets.PacketTileStream; import forestry.core.proxy.Proxies; import forestry.core.render.TextureManager; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.Packet; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; public class TileFruitPod extends TileEntity implements IFruitBearer, IStreamable, IRipeningPacketReceiver { diff --git a/src/main/java/forestry/arboriculture/tiles/TileLeaves.java b/src/main/java/forestry/arboriculture/tiles/TileLeaves.java index 1e62d67f4..d9382e032 100644 --- a/src/main/java/forestry/arboriculture/tiles/TileLeaves.java +++ b/src/main/java/forestry/arboriculture/tiles/TileLeaves.java @@ -1,16 +1,31 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.tiles; +import java.io.IOException; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.EnumSet; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.EnumPlantType; + import com.mojang.authlib.GameProfile; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.arboriculture.EnumTreeChromosome; @@ -48,20 +63,6 @@ import forestry.core.render.TextureManager; import forestry.core.utils.ColourUtil; import forestry.core.utils.GeneticsUtil; import forestry.core.utils.Log; -import java.io.IOException; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.EnumSet; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTUtil; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.EnumPlantType; public class TileLeaves extends TileTreeContainer implements IPollinatable, IFruitBearer, IButterflyNursery, IRipeningPacketReceiver { @@ -231,8 +232,8 @@ public class TileLeaves extends TileTreeContainer && (fruitProvider == AlleleFruit.fruitApple.getProvider())) { textureIndexFruits = -1; } else { - textureIndexFruits = fruitProvider.getIconIndex( - genome, worldObj, xCoord, yCoord, zCoord, getRipeningTime(), true); + textureIndexFruits = fruitProvider + .getIconIndex(genome, worldObj, xCoord, yCoord, zCoord, getRipeningTime(), true); } ripeningPeriod = (short) tree.getGenome().getFruitProvider().getRipeningPeriod(); @@ -405,10 +406,7 @@ public class TileLeaves extends TileTreeContainer data.writeByte(leafState); if (hasFruit) { - String fruitAlleleUID = getTree() - .getGenome() - .getActiveAllele(EnumTreeChromosome.FRUITS) - .getUID(); + String fruitAlleleUID = getTree().getGenome().getActiveAllele(EnumTreeChromosome.FRUITS).getUID(); int colourFruits = getFruitColour(); data.writeUTF(fruitAlleleUID); @@ -527,8 +525,8 @@ public class TileLeaves extends TileTreeContainer damage += caterpillar.getGenome().getMetabolism(); IButterflyGenome caterpillarGenome = caterpillar.getGenome(); - int caterpillarMatureTime = - Math.round((float) caterpillarGenome.getLifespan() / (caterpillarGenome.getFertility() * 2)); + int caterpillarMatureTime = Math + .round((float) caterpillarGenome.getLifespan() / (caterpillarGenome.getFertility() * 2)); if (maturationTime >= caterpillarMatureTime && caterpillar.canTakeFlight(worldObj, xCoord, yCoord, zCoord)) { if (worldObj.isAirBlock(xCoord - 1, yCoord, zCoord)) { diff --git a/src/main/java/forestry/arboriculture/tiles/TileSapling.java b/src/main/java/forestry/arboriculture/tiles/TileSapling.java index 010f71c4e..2f6a1a189 100644 --- a/src/main/java/forestry/arboriculture/tiles/TileSapling.java +++ b/src/main/java/forestry/arboriculture/tiles/TileSapling.java @@ -1,24 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.tiles; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraft.world.gen.feature.WorldGenerator; + import forestry.api.arboriculture.ITree; import forestry.api.arboriculture.ITreekeepingMode; import forestry.api.arboriculture.TreeManager; import forestry.api.genetics.IBreedingTracker; import forestry.arboriculture.worldgen.WorldGenArboriculture; import forestry.core.worldgen.WorldGenBase; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraft.world.gen.feature.WorldGenerator; public class TileSapling extends TileTreeContainer { diff --git a/src/main/java/forestry/arboriculture/tiles/TileTreeContainer.java b/src/main/java/forestry/arboriculture/tiles/TileTreeContainer.java index d552fc1bf..1778ce24b 100644 --- a/src/main/java/forestry/arboriculture/tiles/TileTreeContainer.java +++ b/src/main/java/forestry/arboriculture/tiles/TileTreeContainer.java @@ -1,16 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.tiles; +import java.io.IOException; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.network.Packet; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + import com.mojang.authlib.GameProfile; + import forestry.api.arboriculture.ITree; import forestry.api.arboriculture.TreeManager; import forestry.api.genetics.IAllele; @@ -21,14 +30,6 @@ import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IStreamable; import forestry.core.network.packets.PacketTileStream; import forestry.core.utils.PlayerUtil; -import java.io.IOException; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTUtil; -import net.minecraft.network.Packet; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; /** * This is the base TE class for any block that needs to contain tree genome information. @@ -145,12 +146,13 @@ public abstract class TileTreeContainer extends TileEntity implements IStreamabl public abstract void onBlockTick(); /** - * Called from Chunk.setBlockIDWithMetadata, determines if this tile entity should be re-created when the ID, or Metadata changes. - * Use with caution as this will leave straggler TileEntities, or create conflicts with other TileEntities if not used properly. + * Called from Chunk.setBlockIDWithMetadata, determines if this tile entity should be re-created when the ID, or + * Metadata changes. Use with caution as this will leave straggler TileEntities, or create conflicts with other + * TileEntities if not used properly. */ @Override - public boolean shouldRefresh( - Block oldBlock, Block newBlock, int oldMeta, int newMeta, World world, int x, int y, int z) { + public boolean shouldRefresh(Block oldBlock, Block newBlock, int oldMeta, int newMeta, World world, int x, int y, + int z) { return !Block.isEqualTo(oldBlock, newBlock); } diff --git a/src/main/java/forestry/arboriculture/tiles/TileWood.java b/src/main/java/forestry/arboriculture/tiles/TileWood.java index f23dbfaeb..06e6cb857 100644 --- a/src/main/java/forestry/arboriculture/tiles/TileWood.java +++ b/src/main/java/forestry/arboriculture/tiles/TileWood.java @@ -1,15 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.tiles; +import java.io.IOException; +import java.util.ArrayList; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.IBlockAccess; +import net.minecraft.world.World; + import forestry.api.arboriculture.EnumWoodType; import forestry.arboriculture.IWoodTyped; import forestry.arboriculture.blocks.BlockSlab; @@ -20,17 +29,9 @@ import forestry.core.network.IStreamable; import forestry.core.network.packets.PacketTileStream; import forestry.core.tiles.TileUtil; import forestry.plugins.PluginArboriculture; -import java.io.IOException; -import java.util.ArrayList; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.Packet; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.IBlockAccess; -import net.minecraft.world.World; public class TileWood extends TileEntity implements IStreamable { + private EnumWoodType woodType; public TileWood() { @@ -111,8 +112,8 @@ public class TileWood extends TileEntity implements IStreamable { return TileUtil.getTile(world, x, y, z, TileWood.class); } - public static ArrayList getDrops( - T block, World world, int x, int y, int z) { + public static ArrayList getDrops(T block, World world, int x, int y, + int z) { ArrayList drops = new ArrayList<>(); ItemStack stack = getPickBlock(block, world, x, y, z); diff --git a/src/main/java/forestry/arboriculture/worldgen/BlockTypeLog.java b/src/main/java/forestry/arboriculture/worldgen/BlockTypeLog.java index 3c08b1a91..edafe5da7 100644 --- a/src/main/java/forestry/arboriculture/worldgen/BlockTypeLog.java +++ b/src/main/java/forestry/arboriculture/worldgen/BlockTypeLog.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; @@ -14,6 +12,7 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; public class BlockTypeLog extends BlockTypeWood { + public BlockTypeLog(ItemStack itemStack) { super(itemStack); } diff --git a/src/main/java/forestry/arboriculture/worldgen/BlockTypeVanillaStairs.java b/src/main/java/forestry/arboriculture/worldgen/BlockTypeVanillaStairs.java index 7c26f278e..1b478dc87 100644 --- a/src/main/java/forestry/arboriculture/worldgen/BlockTypeVanillaStairs.java +++ b/src/main/java/forestry/arboriculture/worldgen/BlockTypeVanillaStairs.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.core.worldgen.BlockType; import net.minecraft.init.Blocks; import net.minecraftforge.common.util.ForgeDirection; +import forestry.core.worldgen.BlockType; + public class BlockTypeVanillaStairs extends BlockType { + public BlockTypeVanillaStairs(int meta) { super(Blocks.oak_stairs, meta); } diff --git a/src/main/java/forestry/arboriculture/worldgen/BlockTypeWood.java b/src/main/java/forestry/arboriculture/worldgen/BlockTypeWood.java index 9a8c13932..d06ab9c8b 100644 --- a/src/main/java/forestry/arboriculture/worldgen/BlockTypeWood.java +++ b/src/main/java/forestry/arboriculture/worldgen/BlockTypeWood.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import forestry.api.world.ITreeGenData; import forestry.arboriculture.items.ItemBlockWood; import forestry.core.worldgen.IBlockType; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class BlockTypeWood implements IBlockType, ITreeBlockType { diff --git a/src/main/java/forestry/arboriculture/worldgen/BlockTypeWoodStairs.java b/src/main/java/forestry/arboriculture/worldgen/BlockTypeWoodStairs.java index 25f3d468f..50eed9d5e 100644 --- a/src/main/java/forestry/arboriculture/worldgen/BlockTypeWoodStairs.java +++ b/src/main/java/forestry/arboriculture/worldgen/BlockTypeWoodStairs.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; @@ -14,6 +12,7 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; public class BlockTypeWoodStairs extends BlockTypeWood { + public BlockTypeWoodStairs(ItemStack itemStack) { super(itemStack); } diff --git a/src/main/java/forestry/arboriculture/worldgen/ITreeBlockType.java b/src/main/java/forestry/arboriculture/worldgen/ITreeBlockType.java index f02c6d749..50740e6e5 100644 --- a/src/main/java/forestry/arboriculture/worldgen/ITreeBlockType.java +++ b/src/main/java/forestry/arboriculture/worldgen/ITreeBlockType.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import forestry.api.world.ITreeGenData; + public interface ITreeBlockType { + void setDirection(ForgeDirection facing); void setBlock(World world, ITreeGenData tree, int x, int y, int z); diff --git a/src/main/java/forestry/arboriculture/worldgen/TreeBlockType.java b/src/main/java/forestry/arboriculture/worldgen/TreeBlockType.java index 7968d6464..7bf79e11d 100644 --- a/src/main/java/forestry/arboriculture/worldgen/TreeBlockType.java +++ b/src/main/java/forestry/arboriculture/worldgen/TreeBlockType.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; -import forestry.core.config.Constants; import net.minecraft.block.Block; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import forestry.api.world.ITreeGenData; +import forestry.core.config.Constants; + public class TreeBlockType implements ITreeBlockType { private final Block block; diff --git a/src/main/java/forestry/arboriculture/worldgen/TreeBlockTypeLeaf.java b/src/main/java/forestry/arboriculture/worldgen/TreeBlockTypeLeaf.java index 852f37b8b..f3bd5b02f 100644 --- a/src/main/java/forestry/arboriculture/worldgen/TreeBlockTypeLeaf.java +++ b/src/main/java/forestry/arboriculture/worldgen/TreeBlockTypeLeaf.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import com.mojang.authlib.GameProfile; -import forestry.api.world.ITreeGenData; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import com.mojang.authlib.GameProfile; +import forestry.api.world.ITreeGenData; + public class TreeBlockTypeLeaf implements ITreeBlockType { private final GameProfile owner; diff --git a/src/main/java/forestry/arboriculture/worldgen/TreeBlockTypeLog.java b/src/main/java/forestry/arboriculture/worldgen/TreeBlockTypeLog.java index 7223c6c83..884a05525 100644 --- a/src/main/java/forestry/arboriculture/worldgen/TreeBlockTypeLog.java +++ b/src/main/java/forestry/arboriculture/worldgen/TreeBlockTypeLog.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import forestry.api.world.ITreeGenData; + public class TreeBlockTypeLog implements ITreeBlockType { + private ForgeDirection facing = ForgeDirection.UP; public TreeBlockTypeLog() {} diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenAcacia.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenAcacia.java index a4b95f0ff..28d61180d 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenAcacia.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenAcacia.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import java.util.ArrayList; import java.util.List; + import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenAcacia extends WorldGenTree { public WorldGenAcacia(ITreeGenData tree) { @@ -27,12 +27,22 @@ public class WorldGenAcacia extends WorldGenTree { Direction leanDirection = Direction.getRandom(world.rand); float leanAmount = height / 4.0f; - List treeTops = - generateTreeTrunk(world, height, girth, 0, leanDirection.forgeDirection, leanAmount); + List treeTops = generateTreeTrunk( + world, + height, + girth, + 0, + leanDirection.forgeDirection, + leanAmount); if (height > 5 && world.rand.nextBoolean()) { Direction branchDirection = Direction.getRandomOther(world.rand, leanDirection); List treeTops2 = generateTreeTrunk( - world, Math.round(height * 0.66f), girth, 0, branchDirection.forgeDirection, leanAmount); + world, + Math.round(height * 0.66f), + girth, + 0, + branchDirection.forgeDirection, + leanAmount); treeTops.addAll(treeTops2); } @@ -46,7 +56,14 @@ public class WorldGenAcacia extends WorldGenTree { int canopyThickness = Math.max(1, Math.round(yOffset / 10.0f)); generateAdjustedCylinder( - world, yOffset--, xOffset, zOffset, canopyMultiplier, 1, leaf, EnumReplaceMode.NONE); + world, + yOffset--, + xOffset, + zOffset, + canopyMultiplier, + 1, + leaf, + EnumReplaceMode.NONE); float canopyWidth = world.rand.nextBoolean() ? 3.0f : 2.5f; List branches = generateBranches( diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenAcaciaVanilla.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenAcaciaVanilla.java index e78729ab0..c64063512 100644 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenAcaciaVanilla.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenAcaciaVanilla.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenArboriculture.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenArboriculture.java index 39e4643a8..e08b1cb40 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenArboriculture.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenArboriculture.java @@ -1,16 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.List; +import java.util.Random; + +import net.minecraft.init.Blocks; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import com.mojang.authlib.GameProfile; + import forestry.api.world.ITreeGenData; import forestry.arboriculture.tiles.TileTreeContainer; import forestry.core.tiles.TileUtil; @@ -18,18 +27,11 @@ import forestry.core.utils.BlockUtil; import forestry.core.worldgen.BlockType; import forestry.core.worldgen.BlockTypeVoid; import forestry.core.worldgen.WorldGenBase; -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.List; -import java.util.Random; -import net.minecraft.init.Blocks; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public abstract class WorldGenArboriculture extends WorldGenBase { enum Direction { + NORTH(ForgeDirection.NORTH), SOUTH(ForgeDirection.SOUTH), WEST(ForgeDirection.WEST), @@ -120,20 +122,14 @@ public abstract class WorldGenArboriculture extends WorldGenBase { return generateTreeTrunk(world, height, girth, vinesChance, ForgeDirection.UNKNOWN, 0); } - protected List generateTreeTrunk( - World world, int height, int girth, float vinesChance, ForgeDirection leanDirection, float leanAmount) { + protected List generateTreeTrunk(World world, int height, int girth, float vinesChance, + ForgeDirection leanDirection, float leanAmount) { return generateTreeTrunk(world, height, girth, 0, vinesChance, leanDirection, leanAmount); } /** Returns a list of trunk top coordinates */ - protected List generateTreeTrunk( - World world, - int height, - int girth, - int yStart, - float vinesChance, - ForgeDirection leanDirection, - float leanAmount) { + protected List generateTreeTrunk(World world, int height, int girth, int yStart, + float vinesChance, ForgeDirection leanDirection, float leanAmount) { List treeTops = new ArrayList<>(); final int leanStartY = (int) Math.floor(height * 0.33f); @@ -241,27 +237,13 @@ public abstract class WorldGenArboriculture extends WorldGenBase { } } - protected List generateBranches( - World world, - final int startY, - int xOffset, - int zOffset, - float spreadY, - float spreadXZ, - int radius, - int count) { + protected List generateBranches(World world, final int startY, int xOffset, int zOffset, + float spreadY, float spreadXZ, int radius, int count) { return generateBranches(world, startY, xOffset, zOffset, spreadY, spreadXZ, radius, count, 1.0f); } - protected List generateBranches( - World world, - final int startY, - final int xOffset, - final int zOffset, - final float spreadY, - final float spreadXZ, - int radius, - final int count, + protected List generateBranches(World world, final int startY, final int xOffset, + final int zOffset, final float spreadY, final float spreadXZ, int radius, final int count, final float chance) { List branchEnds = new ArrayList<>(); if (radius < 1) { diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenBalsa.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenBalsa.java index 24a6a09ae..27ba9ce64 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenBalsa.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenBalsa.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenBalsa extends WorldGenTree { public WorldGenBalsa(ITreeGenData tree) { diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenBaobab.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenBaobab.java index c2b4d2aff..80c022655 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenBaobab.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenBaobab.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import java.util.List; + import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenBaobab extends WorldGenTree { public WorldGenBaobab(ITreeGenData tree) { @@ -28,7 +28,14 @@ public class WorldGenBaobab extends WorldGenTree { List branchCoords = generateBranches(world, height, 0, 0, 0, 0.5f, 4, 6); for (ChunkCoordinates branchEnd : branchCoords) { generateAdjustedCylinder( - world, branchEnd.posY, branchEnd.posX, branchEnd.posZ, 0.0f, 2, leaf, EnumReplaceMode.NONE); + world, + branchEnd.posY, + branchEnd.posX, + branchEnd.posZ, + 0.0f, + 2, + leaf, + EnumReplaceMode.NONE); } if (world.rand.nextFloat() < 0.3f) { diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenBirch.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenBirch.java index 2f2b9c7ae..2511fee21 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenBirch.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenBirch.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenCherry.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenCherry.java index f7b07e8cd..3467ff031 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenCherry.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenCherry.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import java.util.List; + import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenCherry extends WorldGenTree { public WorldGenCherry(ITreeGenData tree) { diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenChestnut.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenChestnut.java index be020b4d6..55a03edc4 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenChestnut.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenChestnut.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import java.util.List; + import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenChestnut extends WorldGenTree { public WorldGenChestnut(ITreeGenData tree) { @@ -42,7 +42,14 @@ public class WorldGenChestnut extends WorldGenTree { List branchCoords = generateBranches(world, leafSpawn, 0, 0, 0.5f, 0.5f, branchRadius, 2); for (ChunkCoordinates branchEnd : branchCoords) { generateAdjustedCylinder( - world, branchEnd.posY, branchEnd.posX, branchEnd.posZ, 1.0f, 2, leaf, EnumReplaceMode.NONE); + world, + branchEnd.posY, + branchEnd.posX, + branchEnd.posZ, + 1.0f, + 2, + leaf, + EnumReplaceMode.NONE); } generateAdjustedCylinder(world, leafSpawn, 1.5f, 1, leaf); diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenCocobolo.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenCocobolo.java index 93c99dce8..86deaade9 100644 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenCocobolo.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenCocobolo.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import java.util.List; + import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenCocobolo extends WorldGenTree { public WorldGenCocobolo(ITreeGenData tree) { diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenDarkOak.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenDarkOak.java index 473270e53..6e1e1e208 100644 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenDarkOak.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenDarkOak.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenDate.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenDate.java index 895196991..ef84bf111 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenDate.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenDate.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenDate extends WorldGenTree { public WorldGenDate(ITreeGenData tree) { diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenEbony.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenEbony.java index fbac4dd25..1b0767ca6 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenEbony.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenEbony.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenEbony extends WorldGenTree { public WorldGenEbony(ITreeGenData tree) { diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenGiganteum.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenGiganteum.java index 23f7e40ae..7ab6a7c5b 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenGiganteum.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenGiganteum.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenGreenheart.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenGreenheart.java index 492308bdd..363dffa24 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenGreenheart.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenGreenheart.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenGreenheart extends WorldGenTree { public WorldGenGreenheart(ITreeGenData tree) { diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenIpe.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenIpe.java index 11787861f..7e86769a7 100644 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenIpe.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenIpe.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import java.util.ArrayList; import java.util.List; + import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenIpe extends WorldGenTree { public WorldGenIpe(ITreeGenData tree) { @@ -42,7 +42,14 @@ public class WorldGenIpe extends WorldGenTree { for (ChunkCoordinates branchEnd : branchCoords) { generateAdjustedCylinder( - world, branchEnd.posY, branchEnd.posX, branchEnd.posZ, 2.0f, 2, leaf, EnumReplaceMode.NONE); + world, + branchEnd.posY, + branchEnd.posX, + branchEnd.posZ, + 2.0f, + 2, + leaf, + EnumReplaceMode.NONE); } } } diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenJungle.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenJungle.java index 3ebed700a..3e49ca358 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenJungle.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenJungle.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import java.util.ArrayList; import java.util.List; + import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + /** * This is a dummy and needs to be replaced with something proper. */ @@ -45,7 +45,14 @@ public class WorldGenJungle extends WorldGenTreeVanilla { for (ChunkCoordinates branchEnd : branchCoords) { generateAdjustedCylinder( - world, branchEnd.posY, branchEnd.posX, branchEnd.posZ, 0f, 1, leaf, EnumReplaceMode.NONE); + world, + branchEnd.posY, + branchEnd.posX, + branchEnd.posZ, + 0f, + 1, + leaf, + EnumReplaceMode.NONE); } } diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenKapok.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenKapok.java index 0d920f302..79c0d9c35 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenKapok.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenKapok.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import java.util.ArrayList; import java.util.List; + import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenKapok extends WorldGenTree { public WorldGenKapok(ITreeGenData tree) { @@ -44,7 +44,14 @@ public class WorldGenKapok extends WorldGenTree { for (ChunkCoordinates branchEnd : branchCoords) { generateAdjustedCylinder( - world, branchEnd.posY + 1, branchEnd.posX, branchEnd.posZ, 2.0f, 2, leaf, EnumReplaceMode.NONE); + world, + branchEnd.posY + 1, + branchEnd.posX, + branchEnd.posZ, + 2.0f, + 2, + leaf, + EnumReplaceMode.NONE); } // Add some smaller twigs below for flavour diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenLarch.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenLarch.java index 6b6e974ae..5991abb50 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenLarch.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenLarch.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenLarch extends WorldGenTree { public WorldGenLarch(ITreeGenData tree) { diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenLemon.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenLemon.java index a8b947c8f..ce89fc7a4 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenLemon.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenLemon.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenLemon extends WorldGenTree { public WorldGenLemon(ITreeGenData tree) { diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenMahoe.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenMahoe.java index 4f5a7b878..94c2f511e 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenMahoe.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenMahoe.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import java.util.ArrayList; import java.util.List; + import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenMahoe extends WorldGenTree { public WorldGenMahoe(ITreeGenData tree) { @@ -28,12 +28,28 @@ public class WorldGenMahoe extends WorldGenTree { List branchCoords = new ArrayList<>(); for (int yBranch = 2; yBranch < height - 1; yBranch++) { - branchCoords.addAll(generateBranches( - world, yBranch, 0, 0, 0.15f, 0.25f, Math.round((height - yBranch) * 0.75f), 1, 0.25f)); + branchCoords.addAll( + generateBranches( + world, + yBranch, + 0, + 0, + 0.15f, + 0.25f, + Math.round((height - yBranch) * 0.75f), + 1, + 0.25f)); } for (ChunkCoordinates branchEnd : branchCoords) { generateAdjustedCylinder( - world, branchEnd.posY, branchEnd.posX, branchEnd.posZ, 2, 2, leaf, EnumReplaceMode.NONE); + world, + branchEnd.posY, + branchEnd.posX, + branchEnd.posZ, + 2, + 2, + leaf, + EnumReplaceMode.NONE); } int yCenter = height - girth; diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenMahogany.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenMahogany.java index f5f838dd1..372cc522c 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenMahogany.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenMahogany.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import java.util.ArrayList; import java.util.List; + import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenMahogany extends WorldGenTree { public WorldGenMahogany(ITreeGenData tree) { @@ -29,12 +29,28 @@ public class WorldGenMahogany extends WorldGenTree { List branchCoords = new ArrayList<>(); for (int yBranch = height - 4; yBranch < height - 2; yBranch++) { - branchCoords.addAll(generateBranches( - world, yBranch, 0, 0, 0.15f, 0.25f, Math.round((height - yBranch) * 0.5f), 1, 0.25f)); + branchCoords.addAll( + generateBranches( + world, + yBranch, + 0, + 0, + 0.15f, + 0.25f, + Math.round((height - yBranch) * 0.5f), + 1, + 0.25f)); } for (ChunkCoordinates branchEnd : branchCoords) { generateAdjustedCylinder( - world, branchEnd.posY, branchEnd.posX, branchEnd.posZ, 2, 2, leaf, EnumReplaceMode.NONE); + world, + branchEnd.posY, + branchEnd.posX, + branchEnd.posZ, + 2, + 2, + leaf, + EnumReplaceMode.NONE); } int leafSpawn = height + 1; diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenMaple.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenMaple.java index f0860b17b..475a79df8 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenMaple.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenMaple.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import java.util.ArrayList; import java.util.List; + import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenMaple extends WorldGenTree { public WorldGenMaple(ITreeGenData tree) { @@ -28,12 +28,28 @@ public class WorldGenMaple extends WorldGenTree { List branchCoords = new ArrayList<>(); for (int yBranch = 2; yBranch < height - 2; yBranch++) { - branchCoords.addAll(generateBranches( - world, yBranch, 0, 0, 0.15f, 0.25f, Math.round((height - yBranch) * 0.25f), 1, 0.25f)); + branchCoords.addAll( + generateBranches( + world, + yBranch, + 0, + 0, + 0.15f, + 0.25f, + Math.round((height - yBranch) * 0.25f), + 1, + 0.25f)); } for (ChunkCoordinates branchEnd : branchCoords) { generateAdjustedCylinder( - world, branchEnd.posY, branchEnd.posX, branchEnd.posZ, 2, 2, leaf, EnumReplaceMode.NONE); + world, + branchEnd.posY, + branchEnd.posX, + branchEnd.posZ, + 2, + 2, + leaf, + EnumReplaceMode.NONE); } int leafSpawn = height + 1; diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenOak.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenOak.java index 89f5c9c41..ddc7dbfa7 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenOak.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenOak.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenPadauk.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenPadauk.java index 7faf56b5f..a9f2d1aea 100644 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenPadauk.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenPadauk.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import java.util.Random; + import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import forestry.api.world.ITreeGenData; + public class WorldGenPadauk extends WorldGenTree { public WorldGenPadauk(ITreeGenData tree) { @@ -43,18 +43,17 @@ public class WorldGenPadauk extends WorldGenTree { for (int i = 0; i < girth * 4; i++) { if (world.rand.nextBoolean()) { - int[] offset = {-1, 1}; + int[] offset = { -1, 1 }; int offsetValue = (offset[new Random().nextInt(offset.length)]); int maxBranchLength = 3; int branchLength = new Random().nextInt(maxBranchLength + 1); - ForgeDirection[] direction = {ForgeDirection.NORTH, ForgeDirection.EAST}; + ForgeDirection[] direction = { ForgeDirection.NORTH, ForgeDirection.EAST }; ForgeDirection directionValue = (direction[new Random().nextInt(direction.length)]); int branchSpawn = leafSpawn; for (int j = 1; j < branchLength + 1; j++) { - if (j == branchLength - && world.rand - .nextBoolean()) { // Just adding a bit of variation to the ends for character + if (j == branchLength && world.rand.nextBoolean()) { // Just adding a bit of variation to the + // ends for character branchSpawn += 1; } diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenPapaya.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenPapaya.java index 0fc949ceb..6df8b24c6 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenPapaya.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenPapaya.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import java.util.List; + import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenPapaya extends WorldGenTree { public WorldGenPapaya(ITreeGenData tree) { @@ -28,7 +28,14 @@ public class WorldGenPapaya extends WorldGenTree { List branchCoords = generateBranches(world, height, 0, 0, 0.15f, 0.25f, height / 4, 1, 0.25f); for (ChunkCoordinates branchEnd : branchCoords) { generateAdjustedCylinder( - world, branchEnd.posY, branchEnd.posX, branchEnd.posZ, 1, 1, leaf, EnumReplaceMode.NONE); + world, + branchEnd.posY, + branchEnd.posX, + branchEnd.posZ, + 1, + 1, + leaf, + EnumReplaceMode.NONE); } int yCenter = height - girth; diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenPine.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenPine.java index 3676e5bc7..6f8c3851d 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenPine.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenPine.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import java.util.ArrayList; import java.util.List; + import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenPine extends WorldGenTree { public WorldGenPine(ITreeGenData tree) { @@ -28,12 +28,28 @@ public class WorldGenPine extends WorldGenTree { List branchCoords = new ArrayList<>(); for (int yBranch = 2; yBranch < height - 2; yBranch++) { - branchCoords.addAll(generateBranches( - world, yBranch, 0, 0, 0.05f, 0.1f, Math.round((height - yBranch) * 0.25f), 1, 0.25f)); + branchCoords.addAll( + generateBranches( + world, + yBranch, + 0, + 0, + 0.05f, + 0.1f, + Math.round((height - yBranch) * 0.25f), + 1, + 0.25f)); } for (ChunkCoordinates branchEnd : branchCoords) { generateAdjustedCylinder( - world, branchEnd.posY, branchEnd.posX, branchEnd.posZ, 2, 1, leaf, EnumReplaceMode.NONE); + world, + branchEnd.posY, + branchEnd.posX, + branchEnd.posZ, + 2, + 1, + leaf, + EnumReplaceMode.NONE); } int leafSpawn = height + 1; diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenPlum.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenPlum.java index b69bc8404..7c58bd8e5 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenPlum.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenPlum.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenPlum extends WorldGenTree { public WorldGenPlum(ITreeGenData tree) { diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenPoplar.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenPoplar.java index 8d3aa68e6..ff1f12475 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenPoplar.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenPoplar.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenPoplar extends WorldGenTree { public WorldGenPoplar(ITreeGenData tree) { diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenSequoia.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenSequoia.java index a03dfb913..92a03bfd5 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenSequoia.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenSequoia.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import java.util.ArrayList; import java.util.List; + import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenSequoia extends WorldGenTree { public WorldGenSequoia(ITreeGenData tree) { @@ -43,7 +43,14 @@ public class WorldGenSequoia extends WorldGenTree { } for (ChunkCoordinates branchEnd : branchCoords) { generateAdjustedCylinder( - world, branchEnd.posY, branchEnd.posX, branchEnd.posZ, 1.0f, 1, leaf, EnumReplaceMode.NONE); + world, + branchEnd.posY, + branchEnd.posX, + branchEnd.posZ, + 1.0f, + 1, + leaf, + EnumReplaceMode.NONE); } int leafSpawn = height + 2; diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenSilverLime.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenSilverLime.java index 20fdcbec3..fa8eb1d53 100644 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenSilverLime.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenSilverLime.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import java.util.List; + import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenSilverLime extends WorldGenTree { public WorldGenSilverLime(ITreeGenData tree) { @@ -25,10 +25,25 @@ public class WorldGenSilverLime extends WorldGenTree { public void generate(World world) { generateTreeTrunk(world, height, girth); List branchCoords = generateBranches( - world, 3 + world.rand.nextInt(1), 0, 0, 0.25f, 0.10f, Math.round(height * 0.25f), 2, 0.5f); + world, + 3 + world.rand.nextInt(1), + 0, + 0, + 0.25f, + 0.10f, + Math.round(height * 0.25f), + 2, + 0.5f); for (ChunkCoordinates branchEnd : branchCoords) { generateAdjustedCylinder( - world, branchEnd.posY, branchEnd.posX, branchEnd.posZ, 0, 1, leaf, EnumReplaceMode.NONE); + world, + branchEnd.posY, + branchEnd.posX, + branchEnd.posZ, + 0, + 1, + leaf, + EnumReplaceMode.NONE); } int leafSpawn = height + 1; diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenSpruce.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenSpruce.java index ba7a555e1..257ec4616 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenSpruce.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenSpruce.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import java.util.List; + import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenSpruce extends WorldGenTree { public WorldGenSpruce(ITreeGenData tree) { diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenTeak.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenTeak.java index 535fe40ee..b126c2fb4 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenTeak.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenTeak.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import java.util.List; + import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenTeak extends WorldGenTree { public WorldGenTeak(ITreeGenData tree) { diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenTree.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenTree.java index 542fb8f7d..6f1433d8e 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenTree.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenTree.java @@ -1,22 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; +import net.minecraft.world.World; + import com.mojang.authlib.GameProfile; + import forestry.api.arboriculture.ITreeModifier; import forestry.api.arboriculture.TreeManager; import forestry.api.world.ITreeGenData; -import net.minecraft.world.World; public abstract class WorldGenTree extends WorldGenArboriculture { + private static final int minHeight = 4; private static final int maxHeight = 80; @@ -54,35 +55,19 @@ public abstract class WorldGenTree extends WorldGenArboriculture { generateAdjustedCylinder(world, yCenter, 0, 0, radius, height, block, EnumReplaceMode.SOFT); } - protected void generateAdjustedCylinder( - World world, int yCenter, float radius, int height, ITreeBlockType block, EnumReplaceMode replace) { + protected void generateAdjustedCylinder(World world, int yCenter, float radius, int height, ITreeBlockType block, + EnumReplaceMode replace) { generateAdjustedCylinder(world, yCenter, 0, 0, radius, height, block, replace); } - protected void generateAdjustedCylinder( - World world, - int yCenter, - int xOffset, - int zOffset, - float radius, - int height, - ITreeBlockType block, - EnumReplaceMode replace) { + protected void generateAdjustedCylinder(World world, int yCenter, int xOffset, int zOffset, float radius, + int height, ITreeBlockType block, EnumReplaceMode replace) { Vector center = getCenteredAt(yCenter, xOffset, zOffset); generateCylinder(world, center, radius + girth, height, block, replace); } - protected void generateAdjustedCircle( - World world, - int yCenter, - int xOffset, - int zOffset, - float radius, - int width, - int height, - ITreeBlockType block, - float chance, - EnumReplaceMode replace) { + protected void generateAdjustedCircle(World world, int yCenter, int xOffset, int zOffset, float radius, int width, + int height, ITreeBlockType block, float chance, EnumReplaceMode replace) { Vector center = getCenteredAt(yCenter, xOffset, zOffset); generateCircle(world, center, radius, width, height, block, chance, replace); } @@ -101,16 +86,16 @@ public abstract class WorldGenTree extends WorldGenArboriculture { protected int modifyByHeight(World world, int val, int min, int max) { ITreeModifier treeModifier = TreeManager.treeRoot.getTreekeepingMode(world); - int determined = - Math.round(val * tree.getHeightModifier() * treeModifier.getHeightModifier(tree.getGenome(), 1f)); + int determined = Math + .round(val * tree.getHeightModifier() * treeModifier.getHeightModifier(tree.getGenome(), 1f)); return determined < min ? min : determined > max ? max : determined; } private int determineHeight(World world, int required, int variation) { ITreeModifier treeModifier = TreeManager.treeRoot.getTreekeepingMode(world); int baseHeight = required + world.rand.nextInt(variation); - int height = Math.round( - baseHeight * tree.getHeightModifier() * treeModifier.getHeightModifier(tree.getGenome(), 1f)); + int height = Math + .round(baseHeight * tree.getHeightModifier() * treeModifier.getHeightModifier(tree.getGenome(), 1f)); return height < minHeight ? minHeight : height > maxHeight ? maxHeight : height; } diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenTreeVanilla.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenTreeVanilla.java index 05e0f9328..bfb5ec4ef 100644 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenTreeVanilla.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenTreeVanilla.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; import forestry.api.world.ITreeGenData; public abstract class WorldGenTreeVanilla extends WorldGenTree { + protected WorldGenTreeVanilla(ITreeGenData tree) { super(tree, 5, 2); } diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenWalnut.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenWalnut.java index 00f036fa4..73ba0c02a 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenWalnut.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenWalnut.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import java.util.List; + import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenWalnut extends WorldGenTree { public WorldGenWalnut(ITreeGenData tree) { @@ -36,8 +36,16 @@ public class WorldGenWalnut extends WorldGenTree { float branchSize = 2; while (leafSpawn >= 3) { int leafRadius = Math.min(4, (int) branchSize); - List branchCoords = - generateBranches(world, leafSpawn, 0, 0, 0.2f, 0.2f, (int) branchSize, 1, 0.5f); + List branchCoords = generateBranches( + world, + leafSpawn, + 0, + 0, + 0.2f, + 0.2f, + (int) branchSize, + 1, + 0.5f); for (ChunkCoordinates branchEnd : branchCoords) { generateAdjustedCircle( world, diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenWenge.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenWenge.java index a280076fe..6c4a2f743 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenWenge.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenWenge.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import java.util.List; + import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenWenge extends WorldGenTree { public WorldGenWenge(ITreeGenData tree) { @@ -37,8 +37,16 @@ public class WorldGenWenge extends WorldGenTree { while (leafSpawn > 1) { generateAdjustedCylinder(world, leafSpawn--, 3f, 1, leaf); - List branchCoords = - generateBranches(world, leafSpawn, 0, 0, 0.2f, 0.2f, (int) branchSize, 2, 0.75f); + List branchCoords = generateBranches( + world, + leafSpawn, + 0, + 0, + 0.2f, + 0.2f, + (int) branchSize, + 2, + 0.75f); for (ChunkCoordinates branchEnd : branchCoords) { generateAdjustedCircle( world, diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenWillow.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenWillow.java index 7231644cd..4dcd761a2 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenWillow.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenWillow.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenWillow extends WorldGenTree { public WorldGenWillow(ITreeGenData tree) { diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenZebrawood.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenZebrawood.java index 218f82e60..b45c43e6c 100644 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenZebrawood.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenZebrawood.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.arboriculture.worldgen; -import forestry.api.world.ITreeGenData; import java.util.List; + import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; +import forestry.api.world.ITreeGenData; + public class WorldGenZebrawood extends WorldGenTree { public WorldGenZebrawood(ITreeGenData tree) { @@ -30,7 +30,14 @@ public class WorldGenZebrawood extends WorldGenTree { List branchCoords = generateBranches(world, height - 4, 0, 0, 0, 0.25f, 3, 2, 0.75f); for (ChunkCoordinates branchEnd : branchCoords) { generateAdjustedCylinder( - world, branchEnd.posY, branchEnd.posX, branchEnd.posZ, 1.0f, 2, leaf, EnumReplaceMode.NONE); + world, + branchEnd.posY, + branchEnd.posX, + branchEnd.posZ, + 1.0f, + 2, + leaf, + EnumReplaceMode.NONE); } int leafSpawn = height + 1; diff --git a/src/main/java/forestry/core/ClimateManager.java b/src/main/java/forestry/core/ClimateManager.java index cb823f8da..04842ea1d 100644 --- a/src/main/java/forestry/core/ClimateManager.java +++ b/src/main/java/forestry/core/ClimateManager.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core; -import forestry.api.core.IClimateManager; -import forestry.api.core.IClimateProvider; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; +import forestry.api.core.IClimateManager; +import forestry.api.core.IClimateProvider; + public class ClimateManager implements IClimateManager { @Override diff --git a/src/main/java/forestry/core/CreativeTabForestry.java b/src/main/java/forestry/core/CreativeTabForestry.java index 6759b7033..531880ee0 100755 --- a/src/main/java/forestry/core/CreativeTabForestry.java +++ b/src/main/java/forestry/core/CreativeTabForestry.java @@ -1,22 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + import cpw.mods.fml.common.registry.GameRegistry; import forestry.api.core.Tabs; import forestry.plugins.PluginCore; import forestry.plugins.PluginManager; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; public class CreativeTabForestry extends CreativeTabs { diff --git a/src/main/java/forestry/core/DefaultClimateProvider.java b/src/main/java/forestry/core/DefaultClimateProvider.java index 3df98d65f..9c034f707 100644 --- a/src/main/java/forestry/core/DefaultClimateProvider.java +++ b/src/main/java/forestry/core/DefaultClimateProvider.java @@ -1,13 +1,15 @@ package forestry.core; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + import forestry.api.core.EnumHumidity; import forestry.api.core.EnumTemperature; import forestry.api.core.ForestryAPI; import forestry.api.core.IClimateProvider; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; public class DefaultClimateProvider implements IClimateProvider { + private World world; private int xCoord, yCoord, zCoord; diff --git a/src/main/java/forestry/core/EventHandlerCore.java b/src/main/java/forestry/core/EventHandlerCore.java index f1d50f027..fe037ba40 100755 --- a/src/main/java/forestry/core/EventHandlerCore.java +++ b/src/main/java/forestry/core/EventHandlerCore.java @@ -1,15 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core; +import java.util.Collection; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraftforge.client.event.TextureStitchEvent; +import net.minecraftforge.event.entity.player.EntityItemPickupEvent; +import net.minecraftforge.event.world.WorldEvent; + import cpw.mods.fml.common.eventhandler.Event.Result; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.PlayerEvent; @@ -21,11 +26,6 @@ import forestry.api.genetics.ISpeciesRoot; import forestry.core.errors.ErrorStateRegistry; import forestry.core.render.TextureManager; import forestry.plugins.PluginManager; -import java.util.Collection; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.client.event.TextureStitchEvent; -import net.minecraftforge.event.entity.player.EntityItemPickupEvent; -import net.minecraftforge.event.world.WorldEvent; public class EventHandlerCore { @@ -50,11 +50,10 @@ public class EventHandlerCore { public void handlePlayerLoggedIn(PlayerEvent.PlayerLoggedInEvent event) { EntityPlayer player = event.player; if (player != null) { - Collection speciesRoots = - AlleleManager.alleleRegistry.getSpeciesRoot().values(); + Collection speciesRoots = AlleleManager.alleleRegistry.getSpeciesRoot().values(); for (ISpeciesRoot speciesRoot : speciesRoots) { - IBreedingTracker breedingTracker = - speciesRoot.getBreedingTracker(player.getEntityWorld(), player.getGameProfile()); + IBreedingTracker breedingTracker = speciesRoot + .getBreedingTracker(player.getEntityWorld(), player.getGameProfile()); breedingTracker.synchToPlayer(player); } } diff --git a/src/main/java/forestry/core/IPickupHandler.java b/src/main/java/forestry/core/IPickupHandler.java index ad1ed57d7..edd562722 100644 --- a/src/main/java/forestry/core/IPickupHandler.java +++ b/src/main/java/forestry/core/IPickupHandler.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core; diff --git a/src/main/java/forestry/core/IResupplyHandler.java b/src/main/java/forestry/core/IResupplyHandler.java index 595fd191e..6732e2362 100644 --- a/src/main/java/forestry/core/IResupplyHandler.java +++ b/src/main/java/forestry/core/IResupplyHandler.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core; diff --git a/src/main/java/forestry/core/ISaveEventHandler.java b/src/main/java/forestry/core/ISaveEventHandler.java index a41c064b0..8504be0da 100644 --- a/src/main/java/forestry/core/ISaveEventHandler.java +++ b/src/main/java/forestry/core/ISaveEventHandler.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core; diff --git a/src/main/java/forestry/core/PickupHandlerCore.java b/src/main/java/forestry/core/PickupHandlerCore.java index 9ee7b4397..a80f63cae 100755 --- a/src/main/java/forestry/core/PickupHandlerCore.java +++ b/src/main/java/forestry/core/PickupHandlerCore.java @@ -1,22 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IBreedingTracker; import forestry.api.genetics.IIndividual; import forestry.api.genetics.ISpeciesRoot; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class PickupHandlerCore implements IPickupHandler { diff --git a/src/main/java/forestry/core/SaveEventHandlerCore.java b/src/main/java/forestry/core/SaveEventHandlerCore.java index 5d1d445af..3bc1c4464 100755 --- a/src/main/java/forestry/core/SaveEventHandlerCore.java +++ b/src/main/java/forestry/core/SaveEventHandlerCore.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core; diff --git a/src/main/java/forestry/core/TickHandlerCoreClient.java b/src/main/java/forestry/core/TickHandlerCoreClient.java index 9dfbbbb3b..cb53d41ff 100755 --- a/src/main/java/forestry/core/TickHandlerCoreClient.java +++ b/src/main/java/forestry/core/TickHandlerCoreClient.java @@ -1,22 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.RenderGlobal; +import net.minecraft.entity.player.EntityPlayer; + import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; import cpw.mods.fml.common.gameevent.TickEvent.Phase; import forestry.core.utils.GeneticsUtil; -import net.minecraft.client.Minecraft; -import net.minecraft.client.renderer.RenderGlobal; -import net.minecraft.entity.player.EntityPlayer; public class TickHandlerCoreClient { diff --git a/src/main/java/forestry/core/TickHandlerCoreServer.java b/src/main/java/forestry/core/TickHandlerCoreServer.java index 708dd0028..1cc1c020e 100755 --- a/src/main/java/forestry/core/TickHandlerCoreServer.java +++ b/src/main/java/forestry/core/TickHandlerCoreServer.java @@ -1,16 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core; +import java.util.List; +import java.util.Random; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraft.world.chunk.Chunk; +import net.minecraftforge.event.world.ChunkDataEvent; + import com.google.common.collect.LinkedListMultimap; + import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent.Phase; import cpw.mods.fml.common.gameevent.TickEvent.WorldTickEvent; @@ -18,13 +26,6 @@ import forestry.core.config.Config; import forestry.core.config.Constants; import forestry.core.worldgen.WorldGenerator; import forestry.plugins.PluginManager; -import java.util.List; -import java.util.Random; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraft.world.chunk.Chunk; -import net.minecraftforge.event.world.ChunkDataEvent; public class TickHandlerCoreServer { @@ -93,6 +94,7 @@ public class TickHandlerCoreServer { } private static class ChunkCoords { + public final int dimension; public final int xCoord; public final int zCoord; diff --git a/src/main/java/forestry/core/access/AccessHandler.java b/src/main/java/forestry/core/access/AccessHandler.java index 8fd9e9e30..61208ac0e 100644 --- a/src/main/java/forestry/core/access/AccessHandler.java +++ b/src/main/java/forestry/core/access/AccessHandler.java @@ -1,16 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.access; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; +import java.util.UUID; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.world.World; + import com.mojang.authlib.GameProfile; + import forestry.core.config.Config; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; @@ -19,17 +29,9 @@ import forestry.core.network.packets.PacketAccessSwitchEntity; import forestry.core.proxy.Proxies; import forestry.core.tiles.ILocatable; import forestry.core.utils.PlayerUtil; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import java.util.UUID; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTUtil; -import net.minecraft.world.World; public final class AccessHandler implements IAccessHandler { + private final IRestrictedAccess accessListener; private final List accessOwnerListeners = new ArrayList<>(); private final Object target; @@ -57,8 +59,7 @@ public final class AccessHandler implements IAccessHandler { @Override public final boolean allowsRemoval(EntityPlayer player) { - return !Config.enablePermissions - || getAccess() == EnumAccess.SHARED + return !Config.enablePermissions || getAccess() == EnumAccess.SHARED || !isOwned() || isOwner(player) || Proxies.common.isOp(player); diff --git a/src/main/java/forestry/core/access/EnumAccess.java b/src/main/java/forestry/core/access/EnumAccess.java index cb4943738..fe26eb720 100644 --- a/src/main/java/forestry/core/access/EnumAccess.java +++ b/src/main/java/forestry/core/access/EnumAccess.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.access; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + public enum EnumAccess { + SHARED("gui.rule.shared"), VIEWABLE("gui.rule.restricted"), PRIVATE("gui.rule.private"); diff --git a/src/main/java/forestry/core/access/FakeAccessHandler.java b/src/main/java/forestry/core/access/FakeAccessHandler.java index 9be2d4608..c59e2c5af 100644 --- a/src/main/java/forestry/core/access/FakeAccessHandler.java +++ b/src/main/java/forestry/core/access/FakeAccessHandler.java @@ -1,23 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.access; -import com.mojang.authlib.GameProfile; -import forestry.core.network.DataInputStreamForestry; -import forestry.core.network.DataOutputStreamForestry; import java.io.IOException; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; +import com.mojang.authlib.GameProfile; + +import forestry.core.network.DataInputStreamForestry; +import forestry.core.network.DataOutputStreamForestry; + public class FakeAccessHandler implements IAccessHandler { + private static FakeAccessHandler instance; public static FakeAccessHandler getInstance() { diff --git a/src/main/java/forestry/core/access/IAccessHandler.java b/src/main/java/forestry/core/access/IAccessHandler.java index 1e8e594a7..df4674b0f 100644 --- a/src/main/java/forestry/core/access/IAccessHandler.java +++ b/src/main/java/forestry/core/access/IAccessHandler.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.access; +import net.minecraft.entity.player.EntityPlayer; + import forestry.api.core.INBTTagable; import forestry.core.network.IStreamable; -import net.minecraft.entity.player.EntityPlayer; public interface IAccessHandler extends IOwnable, IStreamable, INBTTagable { diff --git a/src/main/java/forestry/core/access/IAccessOwnerListener.java b/src/main/java/forestry/core/access/IAccessOwnerListener.java index 8023ef84b..f5a995e17 100644 --- a/src/main/java/forestry/core/access/IAccessOwnerListener.java +++ b/src/main/java/forestry/core/access/IAccessOwnerListener.java @@ -1,17 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.access; import com.mojang.authlib.GameProfile; public interface IAccessOwnerListener { + void onOwnerSet(GameProfile gameProfile); } diff --git a/src/main/java/forestry/core/access/IOwnable.java b/src/main/java/forestry/core/access/IOwnable.java index a7877e213..7e398b29b 100644 --- a/src/main/java/forestry/core/access/IOwnable.java +++ b/src/main/java/forestry/core/access/IOwnable.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.access; -import com.mojang.authlib.GameProfile; import net.minecraft.entity.player.EntityPlayer; +import com.mojang.authlib.GameProfile; + public interface IOwnable { boolean isOwned(); diff --git a/src/main/java/forestry/core/access/IRestrictedAccess.java b/src/main/java/forestry/core/access/IRestrictedAccess.java index 944d69e09..03f4b285e 100644 --- a/src/main/java/forestry/core/access/IRestrictedAccess.java +++ b/src/main/java/forestry/core/access/IRestrictedAccess.java @@ -1,16 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.access; public interface IRestrictedAccess { + IAccessHandler getAccessHandler(); void onSwitchAccess(EnumAccess oldAccess, EnumAccess newAccess); diff --git a/src/main/java/forestry/core/blocks/BlockBase.java b/src/main/java/forestry/core/blocks/BlockBase.java index 94b4d54c3..819e8d595 100644 --- a/src/main/java/forestry/core/blocks/BlockBase.java +++ b/src/main/java/forestry/core/blocks/BlockBase.java @@ -1,29 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.blocks; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.core.access.IAccessHandler; -import forestry.core.circuits.ISocketable; -import forestry.core.fluids.FluidHelper; -import forestry.core.proxy.Proxies; -import forestry.core.tiles.MachineDefinition; -import forestry.core.tiles.TileBase; -import forestry.core.tiles.TileForestry; -import forestry.core.tiles.TileUtil; -import forestry.core.utils.InventoryUtil; -import forestry.core.utils.PlayerUtil; import java.util.ArrayList; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -44,7 +31,21 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.IFluidHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.core.access.IAccessHandler; +import forestry.core.circuits.ISocketable; +import forestry.core.fluids.FluidHelper; +import forestry.core.proxy.Proxies; +import forestry.core.tiles.MachineDefinition; +import forestry.core.tiles.TileBase; +import forestry.core.tiles.TileForestry; +import forestry.core.tiles.TileUtil; +import forestry.core.utils.InventoryUtil; +import forestry.core.utils.PlayerUtil; + public class BlockBase extends BlockForestry { + private final List definitions = new ArrayList<>(); private final boolean hasTESR; @@ -176,8 +177,8 @@ public class BlockBase extends BlockForestry { } @Override - public boolean onBlockActivated( - World world, int x, int y, int z, EntityPlayer player, int side, float par7, float par8, float par9) { + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float par7, + float par8, float par9) { if (player.isSneaking()) { return false; } @@ -190,8 +191,7 @@ public class BlockBase extends BlockForestry { IAccessHandler access = tile.getAccessHandler(); ItemStack current = player.getCurrentEquippedItem(); - if (current != null - && current.getItem() != Items.bucket + if (current != null && current.getItem() != Items.bucket && tile instanceof IFluidHandler && access.allowsAlteration(player)) { if (FluidHelper.handleRightClick( @@ -241,8 +241,8 @@ public class BlockBase extends BlockForestry { ((TileForestry) tile).onRemoval(); } if (tile instanceof ISocketable) { - InventoryUtil.dropSockets( - (ISocketable) tile, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord); + InventoryUtil + .dropSockets((ISocketable) tile, tile.getWorldObj(), tile.xCoord, tile.yCoord, tile.zCoord); } } super.breakBlock(world, x, y, z, block, meta); diff --git a/src/main/java/forestry/core/blocks/BlockCore.java b/src/main/java/forestry/core/blocks/BlockCore.java index 3a3eec5a1..86559f2e7 100644 --- a/src/main/java/forestry/core/blocks/BlockCore.java +++ b/src/main/java/forestry/core/blocks/BlockCore.java @@ -1,16 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.blocks; public class BlockCore extends BlockBase { + public BlockCore() { super(true); } diff --git a/src/main/java/forestry/core/blocks/BlockCoreType.java b/src/main/java/forestry/core/blocks/BlockCoreType.java index 2e1e60bb9..54f8e220e 100644 --- a/src/main/java/forestry/core/blocks/BlockCoreType.java +++ b/src/main/java/forestry/core/blocks/BlockCoreType.java @@ -1,15 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.blocks; +import javax.annotation.Nullable; + import forestry.core.config.Constants; import forestry.core.proxy.Proxies; import forestry.core.render.IBlockRenderer; @@ -17,10 +17,11 @@ import forestry.core.tiles.TileAnalyzer; import forestry.core.tiles.TileEscritoire; import forestry.core.tiles.TileForestry; import forestry.plugins.PluginApiculture; -import javax.annotation.Nullable; public enum BlockCoreType implements IMachinePropertiesTESR { + ANALYZER(TileAnalyzer.class, "Analyzer") { + @Nullable @Override public IBlockRenderer getRenderer() { @@ -28,6 +29,7 @@ public enum BlockCoreType implements IMachinePropertiesTESR { } }, ESCRITOIRE(TileEscritoire.class, "Escritoire") { + @Nullable @Override public IBlockRenderer getRenderer() { diff --git a/src/main/java/forestry/core/blocks/BlockForestry.java b/src/main/java/forestry/core/blocks/BlockForestry.java index cc1f21f6e..35e98a508 100644 --- a/src/main/java/forestry/core/blocks/BlockForestry.java +++ b/src/main/java/forestry/core/blocks/BlockForestry.java @@ -1,21 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.blocks; -import com.mojang.authlib.GameProfile; -import forestry.core.CreativeTabForestry; -import forestry.core.access.IOwnable; -import forestry.core.access.IRestrictedAccess; -import forestry.core.tiles.TileForestry; -import forestry.core.utils.Log; import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; @@ -24,8 +16,17 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; + import org.apache.logging.log4j.Level; +import com.mojang.authlib.GameProfile; + +import forestry.core.CreativeTabForestry; +import forestry.core.access.IOwnable; +import forestry.core.access.IRestrictedAccess; +import forestry.core.tiles.TileForestry; +import forestry.core.utils.Log; + public abstract class BlockForestry extends BlockContainer { protected BlockForestry(Material material) { diff --git a/src/main/java/forestry/core/blocks/BlockRegistry.java b/src/main/java/forestry/core/blocks/BlockRegistry.java index a91e99a36..cb4bb038c 100644 --- a/src/main/java/forestry/core/blocks/BlockRegistry.java +++ b/src/main/java/forestry/core/blocks/BlockRegistry.java @@ -1,26 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.blocks; -import cpw.mods.fml.common.registry.GameRegistry; -import forestry.core.utils.StringUtil; -import forestry.plugins.PluginManager; import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; +import cpw.mods.fml.common.registry.GameRegistry; +import forestry.core.utils.StringUtil; +import forestry.plugins.PluginManager; + public abstract class BlockRegistry { - protected static T registerBlock( - T block, Class itemClass, String name, Object... itemCtorArgs) { + + protected static T registerBlock(T block, Class itemClass, String name, + Object... itemCtorArgs) { if (PluginManager.getStage() != PluginManager.Stage.SETUP) { throw new RuntimeException("Tried to register Block outside of Setup"); } diff --git a/src/main/java/forestry/core/blocks/BlockRegistryCore.java b/src/main/java/forestry/core/blocks/BlockRegistryCore.java index 5873dd146..491452aab 100644 --- a/src/main/java/forestry/core/blocks/BlockRegistryCore.java +++ b/src/main/java/forestry/core/blocks/BlockRegistryCore.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.blocks; -import forestry.core.items.ItemBlockForestry; -import forestry.core.items.ItemBlockTyped; import net.minecraft.init.Blocks; import net.minecraftforge.oredict.OreDictionary; +import forestry.core.items.ItemBlockForestry; +import forestry.core.items.ItemBlockTyped; + public class BlockRegistryCore extends BlockRegistry { + public final BlockCore core; public final BlockSoil soil; public final BlockResourceOre resources; diff --git a/src/main/java/forestry/core/blocks/BlockResourceOre.java b/src/main/java/forestry/core/blocks/BlockResourceOre.java index 7553fc356..2ebdc3529 100644 --- a/src/main/java/forestry/core/blocks/BlockResourceOre.java +++ b/src/main/java/forestry/core/blocks/BlockResourceOre.java @@ -1,22 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.blocks; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.core.CreativeTabForestry; -import forestry.core.render.TextureManager; -import forestry.plugins.PluginCore; import java.util.ArrayList; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -27,8 +21,16 @@ import net.minecraft.util.IIcon; import net.minecraft.util.MathHelper; import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.core.CreativeTabForestry; +import forestry.core.render.TextureManager; +import forestry.plugins.PluginCore; + public class BlockResourceOre extends Block { + public enum ResourceType { + APATITE, COPPER, TIN; @@ -87,7 +89,7 @@ public class BlockResourceOre extends Block { } // / CREATIVE INVENTORY - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void getSubBlocks(Item item, CreativeTabs par2CreativeTabs, List itemList) { for (ResourceType resourceType : ResourceType.values()) { diff --git a/src/main/java/forestry/core/blocks/BlockResourceStorage.java b/src/main/java/forestry/core/blocks/BlockResourceStorage.java index 92f96169b..5e49854f0 100644 --- a/src/main/java/forestry/core/blocks/BlockResourceStorage.java +++ b/src/main/java/forestry/core/blocks/BlockResourceStorage.java @@ -1,10 +1,7 @@ package forestry.core.blocks; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.core.CreativeTabForestry; -import forestry.core.render.TextureManager; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -13,8 +10,15 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.core.CreativeTabForestry; +import forestry.core.render.TextureManager; + public class BlockResourceStorage extends Block { + public enum ResourceType { + APATITE, COPPER, TIN, @@ -33,7 +37,7 @@ public class BlockResourceStorage extends Block { setCreativeTab(CreativeTabForestry.tabForestry); } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void getSubBlocks(Item item, CreativeTabs creativeTabs, List itemList) { for (ResourceType resourceType : ResourceType.values()) { diff --git a/src/main/java/forestry/core/blocks/BlockSoil.java b/src/main/java/forestry/core/blocks/BlockSoil.java index 1d9dacb10..f86fd6991 100644 --- a/src/main/java/forestry/core/blocks/BlockSoil.java +++ b/src/main/java/forestry/core/blocks/BlockSoil.java @@ -1,24 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.blocks; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.core.CreativeTabForestry; -import forestry.core.config.Constants; -import forestry.core.render.TextureManager; -import forestry.plugins.PluginCore; import java.util.ArrayList; import java.util.List; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.IGrowable; import net.minecraft.block.material.Material; @@ -34,6 +27,13 @@ import net.minecraftforge.common.EnumPlantType; import net.minecraftforge.common.IPlantable; import net.minecraftforge.common.util.ForgeDirection; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.core.CreativeTabForestry; +import forestry.core.config.Constants; +import forestry.core.render.TextureManager; +import forestry.plugins.PluginCore; + /** * Humus, bog earth, peat */ @@ -195,8 +195,8 @@ public class BlockSoil extends Block implements IItemTyped { } @Override - public boolean canSustainPlant( - IBlockAccess world, int x, int y, int z, ForgeDirection direction, IPlantable plant) { + public boolean canSustainPlant(IBlockAccess world, int x, int y, int z, ForgeDirection direction, + IPlantable plant) { EnumPlantType plantType = plant.getPlantType(world, x, y, z); if (plantType != EnumPlantType.Crop && plantType != EnumPlantType.Plains) { return false; @@ -229,7 +229,7 @@ public class BlockSoil extends Block implements IItemTyped { } // / CREATIVE INVENTORY - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void getSubBlocks(Item item, CreativeTabs par2CreativeTabs, List itemList) { itemList.add(new ItemStack(this, 1, 0)); diff --git a/src/main/java/forestry/core/blocks/BlockStructure.java b/src/main/java/forestry/core/blocks/BlockStructure.java index 9fca08181..5caa8ed1a 100644 --- a/src/main/java/forestry/core/blocks/BlockStructure.java +++ b/src/main/java/forestry/core/blocks/BlockStructure.java @@ -1,22 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.blocks; -import com.mojang.authlib.GameProfile; -import forestry.api.multiblock.IMultiblockComponent; -import forestry.api.multiblock.IMultiblockController; -import forestry.core.circuits.ISocketable; -import forestry.core.multiblock.MultiblockTileEntityForestry; -import forestry.core.multiblock.MultiblockUtil; -import forestry.core.utils.InventoryUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.EntityLivingBase; @@ -28,6 +19,15 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import com.mojang.authlib.GameProfile; + +import forestry.api.multiblock.IMultiblockComponent; +import forestry.api.multiblock.IMultiblockController; +import forestry.core.circuits.ISocketable; +import forestry.core.multiblock.MultiblockTileEntityForestry; +import forestry.core.multiblock.MultiblockUtil; +import forestry.core.utils.InventoryUtil; + public abstract class BlockStructure extends BlockForestry { protected BlockStructure(Material material) { @@ -43,8 +43,8 @@ public abstract class BlockStructure extends BlockForestry { private long previousMessageTick = 0; @Override - public boolean onBlockActivated( - World world, int x, int y, int z, EntityPlayer player, int par6, float par7, float par8, float par9) { + public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int par6, float par7, + float par8, float par9) { if (player.isSneaking()) { return false; } diff --git a/src/main/java/forestry/core/blocks/IItemTyped.java b/src/main/java/forestry/core/blocks/IItemTyped.java index ddeb97f4d..1ae12cddd 100644 --- a/src/main/java/forestry/core/blocks/IItemTyped.java +++ b/src/main/java/forestry/core/blocks/IItemTyped.java @@ -1,5 +1,6 @@ package forestry.core.blocks; public interface IItemTyped { + Enum getTypeFromMeta(int meta); } diff --git a/src/main/java/forestry/core/blocks/IMachineProperties.java b/src/main/java/forestry/core/blocks/IMachineProperties.java index c9d63a001..dcce99495 100644 --- a/src/main/java/forestry/core/blocks/IMachineProperties.java +++ b/src/main/java/forestry/core/blocks/IMachineProperties.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.blocks; import forestry.core.tiles.TileForestry; public interface IMachineProperties { + int getMeta(); String getTeIdent(); diff --git a/src/main/java/forestry/core/blocks/IMachinePropertiesTESR.java b/src/main/java/forestry/core/blocks/IMachinePropertiesTESR.java index d900902f0..1721cbb96 100644 --- a/src/main/java/forestry/core/blocks/IMachinePropertiesTESR.java +++ b/src/main/java/forestry/core/blocks/IMachinePropertiesTESR.java @@ -1,17 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.blocks; import forestry.core.render.IBlockRenderer; public interface IMachinePropertiesTESR extends IMachineProperties { + IBlockRenderer getRenderer(); } diff --git a/src/main/java/forestry/core/circuits/Circuit.java b/src/main/java/forestry/core/circuits/Circuit.java index efd58773d..f17766598 100755 --- a/src/main/java/forestry/core/circuits/Circuit.java +++ b/src/main/java/forestry/core/circuits/Circuit.java @@ -1,19 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.circuits; +import java.util.List; + import forestry.api.circuits.ChipsetManager; import forestry.api.circuits.ICircuit; import forestry.core.utils.StringUtil; -import java.util.List; public abstract class Circuit implements ICircuit { diff --git a/src/main/java/forestry/core/circuits/CircuitBoard.java b/src/main/java/forestry/core/circuits/CircuitBoard.java index badbac572..103d7d27e 100755 --- a/src/main/java/forestry/core/circuits/CircuitBoard.java +++ b/src/main/java/forestry/core/circuits/CircuitBoard.java @@ -1,15 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.circuits; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; + import forestry.api.circuits.ChipsetManager; import forestry.api.circuits.ICircuit; import forestry.api.circuits.ICircuitBoard; @@ -17,10 +21,6 @@ import forestry.api.circuits.ICircuitLayout; import forestry.api.circuits.ICircuitSocketType; import forestry.core.proxy.Proxies; import forestry.core.utils.StringUtil; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; public class CircuitBoard implements ICircuitBoard { diff --git a/src/main/java/forestry/core/circuits/CircuitId.java b/src/main/java/forestry/core/circuits/CircuitId.java index 4cf188ba4..03fd39a1b 100755 --- a/src/main/java/forestry/core/circuits/CircuitId.java +++ b/src/main/java/forestry/core/circuits/CircuitId.java @@ -1,16 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.circuits; public class CircuitId { + public static final int ELECTRIC_CHOKE_I = 1; public static final int FIRE_DAMPENER_I = 2; public static final int ELECTRIC_EFFICIENCY_I = 3; diff --git a/src/main/java/forestry/core/circuits/CircuitLayout.java b/src/main/java/forestry/core/circuits/CircuitLayout.java index 1ec698290..8ac40f3e2 100755 --- a/src/main/java/forestry/core/circuits/CircuitLayout.java +++ b/src/main/java/forestry/core/circuits/CircuitLayout.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.circuits; diff --git a/src/main/java/forestry/core/circuits/CircuitLibrary.java b/src/main/java/forestry/core/circuits/CircuitLibrary.java index 5757a98a9..55eecbfa1 100755 --- a/src/main/java/forestry/core/circuits/CircuitLibrary.java +++ b/src/main/java/forestry/core/circuits/CircuitLibrary.java @@ -1,19 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.circuits; -import forestry.api.circuits.ICircuitLibrary; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.WorldSavedData; +import forestry.api.circuits.ICircuitLibrary; + public class CircuitLibrary extends WorldSavedData implements ICircuitLibrary { public CircuitLibrary(String par1Str) { diff --git a/src/main/java/forestry/core/circuits/CircuitRecipe.java b/src/main/java/forestry/core/circuits/CircuitRecipe.java index 38c4dd0ea..6f5f743c9 100644 --- a/src/main/java/forestry/core/circuits/CircuitRecipe.java +++ b/src/main/java/forestry/core/circuits/CircuitRecipe.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.circuits; +import net.minecraft.item.ItemStack; + import forestry.api.circuits.ICircuit; import forestry.api.circuits.ICircuitLayout; -import net.minecraft.item.ItemStack; public class CircuitRecipe { diff --git a/src/main/java/forestry/core/circuits/CircuitRegistry.java b/src/main/java/forestry/core/circuits/CircuitRegistry.java index f000cca9f..73042746d 100755 --- a/src/main/java/forestry/core/circuits/CircuitRegistry.java +++ b/src/main/java/forestry/core/circuits/CircuitRegistry.java @@ -1,15 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.circuits; +import java.util.LinkedHashMap; +import java.util.Map; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + import forestry.api.circuits.CircuitSocketType; import forestry.api.circuits.ICircuit; import forestry.api.circuits.ICircuitBoard; @@ -17,11 +22,6 @@ import forestry.api.circuits.ICircuitLayout; import forestry.api.circuits.ICircuitLibrary; import forestry.api.circuits.ICircuitRegistry; import forestry.plugins.PluginCore; -import java.util.LinkedHashMap; -import java.util.Map; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; public class CircuitRegistry implements ICircuitRegistry { @@ -36,8 +36,8 @@ public class CircuitRegistry implements ICircuitRegistry { @Override public ICircuitLibrary getCircuitLibrary(World world, String playername) { - CircuitLibrary library = - (CircuitLibrary) world.loadItemData(CircuitLibrary.class, "CircuitLibrary_" + playername); + CircuitLibrary library = (CircuitLibrary) world + .loadItemData(CircuitLibrary.class, "CircuitLibrary_" + playername); if (library == null) { library = new CircuitLibrary(playername); diff --git a/src/main/java/forestry/core/circuits/ContainerSolderingIron.java b/src/main/java/forestry/core/circuits/ContainerSolderingIron.java index 9cd404017..0efc8a997 100755 --- a/src/main/java/forestry/core/circuits/ContainerSolderingIron.java +++ b/src/main/java/forestry/core/circuits/ContainerSolderingIron.java @@ -1,15 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.circuits; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; + import forestry.api.circuits.ICircuitLayout; import forestry.core.gui.ContainerItemInventory; import forestry.core.gui.IGuiSelectable; @@ -21,8 +22,6 @@ import forestry.core.network.IForestryPacketServer; import forestry.core.network.packets.PacketGuiLayoutSelect; import forestry.core.network.packets.PacketGuiSelectRequest; import forestry.core.proxy.Proxies; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; public class ContainerSolderingIron extends ContainerItemInventory implements IGuiSelectable { @@ -71,8 +70,7 @@ public class ContainerSolderingIron extends ContainerItemInventory { @@ -52,7 +52,8 @@ public class GuiSolderingIron extends GuiForestry recipes = new ArrayList<>(); @Override diff --git a/src/main/java/forestry/core/commands/CommandHelpers.java b/src/main/java/forestry/core/commands/CommandHelpers.java index 162d8f1c4..a192b0876 100644 --- a/src/main/java/forestry/core/commands/CommandHelpers.java +++ b/src/main/java/forestry/core/commands/CommandHelpers.java @@ -1,19 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.commands; -import forestry.core.utils.StringUtil; import java.util.ArrayList; import java.util.Arrays; import java.util.List; + import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; import net.minecraft.command.WrongUsageException; @@ -25,6 +23,8 @@ import net.minecraft.util.ChatStyle; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; +import forestry.core.utils.StringUtil; + /** * @author CovertJaguar */ @@ -62,19 +62,19 @@ public class CommandHelpers { sender.addChatMessage(new ChatComponentTranslation(locTag, args)); } - public static void sendLocalizedChatMessage( - ICommandSender sender, ChatStyle chatStyle, String locTag, Object... args) { + public static void sendLocalizedChatMessage(ICommandSender sender, ChatStyle chatStyle, String locTag, + Object... args) { ChatComponentTranslation chat = new ChatComponentTranslation(locTag, args); chat.setChatStyle(chatStyle); sender.addChatMessage(chat); } /** - * Avoid using this function if at all possible. Commands are processed on the server, - * which has no localization information. + * Avoid using this function if at all possible. Commands are processed on the server, which has no localization + * information. * - * StringUtil.localize() is NOT a valid alternative for sendLocalizedChatMessage(). - * Messages will not be localized properly if you use StringUtil.localize(). + * StringUtil.localize() is NOT a valid alternative for sendLocalizedChatMessage(). Messages will not be localized + * properly if you use StringUtil.localize(). */ public static void sendChatMessage(ICommandSender sender, String message) { sender.addChatMessage(new ChatComponentText(message)); @@ -100,7 +100,10 @@ public class CommandHelpers { ChatStyle header = new ChatStyle(); header.setColor(EnumChatFormatting.BLUE); sendLocalizedChatMessage( - sender, header, "for.chat.command." + commandString + ".format", command.getFullCommandString()); + sender, + header, + "for.chat.command." + commandString + ".format", + command.getFullCommandString()); ChatStyle body = new ChatStyle(); body.setColor(EnumChatFormatting.GRAY); @@ -166,8 +169,8 @@ public class CommandHelpers { return CommandBase.getListOfStringsMatchingLastWord(strings, lastWords); } - public static List addStandardTabCompletionOptions( - IForestryCommand command, ICommandSender sender, String[] incomplete) { + public static List addStandardTabCompletionOptions(IForestryCommand command, ICommandSender sender, + String[] incomplete) { if (incomplete.length > 1) { String commandName = incomplete[0]; for (SubCommand child : command.getChildren()) { diff --git a/src/main/java/forestry/core/commands/CommandMode.java b/src/main/java/forestry/core/commands/CommandMode.java index 98f6e1d0c..98c70385e 100644 --- a/src/main/java/forestry/core/commands/CommandMode.java +++ b/src/main/java/forestry/core/commands/CommandMode.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.commands; diff --git a/src/main/java/forestry/core/commands/CommandModeInfo.java b/src/main/java/forestry/core/commands/CommandModeInfo.java index d3ef554d9..28ba0af90 100644 --- a/src/main/java/forestry/core/commands/CommandModeInfo.java +++ b/src/main/java/forestry/core/commands/CommandModeInfo.java @@ -1,23 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.commands; import java.util.List; + import net.minecraft.command.ICommandSender; import net.minecraft.util.ChatStyle; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; + import org.apache.commons.lang3.StringUtils; public class CommandModeInfo extends SubCommand { + private final String[] modeStringArr; private final String helpString; private final ICommandModeHelper modeHelper; @@ -63,8 +64,8 @@ public class CommandModeInfo extends SubCommand { String modeName = modeHelper.getModeName(world); String worldName = String.valueOf(world.getWorldInfo().getSaveVersion()); - CommandHelpers.sendLocalizedChatMessage( - sender, "for.chat.command.forestry.mode.info.current", modeName, worldName); + CommandHelpers + .sendLocalizedChatMessage(sender, "for.chat.command.forestry.mode.info.current", modeName, worldName); CommandHelpers.sendLocalizedChatMessage(sender, "for.chat.command.forestry.mode.info.available", helpString); } diff --git a/src/main/java/forestry/core/commands/CommandModeSet.java b/src/main/java/forestry/core/commands/CommandModeSet.java index 5beaff5df..aabf703be 100644 --- a/src/main/java/forestry/core/commands/CommandModeSet.java +++ b/src/main/java/forestry/core/commands/CommandModeSet.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.commands; import java.util.List; + import net.minecraft.command.ICommandSender; import net.minecraft.world.World; public final class CommandModeSet extends SubCommand { + private final String[] modeStringArr; private final ICommandModeHelper modeSetter; diff --git a/src/main/java/forestry/core/commands/CommandPlugins.java b/src/main/java/forestry/core/commands/CommandPlugins.java index 2e881583c..85d8ec5fb 100644 --- a/src/main/java/forestry/core/commands/CommandPlugins.java +++ b/src/main/java/forestry/core/commands/CommandPlugins.java @@ -1,23 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.commands; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; + import forestry.core.utils.StringUtil; import forestry.plugins.ForestryPlugin; import forestry.plugins.Plugin; import forestry.plugins.PluginManager; -import net.minecraft.command.CommandException; -import net.minecraft.command.ICommandSender; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; /** * @author CovertJaguar @@ -115,8 +114,8 @@ public class CommandPlugins extends SubCommand { CommandHelpers.sendChatMessage(sender, EnumChatFormatting.BLUE + "URL: " + info.url()); } if (!info.unlocalizedDescription().isEmpty()) { - CommandHelpers.sendChatMessage( - sender, StatCollector.translateToLocal(info.unlocalizedDescription())); + CommandHelpers + .sendChatMessage(sender, StatCollector.translateToLocal(info.unlocalizedDescription())); } } } diff --git a/src/main/java/forestry/core/commands/CommandSaveStats.java b/src/main/java/forestry/core/commands/CommandSaveStats.java index 377d2fdfd..f180fcc02 100644 --- a/src/main/java/forestry/core/commands/CommandSaveStats.java +++ b/src/main/java/forestry/core/commands/CommandSaveStats.java @@ -1,22 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.commands; -import forestry.api.genetics.AlleleManager; -import forestry.api.genetics.IAlleleSpecies; -import forestry.api.genetics.IBreedingTracker; -import forestry.core.config.Constants; -import forestry.core.config.Version; -import forestry.core.proxy.Proxies; -import forestry.core.utils.StringUtil; import java.io.BufferedWriter; import java.io.File; import java.io.FileOutputStream; @@ -28,11 +19,20 @@ import java.util.Collection; import java.util.Date; import java.util.List; import java.util.Locale; + import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import forestry.api.genetics.AlleleManager; +import forestry.api.genetics.IAlleleSpecies; +import forestry.api.genetics.IBreedingTracker; +import forestry.core.config.Constants; +import forestry.core.config.Version; +import forestry.core.proxy.Proxies; +import forestry.core.utils.StringUtil; + public final class CommandSaveStats extends SubCommand { private static final String discoveredSymbol; @@ -41,8 +41,8 @@ public final class CommandSaveStats extends SubCommand { static { discoveredSymbol = StatCollector.translateToLocal("for.chat.command.forestry.stats.save.key.discovered.symbol"); - blacklistedSymbol = - StatCollector.translateToLocal("for.chat.command.forestry.stats.save.key.blacklisted.symbol"); + blacklistedSymbol = StatCollector + .translateToLocal("for.chat.command.forestry.stats.save.key.blacklisted.symbol"); notCountedSymbol = StatCollector.translateToLocal("for.chat.command.forestry.stats.save.key.notCounted.symbol"); } @@ -80,11 +80,16 @@ public final class CommandSaveStats extends SubCommand { Collection statistics = new ArrayList<>(); String date = DateFormat.getInstance().format(new Date()); - statistics.add(StatCollector.translateToLocalFormatted( - saveHelper.getUnlocalizedSaveStatsString(), player.getDisplayName(), date)); + statistics.add( + StatCollector.translateToLocalFormatted( + saveHelper.getUnlocalizedSaveStatsString(), + player.getDisplayName(), + date)); statistics.add(""); - statistics.add(StatCollector.translateToLocalFormatted( - "for.chat.command.forestry.stats.save.mode", modeHelper.getModeName(world))); + statistics.add( + StatCollector.translateToLocalFormatted( + "for.chat.command.forestry.stats.save.mode", + modeHelper.getModeName(world))); statistics.add(""); IBreedingTracker tracker = saveHelper.getBreedingTracker(world, player.getGameProfile()); @@ -100,12 +105,15 @@ public final class CommandSaveStats extends SubCommand { statistics.add(speciesCountLine); statistics.add(StringUtil.line(speciesCountLine.length())); - statistics.add(discoveredSymbol + ": " - + StatCollector.translateToLocal("for.chat.command.forestry.stats.save.key.discovered")); - statistics.add(blacklistedSymbol + ": " - + StatCollector.translateToLocal("for.chat.command.forestry.stats.save.key.blacklisted")); - statistics.add(notCountedSymbol + ": " - + StatCollector.translateToLocal("for.chat.command.forestry.stats.save.key.notCounted")); + statistics.add( + discoveredSymbol + ": " + + StatCollector.translateToLocal("for.chat.command.forestry.stats.save.key.discovered")); + statistics.add( + blacklistedSymbol + ": " + + StatCollector.translateToLocal("for.chat.command.forestry.stats.save.key.blacklisted")); + statistics.add( + notCountedSymbol + ": " + + StatCollector.translateToLocal("for.chat.command.forestry.stats.save.key.notCounted")); statistics.add(""); String header = generateSpeciesListHeader(); @@ -121,8 +129,12 @@ public final class CommandSaveStats extends SubCommand { File file = new File( Proxies.common.getForestryRoot(), - "config/" + Constants.MOD.toLowerCase(Locale.ENGLISH) + "/stats/" + player.getDisplayName() + '-' - + saveHelper.getFileSuffix() + ".log"); + "config/" + Constants.MOD.toLowerCase(Locale.ENGLISH) + + "/stats/" + + player.getDisplayName() + + '-' + + saveHelper.getFileSuffix() + + ".log"); try { File folder = file.getParentFile(); if (folder != null && !folder.exists()) { @@ -161,7 +173,9 @@ public final class CommandSaveStats extends SubCommand { } CommandHelpers.sendLocalizedChatMessage( - sender, "for.chat.command.forestry.stats.save.saved", player.getDisplayName()); + sender, + "for.chat.command.forestry.stats.save.saved", + player.getDisplayName()); } private static String generateSpeciesListHeader() { @@ -187,18 +201,23 @@ public final class CommandSaveStats extends SubCommand { } return speciesListEntry( - discovered, blacklisted, notCounted, species.getUID(), species.getName(), species.getAuthority()); + discovered, + blacklisted, + notCounted, + species.getUID(), + species.getName(), + species.getAuthority()); } - private static String speciesListEntry( - String discovered, - String blacklisted, - String notCounted, - String UID, - String speciesName, - String authority) { + private static String speciesListEntry(String discovered, String blacklisted, String notCounted, String UID, + String speciesName, String authority) { return String.format( "[ %-2s ] [ %-2s ] [ %-2s ]\t%-40s %-20s %-20s", - discovered, blacklisted, notCounted, UID, speciesName, authority); + discovered, + blacklisted, + notCounted, + UID, + speciesName, + authority); } } diff --git a/src/main/java/forestry/core/commands/CommandVersion.java b/src/main/java/forestry/core/commands/CommandVersion.java index 6089ac2e3..58bc1c297 100644 --- a/src/main/java/forestry/core/commands/CommandVersion.java +++ b/src/main/java/forestry/core/commands/CommandVersion.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.commands; -import forestry.core.config.Version; -import forestry.core.proxy.Proxies; import net.minecraft.command.ICommandSender; import net.minecraft.util.ChatStyle; import net.minecraft.util.EnumChatFormatting; +import forestry.core.config.Version; +import forestry.core.proxy.Proxies; + /** * @author CovertJaguar */ diff --git a/src/main/java/forestry/core/commands/ICommandModeHelper.java b/src/main/java/forestry/core/commands/ICommandModeHelper.java index 0728ebc43..3eb1f8ce5 100644 --- a/src/main/java/forestry/core/commands/ICommandModeHelper.java +++ b/src/main/java/forestry/core/commands/ICommandModeHelper.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.commands; import net.minecraft.world.World; public interface ICommandModeHelper { + String[] getModeNames(); String getModeNameMatching(String desired); diff --git a/src/main/java/forestry/core/commands/IForestryCommand.java b/src/main/java/forestry/core/commands/IForestryCommand.java index f6f46625b..445a47bbc 100644 --- a/src/main/java/forestry/core/commands/IForestryCommand.java +++ b/src/main/java/forestry/core/commands/IForestryCommand.java @@ -1,17 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.commands; import java.util.List; import java.util.SortedSet; + import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; diff --git a/src/main/java/forestry/core/commands/IStatsSaveHelper.java b/src/main/java/forestry/core/commands/IStatsSaveHelper.java index e8699a616..bc0686604 100644 --- a/src/main/java/forestry/core/commands/IStatsSaveHelper.java +++ b/src/main/java/forestry/core/commands/IStatsSaveHelper.java @@ -1,20 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.commands; +import java.util.Collection; + +import net.minecraft.world.World; + import com.mojang.authlib.GameProfile; + import forestry.api.genetics.IAlleleSpecies; import forestry.api.genetics.IBreedingTracker; -import java.util.Collection; -import net.minecraft.world.World; public interface IStatsSaveHelper { diff --git a/src/main/java/forestry/core/commands/RootCommand.java b/src/main/java/forestry/core/commands/RootCommand.java index e6adc32aa..44d8c6308 100644 --- a/src/main/java/forestry/core/commands/RootCommand.java +++ b/src/main/java/forestry/core/commands/RootCommand.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.commands; @@ -15,6 +13,7 @@ import java.util.Comparator; import java.util.List; import java.util.SortedSet; import java.util.TreeSet; + import net.minecraft.command.CommandBase; import net.minecraft.command.ICommandSender; @@ -59,8 +58,8 @@ public class RootCommand extends CommandBase implements IForestryCommand { } /** - * Used only for CommandBase. - * It gets obfuscated, so the name needs to be different from the one in IForestryCommand. + * Used only for CommandBase. It gets obfuscated, so the name needs to be different from the one in + * IForestryCommand. */ @Override public int getRequiredPermissionLevel() { diff --git a/src/main/java/forestry/core/commands/SpeciesNotFoundException.java b/src/main/java/forestry/core/commands/SpeciesNotFoundException.java index c309b2b5c..0e4500b00 100644 --- a/src/main/java/forestry/core/commands/SpeciesNotFoundException.java +++ b/src/main/java/forestry/core/commands/SpeciesNotFoundException.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.commands; diff --git a/src/main/java/forestry/core/commands/SubCommand.java b/src/main/java/forestry/core/commands/SubCommand.java index a88452feb..491cc9dbf 100644 --- a/src/main/java/forestry/core/commands/SubCommand.java +++ b/src/main/java/forestry/core/commands/SubCommand.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.commands; @@ -15,7 +13,9 @@ import java.util.Comparator; import java.util.List; import java.util.SortedSet; import java.util.TreeSet; + import javax.annotation.Nonnull; + import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; @@ -25,8 +25,10 @@ import net.minecraft.command.ICommandSender; public abstract class SubCommand implements IForestryCommand { public enum PermLevel { + EVERYONE(0), ADMIN(2); + public final int permLevel; PermLevel(int permLevel) { diff --git a/src/main/java/forestry/core/commands/TemplateNotFoundException.java b/src/main/java/forestry/core/commands/TemplateNotFoundException.java index c18e2f49c..325e28335 100644 --- a/src/main/java/forestry/core/commands/TemplateNotFoundException.java +++ b/src/main/java/forestry/core/commands/TemplateNotFoundException.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.commands; -import forestry.api.genetics.IAlleleSpecies; import net.minecraft.command.CommandException; +import forestry.api.genetics.IAlleleSpecies; + public class TemplateNotFoundException extends CommandException { private static final long serialVersionUID = 1L; diff --git a/src/main/java/forestry/core/config/Config.java b/src/main/java/forestry/core/config/Config.java index 44ba82a61..13502504a 100755 --- a/src/main/java/forestry/core/config/Config.java +++ b/src/main/java/forestry/core/config/Config.java @@ -1,21 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.config; -import com.google.common.collect.LinkedListMultimap; -import forestry.Forestry; -import forestry.core.fluids.Fluids; -import forestry.core.utils.Log; -import forestry.core.utils.StringUtil; -import forestry.mail.gui.GuiMailboxInfo; import java.io.File; import java.io.FileOutputStream; import java.io.InputStream; @@ -25,9 +17,18 @@ import java.util.Arrays; import java.util.HashSet; import java.util.Properties; import java.util.Set; + import net.minecraft.util.StatCollector; import net.minecraftforge.common.config.Property; +import com.google.common.collect.LinkedListMultimap; + +import forestry.Forestry; +import forestry.core.fluids.Fluids; +import forestry.core.utils.Log; +import forestry.core.utils.StringUtil; +import forestry.mail.gui.GuiMailboxInfo; + public class Config { public static final String CATEGORY_COMMON = "common"; @@ -145,16 +146,16 @@ public class Config { configCommon = new LocalizedConfiguration(configFileCommon, "1.2.0"); - gameMode = configCommon.getStringLocalized( - "difficulty", "game.mode", "EASY", new String[] {"OP, EASY, NORMAL, HARD"}); + gameMode = configCommon + .getStringLocalized("difficulty", "game.mode", "EASY", new String[] { "OP, EASY, NORMAL, HARD" }); boolean recreate = configCommon.getBooleanLocalized("difficulty", "recreate.definitions", true); if (recreate) { Log.info("Recreating all gamemode definitions from the defaults. This may be caused by an upgrade"); String recreateDefinitionsComment = StringUtil.localize("config.difficulty.recreate.definitions.comment"); - Property property = - configCommon.get("difficulty", "recreate.definitions", true, recreateDefinitionsComment); + Property property = configCommon + .get("difficulty", "recreate.definitions", true, recreateDefinitionsComment); property.set(false); // Make sure the default mode files are there. @@ -186,10 +187,10 @@ public class Config { Log.info("Enabled retrogen."); } - generateBeehivesAmount = configCommon.getFloatLocalized( - "world.generate.beehives", "amount", generateBeehivesAmount, 0.0f, 10.0f); - generateBeehivesDebug = - configCommon.getBooleanLocalized("world.generate.beehives", "debug", generateBeehivesDebug); + generateBeehivesAmount = configCommon + .getFloatLocalized("world.generate.beehives", "amount", generateBeehivesAmount, 0.0f, 10.0f); + generateBeehivesDebug = configCommon + .getBooleanLocalized("world.generate.beehives", "debug", generateBeehivesDebug); generateApatiteOre = configCommon.getBooleanLocalized("world.generate.ore", "apatite", generateApatiteOre); generateCopperOre = configCommon.getBooleanLocalized("world.generate.ore", "copper", generateCopperOre); @@ -200,10 +201,10 @@ public class Config { craftingBronzeEnabled = configCommon.getBooleanLocalized("crafting", "bronze", craftingBronzeEnabled); craftingStampsEnabled = configCommon.getBooleanLocalized("crafting.stamps", "enabled", true); - String[] allStamps = new String[] {"1n", "2n", "5n", "10n", "20n", "50n", "100n"}; - String[] defaultCollectors = new String[] {"20n", "50n", "100n"}; - String[] stamps = - configCommon.getStringListLocalized("crafting.stamps", "disabled", defaultCollectors, allStamps); + String[] allStamps = new String[] { "1n", "2n", "5n", "10n", "20n", "50n", "100n" }; + String[] defaultCollectors = new String[] { "20n", "50n", "100n" }; + String[] stamps = configCommon + .getStringListLocalized("crafting.stamps", "disabled", defaultCollectors, allStamps); try { collectorStamps.addAll(Arrays.asList(stamps)); } catch (Exception ex) { @@ -213,33 +214,52 @@ public class Config { collectorStamps.addAll(Arrays.asList(defaultCollectors)); } - clearInvalidChromosomes = - configCommon.getBooleanLocalized("genetics", "clear.invalid.chromosomes", clearInvalidChromosomes); - pollinateVanillaTrees = - configCommon.getBooleanLocalized("genetics", "pollinate.vanilla.trees", pollinateVanillaTrees); + clearInvalidChromosomes = configCommon + .getBooleanLocalized("genetics", "clear.invalid.chromosomes", clearInvalidChromosomes); + pollinateVanillaTrees = configCommon + .getBooleanLocalized("genetics", "pollinate.vanilla.trees", pollinateVanillaTrees); researchMutationBoostMultiplier = configCommon.getFloatLocalized( - "genetics.research.boost", "multiplier", researchMutationBoostMultiplier, 1.0f, 1000.f); + "genetics.research.boost", + "multiplier", + researchMutationBoostMultiplier, + 1.0f, + 1000.f); maxResearchMutationBoostPercent = configCommon.getFloatLocalized( - "genetics.research.boost", "max.percent", maxResearchMutationBoostPercent, 0.0f, 100.0f); + "genetics.research.boost", + "max.percent", + maxResearchMutationBoostPercent, + 0.0f, + 100.0f); dungeonLootRare = configCommon.getBooleanLocalized("difficulty", "loot.rare", dungeonLootRare); - enableBackpackResupply = - configCommon.getBooleanLocalized("performance", "backpacks.resupply", enableBackpackResupply); + enableBackpackResupply = configCommon + .getBooleanLocalized("performance", "backpacks.resupply", enableBackpackResupply); - enableCraftingTimeout = - configCommon.getBooleanLocalized("optimization", "enable.crafting.timeout", enableCraftingTimeout); - craftingTimeout = configCommon.getIntLocalized( - "optimization", - "crafting.timeout", - craftingTimeout, - 50, - 2000); // min 50ms, default 200ms, max 2000 ms. Integer.MAX_VALUE is ~ 2100 ms because of multiplication + enableCraftingTimeout = configCommon + .getBooleanLocalized("optimization", "enable.crafting.timeout", enableCraftingTimeout); + craftingTimeout = configCommon.getIntLocalized("optimization", "crafting.timeout", craftingTimeout, 50, 2000); // min + // 50ms, + // default + // 200ms, + // max + // 2000 + // ms. + // Integer.MAX_VALUE + // is + // ~ + // 2100 + // ms + // because + // of + // multiplication // by 1,000,000 - cacheWorktableRecipes = - configCommon.getBooleanLocalized("optimization", "cache.worktable.recipes", cacheWorktableRecipes); + cacheWorktableRecipes = configCommon + .getBooleanLocalized("optimization", "cache.worktable.recipes", cacheWorktableRecipes); promoteWorktableRecipesToFrontOfGlobalRecipemap = configCommon.getBooleanLocalized( - "optimization", "promote.worktable.recipes", promoteWorktableRecipesToFrontOfGlobalRecipemap); + "optimization", + "promote.worktable.recipes", + promoteWorktableRecipesToFrontOfGlobalRecipemap); // move legacy mail property configCommon.moveProperty("tweaks.gui", "mail.alert", "tweaks.gui.mail.alert"); @@ -247,9 +267,15 @@ public class Config { mailAlertEnabled = configCommon.getBooleanLocalized("tweaks.gui.mail.alert", "enabled", mailAlertEnabled); mailAlertXPosition = configCommon.getEnumLocalized( - "tweaks.gui.mail.alert", "xPosition", mailAlertXPosition, GuiMailboxInfo.XPosition.values()); + "tweaks.gui.mail.alert", + "xPosition", + mailAlertXPosition, + GuiMailboxInfo.XPosition.values()); mailAlertYPosition = configCommon.getEnumLocalized( - "tweaks.gui.mail.alert", "yPosition", mailAlertYPosition, GuiMailboxInfo.YPosition.values()); + "tweaks.gui.mail.alert", + "yPosition", + mailAlertYPosition, + GuiMailboxInfo.YPosition.values()); guiTabSpeed = configCommon.getIntLocalized("tweaks.gui.tabs", "speed", guiTabSpeed, 1, 50); enableHints = configCommon.getBooleanLocalized("tweaks.gui.tabs", "hints", enableHints); @@ -260,14 +286,14 @@ public class Config { farmSize = configCommon.getIntLocalized("tweaks.farms", "size", farmSize, 1, 3); squareFarms = configCommon.getBooleanLocalized("tweaks.farms", "square", squareFarms); enableExUtilEnderLily = configCommon.getBooleanLocalized("tweaks.farms", "enderlily", enableExUtilEnderLily); - enableMagicalCropsSupport = - configCommon.getBooleanLocalized("tweaks.farms", "magicalcrops", enableMagicalCropsSupport); + enableMagicalCropsSupport = configCommon + .getBooleanLocalized("tweaks.farms", "magicalcrops", enableMagicalCropsSupport); - String[] availableStructures = - new String[] {"alveary3x3", "farm3x3", "farm3x4", "farm3x5", "farm4x4", "farm5x5"}; + String[] availableStructures = new String[] { "alveary3x3", "farm3x3", "farm3x4", "farm3x5", "farm4x4", + "farm5x5" }; String[] disabledStructureArray = disabledStructures.toArray(new String[disabledStructures.size()]); - disabledStructureArray = configCommon.getStringListLocalized( - "structures", "disabled", disabledStructureArray, availableStructures); + disabledStructureArray = configCommon + .getStringListLocalized("structures", "disabled", disabledStructureArray, availableStructures); disabledStructures.addAll(Arrays.asList(disabledStructureArray)); for (String str : disabledStructures) { @@ -293,10 +319,10 @@ public class Config { } boolean enabledFluidBlock = !Config.disabledBlocks.contains(fluid.getTag()); - String enableFluidBlockComment = - StringUtil.localizeAndFormatRaw("for.config.fluid.blocks.enable.format", fluidName); - enabledFluidBlock = configFluid.getBoolean( - "enableFluidBlock", fluid.getTag(), enabledFluidBlock, enableFluidBlockComment); + String enableFluidBlockComment = StringUtil + .localizeAndFormatRaw("for.config.fluid.blocks.enable.format", fluidName); + enabledFluidBlock = configFluid + .getBoolean("enableFluidBlock", fluid.getTag(), enabledFluidBlock, enableFluidBlockComment); if (!enabledFluidBlock) { Config.disabledBlocks.add(fluid.getTag()); } diff --git a/src/main/java/forestry/core/config/Constants.java b/src/main/java/forestry/core/config/Constants.java index 77081be8b..61625d7e3 100644 --- a/src/main/java/forestry/core/config/Constants.java +++ b/src/main/java/forestry/core/config/Constants.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.config; import forestry.api.core.IForestryConstants; public class Constants implements IForestryConstants { + // System public static final String MOD = "Forestry"; public static final String ID = "forestry"; @@ -26,7 +25,7 @@ public class Constants implements IForestryConstants { public static final int BUCKET_VOLUME = 1000; public static final int FLUID_PER_HONEY_DROP = 100; - public static final int[] FACINGS = {0, 1, 2, 3, 4, 5}; + public static final int[] FACINGS = { 0, 1, 2, 3, 4, 5 }; public static final int[] SLOTS_NONE = new int[0]; public static final String[] EMPTY_STRINGS = new String[0]; diff --git a/src/main/java/forestry/core/config/ForestryGuiConfig.java b/src/main/java/forestry/core/config/ForestryGuiConfig.java index 1446c5e13..7e49d7e6d 100644 --- a/src/main/java/forestry/core/config/ForestryGuiConfig.java +++ b/src/main/java/forestry/core/config/ForestryGuiConfig.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.config; -import cpw.mods.fml.client.config.GuiConfig; -import cpw.mods.fml.client.config.IConfigElement; import java.util.ArrayList; import java.util.Arrays; import java.util.List; + import net.minecraft.client.gui.GuiScreen; import net.minecraftforge.common.config.ConfigCategory; import net.minecraftforge.common.config.ConfigElement; +import cpw.mods.fml.client.config.GuiConfig; +import cpw.mods.fml.client.config.IConfigElement; + public class ForestryGuiConfig extends GuiConfig { public ForestryGuiConfig(GuiScreen parent) { @@ -28,8 +28,8 @@ public class ForestryGuiConfig extends GuiConfig { private static List getConfigCategories() { List configElements = new ArrayList<>(); - List commonCategoryNames = - Arrays.asList("crafting", "difficulty", "genetics", "performance", "structures", "tweaks", "world"); + List commonCategoryNames = Arrays + .asList("crafting", "difficulty", "genetics", "performance", "structures", "tweaks", "world"); for (String categoryName : commonCategoryNames) { ConfigCategory category = Config.configCommon.getCategory(categoryName); configElements.add(new ConfigElement(category)); diff --git a/src/main/java/forestry/core/config/ForestryGuiConfigFactory.java b/src/main/java/forestry/core/config/ForestryGuiConfigFactory.java index 316c124f8..08be3604c 100644 --- a/src/main/java/forestry/core/config/ForestryGuiConfigFactory.java +++ b/src/main/java/forestry/core/config/ForestryGuiConfigFactory.java @@ -1,21 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.config; -import cpw.mods.fml.client.IModGuiFactory; import java.util.Set; + import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; +import cpw.mods.fml.client.IModGuiFactory; + public class ForestryGuiConfigFactory implements IModGuiFactory { + @Override public void initialize(Minecraft minecraftInstance) {} diff --git a/src/main/java/forestry/core/config/GameMode.java b/src/main/java/forestry/core/config/GameMode.java index 21385ff7e..4f92d9a4d 100644 --- a/src/main/java/forestry/core/config/GameMode.java +++ b/src/main/java/forestry/core/config/GameMode.java @@ -1,28 +1,29 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.config; +import java.io.File; +import java.util.HashMap; +import java.util.Map; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + import forestry.Forestry; import forestry.api.core.IGameMode; import forestry.core.blocks.BlockSoil; import forestry.core.utils.Log; import forestry.plugins.PluginCore; import forestry.plugins.PluginFluids; -import java.io.File; -import java.util.HashMap; -import java.util.Map; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; public class GameMode implements IGameMode { + private static final String GAMEMODE_KEY = "gamemode"; private String identifier = "EASY"; private final String category; diff --git a/src/main/java/forestry/core/config/LocalizedConfiguration.java b/src/main/java/forestry/core/config/LocalizedConfiguration.java index 74f759935..fc285ea38 100644 --- a/src/main/java/forestry/core/config/LocalizedConfiguration.java +++ b/src/main/java/forestry/core/config/LocalizedConfiguration.java @@ -1,17 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.config; import java.io.File; import java.util.Arrays; + import net.minecraft.util.StatCollector; import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; @@ -64,8 +63,11 @@ public class LocalizedConfiguration extends Configuration { Property prop = this.get(category, name, defaultValue); prop.setValidValues(validValues); prop.setLanguageKey(langKey); - prop.comment = - comment + " [default: " + defaultValue + "] [valid: " + Arrays.toString(prop.getValidValues()) + "]"; + prop.comment = comment + " [default: " + + defaultValue + + "] [valid: " + + Arrays.toString(prop.getValidValues()) + + "]"; return prop.getString(); } @@ -87,8 +89,11 @@ public class LocalizedConfiguration extends Configuration { prop.setValidValues(validValues); prop.setLanguageKey(langKey); - prop.comment = - comment + " [default: " + defaultValue + "] [valid: " + Arrays.toString(prop.getValidValues()) + "]"; + prop.comment = comment + " [default: " + + defaultValue + + "] [valid: " + + Arrays.toString(prop.getValidValues()) + + "]"; String stringValue = prop.getString(); T enumValue = defaultValue; @@ -122,8 +127,11 @@ public class LocalizedConfiguration extends Configuration { Property prop = this.get(category, name, defaultValue); prop.setLanguageKey(langKey); prop.setValidValues(validValues); - prop.comment = comment + " [default: " + Arrays.toString(defaultValue) + "] [valid: " - + Arrays.toString(prop.getValidValues()) + "]"; + prop.comment = comment + " [default: " + + Arrays.toString(defaultValue) + + "] [valid: " + + Arrays.toString(prop.getValidValues()) + + "]"; return prop.getStringList(); } diff --git a/src/main/java/forestry/core/config/SessionVars.java b/src/main/java/forestry/core/config/SessionVars.java index 13054d72a..ab1a7d374 100755 --- a/src/main/java/forestry/core/config/SessionVars.java +++ b/src/main/java/forestry/core/config/SessionVars.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.config; diff --git a/src/main/java/forestry/core/config/Version.java b/src/main/java/forestry/core/config/Version.java index ba7ec45e4..155589a98 100755 --- a/src/main/java/forestry/core/config/Version.java +++ b/src/main/java/forestry/core/config/Version.java @@ -1,29 +1,29 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.config; -import cpw.mods.fml.common.FMLCommonHandler; -import cpw.mods.fml.common.versioning.DefaultArtifactVersion; -import forestry.Forestry; -import forestry.core.proxy.Proxies; -import forestry.core.utils.Log; import java.io.BufferedReader; import java.io.File; import java.io.InputStreamReader; import java.net.HttpURLConnection; import java.net.URL; import java.util.ArrayList; + import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; +import cpw.mods.fml.common.FMLCommonHandler; +import cpw.mods.fml.common.versioning.DefaultArtifactVersion; +import forestry.Forestry; +import forestry.core.proxy.Proxies; +import forestry.core.utils.Log; + /** * With permission from pahimar. * @@ -39,8 +39,8 @@ public class Version { public static final String VERSION = "@VERSION@"; public static final String BUILD_NUMBER = "@BUILD_NUMBER@"; - public static final String[] FAILED_CHANGELOG = - new String[] {String.format("Unable to retrieve changelog for %s", Constants.MOD)}; + public static final String[] FAILED_CHANGELOG = new String[] { + String.format("Unable to retrieve changelog for %s", Constants.MOD) }; private static final String REMOTE_VERSION_FILE = "http://bit.ly/forestryver"; private static final String REMOTE_CHANGELOG_ROOT = "https://dl.dropbox.com/u/44760587/forestry/changelog/"; public static EnumUpdateState currentVersion = EnumUpdateState.CURRENT; @@ -63,8 +63,7 @@ public class Version { File versionFile = new File(Forestry.instance.getConfigFolder(), Config.CATEGORY_COMMON + ".cfg"); Configuration config = new Configuration(versionFile); Property property = config.get("version", "seen", VERSION); - property.comment = - "indicates the last version the user has been informed about and will suppress further notices on it."; + property.comment = "indicates the last version the user has been informed about and will suppress further notices on it."; String seenVersion = property.getString(); if (recommendedVersion == null || recommendedVersion.equals(seenVersion)) { @@ -112,25 +111,32 @@ public class Version { return; } - int result = FMLCommonHandler.instance() - .findContainerFor(Forestry.instance) - .getProcessedVersion() + int result = FMLCommonHandler.instance().findContainerFor(Forestry.instance).getProcessedVersion() .compareTo(new DefaultArtifactVersion(recommendedVersion)); if (result >= 0) { - Log.finer("Using the latest version [" + VERSION + " (build:" + BUILD_NUMBER + ")] for Minecraft " - + mcVersion); + Log.finer( + "Using the latest version [" + VERSION + + " (build:" + + BUILD_NUMBER + + ")] for Minecraft " + + mcVersion); currentVersion = EnumUpdateState.CURRENT; return; } cachedChangelog = grabChangelog(recommendedVersion); - Log.warning("Using outdated version [" + VERSION + " (build:" + BUILD_NUMBER + ")] for Minecraft " - + mcVersion + ". Consider updating."); + Log.warning( + "Using outdated version [" + VERSION + + " (build:" + + BUILD_NUMBER + + ")] for Minecraft " + + mcVersion + + ". Consider updating."); currentVersion = EnumUpdateState.OUTDATED; } catch (Exception e) { - // e.printStackTrace(); + // e.printStackTrace(); Log.warning("Unable to read from remote version authority."); currentVersion = EnumUpdateState.CONNECTION_ERROR; } @@ -178,10 +184,10 @@ public class Version { return changelog.toArray(new String[changelog.size()]); } catch (Exception ex) { - // ex.printStackTrace(); + // ex.printStackTrace(); Log.warning("Unable to read changelog from remote site."); } - return new String[] {String.format("Unable to retrieve changelog for %s %s", Constants.MOD, version)}; + return new String[] { String.format("Unable to retrieve changelog for %s %s", Constants.MOD, version) }; } } diff --git a/src/main/java/forestry/core/entities/EntityFXColoredDropParticle.java b/src/main/java/forestry/core/entities/EntityFXColoredDropParticle.java index 07c3ddc0c..91de52e33 100644 --- a/src/main/java/forestry/core/entities/EntityFXColoredDropParticle.java +++ b/src/main/java/forestry/core/entities/EntityFXColoredDropParticle.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.entities; @@ -71,16 +69,14 @@ public class EntityFXColoredDropParticle extends EntityFX { this.motionZ *= 0.699999988079071D; } - Material material = this.worldObj - .getBlock( - MathHelper.floor_double(this.posX), - MathHelper.floor_double(this.posY), - MathHelper.floor_double(this.posZ)) - .getMaterial(); + Material material = this.worldObj.getBlock( + MathHelper.floor_double(this.posX), + MathHelper.floor_double(this.posY), + MathHelper.floor_double(this.posZ)).getMaterial(); if (material.isLiquid() || material.isSolid()) { - double d0 = (double) ((float) (MathHelper.floor_double(this.posY) + 1) - - BlockLiquid.getLiquidHeightPercent(this.worldObj.getBlockMetadata( + double d0 = (double) ((float) (MathHelper.floor_double(this.posY) + 1) - BlockLiquid.getLiquidHeightPercent( + this.worldObj.getBlockMetadata( MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ)))); diff --git a/src/main/java/forestry/core/entities/EntityFXHoneydust.java b/src/main/java/forestry/core/entities/EntityFXHoneydust.java index 44ad33be5..8e55c2f2b 100644 --- a/src/main/java/forestry/core/entities/EntityFXHoneydust.java +++ b/src/main/java/forestry/core/entities/EntityFXHoneydust.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.entities; diff --git a/src/main/java/forestry/core/entities/EntityFXIgnition.java b/src/main/java/forestry/core/entities/EntityFXIgnition.java index d2668681d..5bd8c59ce 100644 --- a/src/main/java/forestry/core/entities/EntityFXIgnition.java +++ b/src/main/java/forestry/core/entities/EntityFXIgnition.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.entities; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.client.particle.EntityFX; import net.minecraft.client.renderer.Tessellator; import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + @SideOnly(Side.CLIENT) public class EntityFXIgnition extends EntityFX { + private final float ignitionParticleScale; public EntityFXIgnition(World world, double x, double y, double z) { @@ -48,14 +48,8 @@ public class EntityFXIgnition extends EntityFX { return 1.0F; } - public void renderParticle( - Tessellator p_70539_1_, - float p_70539_2_, - float p_70539_3_, - float p_70539_4_, - float p_70539_5_, - float p_70539_6_, - float p_70539_7_) { + public void renderParticle(Tessellator p_70539_1_, float p_70539_2_, float p_70539_3_, float p_70539_4_, + float p_70539_5_, float p_70539_6_, float p_70539_7_) { float f6 = ((float) this.particleAge + p_70539_2_) / (float) this.particleMaxAge; this.particleScale = this.ignitionParticleScale * (1.0F - f6 * f6); super.renderParticle(p_70539_1_, p_70539_2_, p_70539_3_, p_70539_4_, p_70539_5_, p_70539_6_, p_70539_7_); @@ -76,8 +70,8 @@ public class EntityFXIgnition extends EntityFX { float f = (float) this.particleAge / (float) this.particleMaxAge; if (this.rand.nextFloat() > (f * 2)) { - this.worldObj.spawnParticle( - "smoke", this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ); + this.worldObj + .spawnParticle("smoke", this.posX, this.posY, this.posZ, this.motionX, this.motionY, this.motionZ); } this.motionY -= 0.03D; diff --git a/src/main/java/forestry/core/entities/EntityFXSnow.java b/src/main/java/forestry/core/entities/EntityFXSnow.java index c1b7b086a..30d4a0433 100644 --- a/src/main/java/forestry/core/entities/EntityFXSnow.java +++ b/src/main/java/forestry/core/entities/EntityFXSnow.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.entities; @@ -38,14 +36,8 @@ public class EntityFXSnow extends EntityFX { } @Override - public void renderParticle( - Tessellator tess, - float timeStep, - float rotationX, - float rotationXZ, - float rotationZ, - float rotationYZ, - float rotationXY) { + public void renderParticle(Tessellator tess, float timeStep, float rotationX, float rotationXZ, float rotationZ, + float rotationYZ, float rotationXY) { double x = (this.prevPosX + (this.posX - this.prevPosX) * timeStep - interpPosX); double y = (this.prevPosY + (this.posY - this.prevPosY) * timeStep - interpPosY); double z = (this.prevPosZ + (this.posZ - this.prevPosZ) * timeStep - interpPosZ); @@ -84,21 +76,9 @@ public class EntityFXSnow extends EntityFX { } } - private static void renderParticle( - Tessellator tess, - double x, - double y, - double z, - float rotationX, - float rotationXZ, - float rotationZ, - float rotationYZ, - float rotationXY, - float minU, - float maxU, - float minV, - float maxV, - float scale) { + private static void renderParticle(Tessellator tess, double x, double y, double z, float rotationX, + float rotationXZ, float rotationZ, float rotationYZ, float rotationXY, float minU, float maxU, float minV, + float maxV, float scale) { tess.addVertexWithUV( (x - rotationX * scale - rotationYZ * scale), (y - rotationXZ * scale), diff --git a/src/main/java/forestry/core/entities/EntityMinecartContainerForestry.java b/src/main/java/forestry/core/entities/EntityMinecartContainerForestry.java index a74f94ce9..43a0c89b6 100644 --- a/src/main/java/forestry/core/entities/EntityMinecartContainerForestry.java +++ b/src/main/java/forestry/core/entities/EntityMinecartContainerForestry.java @@ -1,18 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.entities; -import forestry.core.inventory.IInventoryAdapter; -import forestry.core.tiles.IFilterSlotDelegate; -import forestry.core.utils.InventoryUtil; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; import net.minecraft.inventory.ISidedInventory; @@ -20,8 +15,13 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; +import forestry.core.inventory.IInventoryAdapter; +import forestry.core.tiles.IFilterSlotDelegate; +import forestry.core.utils.InventoryUtil; + public abstract class EntityMinecartContainerForestry extends EntityMinecartForestry implements ISidedInventory, IFilterSlotDelegate { + /** * When set to true, the minecart will drop all items when setDead() is called. When false (such as when travelling * dimensions) it preserves its contents. diff --git a/src/main/java/forestry/core/entities/EntityMinecartForestry.java b/src/main/java/forestry/core/entities/EntityMinecartForestry.java index 523711d32..5d8d8431b 100644 --- a/src/main/java/forestry/core/entities/EntityMinecartForestry.java +++ b/src/main/java/forestry/core/entities/EntityMinecartForestry.java @@ -1,24 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.entities; -import com.mojang.authlib.GameProfile; -import forestry.core.access.AccessHandler; -import forestry.core.access.EnumAccess; -import forestry.core.access.IAccessHandler; -import forestry.core.access.IRestrictedAccess; -import forestry.core.gui.GuiHandler; -import forestry.core.gui.IGuiHandlerEntity; -import forestry.core.gui.IHintSource; -import forestry.core.tiles.ITitled; import net.minecraft.block.Block; import net.minecraft.entity.item.EntityMinecart; import net.minecraft.entity.player.EntityPlayer; @@ -30,8 +19,20 @@ import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.minecart.MinecartInteractEvent; +import com.mojang.authlib.GameProfile; + +import forestry.core.access.AccessHandler; +import forestry.core.access.EnumAccess; +import forestry.core.access.IAccessHandler; +import forestry.core.access.IRestrictedAccess; +import forestry.core.gui.GuiHandler; +import forestry.core.gui.IGuiHandlerEntity; +import forestry.core.gui.IHintSource; +import forestry.core.tiles.ITitled; + public abstract class EntityMinecartForestry extends EntityMinecart implements ITitled, IRestrictedAccess, IHintSource, IGuiHandlerEntity { + private final AccessHandler accessHandler = new AccessHandler(this); @SuppressWarnings("unused") diff --git a/src/main/java/forestry/core/entities/EntitySelector.java b/src/main/java/forestry/core/entities/EntitySelector.java index f529995bc..a170086a1 100644 --- a/src/main/java/forestry/core/entities/EntitySelector.java +++ b/src/main/java/forestry/core/entities/EntitySelector.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.entities; @@ -14,6 +12,7 @@ import net.minecraft.command.IEntitySelector; import net.minecraft.entity.Entity; public abstract class EntitySelector implements IEntitySelector { + private final Class entityClass; protected EntitySelector(Class entityClass) { diff --git a/src/main/java/forestry/core/errors/EnumErrorCode.java b/src/main/java/forestry/core/errors/EnumErrorCode.java index 6c129842a..b4bf0c682 100644 --- a/src/main/java/forestry/core/errors/EnumErrorCode.java +++ b/src/main/java/forestry/core/errors/EnumErrorCode.java @@ -5,15 +5,17 @@ ******************************************************************************/ package forestry.core.errors; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.core.ForestryAPI; import forestry.api.core.IErrorState; import forestry.core.config.Constants; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.util.IIcon; public enum EnumErrorCode implements IErrorState { + @Deprecated UNKNOWN("unknown"), // Congratulations, you found a glitch. @Deprecated @@ -26,14 +28,12 @@ public enum EnumErrorCode implements IErrorState { // Bees TOO_HOT("tooHot"), // The bees are melting in the heat here and unable to work. Use the habitat locator to find a // cooler climate. - TOO_COLD("tooCold"), // The bees are huddled together to survive the freezing cold here. Use the habitat locator to + TOO_COLD("tooCold"), // The bees are huddled together to survive the freezing cold here. Use the habitat locator to // find a warmer climate. - TOO_HUMID( - "tooHumid"), // The damp climate here has made the bees' wings too damp to fly. Use the habitat locator to + TOO_HUMID("tooHumid"), // The damp climate here has made the bees' wings too damp to fly. Use the habitat locator to // find a dryer climate. - TOO_ARID( - "tooArid", - "invalidBiome"), // The dry climate here has made the bees parched and unable do work. Use the habitat + TOO_ARID("tooArid", "invalidBiome"), // The dry climate here has made the bees parched and unable do work. Use the + // habitat // locator to find a wetter climate. IS_RAINING("isRaining"), // Only tolerant fliers can work in the rain. NOT_GLOOMY("notGloomy"), // The bees can only work in darkness. @@ -48,9 +48,8 @@ public enum EnumErrorCode implements IErrorState { // Machines NO_RESOURCE("noResource"), // More resources need to be supplied for operation. - NO_RESOURCE_INVENTORY( - "noResourceInventory", - "noResource"), // Resources need to be added to the machine's inventory to craft this recipe. + NO_RESOURCE_INVENTORY("noResourceInventory", "noResource"), // Resources need to be added to the machine's inventory + // to craft this recipe. NO_RESOURCE_LIQUID("noResourceLiquid", "noLiquid"), // More liquid resources need to be supplied for operation. NO_RECIPE("noRecipe"), // No matching recipe was found for the supplied resources. NO_SPACE_INVENTORY("noSpace"), // Empty this machine's inventory. @@ -98,8 +97,8 @@ public enum EnumErrorCode implements IErrorState { NO_FERTILIZER("noFertilizer"), // Farms require fertilizer for function. Compost is insufficient. NO_FARMLAND("noFarmland"), // Smooth sandstone, bricks or stone bricks create a platform the farm will build on. NO_LIQUID_FARM("noLiquid") // Depending on rainfall, temperature and humidity farms need to be supplied with varying -// amounts of water. -; + // amounts of water. + ; private final String name; private final String iconName; diff --git a/src/main/java/forestry/core/errors/ErrorLogic.java b/src/main/java/forestry/core/errors/ErrorLogic.java index 3106eef93..a08600b3a 100644 --- a/src/main/java/forestry/core/errors/ErrorLogic.java +++ b/src/main/java/forestry/core/errors/ErrorLogic.java @@ -1,26 +1,27 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.errors; -import com.google.common.collect.ImmutableSet; -import forestry.api.core.ForestryAPI; -import forestry.api.core.IErrorLogic; -import forestry.api.core.IErrorState; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.util.HashSet; import java.util.Set; +import com.google.common.collect.ImmutableSet; + +import forestry.api.core.ForestryAPI; +import forestry.api.core.IErrorLogic; +import forestry.api.core.IErrorState; + public class ErrorLogic implements IErrorLogic { + private final Set errorStates = new HashSet<>(); @Override diff --git a/src/main/java/forestry/core/errors/ErrorStateRegistry.java b/src/main/java/forestry/core/errors/ErrorStateRegistry.java index 6fe5726f6..87e8ef3b6 100644 --- a/src/main/java/forestry/core/errors/ErrorStateRegistry.java +++ b/src/main/java/forestry/core/errors/ErrorStateRegistry.java @@ -1,27 +1,28 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.errors; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; + +import net.minecraft.client.renderer.texture.IIconRegister; + import com.google.common.collect.BiMap; import com.google.common.collect.HashBiMap; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.core.IErrorLogic; import forestry.api.core.IErrorState; import forestry.api.core.IErrorStateRegistry; -import java.util.Collections; -import java.util.HashMap; -import java.util.Map; -import java.util.Set; -import net.minecraft.client.renderer.texture.IIconRegister; /** * @@ -31,8 +32,7 @@ public class ErrorStateRegistry implements IErrorStateRegistry { private static final BiMap states = HashBiMap.create(); private static final Map stateNames = new HashMap<>(); - private static final Set stateView = - Collections.unmodifiableSet(states.inverse().keySet()); + private static final Set stateView = Collections.unmodifiableSet(states.inverse().keySet()); @Override public void registerErrorState(IErrorState state) { diff --git a/src/main/java/forestry/core/errors/FakeErrorLogic.java b/src/main/java/forestry/core/errors/FakeErrorLogic.java index eabaa5923..cd18d2132 100644 --- a/src/main/java/forestry/core/errors/FakeErrorLogic.java +++ b/src/main/java/forestry/core/errors/FakeErrorLogic.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.errors; -import com.google.common.collect.ImmutableSet; -import forestry.api.core.IErrorLogic; -import forestry.api.core.IErrorState; import java.io.DataInputStream; import java.io.DataOutputStream; import java.io.IOException; +import com.google.common.collect.ImmutableSet; + +import forestry.api.core.IErrorLogic; +import forestry.api.core.IErrorState; + public class FakeErrorLogic implements IErrorLogic { public static final FakeErrorLogic instance = new FakeErrorLogic(); diff --git a/src/main/java/forestry/core/errors/FakeErrorSource.java b/src/main/java/forestry/core/errors/FakeErrorSource.java index 95f56b2c1..ef23ae1c3 100644 --- a/src/main/java/forestry/core/errors/FakeErrorSource.java +++ b/src/main/java/forestry/core/errors/FakeErrorSource.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.errors; import com.google.common.collect.ImmutableSet; + import forestry.api.core.IErrorSource; import forestry.api.core.IErrorState; public class FakeErrorSource implements IErrorSource { + public static final FakeErrorSource instance = new FakeErrorSource(); private FakeErrorSource() {} diff --git a/src/main/java/forestry/core/fluids/BlockForestryFluid.java b/src/main/java/forestry/core/fluids/BlockForestryFluid.java index 8d2028629..ed4e83086 100644 --- a/src/main/java/forestry/core/fluids/BlockForestryFluid.java +++ b/src/main/java/forestry/core/fluids/BlockForestryFluid.java @@ -1,25 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.fluids; -import cpw.mods.fml.client.FMLClientHandler; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.core.config.Constants; -import forestry.core.entities.EntityFXColoredDropParticle; -import forestry.core.render.TextureManager; import java.awt.Color; import java.util.ArrayList; import java.util.List; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.Minecraft; @@ -37,6 +30,13 @@ import net.minecraftforge.fluids.BlockFluidClassic; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; +import cpw.mods.fml.client.FMLClientHandler; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.core.config.Constants; +import forestry.core.entities.EntityFXColoredDropParticle; +import forestry.core.render.TextureManager; + public class BlockForestryFluid extends BlockFluidClassic { private final boolean flammable; @@ -102,8 +102,9 @@ public class BlockForestryFluid extends BlockFluidClassic { @SideOnly(Side.CLIENT) private boolean flowTextureExists() { try { - ResourceLocation resourceLocation = - new ResourceLocation(Constants.ID, "textures/blocks/liquid/" + fluidName + "_flow.png"); + ResourceLocation resourceLocation = new ResourceLocation( + Constants.ID, + "textures/blocks/liquid/" + fluidName + "_flow.png"); IResourceManager resourceManager = Minecraft.getMinecraft().getResourceManager(); return resourceManager.getResource(resourceLocation) != null; } catch (java.lang.Exception e) { @@ -114,15 +115,20 @@ public class BlockForestryFluid extends BlockFluidClassic { @Override @SideOnly(Side.CLIENT) public void randomDisplayTick(World world, int x, int y, int z, Random rand) { - if (rand.nextInt(10) == 0 - && World.doesBlockHaveSolidTopSurface(world, x, y - 1, z) + if (rand.nextInt(10) == 0 && World.doesBlockHaveSolidTopSurface(world, x, y - 1, z) && !world.getBlock(x, y - 2, z).getMaterial().blocksMovement()) { double px = (double) ((float) x + rand.nextFloat()); double py = (double) y - 1.05D; double pz = (double) ((float) z + rand.nextFloat()); EntityFX fx = new EntityFXColoredDropParticle( - world, px, py, pz, color.getRed(), color.getGreen(), color.getBlue()); + world, + px, + py, + pz, + color.getRed(), + color.getGreen(), + color.getBlue()); FMLClientHandler.instance().getClient().effectRenderer.addEffect(fx); } } @@ -234,8 +240,7 @@ public class BlockForestryFluid extends BlockFluidClassic { } private static boolean isNeighborFlammable(World world, int x, int y, int z) { - return isFlammable(world, x - 1, y, z) - || isFlammable(world, x + 1, y, z) + return isFlammable(world, x - 1, y, z) || isFlammable(world, x + 1, y, z) || isFlammable(world, x, y, z - 1) || isFlammable(world, x, y, z + 1) || isFlammable(world, x, y - 1, z) diff --git a/src/main/java/forestry/core/fluids/FakeTankManager.java b/src/main/java/forestry/core/fluids/FakeTankManager.java index 51b769aaf..8ee2a0367 100644 --- a/src/main/java/forestry/core/fluids/FakeTankManager.java +++ b/src/main/java/forestry/core/fluids/FakeTankManager.java @@ -1,17 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.fluids; -import forestry.core.fluids.tanks.FakeTank; import java.util.List; + import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; @@ -21,7 +19,10 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidTank; +import forestry.core.fluids.tanks.FakeTank; + public class FakeTankManager implements ITankManager { + public static final FakeTankManager instance = new FakeTankManager(); private FakeTankManager() {} diff --git a/src/main/java/forestry/core/fluids/FakeTankUpdateHandler.java b/src/main/java/forestry/core/fluids/FakeTankUpdateHandler.java index cc196d5fa..ff9d308fd 100644 --- a/src/main/java/forestry/core/fluids/FakeTankUpdateHandler.java +++ b/src/main/java/forestry/core/fluids/FakeTankUpdateHandler.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.fluids; diff --git a/src/main/java/forestry/core/fluids/FluidHelper.java b/src/main/java/forestry/core/fluids/FluidHelper.java index 99b16aa91..0432ce37d 100644 --- a/src/main/java/forestry/core/fluids/FluidHelper.java +++ b/src/main/java/forestry/core/fluids/FluidHelper.java @@ -1,21 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.fluids; -import forestry.core.config.Constants; -import forestry.core.utils.InventoryUtil; -import forestry.core.utils.ItemStackUtil; -import forestry.plugins.PluginFluids; import java.util.ArrayList; import java.util.List; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; @@ -28,6 +23,11 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidContainerItem; import net.minecraftforge.fluids.IFluidHandler; +import forestry.core.config.Constants; +import forestry.core.utils.InventoryUtil; +import forestry.core.utils.ItemStackUtil; +import forestry.plugins.PluginFluids; + /** * @author CovertJaguar */ @@ -35,8 +35,8 @@ public final class FluidHelper { private FluidHelper() {} - public static boolean handleRightClick( - IFluidHandler tank, ForgeDirection side, EntityPlayer player, boolean fill, boolean drain) { + public static boolean handleRightClick(IFluidHandler tank, ForgeDirection side, EntityPlayer player, boolean fill, + boolean drain) { if (player == null) { return false; } @@ -87,11 +87,13 @@ public final class FluidHelper { return false; } player.inventory.setInventorySlotContents( - player.inventory.currentItem, InventoryUtil.depleteItem(current)); + player.inventory.currentItem, + InventoryUtil.depleteItem(current)); player.inventory.markDirty(); } else { player.inventory.setInventorySlotContents( - player.inventory.currentItem, InventoryUtil.depleteItem(current)); + player.inventory.currentItem, + InventoryUtil.depleteItem(current)); player.inventory.setInventorySlotContents(player.inventory.currentItem, filled); player.inventory.markDirty(); } @@ -120,18 +122,13 @@ public final class FluidHelper { NO_SPACE } - public static FillStatus fillContainers( - IFluidHandler fluidHandler, IInventory inv, int inputSlot, int outputSlot, Fluid fluidToFill) { + public static FillStatus fillContainers(IFluidHandler fluidHandler, IInventory inv, int inputSlot, int outputSlot, + Fluid fluidToFill) { return fillContainers(fluidHandler, inv, inputSlot, outputSlot, fluidToFill, true); } - public static FillStatus fillContainers( - IFluidHandler fluidHandler, - IInventory inv, - int inputSlot, - int outputSlot, - Fluid fluidToFill, - boolean doFill) { + public static FillStatus fillContainers(IFluidHandler fluidHandler, IInventory inv, int inputSlot, int outputSlot, + Fluid fluidToFill, boolean doFill) { if (fluidToFill == null) { return FillStatus.INVALID_INPUT; } @@ -152,8 +149,8 @@ public final class FluidHelper { fillAmount = Math.min(Constants.BUCKET_VOLUME, containerCapacity); } - FluidStack canDrain = - fluidHandler.drain(ForgeDirection.UNKNOWN, new FluidStack(fluidToFill, fillAmount), false); + FluidStack canDrain = fluidHandler + .drain(ForgeDirection.UNKNOWN, new FluidStack(fluidToFill, fillAmount), false); if (canDrain == null || canDrain.amount == 0) { return FillStatus.NO_FLUID; } @@ -229,8 +226,7 @@ public final class FluidHelper { // consume forestry containers if there is only one slot if (outputSlot == inputSlot && drainedItem != null) { Item item = drainedItem.getItem(); - if (PluginFluids.items.canEmpty == item - || PluginFluids.items.waxCapsuleEmpty == item + if (PluginFluids.items.canEmpty == item || PluginFluids.items.waxCapsuleEmpty == item || PluginFluids.items.refractoryEmpty == item) { drainedItem = null; } @@ -258,8 +254,8 @@ public final class FluidHelper { return true; } - private static boolean hasRoomForDrainedContainer( - ItemStack input, ItemStack output, ItemStack drainedItem, int inputSlot, int outputSlot) { + private static boolean hasRoomForDrainedContainer(ItemStack input, ItemStack output, ItemStack drainedItem, + int inputSlot, int outputSlot) { if (output == null || drainedItem == null) { return true; } @@ -424,8 +420,8 @@ public final class FluidHelper { if (fluid == null) { return FluidContainerRegistry.getContainerCapacity(container); } else { - return FluidContainerRegistry.getContainerCapacity( - new FluidStack(fluid, Constants.BUCKET_VOLUME), container); + return FluidContainerRegistry + .getContainerCapacity(new FluidStack(fluid, Constants.BUCKET_VOLUME), container); } } } diff --git a/src/main/java/forestry/core/fluids/Fluids.java b/src/main/java/forestry/core/fluids/Fluids.java index 51b74f656..83e223b90 100644 --- a/src/main/java/forestry/core/fluids/Fluids.java +++ b/src/main/java/forestry/core/fluids/Fluids.java @@ -1,18 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.fluids; -import forestry.core.config.Constants; -import forestry.core.items.EnumContainerType; -import forestry.core.items.ItemLiquidContainer; import java.awt.Color; import java.util.Collections; import java.util.EnumSet; @@ -20,17 +15,26 @@ import java.util.HashMap; import java.util.List; import java.util.Locale; import java.util.Map; + import javax.annotation.Nonnull; + import net.minecraft.block.Block; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; + import org.apache.commons.lang3.text.WordUtils; +import forestry.core.config.Constants; +import forestry.core.items.EnumContainerType; +import forestry.core.items.ItemLiquidContainer; + public enum Fluids { + ETHANOL(new Color(255, 111, 0), 790, 1000) { + @Override public String getTag() { return "bioethanol"; @@ -51,6 +55,7 @@ public enum Fluids { } }, BIOMASS(new Color(100, 132, 41), 400, 6560) { + @Override public Block makeBlock() { return new BlockForestryFluid(this, 100, true); @@ -66,6 +71,7 @@ public enum Fluids { } }, GLASS(new Color(164, 164, 164), 2400, 10000) { + @Override public int getTemperature() { return 1200; @@ -82,6 +88,7 @@ public enum Fluids { } }, HONEY(new Color(255, 196, 35), 1420, 73600) { + @Override public String getTag() { return "for.honey"; @@ -109,12 +116,14 @@ public enum Fluids { } }, LEGACY_HONEY(new Color(255, 196, 35)) { + @Override public String getTag() { return "honey"; } }, ICE(new Color(175, 242, 255), 920, 1000) { + @Override public int getTemperature() { return 265; @@ -135,6 +144,7 @@ public enum Fluids { } }, JUICE(new Color(168, 201, 114)) { + @Override public Block makeBlock() { return new BlockForestryFluid(this); @@ -157,6 +167,7 @@ public enum Fluids { } }, MILK(new Color(255, 255, 255), 1030, 3000) { + @Override public Block makeBlock() { return new BlockForestryFluid(this); @@ -168,6 +179,7 @@ public enum Fluids { } }, SEEDOIL("SeedOil", new Color(255, 255, 168), 885, 5000) { + @Override public Block makeBlock() { return new BlockForestryFluid(this, 2, true); @@ -183,6 +195,7 @@ public enum Fluids { } }, SHORT_MEAD("ShortMead", new Color(239, 154, 56), 1000, 1200) { + @Override public String getTag() { return "short.mead"; @@ -203,6 +216,7 @@ public enum Fluids { } }, MEAD("Mead", new Color(202, 102, 0), 1000, 1200) { + @Override public String getTag() { return "mead"; @@ -224,12 +238,14 @@ public enum Fluids { }, // Vanilla WATER(new Color(0x2432ec)) { + @Override public EnumSet getContainerTypes() { return EnumSet.of(EnumContainerType.CAN, EnumContainerType.CAPSULE, EnumContainerType.REFRACTORY); } }, LAVA(new Color(0xfd461f)) { + @Override public EnumSet getContainerTypes() { return EnumSet.of(EnumContainerType.CAN, EnumContainerType.REFRACTORY); @@ -237,12 +253,14 @@ public enum Fluids { }, // BuildCraft FUEL(new Color(0xffff00)) { + @Override public EnumSet getContainerTypes() { return EnumSet.of(EnumContainerType.CAN, EnumContainerType.CAPSULE, EnumContainerType.REFRACTORY); } }, OIL(new Color(0x404040)) { + @Override public EnumSet getContainerTypes() { return EnumSet.of(EnumContainerType.CAN, EnumContainerType.CAPSULE, EnumContainerType.REFRACTORY); @@ -252,9 +270,8 @@ public enum Fluids { CREOSOTE(new Color(0x635c03)), STEAM(new Color(0x91938F)); - public static final Fluids[] forestryFluids = { - ETHANOL, BIOMASS, GLASS, HONEY, LEGACY_HONEY, ICE, JUICE, MILK, SEEDOIL, SHORT_MEAD, MEAD - }; + public static final Fluids[] forestryFluids = { ETHANOL, BIOMASS, GLASS, HONEY, LEGACY_HONEY, ICE, JUICE, MILK, + SEEDOIL, SHORT_MEAD, MEAD }; private static final Map tagToFluid = new HashMap<>(); diff --git a/src/main/java/forestry/core/fluids/ITankManager.java b/src/main/java/forestry/core/fluids/ITankManager.java index 220ae2376..e2540bc4c 100644 --- a/src/main/java/forestry/core/fluids/ITankManager.java +++ b/src/main/java/forestry/core/fluids/ITankManager.java @@ -1,16 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.fluids; import java.util.List; + import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; @@ -19,6 +18,7 @@ import net.minecraftforge.fluids.IFluidHandler; import net.minecraftforge.fluids.IFluidTank; public interface ITankManager extends IFluidHandler { + void containerAdded(Container container, ICrafting player); void updateGuiData(Container container, List crafters); diff --git a/src/main/java/forestry/core/fluids/ITankUpdateHandler.java b/src/main/java/forestry/core/fluids/ITankUpdateHandler.java index 4abcc3cc0..33561e50c 100644 --- a/src/main/java/forestry/core/fluids/ITankUpdateHandler.java +++ b/src/main/java/forestry/core/fluids/ITankUpdateHandler.java @@ -1,17 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.fluids; import forestry.core.fluids.tanks.StandardTank; public interface ITankUpdateHandler { + void updateTankLevels(StandardTank tank); } diff --git a/src/main/java/forestry/core/fluids/LiquidRegistryHelper.java b/src/main/java/forestry/core/fluids/LiquidRegistryHelper.java index 90f0e9e21..04523ac8c 100644 --- a/src/main/java/forestry/core/fluids/LiquidRegistryHelper.java +++ b/src/main/java/forestry/core/fluids/LiquidRegistryHelper.java @@ -1,21 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.fluids; -import forestry.core.config.Constants; -import forestry.core.items.EnumContainerType; -import forestry.core.items.ItemLiquidContainer; -import forestry.core.utils.Log; -import forestry.plugins.PluginFluids; import java.util.EnumMap; + import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemBucket; @@ -24,10 +18,16 @@ import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; import net.minecraftforge.fluids.FluidStack; +import forestry.core.config.Constants; +import forestry.core.items.EnumContainerType; +import forestry.core.items.ItemLiquidContainer; +import forestry.core.utils.Log; +import forestry.plugins.PluginFluids; + public class LiquidRegistryHelper { - private static final EnumMap emptyContainers = - new EnumMap<>(EnumContainerType.class); + private static final EnumMap emptyContainers = new EnumMap<>( + EnumContainerType.class); static { emptyContainers.put(EnumContainerType.CAN, PluginFluids.items.canEmpty); diff --git a/src/main/java/forestry/core/fluids/PipetteContents.java b/src/main/java/forestry/core/fluids/PipetteContents.java index d747ea7d8..e658ed526 100644 --- a/src/main/java/forestry/core/fluids/PipetteContents.java +++ b/src/main/java/forestry/core/fluids/PipetteContents.java @@ -1,21 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.fluids; -import forestry.api.core.INBTTagable; import java.util.List; + import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidStack; +import forestry.api.core.INBTTagable; + public class PipetteContents implements INBTTagable { + private FluidStack contents; public PipetteContents(NBTTagCompound nbttagcompound) { diff --git a/src/main/java/forestry/core/fluids/TankManager.java b/src/main/java/forestry/core/fluids/TankManager.java index 65e8905ac..d8431b9af 100644 --- a/src/main/java/forestry/core/fluids/TankManager.java +++ b/src/main/java/forestry/core/fluids/TankManager.java @@ -1,17 +1,36 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.fluids; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +import javax.annotation.Nonnull; + +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidTank; + import com.google.common.collect.HashBasedTable; import com.google.common.collect.Table; + import forestry.api.core.INBTTagable; import forestry.core.fluids.tanks.FakeTank; import forestry.core.fluids.tanks.StandardTank; @@ -26,23 +45,6 @@ import forestry.core.tiles.ILiquidTankTile; import forestry.core.tiles.IRenderableTile; import forestry.core.utils.NBTUtil; import forestry.core.utils.NBTUtil.NBTList; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import javax.annotation.Nonnull; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidTank; /** * @author CovertJaguar diff --git a/src/main/java/forestry/core/fluids/tanks/FakeTank.java b/src/main/java/forestry/core/fluids/tanks/FakeTank.java index 6afc442ae..9f844a455 100644 --- a/src/main/java/forestry/core/fluids/tanks/FakeTank.java +++ b/src/main/java/forestry/core/fluids/tanks/FakeTank.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.fluids.tanks; @@ -19,8 +17,8 @@ import net.minecraftforge.fluids.FluidTankInfo; public final class FakeTank extends StandardTank { public static final FakeTank INSTANCE = new FakeTank(); - public static final FakeTank[] ARRAY = new FakeTank[] {INSTANCE}; - public static final FluidTankInfo[] INFO = new FluidTankInfo[] {INSTANCE.getInfo()}; + public static final FakeTank[] ARRAY = new FakeTank[] { INSTANCE }; + public static final FluidTankInfo[] INFO = new FluidTankInfo[] { INSTANCE.getInfo() }; private FakeTank() { super(1); diff --git a/src/main/java/forestry/core/fluids/tanks/FilteredTank.java b/src/main/java/forestry/core/fluids/tanks/FilteredTank.java index dd163a31f..28142b54b 100644 --- a/src/main/java/forestry/core/fluids/tanks/FilteredTank.java +++ b/src/main/java/forestry/core/fluids/tanks/FilteredTank.java @@ -1,22 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.fluids.tanks; -import forestry.core.gui.tooltips.ToolTipLine; -import forestry.core.proxy.Proxies; -import forestry.core.utils.StringUtil; import java.util.Arrays; import java.util.Collection; import java.util.HashSet; import java.util.Set; + import net.minecraft.item.EnumRarity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumChatFormatting; @@ -24,6 +20,10 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; +import forestry.core.gui.tooltips.ToolTipLine; +import forestry.core.proxy.Proxies; +import forestry.core.utils.StringUtil; + /** * @author CovertJaguar */ @@ -87,8 +87,10 @@ public class FilteredTank extends StandardTank { rarity = EnumRarity.common; } FluidStack filterFluidStack = FluidRegistry.getFluidStack(fluidFilter.getName(), 0); - ToolTipLine name = - new ToolTipLine(fluidFilter.getLocalizedName(filterFluidStack), rarity.rarityColor, 2); + ToolTipLine name = new ToolTipLine( + fluidFilter.getLocalizedName(filterFluidStack), + rarity.rarityColor, + 2); toolTip.add(name); } } else { diff --git a/src/main/java/forestry/core/fluids/tanks/StandardTank.java b/src/main/java/forestry/core/fluids/tanks/StandardTank.java index 49267ecbb..60fac6038 100644 --- a/src/main/java/forestry/core/fluids/tanks/StandardTank.java +++ b/src/main/java/forestry/core/fluids/tanks/StandardTank.java @@ -1,15 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.fluids.tanks; +import java.io.IOException; +import java.util.Locale; + +import javax.annotation.Nonnull; + +import net.minecraft.item.EnumRarity; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTank; + import forestry.core.fluids.FakeTankUpdateHandler; import forestry.core.fluids.FluidHelper; import forestry.core.fluids.ITankUpdateHandler; @@ -19,19 +28,12 @@ import forestry.core.gui.tooltips.ToolTipLine; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IStreamable; -import java.io.IOException; -import java.util.Locale; -import javax.annotation.Nonnull; -import net.minecraft.item.EnumRarity; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTank; /** * @author CovertJaguar */ public class StandardTank extends FluidTank implements IStreamable { + // defines how the tank responds to IFluidHandler requests public enum TankMode { DEFAULT, @@ -213,6 +215,7 @@ public class StandardTank extends FluidTank implements IStreamable { } protected final ToolTip toolTip = new ToolTip() { + @Override public void refresh() { refreshTooltip(); diff --git a/src/main/java/forestry/core/genetics/Branch.java b/src/main/java/forestry/core/genetics/Branch.java index 57f186012..562f530f9 100755 --- a/src/main/java/forestry/core/genetics/Branch.java +++ b/src/main/java/forestry/core/genetics/Branch.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics; diff --git a/src/main/java/forestry/core/genetics/BreedingTracker.java b/src/main/java/forestry/core/genetics/BreedingTracker.java index c9500a7fe..b21aada2b 100755 --- a/src/main/java/forestry/core/genetics/BreedingTracker.java +++ b/src/main/java/forestry/core/genetics/BreedingTracker.java @@ -1,16 +1,32 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics; +import java.lang.ref.WeakReference; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; + +import javax.annotation.Nullable; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraft.world.WorldSavedData; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.FakePlayer; + import com.mojang.authlib.GameProfile; + import forestry.api.core.ForestryEvent; import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IAlleleSpecies; @@ -20,20 +36,6 @@ import forestry.api.genetics.IMutation; import forestry.api.genetics.ISpeciesRoot; import forestry.core.network.packets.PacketGenomeTrackerSync; import forestry.core.proxy.Proxies; -import java.lang.ref.WeakReference; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Set; -import javax.annotation.Nullable; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraft.world.WorldSavedData; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.FakePlayer; public abstract class BreedingTracker extends WorldSavedData implements IBreedingTracker { @@ -110,9 +112,7 @@ public abstract class BreedingTracker extends WorldSavedData implements IBreedin } } - private void syncToPlayer( - Collection discoveredSpecies, - Collection discoveredMutations, + private void syncToPlayer(Collection discoveredSpecies, Collection discoveredMutations, Collection researchedMutations) { World world = this.world != null ? this.world.get() : null; if (world != null && username != null && username.getName() != null) { @@ -158,11 +158,8 @@ public abstract class BreedingTracker extends WorldSavedData implements IBreedin writeToNBT(nbttagcompound, discoveredSpecies, discoveredMutations, researchedMutations); } - private void writeToNBT( - NBTTagCompound nbtTagCompound, - Collection discoveredSpecies, - Collection discoveredMutations, - Collection researchedMutations) { + private void writeToNBT(NBTTagCompound nbtTagCompound, Collection discoveredSpecies, + Collection discoveredMutations, Collection researchedMutations) { if (modeName != null && !modeName.isEmpty()) { nbtTagCompound.setString(MODE_NAME_KEY, modeName); } @@ -174,8 +171,8 @@ public abstract class BreedingTracker extends WorldSavedData implements IBreedin writeValuesToNBT(nbtTagCompound, researchedMutations, RESEARCHED_COUNT_KEY, RESEARCHED_KEY); } - private static void readValuesFromNBT( - NBTTagCompound nbttagcompound, Set values, String countKey, String key) { + private static void readValuesFromNBT(NBTTagCompound nbttagcompound, Set values, String countKey, + String key) { if (nbttagcompound.hasKey(countKey)) { final int count = nbttagcompound.getInteger(countKey); for (int i = 0; i < count; i++) { @@ -187,8 +184,8 @@ public abstract class BreedingTracker extends WorldSavedData implements IBreedin } } - private static void writeValuesToNBT( - NBTTagCompound nbttagcompound, Collection values, String countKey, String key) { + private static void writeValuesToNBT(NBTTagCompound nbttagcompound, Collection values, String countKey, + String key) { final int count = values.size(); nbttagcompound.setInteger(countKey, count); Iterator iterator = values.iterator(); diff --git a/src/main/java/forestry/core/genetics/Chromosome.java b/src/main/java/forestry/core/genetics/Chromosome.java index d9ad9e25e..e9c9d5901 100755 --- a/src/main/java/forestry/core/genetics/Chromosome.java +++ b/src/main/java/forestry/core/genetics/Chromosome.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics; +import java.util.Random; + +import net.minecraft.nbt.NBTTagCompound; + import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IAllele; import forestry.api.genetics.IChromosome; import forestry.core.utils.Log; -import java.util.Random; -import net.minecraft.nbt.NBTTagCompound; public class Chromosome implements IChromosome { diff --git a/src/main/java/forestry/core/genetics/Classification.java b/src/main/java/forestry/core/genetics/Classification.java index 14a5d0538..8cbb71ea9 100755 --- a/src/main/java/forestry/core/genetics/Classification.java +++ b/src/main/java/forestry/core/genetics/Classification.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics; +import java.util.ArrayList; +import java.util.Locale; + import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IAlleleSpecies; import forestry.api.genetics.IClassification; import forestry.core.utils.StringUtil; -import java.util.ArrayList; -import java.util.Locale; public class Classification implements IClassification { diff --git a/src/main/java/forestry/core/genetics/EffectData.java b/src/main/java/forestry/core/genetics/EffectData.java index a30084588..0de6801a3 100755 --- a/src/main/java/forestry/core/genetics/EffectData.java +++ b/src/main/java/forestry/core/genetics/EffectData.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics; -import forestry.api.genetics.IEffectData; import net.minecraft.nbt.NBTTagCompound; +import forestry.api.genetics.IEffectData; + public class EffectData implements IEffectData { private final int[] intData; diff --git a/src/main/java/forestry/core/genetics/GenericRatings.java b/src/main/java/forestry/core/genetics/GenericRatings.java index 1e9d7bd0e..763bbbccc 100755 --- a/src/main/java/forestry/core/genetics/GenericRatings.java +++ b/src/main/java/forestry/core/genetics/GenericRatings.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics; -import forestry.core.utils.StringUtil; import net.minecraft.util.StatCollector; +import forestry.core.utils.StringUtil; + public class GenericRatings { public static String rateMetabolism(int metabolism) { diff --git a/src/main/java/forestry/core/genetics/Genome.java b/src/main/java/forestry/core/genetics/Genome.java index 0db34997a..3620b8376 100755 --- a/src/main/java/forestry/core/genetics/Genome.java +++ b/src/main/java/forestry/core/genetics/Genome.java @@ -1,16 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Set; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; + import com.google.common.base.Objects; + import forestry.api.apiculture.EnumBeeChromosome; import forestry.api.genetics.IAllele; import forestry.api.genetics.IAlleleSpecies; @@ -20,12 +27,6 @@ import forestry.api.genetics.IGenome; import forestry.api.genetics.ISpeciesRoot; import forestry.api.lepidopterology.EnumButterflyChromosome; import forestry.core.config.Config; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; public abstract class Genome implements IGenome { @@ -54,7 +55,8 @@ public abstract class Genome implements IGenome { if (chromosomes == null || chromosomes.length != getDefaultTemplate().length) { String message = String.format( "Tried to create a genome for '%s' from an invalid chromosome template.\n%s", - getSpeciesRoot().getUID(), chromosomesToString(chromosomes)); + getSpeciesRoot().getUID(), + chromosomesToString(chromosomes)); throw new IllegalArgumentException(message); } @@ -70,7 +72,9 @@ public abstract class Genome implements IGenome { String message = String.format( "Tried to create a genome for '%s' from an invalid chromosome template. " + "Missing chromosome '%s'.\n%s", - getSpeciesRoot().getUID(), chromosomeType.getName(), chromosomesToString(chromosomes)); + getSpeciesRoot().getUID(), + chromosomeType.getName(), + chromosomesToString(chromosomes)); throw new IllegalArgumentException(message); } @@ -79,7 +83,9 @@ public abstract class Genome implements IGenome { String message = String.format( "Tried to create a genome for '%s' from an invalid chromosome template. " + "Missing primary allele for '%s'.\n%s", - getSpeciesRoot().getUID(), chromosomeType.getName(), chromosomesToString(chromosomes)); + getSpeciesRoot().getUID(), + chromosomeType.getName(), + chromosomesToString(chromosomes)); throw new IllegalArgumentException(message); } @@ -88,7 +94,9 @@ public abstract class Genome implements IGenome { String message = String.format( "Tried to create a genome for '%s' from an invalid chromosome template. " + "Missing secondary allele for '%s'.\n%s", - getSpeciesRoot().getUID(), chromosomeType.getName(), chromosomesToString(chromosomes)); + getSpeciesRoot().getUID(), + chromosomeType.getName(), + chromosomesToString(chromosomes)); throw new IllegalArgumentException(message); } @@ -97,7 +105,9 @@ public abstract class Genome implements IGenome { String message = String.format( "Tried to create a genome for '%s' from an invalid chromosome template. " + "Incorrect type for primary allele '%s'.\n%s.", - getSpeciesRoot().getUID(), chromosomeType.getName(), chromosomesToString(chromosomes)); + getSpeciesRoot().getUID(), + chromosomeType.getName(), + chromosomesToString(chromosomes)); throw new IllegalArgumentException(message); } @@ -105,7 +115,9 @@ public abstract class Genome implements IGenome { String message = String.format( "Tried to create a genome for '%s' from an invalid chromosome template. " + "Incorrect type for secondary allele '%s'.\n%s.", - getSpeciesRoot().getUID(), chromosomeType.getName(), chromosomesToString(chromosomes)); + getSpeciesRoot().getUID(), + chromosomeType.getName(), + chromosomesToString(chromosomes)); throw new IllegalArgumentException(message); } } @@ -124,11 +136,7 @@ public abstract class Genome implements IGenome { continue; } IChromosome chromosome = chromosomes[i]; - stringBuilder - .append(chromosomeType.getName()) - .append(": ") - .append(chromosome) - .append("\n"); + stringBuilder.append(chromosomeType.getName()).append(": ").append(chromosome).append("\n"); } return stringBuilder.toString(); @@ -141,8 +149,8 @@ public abstract class Genome implements IGenome { // NBT RETRIEVAL /** - * Quickly gets the species without loading the whole genome. - * We need this because the client uses the species for rendering. + * Quickly gets the species without loading the whole genome. We need this because the client uses the species for + * rendering. */ protected static IAlleleSpecies getSpeciesDirectly(ItemStack itemStack) { NBTTagCompound nbtTagCompound = itemStack.getTagCompound(); @@ -171,8 +179,8 @@ public abstract class Genome implements IGenome { return (IAlleleSpecies) activeAllele; } - private static IChromosome getChromosome( - ItemStack itemStack, IChromosomeType chromosomeType, ISpeciesRoot speciesRoot) { + private static IChromosome getChromosome(ItemStack itemStack, IChromosomeType chromosomeType, + ISpeciesRoot speciesRoot) { NBTTagCompound nbtTagCompound = itemStack.getTagCompound(); if (nbtTagCompound == null) { return null; @@ -206,24 +214,24 @@ public abstract class Genome implements IGenome { if (Config.clearInvalidChromosomes) { IAllele template = speciesRoot.getDefaultTemplate()[chromosomeOrdinal]; - Class chromosomeClass = - speciesRoot.getKaryotype()[chromosomeOrdinal].getAlleleClass(); + Class chromosomeClass = speciesRoot.getKaryotype()[chromosomeOrdinal] + .getAlleleClass(); if (chromosome.overrideInvalidAlleles(template, chromosomeClass)) { chromosome.writeToNBT(chromosomeNBT); } } if (chromosome.hasInvalidAlleles(speciesRoot.getKaryotype()[chromosomeOrdinal].getAlleleClass())) { - throw new RuntimeException("Found Chromosome with invalid Alleles.\nNBTTagCompound: " - + chromosomesNBT + "\nSee config option \"genetics.clear.invalid.chromosomes\".\nMissing: " - + chromosomeNBT); + throw new RuntimeException( + "Found Chromosome with invalid Alleles.\nNBTTagCompound: " + chromosomesNBT + + "\nSee config option \"genetics.clear.invalid.chromosomes\".\nMissing: " + + chromosomeNBT); } } } // handle old saves that have missing chromosomes - IChromosome speciesChromosome = - chromosomes[speciesRoot.getKaryotypeKey().ordinal()]; + IChromosome speciesChromosome = chromosomes[speciesRoot.getKaryotypeKey().ordinal()]; if (speciesChromosome != null) { IAlleleSpecies species = (IAlleleSpecies) speciesChromosome.getActiveAllele(); IAllele[] template = speciesRoot.getTemplate(species.getUID()); @@ -238,8 +246,8 @@ public abstract class Genome implements IGenome { return chromosomes; } - protected static IAllele getActiveAllele( - ItemStack itemStack, IChromosomeType chromosomeType, ISpeciesRoot speciesRoot) { + protected static IAllele getActiveAllele(ItemStack itemStack, IChromosomeType chromosomeType, + ISpeciesRoot speciesRoot) { IChromosome chromosome = getChromosome(itemStack, chromosomeType, speciesRoot); if (chromosome == null) { return null; @@ -301,16 +309,10 @@ public abstract class Genome implements IGenome { return false; } - if (!chromosome - .getPrimaryAllele() - .getUID() - .equals(otherChromosome.getPrimaryAllele().getUID())) { + if (!chromosome.getPrimaryAllele().getUID().equals(otherChromosome.getPrimaryAllele().getUID())) { return false; } - if (!chromosome - .getSecondaryAllele() - .getUID() - .equals(otherChromosome.getSecondaryAllele().getUID())) { + if (!chromosome.getSecondaryAllele().getUID().equals(otherChromosome.getSecondaryAllele().getUID())) { return false; } } diff --git a/src/main/java/forestry/core/genetics/IBranchDefinition.java b/src/main/java/forestry/core/genetics/IBranchDefinition.java index 9c8fcdd80..50b2efb21 100644 --- a/src/main/java/forestry/core/genetics/IBranchDefinition.java +++ b/src/main/java/forestry/core/genetics/IBranchDefinition.java @@ -4,6 +4,7 @@ import forestry.api.genetics.IAllele; import forestry.api.genetics.IClassification; public interface IBranchDefinition { + IAllele[] getTemplate(); IClassification getBranch(); diff --git a/src/main/java/forestry/core/genetics/Individual.java b/src/main/java/forestry/core/genetics/Individual.java index 6012eee3b..0028fd0ff 100755 --- a/src/main/java/forestry/core/genetics/Individual.java +++ b/src/main/java/forestry/core/genetics/Individual.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics; +import net.minecraft.nbt.NBTTagCompound; + import forestry.api.genetics.IChromosomeType; import forestry.api.genetics.IIndividual; -import net.minecraft.nbt.NBTTagCompound; public abstract class Individual implements IIndividual { @@ -77,9 +76,7 @@ public abstract class Individual implements IIndividual { @Override public boolean isPureBred(IChromosomeType chromosomeType) { - return getGenome() - .getActiveAllele(chromosomeType) - .getUID() + return getGenome().getActiveAllele(chromosomeType).getUID() .equals(getGenome().getInactiveAllele(chromosomeType).getUID()); } } diff --git a/src/main/java/forestry/core/genetics/IndividualLiving.java b/src/main/java/forestry/core/genetics/IndividualLiving.java index 5b580c290..3bbdd6ad0 100755 --- a/src/main/java/forestry/core/genetics/IndividualLiving.java +++ b/src/main/java/forestry/core/genetics/IndividualLiving.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics; -import forestry.api.genetics.IGenome; -import forestry.api.genetics.IIndividualLiving; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; +import forestry.api.genetics.IGenome; +import forestry.api.genetics.IIndividualLiving; + public abstract class IndividualLiving extends Individual implements IIndividualLiving { private int health; diff --git a/src/main/java/forestry/core/genetics/ItemGE.java b/src/main/java/forestry/core/genetics/ItemGE.java index 9de985d61..c793f20cc 100755 --- a/src/main/java/forestry/core/genetics/ItemGE.java +++ b/src/main/java/forestry/core/genetics/ItemGE.java @@ -1,15 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics; +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.ItemStack; +import net.minecraft.util.EnumChatFormatting; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.genetics.IAlleleSpecies; @@ -17,14 +23,9 @@ import forestry.api.genetics.IIndividual; import forestry.core.items.ItemForestry; import forestry.core.proxy.Proxies; import forestry.core.utils.StringUtil; -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.ItemStack; -import net.minecraft.util.EnumChatFormatting; public abstract class ItemGE extends ItemForestry { + protected ItemGE(CreativeTabs creativeTab) { super(creativeTab); hasSubtypes = true; @@ -59,7 +60,7 @@ public abstract class ItemGE extends ItemForestry { return species != null && species.hasEffect(); } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean flag) { if (!itemstack.hasTagCompound()) { diff --git a/src/main/java/forestry/core/genetics/ItemResearchNote.java b/src/main/java/forestry/core/genetics/ItemResearchNote.java index 7cbac7b77..846e624eb 100755 --- a/src/main/java/forestry/core/genetics/ItemResearchNote.java +++ b/src/main/java/forestry/core/genetics/ItemResearchNote.java @@ -1,31 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics; -import com.mojang.authlib.GameProfile; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.genetics.AlleleManager; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IAlleleSpecies; -import forestry.api.genetics.IBreedingTracker; -import forestry.api.genetics.IMutation; -import forestry.api.genetics.ISpeciesRoot; -import forestry.core.genetics.mutations.EnumMutateChance; -import forestry.core.items.ItemForestry; -import forestry.core.proxy.Proxies; -import forestry.core.utils.StringUtil; import java.util.ArrayList; import java.util.List; import java.util.Locale; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; @@ -38,9 +24,25 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IIcon; 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.genetics.AlleleManager; +import forestry.api.genetics.IAllele; +import forestry.api.genetics.IAlleleSpecies; +import forestry.api.genetics.IBreedingTracker; +import forestry.api.genetics.IMutation; +import forestry.api.genetics.ISpeciesRoot; +import forestry.core.genetics.mutations.EnumMutateChance; +import forestry.core.items.ItemForestry; +import forestry.core.proxy.Proxies; +import forestry.core.utils.StringUtil; + public class ItemResearchNote extends ItemForestry { public enum EnumNoteType { + NONE, MUTATION, SPECIES; @@ -92,29 +94,26 @@ public class ItemResearchNote extends ItemForestry { String species1 = encoded.getAllele0().getName(); String species2 = encoded.getAllele1().getName(); - String mutationChanceKey = EnumMutateChance.rateChance(encoded.getBaseChance()) - .toString() + String mutationChanceKey = EnumMutateChance.rateChance(encoded.getBaseChance()).toString() .toLowerCase(Locale.ENGLISH); String mutationChance = StringUtil.localize("researchNote.chance." + mutationChanceKey); - String speciesResult = - encoded.getTemplate()[root.getKaryotypeKey().ordinal()].getName(); + String speciesResult = encoded.getTemplate()[root.getKaryotypeKey().ordinal()].getName(); tooltips.add(StringUtil.localize("researchNote.discovery.0")); - tooltips.add(StringUtil.localize("researchNote.discovery.1") - .replace("%SPEC1", species1) - .replace("%SPEC2", species2)); + tooltips.add( + StringUtil.localize("researchNote.discovery.1").replace("%SPEC1", species1) + .replace("%SPEC2", species2)); tooltips.add(StringUtil.localizeAndFormat("researchNote.discovery.2", mutationChance)); tooltips.add(StringUtil.localizeAndFormat("researchNote.discovery.3", speciesResult)); - if (encoded.getSpecialConditions() != null - && encoded.getSpecialConditions().size() > 0) { + if (encoded.getSpecialConditions() != null && encoded.getSpecialConditions().size() > 0) { for (String line : encoded.getSpecialConditions()) { tooltips.add(EnumChatFormatting.GOLD + line); } } } else if (this == SPECIES) { - IAlleleSpecies allele0 = - (IAlleleSpecies) AlleleManager.alleleRegistry.getAllele(compound.getString("AL0")); + IAlleleSpecies allele0 = (IAlleleSpecies) AlleleManager.alleleRegistry + .getAllele(compound.getString("AL0")); if (allele0 == null) { return tooltips; } @@ -124,8 +123,11 @@ public class ItemResearchNote extends ItemForestry { } tooltips.add("researchNote.discovered.0"); - tooltips.add(StringUtil.localizeAndFormat( - "researchNote.discovered.1", allele0.getName(), allele0.getBinomial())); + tooltips.add( + StringUtil.localizeAndFormat( + "researchNote.discovered.1", + allele0.getName(), + allele0.getBinomial())); } return tooltips; @@ -155,8 +157,7 @@ public class ItemResearchNote extends ItemForestry { IAlleleSpecies species0 = encoded.getAllele0(); IAlleleSpecies species1 = encoded.getAllele1(); - IAlleleSpecies speciesResult = (IAlleleSpecies) - encoded.getTemplate()[root.getKaryotypeKey().ordinal()]; + IAlleleSpecies speciesResult = (IAlleleSpecies) encoded.getTemplate()[root.getKaryotypeKey().ordinal()]; tracker.registerSpecies(species0); tracker.registerSpecies(species1); @@ -165,11 +166,12 @@ public class ItemResearchNote extends ItemForestry { tracker.researchMutation(encoded); player.addChatMessage(new ChatComponentTranslation("for.chat.memorizednote")); - player.addChatMessage(new ChatComponentTranslation( - "for.chat.memorizednote2", - EnumChatFormatting.GRAY + species0.getName(), - EnumChatFormatting.GRAY + species1.getName(), - EnumChatFormatting.GREEN + speciesResult.getName())); + player.addChatMessage( + new ChatComponentTranslation( + "for.chat.memorizednote2", + EnumChatFormatting.GRAY + species0.getName(), + EnumChatFormatting.GRAY + species1.getName(), + EnumChatFormatting.GREEN + speciesResult.getName())); return true; } @@ -253,9 +255,9 @@ public class ItemResearchNote extends ItemForestry { public void addTooltip(List list) { ArrayList tooltips = type.getTooltip(inner); if (tooltips.size() <= 0) { - list.add(EnumChatFormatting.ITALIC - + EnumChatFormatting.RED.toString() - + StringUtil.localize("researchNote.error.0")); + list.add( + EnumChatFormatting.ITALIC + EnumChatFormatting.RED.toString() + + StringUtil.localize("researchNote.error.0")); list.add(StringUtil.localize("researchNote.error.1")); return; } @@ -285,7 +287,7 @@ public class ItemResearchNote extends ItemForestry { return StringUtil.localizeAndFormatRaw(getUnlocalizedName(itemstack) + ".name", researcherName); } - @SuppressWarnings({"unchecked", "rawtypes"}) + @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean flag) { ResearchNote note = new ResearchNote(itemstack.getTagCompound()); diff --git a/src/main/java/forestry/core/genetics/SpeciesRoot.java b/src/main/java/forestry/core/genetics/SpeciesRoot.java index ea0a0d395..14815fe1d 100644 --- a/src/main/java/forestry/core/genetics/SpeciesRoot.java +++ b/src/main/java/forestry/core/genetics/SpeciesRoot.java @@ -1,21 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IAlleleSpecies; -import forestry.api.genetics.IChromosome; -import forestry.api.genetics.IChromosomeType; -import forestry.api.genetics.IMutation; -import forestry.api.genetics.ISpeciesRoot; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -25,9 +17,17 @@ import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Random; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import forestry.api.genetics.IAllele; +import forestry.api.genetics.IAlleleSpecies; +import forestry.api.genetics.IChromosome; +import forestry.api.genetics.IChromosomeType; +import forestry.api.genetics.IMutation; +import forestry.api.genetics.ISpeciesRoot; + public abstract class SpeciesRoot implements ISpeciesRoot { /* RESEARCH */ @@ -93,8 +93,8 @@ public abstract class SpeciesRoot implements ISpeciesRoot { } @Override - public List getCombinations( - IAlleleSpecies parentSpecies0, IAlleleSpecies parentSpecies1, boolean shuffle) { + public List getCombinations(IAlleleSpecies parentSpecies0, IAlleleSpecies parentSpecies1, + boolean shuffle) { List combinations = new ArrayList<>(); String parentSpecies1UID = parentSpecies1.getUID(); diff --git a/src/main/java/forestry/core/genetics/alleles/Allele.java b/src/main/java/forestry/core/genetics/alleles/Allele.java index 6f8da66c3..5b6c8db78 100644 --- a/src/main/java/forestry/core/genetics/alleles/Allele.java +++ b/src/main/java/forestry/core/genetics/alleles/Allele.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics.alleles; -import forestry.api.genetics.IAllele; import net.minecraft.util.StatCollector; +import forestry.api.genetics.IAllele; + public abstract class Allele implements IAllele { private final String uid; diff --git a/src/main/java/forestry/core/genetics/alleles/AlleleArea.java b/src/main/java/forestry/core/genetics/alleles/AlleleArea.java index a7a95baff..384ad2b51 100644 --- a/src/main/java/forestry/core/genetics/alleles/AlleleArea.java +++ b/src/main/java/forestry/core/genetics/alleles/AlleleArea.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics.alleles; diff --git a/src/main/java/forestry/core/genetics/alleles/AlleleBoolean.java b/src/main/java/forestry/core/genetics/alleles/AlleleBoolean.java index 13d5dcaf9..b47a516d1 100644 --- a/src/main/java/forestry/core/genetics/alleles/AlleleBoolean.java +++ b/src/main/java/forestry/core/genetics/alleles/AlleleBoolean.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics.alleles; diff --git a/src/main/java/forestry/core/genetics/alleles/AlleleCategorized.java b/src/main/java/forestry/core/genetics/alleles/AlleleCategorized.java index 7a91079b9..dcb9bab0d 100644 --- a/src/main/java/forestry/core/genetics/alleles/AlleleCategorized.java +++ b/src/main/java/forestry/core/genetics/alleles/AlleleCategorized.java @@ -1,18 +1,18 @@ package forestry.core.genetics.alleles; import net.minecraft.util.StatCollector; + import org.apache.commons.lang3.text.WordUtils; /** - * Alleles that have a category with several values inherit from this class. - * For example, temperature tolerances or speeds are categories with several values. + * Alleles that have a category with several values inherit from this class. For example, temperature tolerances or + * speeds are categories with several values. * - * This class helps localization by allowing specific names like - * forestry.allele.speed.fast - * and can fall back on generic names like - * forestry.allele.fast + * This class helps localization by allowing specific names like forestry.allele.speed.fast and can fall back on generic + * names like forestry.allele.fast */ public abstract class AlleleCategorized extends Allele { + protected AlleleCategorized(String modId, String category, String valueName, boolean isDominant) { super(getUid(modId, category, valueName), getUnlocalizedName(modId, category, valueName), isDominant); } diff --git a/src/main/java/forestry/core/genetics/alleles/AlleleFactory.java b/src/main/java/forestry/core/genetics/alleles/AlleleFactory.java index 1717f8cad..6afddef91 100644 --- a/src/main/java/forestry/core/genetics/alleles/AlleleFactory.java +++ b/src/main/java/forestry/core/genetics/alleles/AlleleFactory.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics.alleles; @@ -24,12 +22,7 @@ import forestry.apiculture.genetics.alleles.AlleleFlowers; public class AlleleFactory implements IAlleleFactory { @Override - public IAlleleFloat createFloat( - String modId, - String category, - String valueName, - float value, - boolean isDominant, + public IAlleleFloat createFloat(String modId, String category, String valueName, float value, boolean isDominant, IChromosomeType... types) { IAlleleFloat alleleFloat = new AlleleFloat(modId, category, valueName, value, isDominant); AlleleManager.alleleRegistry.registerAllele(alleleFloat, types); @@ -37,45 +30,37 @@ public class AlleleFactory implements IAlleleFactory { } @Override - public IAlleleArea createArea( - String modId, - String category, - String valueName, - int xDimValue, - int yDimValue, - int zDimValue, - boolean isDominant, - IChromosomeType... types) { - IAlleleArea alleleArea = - new AlleleArea(modId, category, valueName, new int[] {xDimValue, yDimValue, zDimValue}, isDominant); + public IAlleleArea createArea(String modId, String category, String valueName, int xDimValue, int yDimValue, + int zDimValue, boolean isDominant, IChromosomeType... types) { + IAlleleArea alleleArea = new AlleleArea( + modId, + category, + valueName, + new int[] { xDimValue, yDimValue, zDimValue }, + isDominant); AlleleManager.alleleRegistry.registerAllele(alleleArea, types); return alleleArea; } @Override - public IAlleleInteger createInteger( - String modId, String category, String valueName, int value, boolean isDominant, IChromosomeType... types) { + public IAlleleInteger createInteger(String modId, String category, String valueName, int value, boolean isDominant, + IChromosomeType... types) { IAlleleInteger alleleInteger = new AlleleInteger(modId, category, valueName, value, isDominant); AlleleManager.alleleRegistry.registerAllele(alleleInteger, types); return alleleInteger; } @Override - public IAlleleBoolean createBoolean( - String modId, String category, boolean value, boolean isDominant, IChromosomeType... types) { + public IAlleleBoolean createBoolean(String modId, String category, boolean value, boolean isDominant, + IChromosomeType... types) { IAlleleBoolean alleleBoolean = new AlleleBoolean(modId, category, value, isDominant); AlleleManager.alleleRegistry.registerAllele(alleleBoolean, types); return alleleBoolean; } @Override - public IAlleleFlowers createFlowers( - String modId, - String category, - String valueName, - IFlowerProvider value, - boolean isDominant, - IChromosomeType... types) { + public IAlleleFlowers createFlowers(String modId, String category, String valueName, IFlowerProvider value, + boolean isDominant, IChromosomeType... types) { IAlleleFlowers alleleFlowers = new AlleleFlowers(modId, category, valueName, value, isDominant); AlleleManager.alleleRegistry.registerAllele(alleleFlowers, types); return alleleFlowers; @@ -89,16 +74,16 @@ public class AlleleFactory implements IAlleleFactory { } @Override - public IAlleleArea createArea( - String modId, String category, String name, int xDim, int yDim, int zDim, boolean isDominant) { - IAlleleArea alleleArea = new AlleleArea(modId, category, name, new int[] {xDim, yDim, zDim}, isDominant); + public IAlleleArea createArea(String modId, String category, String name, int xDim, int yDim, int zDim, + boolean isDominant) { + IAlleleArea alleleArea = new AlleleArea(modId, category, name, new int[] { xDim, yDim, zDim }, isDominant); AlleleManager.alleleRegistry.registerAllele(alleleArea); return alleleArea; } @Override - public IAlleleInteger createInteger( - String modId, String category, String valueName, int value, boolean isDominant) { + public IAlleleInteger createInteger(String modId, String category, String valueName, int value, + boolean isDominant) { IAlleleInteger alleleInteger = new AlleleInteger(modId, category, valueName, value, isDominant); AlleleManager.alleleRegistry.registerAllele(alleleInteger); return alleleInteger; @@ -112,8 +97,8 @@ public class AlleleFactory implements IAlleleFactory { } @Override - public IAlleleFlowers createFlowers( - String modId, String category, String name, IFlowerProvider flowerProvider, boolean isDominant) { + public IAlleleFlowers createFlowers(String modId, String category, String name, IFlowerProvider flowerProvider, + boolean isDominant) { IAlleleFlowers alleleFlowers = new AlleleFlowers(modId, category, name, flowerProvider, isDominant); AlleleManager.alleleRegistry.registerAllele(alleleFlowers); return alleleFlowers; diff --git a/src/main/java/forestry/core/genetics/alleles/AlleleFloat.java b/src/main/java/forestry/core/genetics/alleles/AlleleFloat.java index 26bad5777..f61f3b9c4 100644 --- a/src/main/java/forestry/core/genetics/alleles/AlleleFloat.java +++ b/src/main/java/forestry/core/genetics/alleles/AlleleFloat.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics.alleles; diff --git a/src/main/java/forestry/core/genetics/alleles/AlleleHelper.java b/src/main/java/forestry/core/genetics/alleles/AlleleHelper.java index 63e18ce1e..85a115701 100644 --- a/src/main/java/forestry/core/genetics/alleles/AlleleHelper.java +++ b/src/main/java/forestry/core/genetics/alleles/AlleleHelper.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics.alleles; +import java.util.EnumMap; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + import forestry.api.apiculture.EnumBeeChromosome; import forestry.api.arboriculture.EnumTreeChromosome; import forestry.api.genetics.AlleleManager; @@ -24,10 +27,6 @@ import forestry.apiculture.flowers.FlowerProvider; import forestry.core.config.Constants; import forestry.core.utils.vect.IVect; import forestry.plugins.PluginManager; -import java.util.EnumMap; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; public class AlleleHelper implements IAlleleHelper { @@ -46,7 +45,8 @@ public class AlleleHelper implements IAlleleHelper { createAlleles(EnumAllele.Territory.class, EnumBeeChromosome.TERRITORY, EnumTreeChromosome.TERRITORY); AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( - "forestry.territoryDefault", get(EnumAllele.Territory.AVERAGE)); + "forestry.territoryDefault", + get(EnumAllele.Territory.AVERAGE)); } if (PluginManager.Module.APICULTURE.isEnabled() || PluginManager.Module.LEPIDOPTEROLOGY.isEnabled()) { @@ -63,8 +63,8 @@ public class AlleleHelper implements IAlleleHelper { EnumBeeChromosome.FLOWER_PROVIDER, EnumButterflyChromosome.FLOWER_PROVIDER); - AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( - "forestry.speedNorm", get(EnumAllele.Speed.NORMAL)); + AlleleManager.alleleRegistry + .registerDeprecatedAlleleReplacement("forestry.speedNorm", get(EnumAllele.Speed.NORMAL)); } if (PluginManager.Module.ARBORICULTURE.isEnabled()) { @@ -75,30 +75,33 @@ public class AlleleHelper implements IAlleleHelper { createAlleles(EnumAllele.Maturation.class, EnumTreeChromosome.MATURATION); createAlleles(EnumAllele.Sappiness.class, EnumTreeChromosome.SAPPINESS); + AlleleManager.alleleRegistry + .registerDeprecatedAlleleReplacement("forestry.heightMax10", get(EnumAllele.Height.AVERAGE)); + AlleleManager.alleleRegistry + .registerDeprecatedAlleleReplacement("forestry.saplingsDefault", get(EnumAllele.Saplings.AVERAGE)); + AlleleManager.alleleRegistry + .registerDeprecatedAlleleReplacement("forestry.saplingsDouble", get(EnumAllele.Saplings.HIGH)); + AlleleManager.alleleRegistry + .registerDeprecatedAlleleReplacement("forestry.saplingsTriple", get(EnumAllele.Saplings.HIGHER)); + AlleleManager.alleleRegistry + .registerDeprecatedAlleleReplacement("forestry.yieldDefault", get(EnumAllele.Yield.AVERAGE)); AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( - "forestry.heightMax10", get(EnumAllele.Height.AVERAGE)); + "forestry.maturitySlowest", + get(EnumAllele.Maturation.SLOWEST)); + AlleleManager.alleleRegistry + .registerDeprecatedAlleleReplacement("forestry.maturitySlower", get(EnumAllele.Maturation.SLOWER)); + AlleleManager.alleleRegistry + .registerDeprecatedAlleleReplacement("forestry.maturitySlow", get(EnumAllele.Maturation.SLOW)); AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( - "forestry.saplingsDefault", get(EnumAllele.Saplings.AVERAGE)); + "forestry.maturityAverage", + get(EnumAllele.Maturation.AVERAGE)); + AlleleManager.alleleRegistry + .registerDeprecatedAlleleReplacement("forestry.maturityFast", get(EnumAllele.Maturation.FAST)); + AlleleManager.alleleRegistry + .registerDeprecatedAlleleReplacement("forestry.maturityFaster", get(EnumAllele.Maturation.FASTER)); AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( - "forestry.saplingsDouble", get(EnumAllele.Saplings.HIGH)); - AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( - "forestry.saplingsTriple", get(EnumAllele.Saplings.HIGHER)); - AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( - "forestry.yieldDefault", get(EnumAllele.Yield.AVERAGE)); - AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( - "forestry.maturitySlowest", get(EnumAllele.Maturation.SLOWEST)); - AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( - "forestry.maturitySlower", get(EnumAllele.Maturation.SLOWER)); - AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( - "forestry.maturitySlow", get(EnumAllele.Maturation.SLOW)); - AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( - "forestry.maturityAverage", get(EnumAllele.Maturation.AVERAGE)); - AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( - "forestry.maturityFast", get(EnumAllele.Maturation.FAST)); - AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( - "forestry.maturityFaster", get(EnumAllele.Maturation.FASTER)); - AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( - "forestry.maturityFastest", get(EnumAllele.Maturation.FASTEST)); + "forestry.maturityFastest", + get(EnumAllele.Maturation.FASTEST)); } if (PluginManager.Module.LEPIDOPTEROLOGY.isEnabled()) { @@ -158,11 +161,11 @@ public class AlleleHelper implements IAlleleHelper { } // uncomment this once all addon mods are using the allele registration with IChromosomeType - // Collection validTypes = AlleleManager.alleleRegistry.getChromosomeTypes(allele); - // if (validTypes.size() > 0 && !validTypes.contains(chromosomeType)) { - // throw new IllegalArgumentException("Allele can't applied to this Chromosome type. Expected: " + validTypes + // Collection validTypes = AlleleManager.alleleRegistry.getChromosomeTypes(allele); + // if (validTypes.size() > 0 && !validTypes.contains(chromosomeType)) { + // throw new IllegalArgumentException("Allele can't applied to this Chromosome type. Expected: " + validTypes // + " Got: " + chromosomeType); - // } + // } alleles[chromosomeType.ordinal()] = allele; } @@ -192,8 +195,8 @@ public class AlleleHelper implements IAlleleHelper { alleleMaps.put(enumClass, map); } - private static , V> IAllele createAllele( - String category, K enumValue, IChromosomeType... types) { + private static , V> IAllele createAllele(String category, K enumValue, + IChromosomeType... types) { V value = enumValue.getValue(); boolean isDominant = enumValue.isDominant(); String name = enumValue.toString().toLowerCase(Locale.ENGLISH); @@ -205,18 +208,22 @@ public class AlleleHelper implements IAlleleHelper { return AlleleManager.alleleFactory.createInteger(modId, category, name, (Integer) value, isDominant, types); } else if (IVect.class.isAssignableFrom(valueClass)) { IVect area = (IVect) value; - return AlleleManager.alleleFactory.createArea( - modId, category, name, area.getX(), area.getY(), area.getZ(), isDominant, types); + return AlleleManager.alleleFactory + .createArea(modId, category, name, area.getX(), area.getY(), area.getZ(), isDominant, types); } else if (Boolean.class.isAssignableFrom(valueClass)) { return AlleleManager.alleleFactory.createBoolean(modId, category, (Boolean) value, isDominant, types); } else if (EnumTolerance.class.isAssignableFrom(valueClass)) { - IAlleleTolerance alleleTolerance = - new AlleleTolerance(modId, category, name, (EnumTolerance) value, isDominant); + IAlleleTolerance alleleTolerance = new AlleleTolerance( + modId, + category, + name, + (EnumTolerance) value, + isDominant); AlleleManager.alleleRegistry.registerAllele(alleleTolerance, types); return alleleTolerance; } else if (FlowerProvider.class.isAssignableFrom(valueClass)) { - return AlleleManager.alleleFactory.createFlowers( - modId, category, name, (FlowerProvider) value, isDominant, types); + return AlleleManager.alleleFactory + .createFlowers(modId, category, name, (FlowerProvider) value, isDominant, types); } throw new RuntimeException("could not create allele for category: " + category + " and value " + valueClass); } diff --git a/src/main/java/forestry/core/genetics/alleles/AlleleInteger.java b/src/main/java/forestry/core/genetics/alleles/AlleleInteger.java index ca9989cdd..940631c3b 100644 --- a/src/main/java/forestry/core/genetics/alleles/AlleleInteger.java +++ b/src/main/java/forestry/core/genetics/alleles/AlleleInteger.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics.alleles; diff --git a/src/main/java/forestry/core/genetics/alleles/AllelePlantType.java b/src/main/java/forestry/core/genetics/alleles/AllelePlantType.java index a41f0acc3..860aac686 100644 --- a/src/main/java/forestry/core/genetics/alleles/AllelePlantType.java +++ b/src/main/java/forestry/core/genetics/alleles/AllelePlantType.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics.alleles; -import forestry.api.arboriculture.EnumTreeChromosome; -import forestry.api.genetics.AlleleManager; -import forestry.api.genetics.IAllelePlantType; import java.util.Arrays; import java.util.EnumSet; import java.util.List; import java.util.Locale; + import net.minecraftforge.common.EnumPlantType; +import forestry.api.arboriculture.EnumTreeChromosome; +import forestry.api.genetics.AlleleManager; +import forestry.api.genetics.IAllelePlantType; + public class AllelePlantType extends AlleleCategorized implements IAllelePlantType { public static IAllelePlantType plantTypeNone; diff --git a/src/main/java/forestry/core/genetics/alleles/AlleleRegistry.java b/src/main/java/forestry/core/genetics/alleles/AlleleRegistry.java index 3c99c7a3b..dab0459e7 100644 --- a/src/main/java/forestry/core/genetics/alleles/AlleleRegistry.java +++ b/src/main/java/forestry/core/genetics/alleles/AlleleRegistry.java @@ -1,17 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics.alleles; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.Map; + +import net.minecraft.item.ItemStack; + import com.google.common.collect.HashMultimap; import com.mojang.authlib.GameProfile; + import forestry.api.genetics.IAllele; import forestry.api.genetics.IAlleleHandler; import forestry.api.genetics.IAlleleRegistry; @@ -26,13 +34,6 @@ import forestry.api.genetics.ISpeciesRoot; import forestry.core.genetics.Classification; import forestry.core.genetics.ItemResearchNote.EnumNoteType; import forestry.plugins.PluginCore; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.Map; -import net.minecraft.item.ItemStack; public class AlleleRegistry implements IAlleleRegistry { @@ -162,8 +163,11 @@ public class AlleleRegistry implements IAlleleRegistry { public void registerAllele(IAllele allele, IChromosomeType... chromosomeTypes) { for (IChromosomeType chromosomeType : chromosomeTypes) { if (!chromosomeType.getAlleleClass().isAssignableFrom(allele.getClass())) { - throw new IllegalArgumentException("Allele class (" + allele.getClass() - + ") does not match chromosome type (" + chromosomeType.getAlleleClass() + ")."); + throw new IllegalArgumentException( + "Allele class (" + allele.getClass() + + ") does not match chromosome type (" + + chromosomeType.getAlleleClass() + + ")."); } allelesByType.put(chromosomeType, allele); typesByAllele.put(allele, chromosomeType); @@ -206,9 +210,11 @@ public class AlleleRegistry implements IAlleleRegistry { public void registerClassification(IClassification branch) { if (classificationMap.containsKey(branch.getUID())) { - throw new RuntimeException(String.format( - "Could not add new classification '%s', because the key is already taken by %s.", - branch.getUID(), classificationMap.get(branch.getUID()))); + throw new RuntimeException( + String.format( + "Could not add new classification '%s', because the key is already taken by %s.", + branch.getUID(), + classificationMap.get(branch.getUID()))); } classificationMap.put(branch.getUID(), branch); @@ -228,8 +234,8 @@ public class AlleleRegistry implements IAlleleRegistry { } @Override - public IClassification createAndRegisterClassification( - EnumClassLevel level, String uid, String scientific, IClassification... members) { + public IClassification createAndRegisterClassification(EnumClassLevel level, String uid, String scientific, + IClassification... members) { IClassification classification = new Classification(level, uid, scientific); for (IClassification member : members) { classification.addMemberGroup(member); diff --git a/src/main/java/forestry/core/genetics/alleles/AlleleSpecies.java b/src/main/java/forestry/core/genetics/alleles/AlleleSpecies.java index 73e01c50e..bb6066c33 100644 --- a/src/main/java/forestry/core/genetics/alleles/AlleleSpecies.java +++ b/src/main/java/forestry/core/genetics/alleles/AlleleSpecies.java @@ -1,16 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics.alleles; +import java.util.Collection; +import java.util.Map; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; +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; @@ -25,14 +32,9 @@ import forestry.apiculture.items.ItemRegistryApiculture; import forestry.core.utils.GeneticsUtil; import forestry.core.utils.ItemStackUtil; import forestry.plugins.PluginApiculture; -import java.util.Collection; -import java.util.Map; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; public abstract class AlleleSpecies extends Allele implements IAlleleSpeciesCustom { + private final String binomial; private final String authority; private final String description; @@ -44,14 +46,8 @@ public abstract class AlleleSpecies extends Allele implements IAlleleSpeciesCust private EnumTemperature climate = EnumTemperature.NORMAL; private EnumHumidity humidity = EnumHumidity.NORMAL; - protected AlleleSpecies( - String uid, - String unlocalizedName, - String authority, - String unlocalizedDescription, - boolean isDominant, - IClassification branch, - String binomial) { + protected AlleleSpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, + boolean isDominant, IClassification branch, String binomial) { super(uid, unlocalizedName, isDominant); this.branch = branch; @@ -87,8 +83,7 @@ public abstract class AlleleSpecies extends Allele implements IAlleleSpeciesCust return 1.0f; } - for (Map.Entry entry : - getRoot().getResearchCatalysts().entrySet()) { + for (Map.Entry entry : getRoot().getResearchCatalysts().entrySet()) { if (ItemStackUtil.isIdenticalItem(entry.getKey(), itemstack)) { return entry.getValue(); } @@ -109,13 +104,13 @@ public abstract class AlleleSpecies extends Allele implements IAlleleSpeciesCust Collection combinations = getRoot().getCombinations(this); if (combinations.size() > 0) { IMutation[] candidates = combinations.toArray(new IMutation[combinations.size()]); - research = AlleleManager.alleleRegistry.getMutationNoteStack( - researcher, candidates[world.rand.nextInt(candidates.length)]); + research = AlleleManager.alleleRegistry + .getMutationNoteStack(researcher, candidates[world.rand.nextInt(candidates.length)]); } } if (research != null) { - return new ItemStack[] {research}; + return new ItemStack[] { research }; } else { return ItemStackUtil.EMPTY_STACK_ARRAY; } diff --git a/src/main/java/forestry/core/genetics/alleles/AlleleTolerance.java b/src/main/java/forestry/core/genetics/alleles/AlleleTolerance.java index 089c4372b..b823fa441 100644 --- a/src/main/java/forestry/core/genetics/alleles/AlleleTolerance.java +++ b/src/main/java/forestry/core/genetics/alleles/AlleleTolerance.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics.alleles; diff --git a/src/main/java/forestry/core/genetics/alleles/EnumAllele.java b/src/main/java/forestry/core/genetics/alleles/EnumAllele.java index 8186bb19f..c02d86fad 100644 --- a/src/main/java/forestry/core/genetics/alleles/EnumAllele.java +++ b/src/main/java/forestry/core/genetics/alleles/EnumAllele.java @@ -1,14 +1,17 @@ package forestry.core.genetics.alleles; +import java.util.Locale; + import forestry.api.apiculture.FlowerManager; import forestry.api.genetics.EnumTolerance; import forestry.apiculture.flowers.FlowerProvider; import forestry.core.utils.vect.IVect; import forestry.core.utils.vect.Vect; -import java.util.Locale; public class EnumAllele { + public enum Fertility implements IAlleleValue { + LOW(1, true), NORMAL(2, true), HIGH(3), @@ -38,6 +41,7 @@ public class EnumAllele { } public enum Fireproof implements IAlleleValue { + TRUE(true), FALSE(false); @@ -65,6 +69,7 @@ public class EnumAllele { } public enum Flowering implements IAlleleValue { + SLOWEST(5, true), SLOWER(10), SLOW(15), @@ -98,6 +103,7 @@ public class EnumAllele { } public enum Flowers implements IAlleleValue { + VANILLA(FlowerManager.FlowerTypeVanilla, true), NETHER(FlowerManager.FlowerTypeNether), CACTI(FlowerManager.FlowerTypeCacti), @@ -133,6 +139,7 @@ public class EnumAllele { } public enum Height implements IAlleleValue { + SMALLEST(0.25f), SMALLER(0.5f), SMALL(0.75f), @@ -166,6 +173,7 @@ public class EnumAllele { } public enum Lifespan implements IAlleleValue { + SHORTEST(10), SHORTER(20, true), SHORT(30, true), @@ -200,6 +208,7 @@ public class EnumAllele { } public enum Maturation implements IAlleleValue { + SLOWEST(10, true), SLOWER(7), SLOW(5, true), @@ -232,6 +241,7 @@ public class EnumAllele { } public enum Saplings implements IAlleleValue { + LOWEST(0.01f, true), LOWER(0.025f, true), LOW(0.035f, true), @@ -264,6 +274,7 @@ public class EnumAllele { } public enum Sappiness implements IAlleleValue { + LOWEST(0.1f, true), LOWER(0.2f, true), LOW(0.3f, true), @@ -296,6 +307,7 @@ public class EnumAllele { } public enum Size implements IAlleleValue { + SMALLEST(0.3f), SMALLER(0.4f), SMALL(0.5f), @@ -328,6 +340,7 @@ public class EnumAllele { } public enum Speed implements IAlleleValue { + SLOWEST(0.3f, true), SLOWER(0.6f, true), SLOW(0.8f, true), @@ -360,6 +373,7 @@ public class EnumAllele { } public enum Territory implements IAlleleValue { + AVERAGE(9, 6, 9), LARGE(11, 8, 11), LARGER(13, 12, 13), @@ -389,6 +403,7 @@ public class EnumAllele { } public enum Tolerance implements IAlleleValue { + NONE, BOTH_1(true), BOTH_2, @@ -435,6 +450,7 @@ public class EnumAllele { } public enum Yield implements IAlleleValue { + LOWEST(0.025f, true), LOWER(0.05f, true), LOW(0.1f, true), diff --git a/src/main/java/forestry/core/genetics/alleles/IAlleleHelper.java b/src/main/java/forestry/core/genetics/alleles/IAlleleHelper.java index 4f149a2ff..6322e7bbb 100644 --- a/src/main/java/forestry/core/genetics/alleles/IAlleleHelper.java +++ b/src/main/java/forestry/core/genetics/alleles/IAlleleHelper.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics.alleles; diff --git a/src/main/java/forestry/core/genetics/alleles/IAlleleValue.java b/src/main/java/forestry/core/genetics/alleles/IAlleleValue.java index b7596f17f..a79d5d836 100644 --- a/src/main/java/forestry/core/genetics/alleles/IAlleleValue.java +++ b/src/main/java/forestry/core/genetics/alleles/IAlleleValue.java @@ -1,6 +1,7 @@ package forestry.core.genetics.alleles; public interface IAlleleValue { + boolean isDominant(); V getValue(); diff --git a/src/main/java/forestry/core/genetics/mutations/EnumMutateChance.java b/src/main/java/forestry/core/genetics/mutations/EnumMutateChance.java index c23df6a89..5bb83f0ed 100644 --- a/src/main/java/forestry/core/genetics/mutations/EnumMutateChance.java +++ b/src/main/java/forestry/core/genetics/mutations/EnumMutateChance.java @@ -1,16 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics.mutations; public enum EnumMutateChance { + NONE(0xffffff), LOWEST(0xffba77), LOW(0xfffd77), diff --git a/src/main/java/forestry/core/genetics/mutations/Mutation.java b/src/main/java/forestry/core/genetics/mutations/Mutation.java index 2a218a7d6..68a9628cb 100644 --- a/src/main/java/forestry/core/genetics/mutations/Mutation.java +++ b/src/main/java/forestry/core/genetics/mutations/Mutation.java @@ -1,15 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics.mutations; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.world.World; +import net.minecraftforge.common.BiomeDictionary; + import forestry.api.core.EnumHumidity; import forestry.api.core.EnumTemperature; import forestry.api.core.IClimateProvider; @@ -18,12 +24,6 @@ import forestry.api.genetics.IAlleleSpecies; import forestry.api.genetics.IGenome; import forestry.api.genetics.IMutationCondition; import forestry.api.genetics.IMutationCustom; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.world.World; -import net.minecraftforge.common.BiomeDictionary; public abstract class Mutation implements IMutationCustom { @@ -122,16 +122,8 @@ public abstract class Mutation implements IMutationCustom { return this; } - protected float getChance( - World world, - int x, - int y, - int z, - IAllele allele0, - IAllele allele1, - IGenome genome0, - IGenome genome1, - IClimateProvider climate) { + protected float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, + IGenome genome1, IClimateProvider climate) { float mutationChance = chance; for (IMutationCondition mutationCondition : mutationConditions) { mutationChance *= mutationCondition.getChance(world, x, y, z, allele0, allele1, genome0, genome1, climate); diff --git a/src/main/java/forestry/core/genetics/mutations/MutationConditionBiome.java b/src/main/java/forestry/core/genetics/mutations/MutationConditionBiome.java index 7a5599ba0..f9c3b06fc 100644 --- a/src/main/java/forestry/core/genetics/mutations/MutationConditionBiome.java +++ b/src/main/java/forestry/core/genetics/mutations/MutationConditionBiome.java @@ -1,26 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics.mutations; +import java.util.Arrays; +import java.util.List; +import java.util.Locale; + +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.BiomeDictionary; + import forestry.api.core.IClimateProvider; import forestry.api.genetics.IAllele; import forestry.api.genetics.IGenome; import forestry.api.genetics.IMutationCondition; import forestry.core.utils.StringUtil; -import java.util.Arrays; -import java.util.List; -import java.util.Locale; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary; public class MutationConditionBiome implements IMutationCondition { @@ -31,16 +31,8 @@ public class MutationConditionBiome implements IMutationCondition { } @Override - public float getChance( - World world, - int x, - int y, - int z, - IAllele allele0, - IAllele allele1, - IGenome genome0, - IGenome genome1, - IClimateProvider climate) { + public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, + IGenome genome1, IClimateProvider climate) { BiomeGenBase biome = climate.getBiome(); for (BiomeDictionary.Type type : validBiomeTypes) { if (BiomeDictionary.isBiomeOfType(biome, type)) { diff --git a/src/main/java/forestry/core/genetics/mutations/MutationConditionDaytime.java b/src/main/java/forestry/core/genetics/mutations/MutationConditionDaytime.java index 8f4e6362b..f3606413a 100644 --- a/src/main/java/forestry/core/genetics/mutations/MutationConditionDaytime.java +++ b/src/main/java/forestry/core/genetics/mutations/MutationConditionDaytime.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics.mutations; +import net.minecraft.world.World; + import forestry.api.core.IClimateProvider; import forestry.api.genetics.IAllele; import forestry.api.genetics.IGenome; import forestry.api.genetics.IMutationCondition; import forestry.core.utils.StringUtil; -import net.minecraft.world.World; public class MutationConditionDaytime implements IMutationCondition { @@ -26,16 +25,8 @@ public class MutationConditionDaytime implements IMutationCondition { } @Override - public float getChance( - World world, - int x, - int y, - int z, - IAllele allele0, - IAllele allele1, - IGenome genome0, - IGenome genome1, - IClimateProvider climate) { + public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, + IGenome genome1, IClimateProvider climate) { if (world.isDaytime() == daytime) { return 1; } diff --git a/src/main/java/forestry/core/genetics/mutations/MutationConditionHumidity.java b/src/main/java/forestry/core/genetics/mutations/MutationConditionHumidity.java index c9bcf969e..16f8f4127 100644 --- a/src/main/java/forestry/core/genetics/mutations/MutationConditionHumidity.java +++ b/src/main/java/forestry/core/genetics/mutations/MutationConditionHumidity.java @@ -1,15 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics.mutations; +import net.minecraft.world.World; + import forestry.api.core.EnumHumidity; import forestry.api.core.IClimateProvider; import forestry.api.genetics.AlleleManager; @@ -17,9 +17,9 @@ import forestry.api.genetics.IAllele; import forestry.api.genetics.IGenome; import forestry.api.genetics.IMutationCondition; import forestry.core.utils.StringUtil; -import net.minecraft.world.World; public class MutationConditionHumidity implements IMutationCondition { + private final EnumHumidity minHumidity; private final EnumHumidity maxHumidity; @@ -29,16 +29,8 @@ public class MutationConditionHumidity implements IMutationCondition { } @Override - public float getChance( - World world, - int x, - int y, - int z, - IAllele allele0, - IAllele allele1, - IGenome genome0, - IGenome genome1, - IClimateProvider climate) { + public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, + IGenome genome1, IClimateProvider climate) { EnumHumidity biomeHumidity = climate.getHumidity(); if (biomeHumidity.ordinal() < minHumidity.ordinal() || biomeHumidity.ordinal() > maxHumidity.ordinal()) { @@ -53,8 +45,7 @@ public class MutationConditionHumidity implements IMutationCondition { if (minHumidity != maxHumidity) { String maxHumidityString = AlleleManager.climateHelper.toDisplay(maxHumidity); - return StringUtil.localize("mutation.condition.humidity.range") - .replace("%LOW", minHumidityString) + return StringUtil.localize("mutation.condition.humidity.range").replace("%LOW", minHumidityString) .replace("%HIGH", maxHumidityString); } else { return StringUtil.localizeAndFormat("mutation.condition.humidity.single", minHumidityString); diff --git a/src/main/java/forestry/core/genetics/mutations/MutationConditionRequiresResource.java b/src/main/java/forestry/core/genetics/mutations/MutationConditionRequiresResource.java index 72cc73045..17b0c8707 100644 --- a/src/main/java/forestry/core/genetics/mutations/MutationConditionRequiresResource.java +++ b/src/main/java/forestry/core/genetics/mutations/MutationConditionRequiresResource.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics.mutations; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + import forestry.api.apiculture.IBeeHousing; import forestry.api.core.IClimateProvider; import forestry.api.genetics.IAllele; @@ -18,10 +21,6 @@ import forestry.api.genetics.IMutationCondition; import forestry.core.utils.BlockUtil; import forestry.core.utils.InventoryUtil; import forestry.core.utils.StringUtil; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; // import forestry.core.utils.ItemStackUtil; @@ -34,32 +33,15 @@ public class MutationConditionRequiresResource implements IMutationCondition { } @Override - public float getChance( - World world, - int x, - int y, - int z, - IAllele allele0, - IAllele allele1, - IGenome genome0, - IGenome genome1, - IClimateProvider climate) { + public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, + IGenome genome1, IClimateProvider climate) { /* - Block block; - TileEntity tile; - int meta; - int i = 1; - do { - block = world.getBlock(x, y - i, z); - meta = world.getBlockMetadata(x, y - i, z); - tile = world.getTileEntity(x, y - i, z); - i++; - } while (tile instanceof IBeeHousing); - - return ItemStackUtil.equals(block, meta, blockRequired) ? 1 : 0; - */ - ItemStack stk = BlockUtil.getItemStackFromBlockBelow( - world, x, y, z, (TileEntity tile) -> (tile instanceof IBeeHousing)); + * Block block; TileEntity tile; int meta; int i = 1; do { block = world.getBlock(x, y - i, z); meta = + * world.getBlockMetadata(x, y - i, z); tile = world.getTileEntity(x, y - i, z); i++; } while (tile instanceof + * IBeeHousing); return ItemStackUtil.equals(block, meta, blockRequired) ? 1 : 0; + */ + ItemStack stk = BlockUtil + .getItemStackFromBlockBelow(world, x, y, z, (TileEntity tile) -> (tile instanceof IBeeHousing)); return InventoryUtil.isItemEqual(blockRequired, stk, true, true) ? 1 : 0; } diff --git a/src/main/java/forestry/core/genetics/mutations/MutationConditionRequiresResourceOreDict.java b/src/main/java/forestry/core/genetics/mutations/MutationConditionRequiresResourceOreDict.java index 57bb31fb2..69dae88f4 100644 --- a/src/main/java/forestry/core/genetics/mutations/MutationConditionRequiresResourceOreDict.java +++ b/src/main/java/forestry/core/genetics/mutations/MutationConditionRequiresResourceOreDict.java @@ -1,15 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics.mutations; +import java.util.ArrayList; + +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; + import forestry.api.apiculture.IBeeHousing; import forestry.api.core.IClimateProvider; import forestry.api.genetics.IAllele; @@ -17,11 +22,6 @@ import forestry.api.genetics.IGenome; import forestry.api.genetics.IMutationCondition; import forestry.core.utils.BlockUtil; import forestry.core.utils.StringUtil; -import java.util.ArrayList; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.oredict.OreDictionary; public class MutationConditionRequiresResourceOreDict implements IMutationCondition { @@ -40,30 +40,15 @@ public class MutationConditionRequiresResourceOreDict implements IMutationCondit } @Override - public float getChance( - World world, - int x, - int y, - int z, - IAllele allele0, - IAllele allele1, - IGenome genome0, - IGenome genome1, - IClimateProvider climate) { + public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, + IGenome genome1, IClimateProvider climate) { /* - Block block; - int meta; - TileEntity tile; - int i = 1; - do { - block = world.getBlock(x, y - i, z); - meta = world.getBlockMetadata(x, y - i, z); - tile = world.getTileEntity(x, y-i, z); - i++; - } while (tile instanceof IBeeHousing); - */ - ItemStack stk = BlockUtil.getItemStackFromBlockBelow( - world, x, y, z, (TileEntity tile) -> (tile instanceof IBeeHousing)); + * Block block; int meta; TileEntity tile; int i = 1; do { block = world.getBlock(x, y - i, z); meta = + * world.getBlockMetadata(x, y - i, z); tile = world.getTileEntity(x, y-i, z); i++; } while (tile instanceof + * IBeeHousing); + */ + ItemStack stk = BlockUtil + .getItemStackFromBlockBelow(world, x, y, z, (TileEntity tile) -> (tile instanceof IBeeHousing)); int[] oreIds = OreDictionary.getOreIDs(stk); for (int oreId : oreIds) if (oreId == this.oreDictId) return 1f; return 0f; diff --git a/src/main/java/forestry/core/genetics/mutations/MutationConditionTemperature.java b/src/main/java/forestry/core/genetics/mutations/MutationConditionTemperature.java index 581386efb..3632d7416 100644 --- a/src/main/java/forestry/core/genetics/mutations/MutationConditionTemperature.java +++ b/src/main/java/forestry/core/genetics/mutations/MutationConditionTemperature.java @@ -1,15 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics.mutations; +import net.minecraft.world.World; + import forestry.api.core.EnumTemperature; import forestry.api.core.IClimateProvider; import forestry.api.genetics.AlleleManager; @@ -17,7 +17,6 @@ import forestry.api.genetics.IAllele; import forestry.api.genetics.IGenome; import forestry.api.genetics.IMutationCondition; import forestry.core.utils.StringUtil; -import net.minecraft.world.World; public class MutationConditionTemperature implements IMutationCondition { @@ -30,16 +29,8 @@ public class MutationConditionTemperature implements IMutationCondition { } @Override - public float getChance( - World world, - int x, - int y, - int z, - IAllele allele0, - IAllele allele1, - IGenome genome0, - IGenome genome1, - IClimateProvider climate) { + public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, + IGenome genome1, IClimateProvider climate) { EnumTemperature biomeTemperature = climate.getTemperature(); if (biomeTemperature.ordinal() < minTemperature.ordinal() @@ -55,8 +46,7 @@ public class MutationConditionTemperature implements IMutationCondition { if (minTemperature != maxTemperature) { String maxString = AlleleManager.climateHelper.toDisplay(maxTemperature); - return StringUtil.localize("mutation.condition.temperature.range") - .replace("%LOW", minString) + return StringUtil.localize("mutation.condition.temperature.range").replace("%LOW", minString) .replace("%HIGH", maxString); } else { return StringUtil.localizeAndFormat("mutation.condition.temperature.single", minString); diff --git a/src/main/java/forestry/core/genetics/mutations/MutationConditionTimeLimited.java b/src/main/java/forestry/core/genetics/mutations/MutationConditionTimeLimited.java index 3658302d0..08c41b7d8 100644 --- a/src/main/java/forestry/core/genetics/mutations/MutationConditionTimeLimited.java +++ b/src/main/java/forestry/core/genetics/mutations/MutationConditionTimeLimited.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.genetics.mutations; +import java.util.Calendar; + +import net.minecraft.world.World; + import forestry.api.core.IClimateProvider; import forestry.api.genetics.IAllele; import forestry.api.genetics.IGenome; import forestry.api.genetics.IMutationCondition; import forestry.core.utils.DayMonth; import forestry.core.utils.StringUtil; -import java.util.Calendar; -import net.minecraft.world.World; public class MutationConditionTimeLimited implements IMutationCondition { @@ -30,16 +30,8 @@ public class MutationConditionTimeLimited implements IMutationCondition { } @Override - public float getChance( - World world, - int x, - int y, - int z, - IAllele allele0, - IAllele allele1, - IGenome genome0, - IGenome genome1, - IClimateProvider climate) { + public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, + IGenome genome1, IClimateProvider climate) { DayMonth now = new DayMonth(); // If we are equal to start day, return 1. @@ -65,8 +57,7 @@ public class MutationConditionTimeLimited implements IMutationCondition { @Override public String getDescription() { - return StringUtil.localize("mutation.condition.date") - .replace("%START", start.toString()) + return StringUtil.localize("mutation.condition.date").replace("%START", start.toString()) .replace("%END", end.toString()); } } diff --git a/src/main/java/forestry/core/gui/ContainerAlyzer.java b/src/main/java/forestry/core/gui/ContainerAlyzer.java index 5c724e39b..a47c6b018 100644 --- a/src/main/java/forestry/core/gui/ContainerAlyzer.java +++ b/src/main/java/forestry/core/gui/ContainerAlyzer.java @@ -1,8 +1,9 @@ package forestry.core.gui; +import net.minecraft.entity.player.EntityPlayer; + import forestry.core.gui.slots.SlotFiltered; import forestry.core.inventory.ItemInventoryAlyzer; -import net.minecraft.entity.player.EntityPlayer; public class ContainerAlyzer extends ContainerItemInventory { diff --git a/src/main/java/forestry/core/gui/ContainerAnalyzer.java b/src/main/java/forestry/core/gui/ContainerAnalyzer.java index b29d6599f..852a4606b 100755 --- a/src/main/java/forestry/core/gui/ContainerAnalyzer.java +++ b/src/main/java/forestry/core/gui/ContainerAnalyzer.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.core.gui.slots.SlotFiltered; import forestry.core.gui.slots.SlotOutput; import forestry.core.gui.slots.SlotWorking; import forestry.core.inventory.InventoryAnalyzer; import forestry.core.tiles.TileAnalyzer; -import net.minecraft.entity.player.InventoryPlayer; public class ContainerAnalyzer extends ContainerLiquidTanks { diff --git a/src/main/java/forestry/core/gui/ContainerDummy.java b/src/main/java/forestry/core/gui/ContainerDummy.java index 4460509bd..92eade15b 100755 --- a/src/main/java/forestry/core/gui/ContainerDummy.java +++ b/src/main/java/forestry/core/gui/ContainerDummy.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui; @@ -14,6 +12,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; public class ContainerDummy extends Container { + public static final ContainerDummy instance = new ContainerDummy(); private ContainerDummy() {} diff --git a/src/main/java/forestry/core/gui/ContainerEntity.java b/src/main/java/forestry/core/gui/ContainerEntity.java index 94f562adb..4ef08ad90 100644 --- a/src/main/java/forestry/core/gui/ContainerEntity.java +++ b/src/main/java/forestry/core/gui/ContainerEntity.java @@ -1,16 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.IInventory; + import com.google.common.collect.ImmutableSet; + import forestry.api.core.IErrorLogicSource; import forestry.api.core.IErrorState; import forestry.core.access.EnumAccess; @@ -20,12 +24,9 @@ import forestry.core.access.IRestrictedAccess; import forestry.core.network.IForestryPacketClient; import forestry.core.network.packets.PacketAccessUpdateEntity; import forestry.core.network.packets.PacketErrorUpdateEntity; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.IInventory; public class ContainerEntity extends ContainerForestry { + protected final T entity; private final IAccessHandler accessHandler; @@ -63,8 +64,7 @@ public class ContainerEntity extends ContainerFor if (entity instanceof IErrorLogicSource) { IErrorLogicSource errorLogicSource = (IErrorLogicSource) entity; - ImmutableSet errorStates = - errorLogicSource.getErrorLogic().getErrorStates(); + ImmutableSet errorStates = errorLogicSource.getErrorLogic().getErrorStates(); if ((previousErrorStates == null) || !errorStates.equals(previousErrorStates)) { PacketErrorUpdateEntity packet = new PacketErrorUpdateEntity(entity, errorLogicSource); diff --git a/src/main/java/forestry/core/gui/ContainerEscritoire.java b/src/main/java/forestry/core/gui/ContainerEscritoire.java index 8335c941c..366b7fb35 100755 --- a/src/main/java/forestry/core/gui/ContainerEscritoire.java +++ b/src/main/java/forestry/core/gui/ContainerEscritoire.java @@ -1,15 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; + import forestry.core.gui.slots.SlotFiltered; import forestry.core.gui.slots.SlotOutput; import forestry.core.inventory.InventoryEscritoire; @@ -18,8 +19,6 @@ import forestry.core.network.packets.PacketGuiUpdate; import forestry.core.proxy.Proxies; import forestry.core.tiles.EscritoireGame; import forestry.core.tiles.TileEscritoire; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; public class ContainerEscritoire extends ContainerTile implements IGuiSelectable { @@ -33,19 +32,24 @@ public class ContainerEscritoire extends ContainerTile implement this.player = player; // Analyze slot - addSlotToContainer(new SlotFiltered(this.tile, InventoryEscritoire.SLOT_ANALYZE, 97, 67) - .setPickupWatcher(this.tile) - .setStackLimit(1)); + addSlotToContainer( + new SlotFiltered(this.tile, InventoryEscritoire.SLOT_ANALYZE, 97, 67).setPickupWatcher(this.tile) + .setStackLimit(1)); for (int i = 0; i < InventoryEscritoire.SLOTS_INPUT_COUNT; i++) { - addSlotToContainer(new SlotFiltered(this.tile, InventoryEscritoire.SLOT_INPUT_1 + i, 17, 49 + i * 18) - .setBlockedTexture("slots/blocked_2")); + addSlotToContainer( + new SlotFiltered(this.tile, InventoryEscritoire.SLOT_INPUT_1 + i, 17, 49 + i * 18) + .setBlockedTexture("slots/blocked_2")); } for (int i = 0; i < 3; i++) { for (int j = 0; j < 2; j++) { - addSlotToContainer(new SlotOutput( - this.tile, InventoryEscritoire.SLOT_RESULTS_1 + (i * 2) + j, 177 + j * 18, 85 + i * 18)); + addSlotToContainer( + new SlotOutput( + this.tile, + InventoryEscritoire.SLOT_RESULTS_1 + (i * 2) + j, + 177 + j * 18, + 85 + i * 18)); } } } diff --git a/src/main/java/forestry/core/gui/ContainerForestry.java b/src/main/java/forestry/core/gui/ContainerForestry.java index 94046aabc..d1aa36376 100644 --- a/src/main/java/forestry/core/gui/ContainerForestry.java +++ b/src/main/java/forestry/core/gui/ContainerForestry.java @@ -1,17 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui; +import java.util.List; +import java.util.Map; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Multimaps; + import forestry.core.gui.slots.SlotFilteredInventory; import forestry.core.gui.slots.SlotForestry; import forestry.core.gui.slots.SlotLocked; @@ -20,16 +28,10 @@ import forestry.core.proxy.Proxies; import forestry.core.utils.SlotUtil; import invtweaks.api.container.ContainerSection; import invtweaks.api.container.ContainerSectionCallback; -import java.util.List; -import java.util.Map; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; @invtweaks.api.container.ChestContainer(showButtons = false) public abstract class ContainerForestry extends Container { + protected final void addPlayerInventory(InventoryPlayer playerInventory, int xInv, int yInv) { // Player inventory for (int row = 0; row < 3; row++) { diff --git a/src/main/java/forestry/core/gui/ContainerItemInventory.java b/src/main/java/forestry/core/gui/ContainerItemInventory.java index 2909e5227..50dc16097 100755 --- a/src/main/java/forestry/core/gui/ContainerItemInventory.java +++ b/src/main/java/forestry/core/gui/ContainerItemInventory.java @@ -1,22 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui; -import forestry.core.gui.slots.SlotLocked; -import forestry.core.inventory.ItemInventory; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; +import forestry.core.gui.slots.SlotLocked; +import forestry.core.inventory.ItemInventory; + public abstract class ContainerItemInventory extends ContainerForestry { protected final I inventory; diff --git a/src/main/java/forestry/core/gui/ContainerLiquidTanks.java b/src/main/java/forestry/core/gui/ContainerLiquidTanks.java index 24e130fdf..1416ccdba 100755 --- a/src/main/java/forestry/core/gui/ContainerLiquidTanks.java +++ b/src/main/java/forestry/core/gui/ContainerLiquidTanks.java @@ -1,16 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui; -import forestry.core.tiles.ILiquidTankTile; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; @@ -18,6 +15,8 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.fluids.IFluidTank; +import forestry.core.tiles.ILiquidTankTile; + public abstract class ContainerLiquidTanks extends ContainerTile implements IContainerLiquidTanks { diff --git a/src/main/java/forestry/core/gui/ContainerLiquidTanksHelper.java b/src/main/java/forestry/core/gui/ContainerLiquidTanksHelper.java index 92e305d6b..104aabe10 100644 --- a/src/main/java/forestry/core/gui/ContainerLiquidTanksHelper.java +++ b/src/main/java/forestry/core/gui/ContainerLiquidTanksHelper.java @@ -1,19 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui; -import forestry.api.core.IToolPipette; -import forestry.core.network.packets.PacketPipetteClick; -import forestry.core.proxy.Proxies; -import forestry.core.tiles.ILiquidTankTile; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.Item; @@ -22,6 +16,11 @@ import net.minecraft.tileentity.TileEntity; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidTank; +import forestry.api.core.IToolPipette; +import forestry.core.network.packets.PacketPipetteClick; +import forestry.core.proxy.Proxies; +import forestry.core.tiles.ILiquidTankTile; + public class ContainerLiquidTanksHelper implements IContainerLiquidTanks { private final T tile; diff --git a/src/main/java/forestry/core/gui/ContainerLiquidTanksSocketed.java b/src/main/java/forestry/core/gui/ContainerLiquidTanksSocketed.java index 92ed6c9f1..1ddb6e554 100644 --- a/src/main/java/forestry/core/gui/ContainerLiquidTanksSocketed.java +++ b/src/main/java/forestry/core/gui/ContainerLiquidTanksSocketed.java @@ -1,17 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui; -import forestry.core.circuits.ISocketable; -import forestry.core.tiles.ILiquidTankTile; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; @@ -20,6 +16,9 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.fluids.IFluidTank; +import forestry.core.circuits.ISocketable; +import forestry.core.tiles.ILiquidTankTile; + public abstract class ContainerLiquidTanksSocketed extends ContainerTile implements IContainerSocketed, IContainerLiquidTanks { diff --git a/src/main/java/forestry/core/gui/ContainerNaturalistInventory.java b/src/main/java/forestry/core/gui/ContainerNaturalistInventory.java index 9d0d26e7e..ad19e15f9 100755 --- a/src/main/java/forestry/core/gui/ContainerNaturalistInventory.java +++ b/src/main/java/forestry/core/gui/ContainerNaturalistInventory.java @@ -1,25 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui; -import forestry.core.gui.slots.SlotFilteredInventory; -import forestry.core.network.packets.PacketGuiSelectRequest; -import forestry.core.tiles.IFilterSlotDelegate; -import forestry.core.tiles.TileNaturalistChest; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.IInventory; +import forestry.core.gui.slots.SlotFilteredInventory; +import forestry.core.network.packets.PacketGuiSelectRequest; +import forestry.core.tiles.IFilterSlotDelegate; +import forestry.core.tiles.TileNaturalistChest; + public class ContainerNaturalistInventory extends ContainerTile implements IGuiSelectable { public ContainerNaturalistInventory(InventoryPlayer player, TileNaturalistChest tile, int page) { @@ -28,8 +27,8 @@ public class ContainerNaturalistInventory extends ContainerTile void addInventory( - ContainerForestry container, T inventory, int selectedPage) { + public static void addInventory(ContainerForestry container, + T inventory, int selectedPage) { for (int page = 0; page < 5; page++) { for (int x = 0; x < 5; x++) { for (int y = 0; y < 5; y++) { diff --git a/src/main/java/forestry/core/gui/ContainerSocketed.java b/src/main/java/forestry/core/gui/ContainerSocketed.java index 9d270d580..3691def13 100755 --- a/src/main/java/forestry/core/gui/ContainerSocketed.java +++ b/src/main/java/forestry/core/gui/ContainerSocketed.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui; -import forestry.core.circuits.ISocketable; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import forestry.core.circuits.ISocketable; + public abstract class ContainerSocketed extends ContainerTile implements IContainerSocketed { diff --git a/src/main/java/forestry/core/gui/ContainerSocketedHelper.java b/src/main/java/forestry/core/gui/ContainerSocketedHelper.java index 90b80b9a0..2e9c2597f 100644 --- a/src/main/java/forestry/core/gui/ContainerSocketedHelper.java +++ b/src/main/java/forestry/core/gui/ContainerSocketedHelper.java @@ -1,15 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; + import forestry.api.circuits.ChipsetManager; import forestry.api.circuits.ICircuitBoard; import forestry.core.circuits.ISocketable; @@ -18,9 +20,6 @@ import forestry.core.network.packets.PacketSocketUpdate; import forestry.core.network.packets.PacketSolderingIronClick; import forestry.core.proxy.Proxies; import forestry.core.utils.InventoryUtil; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; public class ContainerSocketedHelper implements IContainerSocketed { diff --git a/src/main/java/forestry/core/gui/ContainerTile.java b/src/main/java/forestry/core/gui/ContainerTile.java index 692c2a346..8ace5d90d 100644 --- a/src/main/java/forestry/core/gui/ContainerTile.java +++ b/src/main/java/forestry/core/gui/ContainerTile.java @@ -1,16 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.tileentity.TileEntity; + import com.google.common.collect.ImmutableSet; + import forestry.api.core.IErrorLogicSource; import forestry.api.core.IErrorState; import forestry.core.access.EnumAccess; @@ -26,9 +29,6 @@ import forestry.core.tiles.IPowerHandler; import forestry.core.tiles.TilePowered; import forestry.core.tiles.TileUtil; import forestry.energy.EnergyManager; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.tileentity.TileEntity; public abstract class ContainerTile extends ContainerForestry { @@ -73,8 +73,7 @@ public abstract class ContainerTile extends ContainerFores if (tile instanceof IErrorLogicSource) { IErrorLogicSource errorLogicSource = (IErrorLogicSource) tile; - ImmutableSet errorStates = - errorLogicSource.getErrorLogic().getErrorStates(); + ImmutableSet errorStates = errorLogicSource.getErrorLogic().getErrorStates(); if ((previousErrorStates == null) || !errorStates.equals(previousErrorStates)) { PacketErrorUpdate packet = new PacketErrorUpdate(tile, errorLogicSource); diff --git a/src/main/java/forestry/core/gui/GuiAlyzer.java b/src/main/java/forestry/core/gui/GuiAlyzer.java index a1b24f954..a81feff14 100755 --- a/src/main/java/forestry/core/gui/GuiAlyzer.java +++ b/src/main/java/forestry/core/gui/GuiAlyzer.java @@ -1,15 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui; +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; +import java.util.Stack; + +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + +import org.apache.commons.lang3.StringUtils; +import org.lwjgl.opengl.GL11; + import forestry.api.apiculture.EnumBeeChromosome; import forestry.api.genetics.AlleleManager; import forestry.api.genetics.EnumTolerance; @@ -28,16 +39,6 @@ import forestry.core.genetics.mutations.EnumMutateChance; import forestry.core.gui.widgets.ItemStackWidget; import forestry.core.proxy.Proxies; import forestry.core.utils.StringUtil; -import java.util.HashMap; -import java.util.Locale; -import java.util.Map; -import java.util.Stack; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import org.apache.commons.lang3.StringUtils; -import org.lwjgl.opengl.GL11; public abstract class GuiAlyzer extends GuiForestry { @@ -52,11 +53,7 @@ public abstract class GuiAlyzer extends GuiForestry protected final Map iconStacks = new HashMap<>(); - protected GuiAlyzer( - ISpeciesRoot speciesRoot, - EntityPlayer player, - ContainerAlyzer container, - IInventory inventory, + protected GuiAlyzer(ISpeciesRoot speciesRoot, EntityPlayer player, ContainerAlyzer container, IInventory inventory, String guiName) { super(Constants.TEXTURE_PATH_GUI + "/beealyzer2.png", container, inventory); @@ -77,53 +74,45 @@ public abstract class GuiAlyzer extends GuiForestry } } - protected final void drawLine( - String text, int x, IIndividual individual, IChromosomeType chromosome, boolean inactive) { + protected final void drawLine(String text, int x, IIndividual individual, IChromosomeType chromosome, + boolean inactive) { if (!inactive) { - textLayout.drawLine( - text, - x, - getColorCoding( - individual.getGenome().getActiveAllele(chromosome).isDominant())); + textLayout + .drawLine(text, x, getColorCoding(individual.getGenome().getActiveAllele(chromosome).isDominant())); } else { textLayout.drawLine( text, x, - getColorCoding( - individual.getGenome().getInactiveAllele(chromosome).isDominant())); + getColorCoding(individual.getGenome().getInactiveAllele(chromosome).isDominant())); } } - protected final void drawSplitLine( - String text, int x, int maxWidth, IIndividual individual, IChromosomeType chromosome, boolean inactive) { + protected final void drawSplitLine(String text, int x, int maxWidth, IIndividual individual, + IChromosomeType chromosome, boolean inactive) { if (!inactive) { textLayout.drawSplitLine( text, x, maxWidth, - getColorCoding( - individual.getGenome().getActiveAllele(chromosome).isDominant())); + getColorCoding(individual.getGenome().getActiveAllele(chromosome).isDominant())); } else { textLayout.drawSplitLine( text, x, maxWidth, - getColorCoding( - individual.getGenome().getInactiveAllele(chromosome).isDominant())); + getColorCoding(individual.getGenome().getInactiveAllele(chromosome).isDominant())); } } - protected final void drawRow( - String text0, String text1, String text2, IIndividual individual, IChromosomeType chromosome) { + protected final void drawRow(String text0, String text1, String text2, IIndividual individual, + IChromosomeType chromosome) { textLayout.drawRow( text0, text1, text2, fontColor.get("gui.screen"), - getColorCoding( - individual.getGenome().getActiveAllele(chromosome).isDominant()), - getColorCoding( - individual.getGenome().getInactiveAllele(chromosome).isDominant())); + getColorCoding(individual.getGenome().getActiveAllele(chromosome).isDominant()), + getColorCoding(individual.getGenome().getInactiveAllele(chromosome).isDominant())); } protected final void drawChromosomeRow(String chromosomeName, IIndividual individual, IChromosomeType chromosome) { @@ -138,12 +127,8 @@ public abstract class GuiAlyzer extends GuiForestry getColorCoding(inactive.isDominant())); } - protected final void drawSpeciesRow( - String text0, - IIndividual individual, - IChromosomeType chromosome, - String customPrimaryName, - String customSecondaryName) { + protected final void drawSpeciesRow(String text0, IIndividual individual, IChromosomeType chromosome, + String customPrimaryName, String customSecondaryName) { IAlleleSpecies primary = individual.getGenome().getPrimary(); IAlleleSpecies secondary = individual.getGenome().getSecondary(); @@ -151,7 +136,10 @@ public abstract class GuiAlyzer extends GuiForestry int columnwidth = textLayout.column2 - textLayout.column1 - 2; GuiUtil.drawItemStack( - this, iconStacks.get(primary.getUID()), guiLeft + textLayout.column1 + (columnwidth - 20), guiTop + 10); + this, + iconStacks.get(primary.getUID()), + guiLeft + textLayout.column1 + (columnwidth - 20), + guiTop + 10); GuiUtil.drawItemStack( this, iconStacks.get(secondary.getUID()), @@ -224,8 +212,7 @@ public abstract class GuiAlyzer extends GuiForestry IClassification classification = individual.getGenome().getPrimary().getBranch(); while (classification != null) { - if (classification.getScientific() != null - && !classification.getScientific().isEmpty()) { + if (classification.getScientific() != null && !classification.getScientific().isEmpty()) { hierarchy.push(classification); } classification = classification.getParent(); @@ -259,8 +246,7 @@ public abstract class GuiAlyzer extends GuiForestry textLayout.newLine(); textLayout.drawLine( - StringUtil.localize("gui.alyzer.authority") + ": " - + individual.getGenome().getPrimary().getAuthority(), + StringUtil.localize("gui.alyzer.authority") + ": " + individual.getGenome().getPrimary().getAuthority(), 12); if (AlleleManager.alleleRegistry.isBlacklisted(individual.getIdent())) { String extinct = ">> " + StringUtil.localize("gui.alyzer.extinct").toUpperCase() + " <<"; @@ -301,13 +287,11 @@ public abstract class GuiAlyzer extends GuiForestry HashMap combinations = new HashMap<>(); - for (IMutation mutation : - speciesRoot.getCombinations(individual.getGenome().getPrimary())) { + for (IMutation mutation : speciesRoot.getCombinations(individual.getGenome().getPrimary())) { combinations.put(mutation, individual.getGenome().getPrimary()); } - for (IMutation mutation : - speciesRoot.getCombinations(individual.getGenome().getSecondary())) { + for (IMutation mutation : speciesRoot.getCombinations(individual.getGenome().getSecondary())) { combinations.put(mutation, individual.getGenome().getSecondary()); } @@ -470,7 +454,12 @@ public abstract class GuiAlyzer extends GuiForestry Proxies.render.bindTexture(textureFile); drawTexturedModalRect( - guiLeft + x + stringWidth + 2, guiTop + textLayout.getLineY() - 1, 60, 240 + texOffset, 12, 8); + guiLeft + x + stringWidth + 2, + guiTop + textLayout.getLineY() - 1, + 60, + 240 + texOffset, + 12, + 8); textLayout.drawLine(fertilityString, x, textColor); } diff --git a/src/main/java/forestry/core/gui/GuiAnalyzer.java b/src/main/java/forestry/core/gui/GuiAnalyzer.java index 4d74ad22f..33ed53ffc 100755 --- a/src/main/java/forestry/core/gui/GuiAnalyzer.java +++ b/src/main/java/forestry/core/gui/GuiAnalyzer.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.core.config.Constants; import forestry.core.gui.widgets.TankWidget; import forestry.core.render.EnumTankLevel; import forestry.core.tiles.TileAnalyzer; -import net.minecraft.entity.player.InventoryPlayer; public class GuiAnalyzer extends GuiForestryTitled { diff --git a/src/main/java/forestry/core/gui/GuiEscritoire.java b/src/main/java/forestry/core/gui/GuiEscritoire.java index a8e255b5c..ef9040e57 100755 --- a/src/main/java/forestry/core/gui/GuiEscritoire.java +++ b/src/main/java/forestry/core/gui/GuiEscritoire.java @@ -1,15 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; + +import org.lwjgl.opengl.GL11; + import forestry.core.config.Constants; import forestry.core.gui.widgets.GameTokenWidget; import forestry.core.gui.widgets.ProbeButton; @@ -18,13 +23,9 @@ import forestry.core.tiles.EscritoireGame; import forestry.core.tiles.EscritoireTextSource; import forestry.core.tiles.TileEscritoire; import forestry.core.utils.StringUtil; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import org.lwjgl.opengl.GL11; public class GuiEscritoire extends GuiForestry { + private final ItemStack LEVEL_ITEM = new ItemStack(Items.paper); private final EscritoireTextSource textSource = new EscritoireTextSource(); diff --git a/src/main/java/forestry/core/gui/GuiForestry.java b/src/main/java/forestry/core/gui/GuiForestry.java index dd7745d04..b4397b35e 100755 --- a/src/main/java/forestry/core/gui/GuiForestry.java +++ b/src/main/java/forestry/core/gui/GuiForestry.java @@ -1,15 +1,32 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui; +import java.util.Collections; +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; +import org.lwjgl.opengl.GL12; + import codechicken.nei.VisiblityData; import codechicken.nei.api.INEIGuiHandler; import codechicken.nei.api.TaggedInventoryArea; @@ -28,26 +45,11 @@ import forestry.core.proxy.Proxies; import forestry.core.render.FontColour; import forestry.core.tiles.IClimatised; import forestry.core.tiles.IPowerHandler; -import java.util.Collections; -import java.util.List; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.OpenGlHelper; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.client.renderer.entity.RenderItem; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL12; @Optional.Interface(iface = "codechicken.nei.api.INEIGuiHandler", modid = "NotEnoughItems") public abstract class GuiForestry extends GuiContainer implements INEIGuiHandler { + protected final I inventory; protected final C container; @@ -106,8 +108,7 @@ public abstract class GuiForestry ext ledgerManager.add(new ClimateLedger(ledgerManager, (IClimatised) inventory)); } - if (Config.enableEnergyStat - && inventory instanceof IPowerHandler + if (Config.enableEnergyStat && inventory instanceof IPowerHandler && ((IPowerHandler) inventory).getEnergyManager().getMaxEnergyStored() > 0) { ledgerManager.add(new PowerLedger(ledgerManager, (IPowerHandler) inventory)); } diff --git a/src/main/java/forestry/core/gui/GuiForestryTitled.java b/src/main/java/forestry/core/gui/GuiForestryTitled.java index fb1462beb..b6dffd746 100644 --- a/src/main/java/forestry/core/gui/GuiForestryTitled.java +++ b/src/main/java/forestry/core/gui/GuiForestryTitled.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui; -import forestry.core.tiles.ITitled; import net.minecraft.inventory.Container; import net.minecraft.inventory.IInventory; import net.minecraft.util.StatCollector; +import forestry.core.tiles.ITitled; + public abstract class GuiForestryTitled extends GuiForestry { protected GuiForestryTitled(String texture, C container, I inventory) { diff --git a/src/main/java/forestry/core/gui/GuiHandler.java b/src/main/java/forestry/core/gui/GuiHandler.java index 4d421e0d3..757fd2269 100644 --- a/src/main/java/forestry/core/gui/GuiHandler.java +++ b/src/main/java/forestry/core/gui/GuiHandler.java @@ -1,17 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui; -import cpw.mods.fml.common.network.IGuiHandler; -import forestry.api.core.ForestryAPI; import net.minecraft.entity.Entity; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; @@ -20,7 +16,11 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; +import cpw.mods.fml.common.network.IGuiHandler; +import forestry.api.core.ForestryAPI; + public class GuiHandler implements IGuiHandler { + public static void openGui(EntityPlayer entityplayer, IGuiHandlerEntity guiHandler) { openGui(entityplayer, guiHandler, (short) 0); } diff --git a/src/main/java/forestry/core/gui/GuiId.java b/src/main/java/forestry/core/gui/GuiId.java index 3834594bc..4540cee8b 100644 --- a/src/main/java/forestry/core/gui/GuiId.java +++ b/src/main/java/forestry/core/gui/GuiId.java @@ -1,16 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui; public class GuiId { + private final int id; private final GuiType guiType; private final Class guiHandlerClass; diff --git a/src/main/java/forestry/core/gui/GuiIdRegistry.java b/src/main/java/forestry/core/gui/GuiIdRegistry.java index 511a360d8..e04e11ac7 100644 --- a/src/main/java/forestry/core/gui/GuiIdRegistry.java +++ b/src/main/java/forestry/core/gui/GuiIdRegistry.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui; +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + import forestry.apiculture.entities.EntityMinecartApiary; import forestry.apiculture.entities.EntityMinecartBeehouse; import forestry.apiculture.items.ItemBeealyzer; @@ -49,12 +52,9 @@ import forestry.mail.tiles.TileStampCollector; import forestry.mail.tiles.TileTrader; import forestry.storage.items.ItemBackpack; import forestry.storage.items.ItemBackpackNaturalist; -import java.util.Arrays; -import java.util.HashMap; -import java.util.List; -import java.util.Map; public class GuiIdRegistry { + private static final Map, GuiId> classMap = new HashMap<>(); private static final Map idMap = new HashMap<>(); private static int nextId = 0; @@ -108,11 +108,12 @@ public class GuiIdRegistry { registerGuiHandlers( GuiType.Entity, Arrays.>asList( - EntityMinecartApiary.class, EntityMinecartBeehouse.class)); + EntityMinecartApiary.class, + EntityMinecartBeehouse.class)); } - private static void registerGuiHandlers( - GuiType guiType, List> guiHandlerClasses) { + private static void registerGuiHandlers(GuiType guiType, + List> guiHandlerClasses) { for (Class tileGuiHandlerClass : guiHandlerClasses) { GuiId guiId = new GuiId(nextId++, guiType, tileGuiHandlerClass); classMap.put(tileGuiHandlerClass, guiId); diff --git a/src/main/java/forestry/core/gui/GuiNaturalistInventory.java b/src/main/java/forestry/core/gui/GuiNaturalistInventory.java index 8c8c5a28d..6ca59bbf0 100755 --- a/src/main/java/forestry/core/gui/GuiNaturalistInventory.java +++ b/src/main/java/forestry/core/gui/GuiNaturalistInventory.java @@ -1,15 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui; +import java.util.HashMap; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + import forestry.api.apiculture.IApiaristTracker; import forestry.api.arboriculture.EnumTreeChromosome; import forestry.api.genetics.IAlleleSpecies; @@ -24,27 +31,16 @@ import forestry.core.gui.buttons.StandardButtonTextureSets; import forestry.core.network.packets.PacketGuiSelectRequest; import forestry.core.proxy.Proxies; import forestry.core.utils.StringUtil; -import java.util.HashMap; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; public class GuiNaturalistInventory extends GuiForestry { + private final ISpeciesRoot speciesRoot; private final IBreedingTracker breedingTracker; private final HashMap iconStacks = new HashMap<>(); private final int pageCurrent, pageMax; - public GuiNaturalistInventory( - ISpeciesRoot speciesRoot, - EntityPlayer player, - Container container, - IPagedInventory inventory, - int page, - int maxPages) { + public GuiNaturalistInventory(ISpeciesRoot speciesRoot, EntityPlayer player, Container container, + IPagedInventory inventory, int page, int maxPages) { super(Constants.TEXTURE_PATH_GUI + "/apiaristinventory.png", container, inventory); this.speciesRoot = speciesRoot; @@ -82,7 +78,10 @@ public class GuiNaturalistInventory extends GuiForestry getHints(); } diff --git a/src/main/java/forestry/core/gui/IPagedInventory.java b/src/main/java/forestry/core/gui/IPagedInventory.java index 833fa5324..595e4f344 100755 --- a/src/main/java/forestry/core/gui/IPagedInventory.java +++ b/src/main/java/forestry/core/gui/IPagedInventory.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui; diff --git a/src/main/java/forestry/core/gui/TextLayoutHelper.java b/src/main/java/forestry/core/gui/TextLayoutHelper.java index 9c2a25480..2ebb3afae 100644 --- a/src/main/java/forestry/core/gui/TextLayoutHelper.java +++ b/src/main/java/forestry/core/gui/TextLayoutHelper.java @@ -1,20 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui; -import forestry.core.render.FontColour; import net.minecraft.client.gui.FontRenderer; + import org.lwjgl.opengl.GL11; +import forestry.core.render.FontColour; + public class TextLayoutHelper { + private static final int LINE_HEIGHT = 12; private final GuiForestry guiForestry; @@ -100,8 +101,8 @@ public class TextLayoutHelper { } public void drawSplitLine(String text, int x, int maxWidth, int color) { - fontRendererObj.drawSplitString( - text, guiForestry.getGuiLeft() + x, guiForestry.getGuiTop() + line, maxWidth, color); + fontRendererObj + .drawSplitString(text, guiForestry.getGuiLeft() + x, guiForestry.getGuiTop() + line, maxWidth, color); } public int getCenteredOffset(String string) { diff --git a/src/main/java/forestry/core/gui/buttons/GuiBetterButton.java b/src/main/java/forestry/core/gui/buttons/GuiBetterButton.java index 97b83deee..ef19053dc 100755 --- a/src/main/java/forestry/core/gui/buttons/GuiBetterButton.java +++ b/src/main/java/forestry/core/gui/buttons/GuiBetterButton.java @@ -1,31 +1,32 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.buttons; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.core.config.Constants; import forestry.core.gui.tooltips.IToolTipProvider; import forestry.core.gui.tooltips.ToolTip; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; @SideOnly(Side.CLIENT) public class GuiBetterButton extends GuiButton implements IToolTipProvider { - private static final ResourceLocation TEXTURE = - new ResourceLocation("forestry", Constants.TEXTURE_PATH_GUI + "/buttons.png"); + private static final ResourceLocation TEXTURE = new ResourceLocation( + "forestry", + Constants.TEXTURE_PATH_GUI + "/buttons.png"); protected IButtonTextureSet texture; private ToolTip toolTip; private boolean useTexWidth = false; @@ -78,8 +79,7 @@ public class GuiBetterButton extends GuiButton implements IToolTipProvider { } public boolean isMouseOverButton(int mouseX, int mouseY) { - return mouseX >= xPosition - && mouseY >= yPosition + return mouseX >= xPosition && mouseY >= yPosition && mouseX < xPosition + getWidth() && mouseY < yPosition + getHeight(); } @@ -107,7 +107,12 @@ public class GuiBetterButton extends GuiButton implements IToolTipProvider { } else { drawTexturedModalRect(xPosition, yPosition, xOffset, yOffset + hoverState * h, width / 2, h); drawTexturedModalRect( - xPosition + width / 2, yPosition, xOffset + w - width / 2, yOffset + hoverState * h, width / 2, h); + xPosition + width / 2, + yPosition, + xOffset + w - width / 2, + yOffset + hoverState * h, + width / 2, + h); } mouseDragged(minecraft, mouseX, mouseY); drawCenteredString( diff --git a/src/main/java/forestry/core/gui/buttons/IButtonTextureSet.java b/src/main/java/forestry/core/gui/buttons/IButtonTextureSet.java index 83ee492fe..cf728fc6c 100755 --- a/src/main/java/forestry/core/gui/buttons/IButtonTextureSet.java +++ b/src/main/java/forestry/core/gui/buttons/IButtonTextureSet.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.buttons; diff --git a/src/main/java/forestry/core/gui/buttons/StandardButtonTextureSets.java b/src/main/java/forestry/core/gui/buttons/StandardButtonTextureSets.java index e3b4853a3..18f247672 100755 --- a/src/main/java/forestry/core/gui/buttons/StandardButtonTextureSets.java +++ b/src/main/java/forestry/core/gui/buttons/StandardButtonTextureSets.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.buttons; @@ -14,6 +12,7 @@ package forestry.core.gui.buttons; * @author CovertJaguar */ public enum StandardButtonTextureSets implements IButtonTextureSet { + LARGE_BUTTON(0, 0, 20, 200), SMALL_BUTTON(0, 80, 15, 200), LOCKED_BUTTON(224, 0, 16, 16), @@ -22,6 +21,7 @@ public enum StandardButtonTextureSets implements IButtonTextureSet { RIGHT_BUTTON(214, 0, 16, 10), LEFT_BUTTON_SMALL(238, 220, 12, 9), RIGHT_BUTTON_SMALL(247, 220, 12, 9); + private final int x, y, height, width; StandardButtonTextureSets(int x, int y, int height, int width) { diff --git a/src/main/java/forestry/core/gui/ledgers/ClimateLedger.java b/src/main/java/forestry/core/gui/ledgers/ClimateLedger.java index ea4be6013..f61422e68 100644 --- a/src/main/java/forestry/core/gui/ledgers/ClimateLedger.java +++ b/src/main/java/forestry/core/gui/ledgers/ClimateLedger.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.ledgers; @@ -47,16 +45,14 @@ public class ClimateLedger extends Ledger { drawSubheader(StringUtil.localize("gui.temperature") + ':', x + 22, y + 20); drawText( - AlleleManager.climateHelper.toDisplay(temperature) - + ' ' + AlleleManager.climateHelper.toDisplay(temperature) + ' ' + StringUtil.floatAsPercent(tile.getExactTemperature()), x + 22, y + 32); drawSubheader(StringUtil.localize("gui.humidity") + ':', x + 22, y + 44); drawText( - AlleleManager.climateHelper.toDisplay(tile.getHumidity()) - + ' ' + AlleleManager.climateHelper.toDisplay(tile.getHumidity()) + ' ' + StringUtil.floatAsPercent(tile.getExactHumidity()), x + 22, y + 56); @@ -64,7 +60,8 @@ public class ClimateLedger extends Ledger { @Override public String getTooltip() { - return "T: " + AlleleManager.climateHelper.toDisplay(tile.getTemperature()) + " / H: " + return "T: " + AlleleManager.climateHelper.toDisplay(tile.getTemperature()) + + " / H: " + AlleleManager.climateHelper.toDisplay(tile.getHumidity()); } } diff --git a/src/main/java/forestry/core/gui/ledgers/ErrorLedger.java b/src/main/java/forestry/core/gui/ledgers/ErrorLedger.java index f2f279b63..2ec037ed4 100644 --- a/src/main/java/forestry/core/gui/ledgers/ErrorLedger.java +++ b/src/main/java/forestry/core/gui/ledgers/ErrorLedger.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.ledgers; +import javax.annotation.Nullable; + import forestry.api.core.IErrorState; import forestry.core.utils.StringUtil; -import javax.annotation.Nullable; /** * A ledger displaying error messages and help text. diff --git a/src/main/java/forestry/core/gui/ledgers/HintLedger.java b/src/main/java/forestry/core/gui/ledgers/HintLedger.java index d8b75b40c..cc92f4284 100644 --- a/src/main/java/forestry/core/gui/ledgers/HintLedger.java +++ b/src/main/java/forestry/core/gui/ledgers/HintLedger.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.ledgers; +import java.util.List; +import java.util.Random; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; + import forestry.core.gui.IHintSource; import forestry.core.proxy.Proxies; import forestry.core.render.TextureManager; import forestry.core.utils.StringUtil; -import java.util.List; -import java.util.Random; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; public class HintLedger extends Ledger { @@ -35,9 +35,7 @@ public class HintLedger extends Ledger { Minecraft minecraft = Proxies.common.getClientInstance(); FontRenderer fontRenderer = minecraft.fontRenderer; - int lineCount = fontRenderer - .listFormattedStringToWidth(hintString, maxTextWidth) - .size(); + int lineCount = fontRenderer.listFormattedStringToWidth(hintString, maxTextWidth).size(); maxHeight = (lineCount + 1) * fontRenderer.FONT_HEIGHT + 20; } diff --git a/src/main/java/forestry/core/gui/ledgers/Ledger.java b/src/main/java/forestry/core/gui/ledgers/Ledger.java index 228bfef2d..b426f9322 100644 --- a/src/main/java/forestry/core/gui/ledgers/Ledger.java +++ b/src/main/java/forestry/core/gui/ledgers/Ledger.java @@ -1,26 +1,27 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.ledgers; +import java.util.List; + +import net.minecraft.client.Minecraft; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + import forestry.core.config.Config; import forestry.core.config.Constants; import forestry.core.config.SessionVars; import forestry.core.proxy.Proxies; import forestry.core.render.ForestryResource; import forestry.core.render.SpriteSheet; -import java.util.List; -import net.minecraft.client.Minecraft; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; /** * Side ledger for guis @@ -33,10 +34,10 @@ public abstract class Ledger { protected final int maxTextWidth; protected int maxHeight = 24; - private static final ResourceLocation ledgerTextureRight = - new ForestryResource(Constants.TEXTURE_PATH_GUI + "/ledger.png"); - private static final ResourceLocation ledgerTextureLeft = - new ForestryResource(Constants.TEXTURE_PATH_GUI + "/ledgerLeft.png"); + private static final ResourceLocation ledgerTextureRight = new ForestryResource( + Constants.TEXTURE_PATH_GUI + "/ledger.png"); + private static final ResourceLocation ledgerTextureLeft = new ForestryResource( + Constants.TEXTURE_PATH_GUI + "/ledgerLeft.png"); private final LedgerManager manager; @@ -138,8 +139,7 @@ public abstract class Ledger { } public boolean intersectsWith(int mouseX, int mouseY) { - return mouseX >= currentShiftX - && mouseX <= currentShiftX + currentWidth + return mouseX >= currentShiftX && mouseX <= currentShiftX + currentWidth && mouseY >= currentShiftY && mouseY <= currentShiftY + getHeight(); } @@ -191,8 +191,11 @@ public abstract class Ledger { manager.gui.drawTexturedModalRect(x + 4, y, 256 - width + 4, 0, width - 4, 4); // top edge manager.gui.drawTexturedModalRect(x, y, 0, 0, 4, 4); // top left corner - manager.gui.drawTexturedModalRect( - x + 4, y + 4, 256 - width + 4, 256 - height + 4, width - 4, height - 4); // body + bottom + right + manager.gui.drawTexturedModalRect(x + 4, y + 4, 256 - width + 4, 256 - height + 4, width - 4, height - 4); // body + // + + // bottom + // + + // right GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0F); } diff --git a/src/main/java/forestry/core/gui/ledgers/LedgerManager.java b/src/main/java/forestry/core/gui/ledgers/LedgerManager.java index dc1a7f60d..93d61cf05 100644 --- a/src/main/java/forestry/core/gui/ledgers/LedgerManager.java +++ b/src/main/java/forestry/core/gui/ledgers/LedgerManager.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.ledgers; +import java.util.ArrayList; +import java.util.List; + +import org.lwjgl.opengl.GL11; + import forestry.api.core.IErrorSource; import forestry.api.core.IErrorState; import forestry.core.config.SessionVars; @@ -17,11 +20,9 @@ import forestry.core.errors.FakeErrorSource; import forestry.core.gui.GuiForestry; import forestry.core.gui.GuiUtil; import forestry.core.gui.tooltips.ToolTip; -import java.util.ArrayList; -import java.util.List; -import org.lwjgl.opengl.GL11; public class LedgerManager { + private final List ledgers = new ArrayList<>(); private final List errorLedgers = new ArrayList<>(); @@ -182,8 +183,7 @@ public class LedgerManager { } public boolean ledgerOverlaps(int x, int y, int width, int height) { - return getAtPosition(x + width, y + height) != null - || getAtPosition(x + width, y) != null + return getAtPosition(x + width, y + height) != null || getAtPosition(x + width, y) != null || getAtPosition(x, y + height) != null || getAtPosition(x, y) != null; } diff --git a/src/main/java/forestry/core/gui/ledgers/OwnerLedger.java b/src/main/java/forestry/core/gui/ledgers/OwnerLedger.java index cd858765b..a6b10347a 100644 --- a/src/main/java/forestry/core/gui/ledgers/OwnerLedger.java +++ b/src/main/java/forestry/core/gui/ledgers/OwnerLedger.java @@ -1,16 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.ledgers; +import java.util.Locale; + +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.util.IIcon; + import com.mojang.authlib.GameProfile; + import forestry.core.access.EnumAccess; import forestry.core.access.IAccessHandler; import forestry.core.access.IAccessOwnerListener; @@ -19,10 +24,6 @@ import forestry.core.proxy.Proxies; import forestry.core.render.TextureManager; import forestry.core.utils.PlayerUtil; import forestry.core.utils.StringUtil; -import java.util.Locale; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.util.IIcon; /** * Ledger displaying ownership information diff --git a/src/main/java/forestry/core/gui/ledgers/PowerLedger.java b/src/main/java/forestry/core/gui/ledgers/PowerLedger.java index 46d8997f1..9ebbd866e 100644 --- a/src/main/java/forestry/core/gui/ledgers/PowerLedger.java +++ b/src/main/java/forestry/core/gui/ledgers/PowerLedger.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.ledgers; diff --git a/src/main/java/forestry/core/gui/slots/SlotCraftMatrix.java b/src/main/java/forestry/core/gui/slots/SlotCraftMatrix.java index 1f300eb1e..bf8ddc780 100644 --- a/src/main/java/forestry/core/gui/slots/SlotCraftMatrix.java +++ b/src/main/java/forestry/core/gui/slots/SlotCraftMatrix.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.slots; -import forestry.core.gui.IContainerCrafting; import net.minecraft.inventory.IInventory; +import forestry.core.gui.IContainerCrafting; + /** * Informs the passed container of slot changes. Contains a dummy itemstack. */ diff --git a/src/main/java/forestry/core/gui/slots/SlotCrafter.java b/src/main/java/forestry/core/gui/slots/SlotCrafter.java index 83cce4170..c3e5f844d 100755 --- a/src/main/java/forestry/core/gui/slots/SlotCrafter.java +++ b/src/main/java/forestry/core/gui/slots/SlotCrafter.java @@ -1,29 +1,28 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.slots; -import cpw.mods.fml.common.FMLCommonHandler; -import forestry.factory.tiles.ICrafterWorktable; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.SlotCrafting; import net.minecraft.item.ItemStack; +import cpw.mods.fml.common.FMLCommonHandler; +import forestry.factory.tiles.ICrafterWorktable; + public class SlotCrafter extends SlotCrafting { private final IInventory craftMatrix; private final ICrafterWorktable crafter; - public SlotCrafter( - EntityPlayer player, IInventory craftMatrix, ICrafterWorktable crafter, int slot, int xPos, int yPos) { + public SlotCrafter(EntityPlayer player, IInventory craftMatrix, ICrafterWorktable crafter, int slot, int xPos, + int yPos) { super(player, craftMatrix, craftMatrix, slot, xPos, yPos); this.craftMatrix = craftMatrix; this.crafter = crafter; diff --git a/src/main/java/forestry/core/gui/slots/SlotFiltered.java b/src/main/java/forestry/core/gui/slots/SlotFiltered.java index e93abc0db..dd4e0ea36 100644 --- a/src/main/java/forestry/core/gui/slots/SlotFiltered.java +++ b/src/main/java/forestry/core/gui/slots/SlotFiltered.java @@ -1,27 +1,27 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.slots; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.core.render.TextureManager; import forestry.core.tiles.IFilterSlotDelegate; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; /** * Slot which only takes specific items, specified by the IFilterSlotDelegate. */ public class SlotFiltered extends SlotWatched { + private String blockedTexture = "slots/blocked"; private final IFilterSlotDelegate filterSlotDelegate; diff --git a/src/main/java/forestry/core/gui/slots/SlotFilteredInventory.java b/src/main/java/forestry/core/gui/slots/SlotFilteredInventory.java index 409465c30..7a1030fbe 100644 --- a/src/main/java/forestry/core/gui/slots/SlotFilteredInventory.java +++ b/src/main/java/forestry/core/gui/slots/SlotFilteredInventory.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.slots; -import forestry.core.tiles.IFilterSlotDelegate; import net.minecraft.inventory.IInventory; +import forestry.core.tiles.IFilterSlotDelegate; + /** * Useful for InventoryTweaks. Works like SlotFiltered but allows InventoryTweaks to sort it. */ public class SlotFilteredInventory extends SlotFiltered { - public SlotFilteredInventory( - T inventory, int slotIndex, int xPos, int yPos) { + + public SlotFilteredInventory(T inventory, int slotIndex, int xPos, + int yPos) { super(inventory, slotIndex, xPos, yPos); } } diff --git a/src/main/java/forestry/core/gui/slots/SlotForestry.java b/src/main/java/forestry/core/gui/slots/SlotForestry.java index 521a930bb..990ddb248 100755 --- a/src/main/java/forestry/core/gui/slots/SlotForestry.java +++ b/src/main/java/forestry/core/gui/slots/SlotForestry.java @@ -1,22 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.slots; -import forestry.core.gui.tooltips.IToolTipProvider; -import forestry.core.gui.tooltips.ToolTip; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; +import forestry.core.gui.tooltips.IToolTipProvider; +import forestry.core.gui.tooltips.ToolTip; + public class SlotForestry extends Slot implements IToolTipProvider { private boolean isPhantom; @@ -110,8 +109,7 @@ public class SlotForestry extends Slot implements IToolTipProvider { @Override public boolean isMouseOver(int mouseX, int mouseY) { - return mouseX >= xDisplayPosition - && mouseX <= xDisplayPosition + 16 + return mouseX >= xDisplayPosition && mouseX <= xDisplayPosition + 16 && mouseY >= yDisplayPosition && mouseY <= yDisplayPosition + 16; } diff --git a/src/main/java/forestry/core/gui/slots/SlotLocked.java b/src/main/java/forestry/core/gui/slots/SlotLocked.java index cec025ae7..b672fdc23 100755 --- a/src/main/java/forestry/core/gui/slots/SlotLocked.java +++ b/src/main/java/forestry/core/gui/slots/SlotLocked.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.slots; diff --git a/src/main/java/forestry/core/gui/slots/SlotOutput.java b/src/main/java/forestry/core/gui/slots/SlotOutput.java index a72ab57d9..26e5f3c6f 100755 --- a/src/main/java/forestry/core/gui/slots/SlotOutput.java +++ b/src/main/java/forestry/core/gui/slots/SlotOutput.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.slots; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + /** * @author CovertJaguar */ diff --git a/src/main/java/forestry/core/gui/slots/SlotWatched.java b/src/main/java/forestry/core/gui/slots/SlotWatched.java index 2ce5744f0..a7a47a0f0 100644 --- a/src/main/java/forestry/core/gui/slots/SlotWatched.java +++ b/src/main/java/forestry/core/gui/slots/SlotWatched.java @@ -1,27 +1,27 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.slots; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + import forestry.core.inventory.watchers.FakeSlotChangeWatcher; import forestry.core.inventory.watchers.FakeSlotPickupWatcher; import forestry.core.inventory.watchers.ISlotChangeWatcher; import forestry.core.inventory.watchers.ISlotPickupWatcher; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; /** * Slot with a watcher callbacks. */ public class SlotWatched extends SlotForestry { + private ISlotPickupWatcher pickupWatcher = FakeSlotPickupWatcher.instance; private ISlotChangeWatcher changeWatcher = FakeSlotChangeWatcher.instance; diff --git a/src/main/java/forestry/core/gui/slots/SlotWorking.java b/src/main/java/forestry/core/gui/slots/SlotWorking.java index a6f6a2c77..015f4fb83 100755 --- a/src/main/java/forestry/core/gui/slots/SlotWorking.java +++ b/src/main/java/forestry/core/gui/slots/SlotWorking.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.slots; diff --git a/src/main/java/forestry/core/gui/tooltips/IToolTipProvider.java b/src/main/java/forestry/core/gui/tooltips/IToolTipProvider.java index 86f8e2913..b2c67c2e3 100755 --- a/src/main/java/forestry/core/gui/tooltips/IToolTipProvider.java +++ b/src/main/java/forestry/core/gui/tooltips/IToolTipProvider.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.tooltips; diff --git a/src/main/java/forestry/core/gui/tooltips/ToolTip.java b/src/main/java/forestry/core/gui/tooltips/ToolTip.java index 9cbd513b4..3fc51e14d 100755 --- a/src/main/java/forestry/core/gui/tooltips/ToolTip.java +++ b/src/main/java/forestry/core/gui/tooltips/ToolTip.java @@ -1,19 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.tooltips; -import com.google.common.collect.ForwardingList; import java.util.ArrayList; import java.util.List; +import com.google.common.collect.ForwardingList; + /** * @author CovertJaguar */ diff --git a/src/main/java/forestry/core/gui/tooltips/ToolTipLine.java b/src/main/java/forestry/core/gui/tooltips/ToolTipLine.java index 8ff51896e..ed442ab4d 100755 --- a/src/main/java/forestry/core/gui/tooltips/ToolTipLine.java +++ b/src/main/java/forestry/core/gui/tooltips/ToolTipLine.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.tooltips; diff --git a/src/main/java/forestry/core/gui/widgets/GameTokenWidget.java b/src/main/java/forestry/core/gui/widgets/GameTokenWidget.java index 6012a7d8c..42b8500f5 100644 --- a/src/main/java/forestry/core/gui/widgets/GameTokenWidget.java +++ b/src/main/java/forestry/core/gui/widgets/GameTokenWidget.java @@ -1,15 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.widgets; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; + +import org.lwjgl.opengl.GL11; + import forestry.core.gui.GuiUtil; import forestry.core.network.packets.PacketGuiSelectRequest; import forestry.core.proxy.Proxies; @@ -17,14 +23,9 @@ import forestry.core.render.SpriteSheet; import forestry.core.render.TextureManager; import forestry.core.tiles.EscritoireGame; import forestry.core.tiles.EscritoireGameToken; -import net.minecraft.client.renderer.RenderHelper; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import org.lwjgl.opengl.GL11; public class GameTokenWidget extends Widget { + private final ItemStack HIDDEN_TOKEN = new ItemStack(Items.book); private final EscritoireGame game; diff --git a/src/main/java/forestry/core/gui/widgets/ItemStackWidget.java b/src/main/java/forestry/core/gui/widgets/ItemStackWidget.java index 7020b20c0..5c4d8024d 100644 --- a/src/main/java/forestry/core/gui/widgets/ItemStackWidget.java +++ b/src/main/java/forestry/core/gui/widgets/ItemStackWidget.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.widgets; import net.minecraft.item.ItemStack; public class ItemStackWidget extends ItemStackWidgetBase { + private final ItemStack itemStack; public ItemStackWidget(WidgetManager widgetManager, int xPos, int yPos, ItemStack itemStack) { diff --git a/src/main/java/forestry/core/gui/widgets/ItemStackWidgetBase.java b/src/main/java/forestry/core/gui/widgets/ItemStackWidgetBase.java index 69f62bdd7..04163c668 100644 --- a/src/main/java/forestry/core/gui/widgets/ItemStackWidgetBase.java +++ b/src/main/java/forestry/core/gui/widgets/ItemStackWidgetBase.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.widgets; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import forestry.core.gui.GuiUtil; import forestry.core.gui.tooltips.ToolTip; import forestry.core.proxy.Proxies; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public abstract class ItemStackWidgetBase extends Widget { + public ItemStackWidgetBase(WidgetManager widgetManager, int xPos, int yPos) { super(widgetManager, xPos, yPos); } diff --git a/src/main/java/forestry/core/gui/widgets/ProbeButton.java b/src/main/java/forestry/core/gui/widgets/ProbeButton.java index c32ccf74f..e843c4fc7 100644 --- a/src/main/java/forestry/core/gui/widgets/ProbeButton.java +++ b/src/main/java/forestry/core/gui/widgets/ProbeButton.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.widgets; +import net.minecraft.entity.player.EntityPlayer; + +import org.lwjgl.opengl.GL11; + import forestry.core.gui.GuiEscritoire; import forestry.core.network.packets.PacketGuiSelectRequest; import forestry.core.proxy.Proxies; import forestry.core.utils.StringUtil; -import net.minecraft.entity.player.EntityPlayer; -import org.lwjgl.opengl.GL11; public class ProbeButton extends Widget { diff --git a/src/main/java/forestry/core/gui/widgets/ReservoirWidget.java b/src/main/java/forestry/core/gui/widgets/ReservoirWidget.java index 17c2da5dc..bf83da613 100755 --- a/src/main/java/forestry/core/gui/widgets/ReservoirWidget.java +++ b/src/main/java/forestry/core/gui/widgets/ReservoirWidget.java @@ -1,16 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.widgets; public class ReservoirWidget extends TankWidget { + public ReservoirWidget(WidgetManager manager, int xPos, int yPos, int slot) { super(manager, xPos, yPos, slot); this.height = 16; diff --git a/src/main/java/forestry/core/gui/widgets/SocketWidget.java b/src/main/java/forestry/core/gui/widgets/SocketWidget.java index cf61ffaaa..a375fa9d9 100755 --- a/src/main/java/forestry/core/gui/widgets/SocketWidget.java +++ b/src/main/java/forestry/core/gui/widgets/SocketWidget.java @@ -1,15 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.widgets; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; + import forestry.core.circuits.ISocketable; import forestry.core.circuits.ISolderingIron; import forestry.core.circuits.ItemCircuitBoard; @@ -18,11 +22,6 @@ import forestry.core.gui.IContainerSocketed; import forestry.core.gui.tooltips.ToolTip; import forestry.core.proxy.Proxies; import forestry.core.utils.StringUtil; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; public class SocketWidget extends Widget { @@ -39,13 +38,12 @@ public class SocketWidget extends Widget { public void draw(int startX, int startY) { ItemStack socketStack = tile.getSocket(slot); if (socketStack != null) { - GuiForestry.getItemRenderer() - .renderItemIntoGUI( - manager.minecraft.fontRenderer, - manager.minecraft.renderEngine, - socketStack, - startX + xPos, - startY + yPos); + GuiForestry.getItemRenderer().renderItemIntoGUI( + manager.minecraft.fontRenderer, + manager.minecraft.renderEngine, + socketStack, + startX + xPos, + startY + yPos); } } @@ -55,6 +53,7 @@ public class SocketWidget extends Widget { } private final ToolTip toolTip = new ToolTip(250) { + @SuppressWarnings("unchecked") @Override public void refresh() { diff --git a/src/main/java/forestry/core/gui/widgets/TankWidget.java b/src/main/java/forestry/core/gui/widgets/TankWidget.java index c2058e935..d9dfc8bf1 100755 --- a/src/main/java/forestry/core/gui/widgets/TankWidget.java +++ b/src/main/java/forestry/core/gui/widgets/TankWidget.java @@ -1,15 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.widgets; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidTank; + +import org.lwjgl.opengl.GL11; + import forestry.api.core.IToolPipette; import forestry.core.fluids.tanks.StandardTank; import forestry.core.gui.IContainerLiquidTanks; @@ -17,14 +25,6 @@ import forestry.core.gui.tooltips.ToolTip; import forestry.core.proxy.Proxies; import forestry.core.render.SpriteSheet; import forestry.farming.gui.ContainerFarm; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidTank; -import org.lwjgl.opengl.GL11; /** * Slot for liquid tanks @@ -99,7 +99,11 @@ public class TankWidget extends Widget { } manager.gui.drawTexturedModelRectFromIcon( - startX + xPos, startY + yPos + height - x - start, liquidIcon, 16, x); + startX + xPos, + startY + yPos + height - x - start, + liquidIcon, + 16, + x); start += 16; } diff --git a/src/main/java/forestry/core/gui/widgets/Widget.java b/src/main/java/forestry/core/gui/widgets/Widget.java index 72498f052..0b4cfb551 100755 --- a/src/main/java/forestry/core/gui/widgets/Widget.java +++ b/src/main/java/forestry/core/gui/widgets/Widget.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.widgets; +import net.minecraft.entity.player.EntityPlayer; + import forestry.core.gui.tooltips.IToolTipProvider; import forestry.core.gui.tooltips.ToolTip; import forestry.core.proxy.Proxies; -import net.minecraft.entity.player.EntityPlayer; /** * Basic non-ItemStack slot */ public abstract class Widget implements IToolTipProvider { + protected final WidgetManager manager; protected final int xPos; protected final int yPos; diff --git a/src/main/java/forestry/core/gui/widgets/WidgetManager.java b/src/main/java/forestry/core/gui/widgets/WidgetManager.java index 1bd25dc74..e7a26e43d 100644 --- a/src/main/java/forestry/core/gui/widgets/WidgetManager.java +++ b/src/main/java/forestry/core/gui/widgets/WidgetManager.java @@ -1,22 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.gui.widgets; -import forestry.core.gui.GuiForestry; -import forestry.core.proxy.Proxies; import java.util.ArrayList; import java.util.List; + import net.minecraft.client.Minecraft; + import org.lwjgl.opengl.GL11; +import forestry.core.gui.GuiForestry; +import forestry.core.proxy.Proxies; + public class WidgetManager { public final GuiForestry gui; diff --git a/src/main/java/forestry/core/inventory/AdjacentInventoryCache.java b/src/main/java/forestry/core/inventory/AdjacentInventoryCache.java index a2737d465..88cb2aaa4 100644 --- a/src/main/java/forestry/core/inventory/AdjacentInventoryCache.java +++ b/src/main/java/forestry/core/inventory/AdjacentInventoryCache.java @@ -1,33 +1,34 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory; -import forestry.core.tiles.AdjacentTileCache; -import forestry.core.tiles.TileUtil; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Comparator; import java.util.LinkedList; import java.util.List; + import net.minecraft.inventory.IInventory; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.util.ForgeDirection; +import forestry.core.tiles.AdjacentTileCache; +import forestry.core.tiles.TileUtil; + /** * @author CovertJaguar */ public final class AdjacentInventoryCache implements AdjacentTileCache.ICacheListener { public interface ITileFilter { + boolean matches(TileEntity tile); } @@ -46,8 +47,8 @@ public final class AdjacentInventoryCache implements AdjacentTileCache.ICacheLis this(tile, cache, filter, null); } - public AdjacentInventoryCache( - TileEntity tile, AdjacentTileCache cache, ITileFilter filter, Comparator sorter) { + public AdjacentInventoryCache(TileEntity tile, AdjacentTileCache cache, ITileFilter filter, + Comparator sorter) { this.cache = cache; this.filter = filter; this.sorter = sorter; diff --git a/src/main/java/forestry/core/inventory/FakeInventoryAdapter.java b/src/main/java/forestry/core/inventory/FakeInventoryAdapter.java index da1959e22..cd6467536 100644 --- a/src/main/java/forestry/core/inventory/FakeInventoryAdapter.java +++ b/src/main/java/forestry/core/inventory/FakeInventoryAdapter.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory; -import forestry.core.config.Constants; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import forestry.core.config.Constants; + public class FakeInventoryAdapter implements IInventoryAdapter { private static FakeInventoryAdapter instance; diff --git a/src/main/java/forestry/core/inventory/IInventoryAdapter.java b/src/main/java/forestry/core/inventory/IInventoryAdapter.java index 594c5f91f..9a3b7d6d8 100644 --- a/src/main/java/forestry/core/inventory/IInventoryAdapter.java +++ b/src/main/java/forestry/core/inventory/IInventoryAdapter.java @@ -1,7 +1,9 @@ package forestry.core.inventory; +import net.minecraft.inventory.ISidedInventory; + import forestry.api.core.INBTTagable; import forestry.core.tiles.IFilterSlotDelegate; -import net.minecraft.inventory.ISidedInventory; -public interface IInventoryAdapter extends ISidedInventory, IFilterSlotDelegate, INBTTagable {} +public interface IInventoryAdapter extends ISidedInventory, IFilterSlotDelegate, INBTTagable { +} diff --git a/src/main/java/forestry/core/inventory/InventoryAdapter.java b/src/main/java/forestry/core/inventory/InventoryAdapter.java index 8a43c677c..99a1c8b50 100755 --- a/src/main/java/forestry/core/inventory/InventoryAdapter.java +++ b/src/main/java/forestry/core/inventory/InventoryAdapter.java @@ -1,25 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import forestry.core.config.Constants; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IStreamable; import forestry.core.utils.InventoryUtil; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; /** * With permission from Krapht. @@ -49,17 +49,19 @@ public class InventoryAdapter implements IInventoryAdapter, IStreamable { return this; } - // public InventoryAdapter enableDebug() { - // this.debug = true; - // return this; - // } + // public InventoryAdapter enableDebug() { + // this.debug = true; + // return this; + // } /** * @return Copy of this inventory. Stacks are copies. */ public InventoryAdapter copy() { InventoryAdapter copy = new InventoryAdapter( - inventory.getSizeInventory(), inventory.getInventoryName(), inventory.getInventoryStackLimit()); + inventory.getSizeInventory(), + inventory.getInventoryName(), + inventory.getInventoryStackLimit()); for (int i = 0; i < inventory.getSizeInventory(); i++) { if (inventory.getStackInSlot(i) != null) { diff --git a/src/main/java/forestry/core/inventory/InventoryAdapterRestricted.java b/src/main/java/forestry/core/inventory/InventoryAdapterRestricted.java index 5d6f042d1..0cc013dd6 100644 --- a/src/main/java/forestry/core/inventory/InventoryAdapterRestricted.java +++ b/src/main/java/forestry/core/inventory/InventoryAdapterRestricted.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory; -import forestry.core.access.IAccessHandler; -import forestry.core.config.Constants; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; +import forestry.core.access.IAccessHandler; +import forestry.core.config.Constants; + public class InventoryAdapterRestricted extends InventoryAdapter { + private final IAccessHandler accessHandler; public InventoryAdapterRestricted(int size, String name, IAccessHandler accessHandler) { diff --git a/src/main/java/forestry/core/inventory/InventoryAdapterTile.java b/src/main/java/forestry/core/inventory/InventoryAdapterTile.java index d4310bf65..9d7a36994 100644 --- a/src/main/java/forestry/core/inventory/InventoryAdapterTile.java +++ b/src/main/java/forestry/core/inventory/InventoryAdapterTile.java @@ -1,19 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory; -import forestry.core.access.IRestrictedAccess; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; +import forestry.core.access.IRestrictedAccess; + public class InventoryAdapterTile extends InventoryAdapterRestricted { protected final T tile; diff --git a/src/main/java/forestry/core/inventory/InventoryAnalyzer.java b/src/main/java/forestry/core/inventory/InventoryAnalyzer.java index 5b4e89937..f10afdd8a 100644 --- a/src/main/java/forestry/core/inventory/InventoryAnalyzer.java +++ b/src/main/java/forestry/core/inventory/InventoryAnalyzer.java @@ -1,15 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; + import forestry.api.arboriculture.TreeManager; import forestry.api.genetics.AlleleManager; import forestry.core.fluids.FluidHelper; @@ -17,10 +18,9 @@ import forestry.core.tiles.TileAnalyzer; import forestry.core.utils.GeneticsUtil; import forestry.core.utils.SlotUtil; import forestry.plugins.PluginManager; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; public class InventoryAnalyzer extends InventoryAdapterTile { + public static final short SLOT_ANALYZE = 0; public static final short SLOT_CAN = 1; public static final short SLOT_INPUT_1 = 2; diff --git a/src/main/java/forestry/core/inventory/InventoryEscritoire.java b/src/main/java/forestry/core/inventory/InventoryEscritoire.java index 428fde25c..378383d33 100644 --- a/src/main/java/forestry/core/inventory/InventoryEscritoire.java +++ b/src/main/java/forestry/core/inventory/InventoryEscritoire.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory; +import net.minecraft.item.ItemStack; + import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IIndividual; import forestry.core.tiles.TileEscritoire; import forestry.core.utils.GeneticsUtil; import forestry.core.utils.SlotUtil; -import net.minecraft.item.ItemStack; public class InventoryEscritoire extends InventoryAdapterTile { + public static final short SLOT_ANALYZE = 0; public static final short SLOT_RESULTS_1 = 1; public static final short SLOTS_RESULTS_COUNT = 6; @@ -30,8 +30,7 @@ public class InventoryEscritoire extends InventoryAdapterTile { @Override public boolean canSlotAccept(int slotIndex, ItemStack itemStack) { - if (slotIndex >= SLOT_INPUT_1 - && slotIndex < SLOT_INPUT_1 + tile.getGame().getSampleSize(SLOTS_INPUT_COUNT)) { + if (slotIndex >= SLOT_INPUT_1 && slotIndex < SLOT_INPUT_1 + tile.getGame().getSampleSize(SLOTS_INPUT_COUNT)) { ItemStack specimen = getStackInSlot(SLOT_ANALYZE); if (specimen == null) { return false; diff --git a/src/main/java/forestry/core/inventory/InventoryNaturalistChest.java b/src/main/java/forestry/core/inventory/InventoryNaturalistChest.java index 05e74a950..210708501 100644 --- a/src/main/java/forestry/core/inventory/InventoryNaturalistChest.java +++ b/src/main/java/forestry/core/inventory/InventoryNaturalistChest.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory; -import forestry.api.genetics.ISpeciesRoot; -import forestry.core.tiles.TileNaturalistChest; import net.minecraft.item.ItemStack; +import forestry.api.genetics.ISpeciesRoot; +import forestry.core.tiles.TileNaturalistChest; + public class InventoryNaturalistChest extends InventoryAdapterTile { + private final ISpeciesRoot speciesRoot; public InventoryNaturalistChest(TileNaturalistChest tile, ISpeciesRoot speciesRoot) { diff --git a/src/main/java/forestry/core/inventory/InventoryPlain.java b/src/main/java/forestry/core/inventory/InventoryPlain.java index 534eff40a..7e8e9908b 100644 --- a/src/main/java/forestry/core/inventory/InventoryPlain.java +++ b/src/main/java/forestry/core/inventory/InventoryPlain.java @@ -1,22 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory; -import forestry.api.core.INBTTagable; -import forestry.core.utils.InventoryUtil; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import forestry.api.core.INBTTagable; +import forestry.core.utils.InventoryUtil; + public class InventoryPlain implements IInventory, INBTTagable { private final ItemStack[] contents; diff --git a/src/main/java/forestry/core/inventory/ItemInventory.java b/src/main/java/forestry/core/inventory/ItemInventory.java index bfb211133..64ebe0848 100755 --- a/src/main/java/forestry/core/inventory/ItemInventory.java +++ b/src/main/java/forestry/core/inventory/ItemInventory.java @@ -1,24 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory; -import forestry.core.tiles.IFilterSlotDelegate; import java.util.Random; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; +import forestry.core.tiles.IFilterSlotDelegate; + public abstract class ItemInventory implements IInventory, IFilterSlotDelegate { + private static final String KEY_ITEMS = "Items"; // legacy private static final String KEY_SLOTS = "Slots"; private static final String KEY_UID = "UID"; diff --git a/src/main/java/forestry/core/inventory/ItemInventoryAlyzer.java b/src/main/java/forestry/core/inventory/ItemInventoryAlyzer.java index 15406df4c..dc940bf34 100644 --- a/src/main/java/forestry/core/inventory/ItemInventoryAlyzer.java +++ b/src/main/java/forestry/core/inventory/ItemInventoryAlyzer.java @@ -1,16 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import com.google.common.collect.ImmutableSet; + import forestry.api.core.IErrorSource; import forestry.api.core.IErrorState; import forestry.api.genetics.IBreedingTracker; @@ -20,12 +24,9 @@ import forestry.apiculture.items.ItemRegistryApiculture; import forestry.core.errors.EnumErrorCode; import forestry.plugins.PluginApiculture; import forestry.plugins.PluginManager; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public abstract class ItemInventoryAlyzer extends ItemInventory implements IErrorSource { + public static final int SLOT_SPECIMEN = 0; public static final int SLOT_ANALYZE_1 = 1; public static final int SLOT_ANALYZE_2 = 2; @@ -90,8 +91,8 @@ public abstract class ItemInventoryAlyzer extends ItemInventory implements IErro individual.analyze(); if (player != null) { - IBreedingTracker breedingTracker = - speciesRoot.getBreedingTracker(player.worldObj, player.getGameProfile()); + IBreedingTracker breedingTracker = speciesRoot + .getBreedingTracker(player.worldObj, player.getGameProfile()); breedingTracker.registerSpecies(individual.getGenome().getPrimary()); breedingTracker.registerSpecies(individual.getGenome().getSecondary()); } diff --git a/src/main/java/forestry/core/inventory/ItemInventorySolderingIron.java b/src/main/java/forestry/core/inventory/ItemInventorySolderingIron.java index 21fe7674e..e8243da03 100644 --- a/src/main/java/forestry/core/inventory/ItemInventorySolderingIron.java +++ b/src/main/java/forestry/core/inventory/ItemInventorySolderingIron.java @@ -1,16 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + import com.google.common.collect.ImmutableSet; + import forestry.api.circuits.ChipsetManager; import forestry.api.circuits.ICircuit; import forestry.api.circuits.ICircuitLayout; @@ -25,10 +30,6 @@ import forestry.core.config.Config; import forestry.core.errors.EnumErrorCode; import forestry.core.gui.IHintSource; import forestry.core.utils.datastructures.RevolvingList; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; public class ItemInventorySolderingIron extends ItemInventory implements IErrorSource, IHintSource { diff --git a/src/main/java/forestry/core/inventory/filters/ArrayStackFilter.java b/src/main/java/forestry/core/inventory/filters/ArrayStackFilter.java index 2d195ac78..8009752ca 100755 --- a/src/main/java/forestry/core/inventory/filters/ArrayStackFilter.java +++ b/src/main/java/forestry/core/inventory/filters/ArrayStackFilter.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory.filters; -import forestry.core.utils.InventoryUtil; import net.minecraft.item.ItemStack; +import forestry.core.utils.InventoryUtil; + /** * @author CovertJaguar */ diff --git a/src/main/java/forestry/core/inventory/filters/IStackFilter.java b/src/main/java/forestry/core/inventory/filters/IStackFilter.java index 27b7f5397..35e9e477a 100755 --- a/src/main/java/forestry/core/inventory/filters/IStackFilter.java +++ b/src/main/java/forestry/core/inventory/filters/IStackFilter.java @@ -1,21 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory.filters; import net.minecraft.item.ItemStack; /** - * This interface is used with several of the functions in IItemTransfer to - * provide a convenient means of dealing with entire classes of items without - * having to specify each item individually. + * This interface is used with several of the functions in IItemTransfer to provide a convenient means of dealing with + * entire classes of items without having to specify each item individually. * * @author CovertJaguar */ diff --git a/src/main/java/forestry/core/inventory/filters/InvertedStackFilter.java b/src/main/java/forestry/core/inventory/filters/InvertedStackFilter.java index f90f174f6..8647f17d6 100755 --- a/src/main/java/forestry/core/inventory/filters/InvertedStackFilter.java +++ b/src/main/java/forestry/core/inventory/filters/InvertedStackFilter.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory.filters; diff --git a/src/main/java/forestry/core/inventory/filters/StackFilter.java b/src/main/java/forestry/core/inventory/filters/StackFilter.java index c5bdf1a99..a9d70627f 100755 --- a/src/main/java/forestry/core/inventory/filters/StackFilter.java +++ b/src/main/java/forestry/core/inventory/filters/StackFilter.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory.filters; @@ -17,30 +15,32 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntityFurnace; /** - * This interface is used with several of the functions in IItemTransfer to - * provide a convenient means of dealing with entire classes of items without - * having to specify each item individually. + * This interface is used with several of the functions in IItemTransfer to provide a convenient means of dealing with + * entire classes of items without having to specify each item individually. * * @author CovertJaguar */ public enum StackFilter implements IStackFilter { + ALL { + @Override public boolean matches(ItemStack stack) { return true; } }, FUEL { + @Override public boolean matches(ItemStack stack) { return TileEntityFurnace.getItemBurnTime(stack) > 0; } }, FEED { + @Override public boolean matches(ItemStack stack) { - return stack.getItem() instanceof ItemFood - || stack.getItem() == Items.wheat + return stack.getItem() instanceof ItemFood || stack.getItem() == Items.wheat || stack.getItem() instanceof ItemSeeds; } }; diff --git a/src/main/java/forestry/core/inventory/manipulators/InventoryManipulator.java b/src/main/java/forestry/core/inventory/manipulators/InventoryManipulator.java index 7cfc5f0c0..798d679fb 100755 --- a/src/main/java/forestry/core/inventory/manipulators/InventoryManipulator.java +++ b/src/main/java/forestry/core/inventory/manipulators/InventoryManipulator.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory.manipulators; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + import forestry.core.inventory.filters.IStackFilter; import forestry.core.inventory.wrappers.IInvSlot; import forestry.core.inventory.wrappers.InventoryIterator; import forestry.core.utils.InventoryUtil; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; /** * @author CovertJaguar diff --git a/src/main/java/forestry/core/inventory/watchers/FakeSlotChangeWatcher.java b/src/main/java/forestry/core/inventory/watchers/FakeSlotChangeWatcher.java index eaa668f48..3141e4849 100644 --- a/src/main/java/forestry/core/inventory/watchers/FakeSlotChangeWatcher.java +++ b/src/main/java/forestry/core/inventory/watchers/FakeSlotChangeWatcher.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory.watchers; import net.minecraft.inventory.IInventory; public class FakeSlotChangeWatcher implements ISlotChangeWatcher { + public static final FakeSlotChangeWatcher instance = new FakeSlotChangeWatcher(); private FakeSlotChangeWatcher() {} diff --git a/src/main/java/forestry/core/inventory/watchers/FakeSlotPickupWatcher.java b/src/main/java/forestry/core/inventory/watchers/FakeSlotPickupWatcher.java index 7b0b97dfe..bbc8e04d2 100644 --- a/src/main/java/forestry/core/inventory/watchers/FakeSlotPickupWatcher.java +++ b/src/main/java/forestry/core/inventory/watchers/FakeSlotPickupWatcher.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory.watchers; diff --git a/src/main/java/forestry/core/inventory/watchers/ISlotChangeWatcher.java b/src/main/java/forestry/core/inventory/watchers/ISlotChangeWatcher.java index f5c69144f..435206e9b 100644 --- a/src/main/java/forestry/core/inventory/watchers/ISlotChangeWatcher.java +++ b/src/main/java/forestry/core/inventory/watchers/ISlotChangeWatcher.java @@ -1,17 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory.watchers; import net.minecraft.inventory.IInventory; public interface ISlotChangeWatcher { + void onSlotChanged(IInventory inventory, int slot); } diff --git a/src/main/java/forestry/core/inventory/watchers/ISlotPickupWatcher.java b/src/main/java/forestry/core/inventory/watchers/ISlotPickupWatcher.java index aef7156d3..6b5c640c6 100644 --- a/src/main/java/forestry/core/inventory/watchers/ISlotPickupWatcher.java +++ b/src/main/java/forestry/core/inventory/watchers/ISlotPickupWatcher.java @@ -1,17 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory.watchers; import net.minecraft.entity.player.EntityPlayer; public interface ISlotPickupWatcher { + void onPickupFromSlot(int slotIndex, EntityPlayer player); } diff --git a/src/main/java/forestry/core/inventory/wrappers/ChestWrapper.java b/src/main/java/forestry/core/inventory/wrappers/ChestWrapper.java index e6b2515c1..e6db514e0 100755 --- a/src/main/java/forestry/core/inventory/wrappers/ChestWrapper.java +++ b/src/main/java/forestry/core/inventory/wrappers/ChestWrapper.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory.wrappers; @@ -79,9 +77,8 @@ public class ChestWrapper implements IInventory { } /** - * If this returns false, the inventory name will be used as an unlocalized - * name, and translated into the player's language. Otherwise it will be - * used directly. + * If this returns false, the inventory name will be used as an unlocalized name, and translated into the player's + * language. Otherwise it will be used directly. */ @Override public boolean hasCustomInventoryName() { @@ -101,8 +98,8 @@ public class ChestWrapper implements IInventory { } /** - * Removes from an inventory slot (first arg) up to a specified number - * (second arg) of items and returns them in a new stack. + * Removes from an inventory slot (first arg) up to a specified number (second arg) of items and returns them in a + * new stack. */ @Override public ItemStack decrStackSize(int slot, int amout) { @@ -114,9 +111,8 @@ public class ChestWrapper implements IInventory { } /** - * When some containers are closed they call this on each slot, then drop - * whatever it returns as an EntityItem - like when you close a workbench - * GUI. + * When some containers are closed they call this on each slot, then drop whatever it returns as an EntityItem - + * like when you close a workbench GUI. */ @Override public ItemStack getStackInSlotOnClosing(int slot) { @@ -128,8 +124,7 @@ public class ChestWrapper implements IInventory { } /** - * Sets the given item stack to the specified slot in the inventory (can be - * crafting or armor sections). + * Sets the given item stack to the specified slot in the inventory (can be crafting or armor sections). */ @Override public void setInventorySlotContents(int slot, ItemStack stack) { @@ -142,8 +137,8 @@ public class ChestWrapper implements IInventory { } /** - * Returns the maximum stack size for a inventory slot. Seems to always be - * 64, possibly will be extended. *Isn't this more of a set than a get?* + * Returns the maximum stack size for a inventory slot. Seems to always be 64, possibly will be extended. *Isn't + * this more of a set than a get?* */ @Override public int getInventoryStackLimit() { @@ -162,8 +157,7 @@ public class ChestWrapper implements IInventory { } /** - * Do not make give this method the name canInteractWith because it clashes - * with Container + * Do not make give this method the name canInteractWith because it clashes with Container */ @Override public boolean isUseableByPlayer(EntityPlayer player) { @@ -188,8 +182,7 @@ public class ChestWrapper implements IInventory { } /** - * Returns true if automation is allowed to insert the given stack (ignoring - * stack size) into the given slot. + * Returns true if automation is allowed to insert the given stack (ignoring stack size) into the given slot. */ @Override public boolean isItemValidForSlot(int slot, ItemStack stack) { diff --git a/src/main/java/forestry/core/inventory/wrappers/IInvSlot.java b/src/main/java/forestry/core/inventory/wrappers/IInvSlot.java index 3764845a4..e04a8e34e 100755 --- a/src/main/java/forestry/core/inventory/wrappers/IInvSlot.java +++ b/src/main/java/forestry/core/inventory/wrappers/IInvSlot.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory.wrappers; diff --git a/src/main/java/forestry/core/inventory/wrappers/InventoryCopy.java b/src/main/java/forestry/core/inventory/wrappers/InventoryCopy.java index fc8fe5a69..0c11d2b1a 100755 --- a/src/main/java/forestry/core/inventory/wrappers/InventoryCopy.java +++ b/src/main/java/forestry/core/inventory/wrappers/InventoryCopy.java @@ -1,25 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory.wrappers; -import forestry.core.utils.InventoryUtil; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +import forestry.core.utils.InventoryUtil; + /** * Creates a deep copy of an existing IInventory. * - * Useful for performing inventory manipulations and then examining the results - * without affecting the original inventory. + * Useful for performing inventory manipulations and then examining the results without affecting the original + * inventory. * * @author CovertJaguar */ diff --git a/src/main/java/forestry/core/inventory/wrappers/InventoryIterator.java b/src/main/java/forestry/core/inventory/wrappers/InventoryIterator.java index eb8c09786..37402115a 100755 --- a/src/main/java/forestry/core/inventory/wrappers/InventoryIterator.java +++ b/src/main/java/forestry/core/inventory/wrappers/InventoryIterator.java @@ -1,16 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory.wrappers; import java.util.Iterator; + import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; @@ -38,6 +37,7 @@ public class InventoryIterator implements Iterable { @Override public Iterator iterator() { return new Iterator() { + int slot = 0; @Override diff --git a/src/main/java/forestry/core/inventory/wrappers/InventoryMapper.java b/src/main/java/forestry/core/inventory/wrappers/InventoryMapper.java index 34be919df..a2b850df3 100755 --- a/src/main/java/forestry/core/inventory/wrappers/InventoryMapper.java +++ b/src/main/java/forestry/core/inventory/wrappers/InventoryMapper.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory.wrappers; @@ -16,9 +14,8 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; /** - * Wrapper class used to specify part of an existing inventory to be treated as - * a complete inventory. Used primarily to map a side of an ISidedInventory, but - * it is also helpful for complex inventories such as the Tunnel Bore. + * Wrapper class used to specify part of an existing inventory to be treated as a complete inventory. Used primarily to + * map a side of an ISidedInventory, but it is also helpful for complex inventories such as the Tunnel Bore. * * @author CovertJaguar */ @@ -47,8 +44,7 @@ public class InventoryMapper implements IInventory { * * @param inv The backing inventory * @param start The starting index - * @param size The size of the new inventory, take care not to exceed the - * end of the backing inventory + * @param size The size of the new inventory, take care not to exceed the end of the backing inventory */ public InventoryMapper(IInventory inv, int start, int size) { this(inv, start, size, true); diff --git a/src/main/java/forestry/core/inventory/wrappers/SidedInventoryIterator.java b/src/main/java/forestry/core/inventory/wrappers/SidedInventoryIterator.java index 5c0e9a363..fe08f85ae 100755 --- a/src/main/java/forestry/core/inventory/wrappers/SidedInventoryIterator.java +++ b/src/main/java/forestry/core/inventory/wrappers/SidedInventoryIterator.java @@ -1,16 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory.wrappers; import java.util.Iterator; + import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; @@ -28,6 +27,7 @@ public class SidedInventoryIterator implements Iterable { @Override public Iterator iterator() { return new Iterator() { + final int[] slots = inv.getAccessibleSlotsFromSide(0); int index = 0; diff --git a/src/main/java/forestry/core/inventory/wrappers/SidedInventoryMapper.java b/src/main/java/forestry/core/inventory/wrappers/SidedInventoryMapper.java index a0bf9f166..179ebd3c9 100755 --- a/src/main/java/forestry/core/inventory/wrappers/SidedInventoryMapper.java +++ b/src/main/java/forestry/core/inventory/wrappers/SidedInventoryMapper.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.inventory.wrappers; @@ -17,8 +15,8 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.common.util.ForgeDirection; /** - * Wrapper class used to bake the side variable into the object itself instead - * of passing it around to all the inventory tools. + * Wrapper class used to bake the side variable into the object itself instead of passing it around to all the inventory + * tools. * * @author CovertJaguar */ diff --git a/src/main/java/forestry/core/items/EnumContainerType.java b/src/main/java/forestry/core/items/EnumContainerType.java index bb4f49823..7a03f7059 100644 --- a/src/main/java/forestry/core/items/EnumContainerType.java +++ b/src/main/java/forestry/core/items/EnumContainerType.java @@ -1,16 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; public enum EnumContainerType { + GLASS("glass"), JAR("jar"), CAN("can"), diff --git a/src/main/java/forestry/core/items/EnumElectronTube.java b/src/main/java/forestry/core/items/EnumElectronTube.java index 4da5cd27e..ab1189c2c 100644 --- a/src/main/java/forestry/core/items/EnumElectronTube.java +++ b/src/main/java/forestry/core/items/EnumElectronTube.java @@ -1,23 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; +import java.awt.Color; + +import net.minecraft.item.ItemStack; + import forestry.api.recipes.RecipeManagers; import forestry.core.fluids.Fluids; import forestry.core.recipes.RecipeUtil; import forestry.plugins.PluginCore; -import java.awt.Color; -import net.minecraft.item.ItemStack; public enum EnumElectronTube implements ItemOverlay.IOverlayInfo { + COPPER(new Color(0xe3b78e)), TIN(new Color(0xE6F8FF)), BRONZE(new Color(0xddc276)), @@ -73,17 +74,19 @@ public enum EnumElectronTube implements ItemOverlay.IOverlayInfo { if (stack != null) { for (Object stackOreDict : RecipeUtil.getOreDictRecipeEquivalents(stack)) { RecipeManagers.fabricatorManager.addRecipe( - null, Fluids.GLASS.getFluid(500), PluginCore.items.tubes.get(this, 4), new Object[] { - " X ", "#X#", "XXX", '#', "dustRedstone", 'X', stackOreDict - }); + null, + Fluids.GLASS.getFluid(500), + PluginCore.items.tubes.get(this, 4), + new Object[] { " X ", "#X#", "XXX", '#', "dustRedstone", 'X', stackOreDict }); } } } public void registerTubeRecipe(String stack) { RecipeManagers.fabricatorManager.addRecipe( - null, Fluids.GLASS.getFluid(500), PluginCore.items.tubes.get(this, 4), new Object[] { - " X ", "#X#", "XXX", '#', "dustRedstone", 'X', stack - }); + null, + Fluids.GLASS.getFluid(500), + PluginCore.items.tubes.get(this, 4), + new Object[] { " X ", "#X#", "XXX", '#', "dustRedstone", 'X', stack }); } } diff --git a/src/main/java/forestry/core/items/ICraftingPlan.java b/src/main/java/forestry/core/items/ICraftingPlan.java index c911ab9e7..88f3d7890 100644 --- a/src/main/java/forestry/core/items/ICraftingPlan.java +++ b/src/main/java/forestry/core/items/ICraftingPlan.java @@ -1,17 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; import net.minecraft.item.ItemStack; public interface ICraftingPlan { + ItemStack planUsed(ItemStack plan, ItemStack result); } diff --git a/src/main/java/forestry/core/items/ItemArmorNaturalist.java b/src/main/java/forestry/core/items/ItemArmorNaturalist.java index f22b59c09..6d2ebbdb0 100755 --- a/src/main/java/forestry/core/items/ItemArmorNaturalist.java +++ b/src/main/java/forestry/core/items/ItemArmorNaturalist.java @@ -1,15 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; +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.util.IIcon; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.core.IArmorNaturalist; @@ -17,12 +22,6 @@ import forestry.core.CreativeTabForestry; import forestry.core.config.Constants; import forestry.core.render.TextureManager; import forestry.core.utils.StringUtil; -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.util.IIcon; public class ItemArmorNaturalist extends ItemArmor implements IArmorNaturalist { diff --git a/src/main/java/forestry/core/items/ItemAssemblyKit.java b/src/main/java/forestry/core/items/ItemAssemblyKit.java index 38c31d19f..55f86d252 100755 --- a/src/main/java/forestry/core/items/ItemAssemblyKit.java +++ b/src/main/java/forestry/core/items/ItemAssemblyKit.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; @@ -16,6 +14,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class ItemAssemblyKit extends ItemForestry { + private final ItemStack assembled; public ItemAssemblyKit(ItemStack assembled) { @@ -27,8 +26,12 @@ public class ItemAssemblyKit extends ItemForestry { public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer entityplayer) { if (!world.isRemote) { itemstack.stackSize--; - EntityItem entity = - new EntityItem(world, entityplayer.posX, entityplayer.posY, entityplayer.posZ, assembled.copy()); + EntityItem entity = new EntityItem( + world, + entityplayer.posX, + entityplayer.posY, + entityplayer.posZ, + assembled.copy()); world.spawnEntityInWorld(entity); } return itemstack; diff --git a/src/main/java/forestry/core/items/ItemBlockForestry.java b/src/main/java/forestry/core/items/ItemBlockForestry.java index 952d6b850..f0fa6114e 100644 --- a/src/main/java/forestry/core/items/ItemBlockForestry.java +++ b/src/main/java/forestry/core/items/ItemBlockForestry.java @@ -1,19 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.core.tiles.TileForestry; -import forestry.core.tiles.TileUtil; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; @@ -21,6 +15,11 @@ 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; +import forestry.core.tiles.TileForestry; +import forestry.core.tiles.TileUtil; + public class ItemBlockForestry extends ItemBlock { public ItemBlockForestry(Block block) { @@ -50,18 +49,8 @@ public class ItemBlockForestry extends ItemBlock { } @Override - 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) { + 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) { boolean placed = super.placeBlockAt(stack, player, world, x, y, z, side, hitX, hitY, hitZ, metadata); TileForestry tile = TileUtil.getTile(world, x, y, z, TileForestry.class); diff --git a/src/main/java/forestry/core/items/ItemBlockNBT.java b/src/main/java/forestry/core/items/ItemBlockNBT.java index 540e88800..f5da3818c 100644 --- a/src/main/java/forestry/core/items/ItemBlockNBT.java +++ b/src/main/java/forestry/core/items/ItemBlockNBT.java @@ -1,16 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; @@ -21,7 +20,7 @@ public class ItemBlockNBT extends ItemBlockForestry { super(block); } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void addInformation(ItemStack itemstack, EntityPlayer player, List info, boolean par4) { if (!itemstack.hasTagCompound()) { diff --git a/src/main/java/forestry/core/items/ItemBlockTyped.java b/src/main/java/forestry/core/items/ItemBlockTyped.java index 8a7b84bb8..8a7e3ef45 100644 --- a/src/main/java/forestry/core/items/ItemBlockTyped.java +++ b/src/main/java/forestry/core/items/ItemBlockTyped.java @@ -1,22 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; -import forestry.core.blocks.IItemTyped; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; +import forestry.core.blocks.IItemTyped; + /** - * For blocks whose type depends on metadata. - * This allows control over which localized name maps to which meta value. + * For blocks whose type depends on metadata. This allows control over which localized name maps to which meta value. */ public class ItemBlockTyped extends ItemBlockForestry { diff --git a/src/main/java/forestry/core/items/ItemCraftingMaterial.java b/src/main/java/forestry/core/items/ItemCraftingMaterial.java index 8208ccc37..e184e8609 100644 --- a/src/main/java/forestry/core/items/ItemCraftingMaterial.java +++ b/src/main/java/forestry/core/items/ItemCraftingMaterial.java @@ -1,30 +1,29 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.core.render.TextureManager; import java.util.List; + 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 cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.core.render.TextureManager; + public class ItemCraftingMaterial extends ItemForestry { - private final String[] definition = new String[] { - "pulsatingDust", "pulsatingMesh", "silkWisp", "wovenSilk", "dissipationCharge", "iceShard", "scentedPaneling" - }; + private final String[] definition = new String[] { "pulsatingDust", "pulsatingMesh", "silkWisp", "wovenSilk", + "dissipationCharge", "iceShard", "scentedPaneling" }; public ItemCraftingMaterial() { super(); @@ -74,7 +73,7 @@ public class ItemCraftingMaterial extends ItemForestry { } } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { for (int i = 0; i < 7; i++) { diff --git a/src/main/java/forestry/core/items/ItemCrated.java b/src/main/java/forestry/core/items/ItemCrated.java index 4aeb25eed..ad04680f4 100755 --- a/src/main/java/forestry/core/items/ItemCrated.java +++ b/src/main/java/forestry/core/items/ItemCrated.java @@ -1,26 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; +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 cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.core.proxy.Proxies; import forestry.core.render.TextureManager; import forestry.core.utils.ItemStackUtil; import forestry.core.utils.StringUtil; -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; public class ItemCrated extends ItemForestry { @@ -52,7 +51,12 @@ public class ItemCrated extends ItemForestry { ItemStack dropStack = contained.copy(); dropStack.stackSize = 9; ItemStackUtil.dropItemStackAsEntity( - dropStack, world, entityplayer.posX, entityplayer.posY, entityplayer.posZ, 40); + dropStack, + world, + entityplayer.posX, + entityplayer.posY, + entityplayer.posZ, + 40); } return itemstack; } diff --git a/src/main/java/forestry/core/items/ItemElectronTube.java b/src/main/java/forestry/core/items/ItemElectronTube.java index 7caa4fbbf..a230a4e9b 100644 --- a/src/main/java/forestry/core/items/ItemElectronTube.java +++ b/src/main/java/forestry/core/items/ItemElectronTube.java @@ -1,17 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; +import java.util.Collection; +import java.util.List; + +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 com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Multimap; + import forestry.api.circuits.ChipsetManager; import forestry.api.circuits.ICircuit; import forestry.api.circuits.ICircuitLayout; @@ -20,13 +28,6 @@ import forestry.core.circuits.SolderManager; import forestry.core.config.Config; import forestry.core.proxy.Proxies; import forestry.core.utils.StringUtil; -import java.util.Collection; -import java.util.List; -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; public class ItemElectronTube extends ItemOverlay { @@ -34,7 +35,7 @@ public class ItemElectronTube extends ItemOverlay { super(CreativeTabForestry.tabForestry, EnumElectronTube.VALUES); } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean flag) { Multimap circuits = getCircuits(itemstack); @@ -55,7 +56,7 @@ public class ItemElectronTube extends ItemOverlay { } } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { for (int i = 0; i < overlays.length; i++) { @@ -70,8 +71,7 @@ public class ItemElectronTube extends ItemOverlay { private static Multimap getCircuits(ItemStack itemStack) { Multimap circuits = ArrayListMultimap.create(); - Collection allLayouts = - ChipsetManager.circuitRegistry.getRegisteredLayouts().values(); + Collection allLayouts = ChipsetManager.circuitRegistry.getRegisteredLayouts().values(); for (ICircuitLayout circuitLayout : allLayouts) { ICircuit circuit = SolderManager.getCircuit(circuitLayout, itemStack); if (circuit != null) { diff --git a/src/main/java/forestry/core/items/ItemForestry.java b/src/main/java/forestry/core/items/ItemForestry.java index acb702eea..2900fd969 100755 --- a/src/main/java/forestry/core/items/ItemForestry.java +++ b/src/main/java/forestry/core/items/ItemForestry.java @@ -1,27 +1,27 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.core.CreativeTabForestry; -import forestry.core.render.TextureManager; -import forestry.core.utils.StringUtil; 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.oredict.OreDictionary; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.core.CreativeTabForestry; +import forestry.core.render.TextureManager; +import forestry.core.utils.StringUtil; + public class ItemForestry extends Item { + public ItemForestry() { setCreativeTab(CreativeTabForestry.tabForestry); } diff --git a/src/main/java/forestry/core/items/ItemForestryBonemeal.java b/src/main/java/forestry/core/items/ItemForestryBonemeal.java index 4e1d404db..5799ceb22 100644 --- a/src/main/java/forestry/core/items/ItemForestryBonemeal.java +++ b/src/main/java/forestry/core/items/ItemForestryBonemeal.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; @@ -16,18 +14,10 @@ import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class ItemForestryBonemeal extends ItemForestry { + @Override - public boolean onItemUse( - ItemStack itemstack, - EntityPlayer player, - World world, - int x, - int y, - int z, - int par7, - float facingX, - float facingY, - float facingZ) { + public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int par7, + float facingX, float facingY, float facingZ) { if (ItemDye.applyBonemeal(itemstack, world, x, y, z, player)) { if (!world.isRemote) { world.playAuxSFX(2005, x, y, z, 0); diff --git a/src/main/java/forestry/core/items/ItemForestryFood.java b/src/main/java/forestry/core/items/ItemForestryFood.java index 39a897d7d..ed1b5584e 100755 --- a/src/main/java/forestry/core/items/ItemForestryFood.java +++ b/src/main/java/forestry/core/items/ItemForestryFood.java @@ -1,24 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.item.EnumAction; +import net.minecraft.item.ItemFood; +import net.minecraft.item.ItemStack; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.core.CreativeTabForestry; import forestry.core.render.TextureManager; import forestry.core.utils.StringUtil; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.item.EnumAction; -import net.minecraft.item.ItemFood; -import net.minecraft.item.ItemStack; public class ItemForestryFood extends ItemFood { diff --git a/src/main/java/forestry/core/items/ItemForestryMultiPass.java b/src/main/java/forestry/core/items/ItemForestryMultiPass.java index 5ec539ea6..4dc5caff0 100644 --- a/src/main/java/forestry/core/items/ItemForestryMultiPass.java +++ b/src/main/java/forestry/core/items/ItemForestryMultiPass.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.core.render.TextureManager; import forestry.core.utils.StringUtil; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.util.IIcon; public class ItemForestryMultiPass extends ItemForestry { diff --git a/src/main/java/forestry/core/items/ItemForestryTool.java b/src/main/java/forestry/core/items/ItemForestryTool.java index bc606c09c..759b48e00 100755 --- a/src/main/java/forestry/core/items/ItemForestryTool.java +++ b/src/main/java/forestry/core/items/ItemForestryTool.java @@ -1,17 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import forestry.core.utils.ItemStackUtil; import net.minecraft.block.Block; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; @@ -21,7 +17,11 @@ import net.minecraftforge.common.ForgeHooks; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; +import forestry.core.utils.ItemStackUtil; + public class ItemForestryTool extends ItemForestry { + private final ItemStack remnants; private float efficiencyOnProperMaterial; @@ -68,8 +68,8 @@ public class ItemForestryTool extends ItemForestry { } @Override - public boolean onBlockDestroyed( - ItemStack itemstack, World world, Block block, int x, int y, int z, EntityLivingBase entityliving) { + public boolean onBlockDestroyed(ItemStack itemstack, World world, Block block, int x, int y, int z, + EntityLivingBase entityliving) { if (block.getBlockHardness(world, x, y, z) != 0) { itemstack.damageItem(1, entityliving); } diff --git a/src/main/java/forestry/core/items/ItemFruit.java b/src/main/java/forestry/core/items/ItemFruit.java index 321a1a85f..e0cf30b6b 100755 --- a/src/main/java/forestry/core/items/ItemFruit.java +++ b/src/main/java/forestry/core/items/ItemFruit.java @@ -1,30 +1,31 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.core.render.TextureManager; -import forestry.plugins.PluginCore; import java.util.List; import java.util.Locale; + 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 cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.core.render.TextureManager; +import forestry.plugins.PluginCore; + public class ItemFruit extends ItemForestryFood { public enum EnumFruit { + CHERRY("cropCherry"), WALNUT("cropWalnut"), CHESTNUT("cropChestnut"), @@ -32,6 +33,7 @@ public class ItemFruit extends ItemForestryFood { PLUM("cropPlum"), DATES("cropDate"), PAPAYA("cropPapaya"); // , COCONUT("cropCoconut"); + public static final EnumFruit[] VALUES = values(); private final String oreDict; @@ -45,8 +47,8 @@ public class ItemFruit extends ItemForestryFood { public static void registerIcons(IIconRegister register) { icons = new IIcon[VALUES.length]; for (int i = 0; i < VALUES.length; i++) { - icons[i] = TextureManager.registerTex( - register, "fruits/" + VALUES[i].toString().toLowerCase(Locale.ENGLISH)); + icons[i] = TextureManager + .registerTex(register, "fruits/" + VALUES[i].toString().toLowerCase(Locale.ENGLISH)); } } @@ -95,7 +97,7 @@ public class ItemFruit extends ItemForestryFood { return EnumFruit.values()[meta].getIcon(); } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { for (int i = 0; i < EnumFruit.values().length; i++) { diff --git a/src/main/java/forestry/core/items/ItemLiquidContainer.java b/src/main/java/forestry/core/items/ItemLiquidContainer.java index 65a753b43..ff5149baa 100755 --- a/src/main/java/forestry/core/items/ItemLiquidContainer.java +++ b/src/main/java/forestry/core/items/ItemLiquidContainer.java @@ -1,27 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.core.CreativeTabForestry; -import forestry.core.fluids.BlockForestryFluid; -import forestry.core.fluids.FluidHelper; -import forestry.core.proxy.Proxies; -import forestry.core.render.TextureManager; import java.awt.Color; import java.util.HashMap; import java.util.Locale; import java.util.Map; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; @@ -39,7 +31,16 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidBlock; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.core.CreativeTabForestry; +import forestry.core.fluids.BlockForestryFluid; +import forestry.core.fluids.FluidHelper; +import forestry.core.proxy.Proxies; +import forestry.core.render.TextureManager; + public class ItemLiquidContainer extends ItemForestry { + private static final Map buckets = new HashMap<>(); private boolean isDrink = false; @@ -100,8 +101,8 @@ public class ItemLiquidContainer extends ItemForestry { entityplayer.getFoodStats().addStats(healAmount, saturationModifier); world.playSoundAtEntity(entityplayer, "random.burp", 0.5F, world.rand.nextFloat() * 0.1F + 0.9F); /* - * if (!world.isRemote && potionId > 0 && world.rand.nextFloat() < potionEffectProbability) entityplayer.addPotionEffect(new PotionEffect(potionId, - * potionDuration * 20, potionAmplifier)); + * if (!world.isRemote && potionId > 0 && world.rand.nextFloat() < potionEffectProbability) + * entityplayer.addPotionEffect(new PotionEffect(potionId, potionDuration * 20, potionAmplifier)); */ return itemstack; @@ -202,8 +203,8 @@ public class ItemLiquidContainer extends ItemForestry { return itemstack; } - private ItemStack tryPlaceLiquid( - ItemStack itemstack, World world, EntityPlayer player, MovingObjectPosition movingobjectposition) { + private ItemStack tryPlaceLiquid(ItemStack itemstack, World world, EntityPlayer player, + MovingObjectPosition movingobjectposition) { if (this.type != EnumContainerType.BUCKET) { return itemstack; @@ -310,8 +311,8 @@ public class ItemLiquidContainer extends ItemForestry { } /* - * public ItemLiquidContainer setPotionEffect(int i, int j, int k, float f) { potionId = i; potionDuration = j; potionAmplifier = k; potionEffectProbability - * = f; return this; } + * public ItemLiquidContainer setPotionEffect(int i, int j, int k, float f) { potionId = i; potionDuration = j; + * potionAmplifier = k; potionEffectProbability = f; return this; } */ public ItemLiquidContainer setAlwaysEdible() { isAlwaysEdible = true; @@ -326,10 +327,10 @@ public class ItemLiquidContainer extends ItemForestry { @Override public void registerIcons(IIconRegister register) { icons = new IIcon[2]; - icons[0] = TextureManager.registerTex( - register, "liquids/" + type.toString().toLowerCase(Locale.ENGLISH) + ".bottle"); - icons[1] = TextureManager.registerTex( - register, "liquids/" + type.toString().toLowerCase(Locale.ENGLISH) + ".contents"); + icons[0] = TextureManager + .registerTex(register, "liquids/" + type.toString().toLowerCase(Locale.ENGLISH) + ".bottle"); + icons[1] = TextureManager + .registerTex(register, "liquids/" + type.toString().toLowerCase(Locale.ENGLISH) + ".contents"); } @SideOnly(Side.CLIENT) diff --git a/src/main/java/forestry/core/items/ItemOverlay.java b/src/main/java/forestry/core/items/ItemOverlay.java index 57e9f6bd4..e2553f19c 100755 --- a/src/main/java/forestry/core/items/ItemOverlay.java +++ b/src/main/java/forestry/core/items/ItemOverlay.java @@ -1,29 +1,31 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.core.config.Config; -import forestry.core.render.TextureManager; -import forestry.core.utils.StringUtil; import java.util.List; + 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 cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.core.config.Config; +import forestry.core.render.TextureManager; +import forestry.core.utils.StringUtil; + public class ItemOverlay extends ItemForestry { + public interface IOverlayInfo { + String getName(); int getPrimaryColor(); @@ -53,7 +55,7 @@ public class ItemOverlay extends ItemForestry { return false; } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { for (int i = 0; i < overlays.length; i++) { diff --git a/src/main/java/forestry/core/items/ItemPipette.java b/src/main/java/forestry/core/items/ItemPipette.java index 7ffcde563..71e9ad753 100755 --- a/src/main/java/forestry/core/items/ItemPipette.java +++ b/src/main/java/forestry/core/items/ItemPipette.java @@ -1,15 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.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.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; +import net.minecraftforge.fluids.FluidStack; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.core.IToolPipette; @@ -17,13 +24,6 @@ import forestry.core.config.Constants; import forestry.core.fluids.PipetteContents; import forestry.core.render.TextureManager; import forestry.core.utils.StringUtil; -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.nbt.NBTTagCompound; -import net.minecraft.util.IIcon; -import net.minecraftforge.fluids.FluidStack; public class ItemPipette extends ItemForestry implements IToolPipette { @@ -92,7 +92,7 @@ public class ItemPipette extends ItemForestry implements IToolPipette { return filled; } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean flag) { PipetteContents contained = new PipetteContents(itemstack.getTagCompound()); @@ -126,8 +126,7 @@ public class ItemPipette extends ItemForestry implements IToolPipette { @Override public FluidStack drain(ItemStack pipette, int maxDrain, boolean doDrain) { PipetteContents contained = new PipetteContents(pipette.getTagCompound()); - if (contained.getContents() == null - || contained.getContents().getFluid().getID() <= 0) { + if (contained.getContents() == null || contained.getContents().getFluid().getID() <= 0) { return null; } diff --git a/src/main/java/forestry/core/items/ItemRegistry.java b/src/main/java/forestry/core/items/ItemRegistry.java index c29ae991f..a0fe61b73 100644 --- a/src/main/java/forestry/core/items/ItemRegistry.java +++ b/src/main/java/forestry/core/items/ItemRegistry.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; +import net.minecraft.item.Item; + import cpw.mods.fml.common.registry.GameRegistry; import forestry.core.utils.StringUtil; import forestry.plugins.PluginManager; -import net.minecraft.item.Item; public abstract class ItemRegistry { + protected static T registerItem(T item, String name) { if (PluginManager.getStage() != PluginManager.Stage.SETUP) { throw new RuntimeException("Tried to register Item outside of Setup"); diff --git a/src/main/java/forestry/core/items/ItemRegistryCore.java b/src/main/java/forestry/core/items/ItemRegistryCore.java index b83010f2f..1cf5be9db 100644 --- a/src/main/java/forestry/core/items/ItemRegistryCore.java +++ b/src/main/java/forestry/core/items/ItemRegistryCore.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + import forestry.api.core.Tabs; import forestry.core.circuits.ItemCircuitBoard; import forestry.core.genetics.ItemResearchNote; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; public class ItemRegistryCore extends ItemRegistry { + /* Fertilizer */ public final ItemForestry fertilizerBio; public final ItemForestryBonemeal fertilizerCompound; diff --git a/src/main/java/forestry/core/items/ItemRegistryFluids.java b/src/main/java/forestry/core/items/ItemRegistryFluids.java index 055a1efb7..3b00a11ec 100644 --- a/src/main/java/forestry/core/items/ItemRegistryFluids.java +++ b/src/main/java/forestry/core/items/ItemRegistryFluids.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; +import net.minecraft.init.Blocks; + import com.google.common.collect.HashBasedTable; import com.google.common.collect.Table; import forestry.core.fluids.Fluids; -import net.minecraft.init.Blocks; public class ItemRegistryFluids extends ItemRegistry { + public final ItemLiquidContainer canEmpty; public final ItemLiquidContainer waxCapsuleEmpty; public final ItemLiquidContainer refractoryEmpty; @@ -36,8 +36,10 @@ public class ItemRegistryFluids extends ItemRegistry { continue; } for (EnumContainerType type : fluidType.getContainerTypes()) { - ItemLiquidContainer liquidContainer = - new ItemLiquidContainer(type, fluidType.getBlock(), fluidType.getColor()); + ItemLiquidContainer liquidContainer = new ItemLiquidContainer( + type, + fluidType.getBlock(), + fluidType.getColor()); fluidType.setProperties(liquidContainer); String name = type.getContainerNameKey() + fluidType.getContainerNameKey(); diff --git a/src/main/java/forestry/core/items/ItemScoop.java b/src/main/java/forestry/core/items/ItemScoop.java index 8b9423ea4..5c084c26b 100755 --- a/src/main/java/forestry/core/items/ItemScoop.java +++ b/src/main/java/forestry/core/items/ItemScoop.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; @@ -14,6 +12,7 @@ import forestry.api.core.IToolScoop; import forestry.api.core.Tabs; public class ItemScoop extends ItemForestryTool implements IToolScoop { + public ItemScoop() { super(null); setEfficiencyOnProperMaterial(4.0f); diff --git a/src/main/java/forestry/core/items/ItemSolderingIron.java b/src/main/java/forestry/core/items/ItemSolderingIron.java index ccce2d229..29afa3dac 100644 --- a/src/main/java/forestry/core/items/ItemSolderingIron.java +++ b/src/main/java/forestry/core/items/ItemSolderingIron.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import forestry.core.circuits.ContainerSolderingIron; import forestry.core.circuits.GuiSolderingIron; import forestry.core.circuits.ISolderingIron; import forestry.core.inventory.ItemInventorySolderingIron; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class ItemSolderingIron extends ItemWithGui implements ISolderingIron { + @Override public Object getGui(EntityPlayer player, ItemStack heldItem, int data) { return new GuiSolderingIron(player, new ItemInventorySolderingIron(player, heldItem)); diff --git a/src/main/java/forestry/core/items/ItemWithGui.java b/src/main/java/forestry/core/items/ItemWithGui.java index c07840033..a682de7e1 100644 --- a/src/main/java/forestry/core/items/ItemWithGui.java +++ b/src/main/java/forestry/core/items/ItemWithGui.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; -import forestry.core.gui.ContainerItemInventory; -import forestry.core.gui.GuiHandler; -import forestry.core.gui.IGuiHandlerItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import forestry.core.gui.ContainerItemInventory; +import forestry.core.gui.GuiHandler; +import forestry.core.gui.IGuiHandlerItem; + public abstract class ItemWithGui extends ItemForestry implements IGuiHandlerItem { + public ItemWithGui() { setMaxStackSize(1); } @@ -38,8 +38,7 @@ public abstract class ItemWithGui extends ItemForestry implements IGuiHandlerIte @Override public boolean onDroppedByPlayer(ItemStack itemstack, EntityPlayer player) { - if (itemstack != null - && player instanceof EntityPlayerMP + if (itemstack != null && player instanceof EntityPlayerMP && player.openContainer instanceof ContainerItemInventory) { player.closeScreen(); } diff --git a/src/main/java/forestry/core/items/ItemWrench.java b/src/main/java/forestry/core/items/ItemWrench.java index a1317053d..18f3588c8 100755 --- a/src/main/java/forestry/core/items/ItemWrench.java +++ b/src/main/java/forestry/core/items/ItemWrench.java @@ -1,23 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.items; -import buildcraft.api.tools.IToolWrench; -import cpw.mods.fml.common.Optional; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import buildcraft.api.tools.IToolWrench; +import cpw.mods.fml.common.Optional; + @Optional.Interface(iface = "buildcraft.api.tools.IToolWrench", modid = "BuildCraftAPI|tools") public class ItemWrench extends ItemForestry implements IToolWrench { @@ -27,17 +26,8 @@ public class ItemWrench extends ItemForestry implements IToolWrench { } @Override - public boolean onItemUseFirst( - ItemStack stack, - EntityPlayer player, - World world, - int x, - int y, - int z, - int 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) { Block block = world.getBlock(x, y, z); if (block.rotateBlock(world, x, y, z, ForgeDirection.getOrientation(side))) { player.swingItem(); diff --git a/src/main/java/forestry/core/multiblock/FakeMultiblockController.java b/src/main/java/forestry/core/multiblock/FakeMultiblockController.java index 8c9876dbc..87324e392 100644 --- a/src/main/java/forestry/core/multiblock/FakeMultiblockController.java +++ b/src/main/java/forestry/core/multiblock/FakeMultiblockController.java @@ -1,15 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.multiblock; +import java.io.IOException; +import java.util.Collection; +import java.util.Collections; +import java.util.Set; + +import javax.annotation.Nonnull; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; + import forestry.api.core.EnumHumidity; import forestry.api.core.EnumTemperature; import forestry.api.core.IErrorLogic; @@ -20,16 +29,9 @@ import forestry.core.access.IAccessHandler; import forestry.core.errors.FakeErrorLogic; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; -import java.io.IOException; -import java.util.Collection; -import java.util.Collections; -import java.util.Set; -import javax.annotation.Nonnull; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; public abstract class FakeMultiblockController implements IMultiblockControllerInternal { + @Override public void attachBlock(IMultiblockComponent part) {} diff --git a/src/main/java/forestry/core/multiblock/IMultiblockControllerInternal.java b/src/main/java/forestry/core/multiblock/IMultiblockControllerInternal.java index 5f65f5072..0f3c09b7c 100644 --- a/src/main/java/forestry/core/multiblock/IMultiblockControllerInternal.java +++ b/src/main/java/forestry/core/multiblock/IMultiblockControllerInternal.java @@ -1,15 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.multiblock; +import java.util.Set; + +import javax.annotation.Nonnull; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; + import forestry.api.core.IErrorLogicSource; import forestry.api.core.INBTTagable; import forestry.api.multiblock.IMultiblockComponent; @@ -17,39 +23,36 @@ import forestry.api.multiblock.IMultiblockController; import forestry.core.access.IRestrictedAccess; import forestry.core.network.IStreamableGui; import forestry.core.tiles.IClimatised; -import java.util.Set; -import javax.annotation.Nonnull; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; // internal implementation of IMultiblockController public interface IMultiblockControllerInternal extends IMultiblockController, INBTTagable, IRestrictedAccess, IErrorLogicSource, IClimatised, IStreamableGui { + /** * Attach a new part to this machine. + * * @param part The part to add. */ void attachBlock(IMultiblockComponent part); /** - * Call to detach a block from this machine. Generally, this should be called - * when the tile entity is being released, e.g. on block destruction. - * @param part The part to detach from this machine. - * @param chunkUnloading Is this entity detaching due to the chunk unloading? If true, the multiblock will be paused instead of broken. + * Call to detach a block from this machine. Generally, this should be called when the tile entity is being + * released, e.g. on block destruction. + * + * @param part The part to detach from this machine. + * @param chunkUnloading Is this entity detaching due to the chunk unloading? If true, the multiblock will be paused + * instead of broken. */ void detachBlock(IMultiblockComponent part, boolean chunkUnloading); /** - * Check if the machine is whole or not. - * If the machine was not whole, but now is, assemble the machine. - * If the machine was whole, but no longer is, disassemble the machine. + * Check if the machine is whole or not. If the machine was not whole, but now is, assemble the machine. If the + * machine was whole, but no longer is, disassemble the machine. */ void checkIfMachineIsWhole(); /** - * Assimilate another controller into this controller. - * Acquire all of the other controller's blocks and attach them + * Assimilate another controller into this controller. Acquire all of the other controller's blocks and attach them * to this one. * * @param other The controller to merge into this one. @@ -57,24 +60,22 @@ public interface IMultiblockControllerInternal void assimilate(IMultiblockControllerInternal other); /** - * Called when this machine is consumed by another controller. - * Essentially, forcibly tear down this object. + * Called when this machine is consumed by another controller. Essentially, forcibly tear down this object. + * * @param otherController The controller consuming this controller. */ void _onAssimilated(IMultiblockControllerInternal otherController); /** - * Callback. Called after this controller is assimilated into another controller. - * All blocks have been stripped out of this object and handed over to the - * other controller. - * This is intended primarily for cleanup. + * Callback. Called after this controller is assimilated into another controller. All blocks have been stripped out + * of this object and handed over to the other controller. This is intended primarily for cleanup. + * * @param assimilator The controller which has assimilated this controller. */ void onAssimilated(IMultiblockControllerInternal assimilator); /** - * Driver for the update loop. If the machine is assembled, runs - * the game logic update method. + * Driver for the update loop. If the machine is assembled, runs the game logic update method. */ void updateMultiblockEntity(); @@ -84,19 +85,20 @@ public interface IMultiblockControllerInternal ChunkCoordinates getReferenceCoord(); /** - * Force this multiblock to recalculate its minimum and maximum coordinates - * from the list of connected parts. + * Force this multiblock to recalculate its minimum and maximum coordinates from the list of connected parts. */ void recalculateMinMaxCoords(); /** * Called when the save delegate's tile entity is being asked for its description packet + * * @param data A fresh compound tag to write your multiblock data into */ void formatDescriptionPacket(NBTTagCompound data); /** * Called when the save delegate's tile entity receiving a description packet + * * @param data A compound tag containing multiblock data to import */ void decodeDescriptionPacket(NBTTagCompound data); @@ -109,9 +111,9 @@ public interface IMultiblockControllerInternal boolean isEmpty(); /** - * Tests whether this multiblock should consume the other multiblock - * and become the new multiblock master when the two multiblocks - * are adjacent. Assumes both multiblocks are the same type. + * Tests whether this multiblock should consume the other multiblock and become the new multiblock master when the + * two multiblocks are adjacent. Assumes both multiblocks are the same type. + * * @param otherController The other multiblock controller. * @return True if this multiblock should consume the other, false otherwise. */ @@ -125,16 +127,17 @@ public interface IMultiblockControllerInternal void auditParts(); /** - * Called when this machine may need to check for blocks that are no - * longer physically connected to the reference coordinate. + * Called when this machine may need to check for blocks that are no longer physically connected to the reference + * coordinate. + * * @return the parts that were disconnected and removed */ @Nonnull Set checkForDisconnections(); /** - * Detach all parts. Return a set of all parts which still - * have a valid tile entity. Chunk-safe. + * Detach all parts. Return a set of all parts which still have a valid tile entity. Chunk-safe. + * * @return A set of all parts which still have a valid tile entity. */ @Nonnull diff --git a/src/main/java/forestry/core/multiblock/IMultiblockSizeLimits.java b/src/main/java/forestry/core/multiblock/IMultiblockSizeLimits.java index 088216aa5..c2e075833 100644 --- a/src/main/java/forestry/core/multiblock/IMultiblockSizeLimits.java +++ b/src/main/java/forestry/core/multiblock/IMultiblockSizeLimits.java @@ -1,59 +1,64 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.multiblock; public interface IMultiblockSizeLimits { + /** - * Helper method so we don't check for a whole machine until we have enough blocks - * to actually assemble it. This isn't as simple as xmax*ymax*zmax for non-cubic machines - * or for machines with hollow/complex interiors. + * Helper method so we don't check for a whole machine until we have enough blocks to actually assemble it. This + * isn't as simple as xmax*ymax*zmax for non-cubic machines or for machines with hollow/complex interiors. + * * @return The minimum number of blocks connected to the machine for it to be assembled. */ int getMinimumNumberOfBlocksForAssembledMachine(); /** - * Returns the maximum X dimension size of the machine, or -1 (DIMENSION_UNBOUNDED) to disable - * dimension checking in X. (This is not recommended.) + * Returns the maximum X dimension size of the machine, or -1 (DIMENSION_UNBOUNDED) to disable dimension checking in + * X. (This is not recommended.) + * * @return The maximum X dimension size of the machine, or -1 */ int getMaximumXSize(); /** - * Returns the maximum Z dimension size of the machine, or -1 (DIMENSION_UNBOUNDED) to disable - * dimension checking in X. (This is not recommended.) + * Returns the maximum Z dimension size of the machine, or -1 (DIMENSION_UNBOUNDED) to disable dimension checking in + * X. (This is not recommended.) + * * @return The maximum Z dimension size of the machine, or -1 */ int getMaximumZSize(); /** - * Returns the maximum Y dimension size of the machine, or -1 (DIMENSION_UNBOUNDED) to disable - * dimension checking in X. (This is not recommended.) + * Returns the maximum Y dimension size of the machine, or -1 (DIMENSION_UNBOUNDED) to disable dimension checking in + * X. (This is not recommended.) + * * @return The maximum Y dimension size of the machine, or -1 */ int getMaximumYSize(); /** * Returns the minimum X dimension size of the machine. Must be at least 1, because nothing else makes sense. + * * @return The minimum X dimension size of the machine */ int getMinimumXSize(); /** * Returns the minimum Y dimension size of the machine. Must be at least 1, because nothing else makes sense. + * * @return The minimum Y dimension size of the machine */ int getMinimumYSize(); /** * Returns the minimum Z dimension size of the machine. Must be at least 1, because nothing else makes sense. + * * @return The minimum Z dimension size of the machine */ int getMinimumZSize(); diff --git a/src/main/java/forestry/core/multiblock/MultiblockClientTickHandler.java b/src/main/java/forestry/core/multiblock/MultiblockClientTickHandler.java index 7fd75ca37..aefe25a3a 100644 --- a/src/main/java/forestry/core/multiblock/MultiblockClientTickHandler.java +++ b/src/main/java/forestry/core/multiblock/MultiblockClientTickHandler.java @@ -1,8 +1,9 @@ package forestry.core.multiblock; +import net.minecraft.client.Minecraft; + import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; -import net.minecraft.client.Minecraft; public class MultiblockClientTickHandler { diff --git a/src/main/java/forestry/core/multiblock/MultiblockControllerBase.java b/src/main/java/forestry/core/multiblock/MultiblockControllerBase.java index 5fc9ab607..5ee4e8066 100644 --- a/src/main/java/forestry/core/multiblock/MultiblockControllerBase.java +++ b/src/main/java/forestry/core/multiblock/MultiblockControllerBase.java @@ -1,8 +1,5 @@ package forestry.core.multiblock; -import forestry.api.multiblock.IMultiblockComponent; -import forestry.core.utils.Log; -import forestry.core.utils.StringUtil; import java.util.Collection; import java.util.Collections; import java.util.HashSet; @@ -10,7 +7,9 @@ import java.util.LinkedList; import java.util.List; import java.util.Random; import java.util.Set; + import javax.annotation.Nonnull; + import net.minecraft.block.Block; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; @@ -19,13 +18,18 @@ import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraft.world.chunk.IChunkProvider; +import forestry.api.multiblock.IMultiblockComponent; +import forestry.core.utils.Log; +import forestry.core.utils.StringUtil; + /** - * This class contains the base logic for "multiblock controllers". Conceptually, they are - * meta-TileEntities. They govern the logic for an associated group of TileEntities. + * This class contains the base logic for "multiblock controllers". Conceptually, they are meta-TileEntities. They + * govern the logic for an associated group of TileEntities. * * Subordinate TileEntities implement the IMultiblockComponent class and, generally, should not have an update() loop. */ public abstract class MultiblockControllerBase implements IMultiblockControllerInternal { + // Multiblock stuff - do not mess with protected World worldObj; @@ -44,23 +48,23 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI protected HashSet connectedParts; - /** This is a deterministically-picked coordinate that identifies this - * multiblock uniquely in its dimension. - * Currently, this is the coord with the lowest X, Y and Z coordinates, in that order of evaluation. - * i.e. If something has a lower X but higher Y/Z coordinates, it will still be the reference. - * If something has the same X but a lower Y coordinate, it will be the reference. Etc. + /** + * This is a deterministically-picked coordinate that identifies this multiblock uniquely in its dimension. + * Currently, this is the coord with the lowest X, Y and Z coordinates, in that order of evaluation. i.e. If + * something has a lower X but higher Y/Z coordinates, it will still be the reference. If something has the same X + * but a lower Y coordinate, it will be the reference. Etc. */ private ChunkCoordinates referenceCoord; /** - * Minimum bounding box coordinate. Blocks do not necessarily exist at this coord if your machine - * is not a cube/rectangular prism. + * Minimum bounding box coordinate. Blocks do not necessarily exist at this coord if your machine is not a + * cube/rectangular prism. */ private ChunkCoordinates minimumCoord; /** - * Maximum bounding box coordinate. Blocks do not necessarily exist at this coord if your machine - * is not a cube/rectangular prism. + * Maximum bounding box coordinate. Blocks do not necessarily exist at this coord if your machine is not a + * cube/rectangular prism. */ private ChunkCoordinates maximumCoord; @@ -95,8 +99,9 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI } /** - * Call when a block with cached save-delegate data is added to the multiblock. - * The part will be notified that the data has been used after this call completes. + * Call when a block with cached save-delegate data is added to the multiblock. The part will be notified that the + * data has been used after this call completes. + * * @param part The NBT tag containing this controller's data. */ protected abstract void onAttachedPartWithMultiblockData(IMultiblockComponent part, NBTTagCompound data); @@ -109,7 +114,10 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI Log.warning( "[%s] Controller %s is double-adding part %d @ %s. This is unusual. " + "If you encounter odd behavior, please tear down the machine and rebuild it.", - (worldObj.isRemote ? "CLIENT" : "SERVER"), hashCode(), part.hashCode(), coord); + (worldObj.isRemote ? "CLIENT" : "SERVER"), + hashCode(), + part.hashCode(), + coord); } MultiblockLogic logic = (MultiblockLogic) part.getMultiblockLogic(); @@ -169,12 +177,14 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI /** * Called when a new part is added to the machine. Good time to register things into lists. + * * @param newPart The part being added. */ protected abstract void onBlockAdded(IMultiblockComponent newPart); /** * Called when a part is removed from the machine. Good time to clean up lists. + * * @param oldPart The part being removed. */ protected abstract void onBlockRemoved(IMultiblockComponent oldPart); @@ -190,20 +200,21 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI protected void onMachineRestored() {} /** - * Called when a machine is paused from an assembled state - * This generally only happens due to chunk-loads and other "system" events. + * Called when a machine is paused from an assembled state This generally only happens due to chunk-loads and other + * "system" events. */ protected void onMachinePaused() {} /** - * Called when a machine is disassembled from an assembled state. - * This happens due to user or in-game actions (e.g. explosions) + * Called when a machine is disassembled from an assembled state. This happens due to user or in-game actions (e.g. + * explosions) */ protected void onMachineDisassembled() {} /** - * Callback whenever a part is removed (or will very shortly be removed) from a controller. - * Do housekeeping/callbacks, also nulls min/max coords. + * Callback whenever a part is removed (or will very shortly be removed) from a controller. Do + * housekeeping/callbacks, also nulls min/max coords. + * * @param part The part being removed. */ private void onDetachBlock(IMultiblockComponent part) { @@ -299,9 +310,8 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI } /** - * Called when a machine becomes "whole" and should begin - * functioning as a game-logically finished machine. - * Calls onMachineAssembled on all attached parts. + * Called when a machine becomes "whole" and should begin functioning as a game-logically finished machine. Calls + * onMachineAssembled on all attached parts. */ private void assembleMachine(AssemblyState oldState) { this.assemblyState = AssemblyState.Assembled; @@ -318,10 +328,8 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI } /** - * Called when the machine needs to be disassembled. - * It is not longer "whole" and should not be functional, usually - * as a result of a block being removed. - * Calls onMachineBroken on all attached parts. + * Called when the machine needs to be disassembled. It is not longer "whole" and should not be functional, usually + * as a result of a block being removed. Calls onMachineBroken on all attached parts. */ private void disassembleMachine() { this.assemblyState = AssemblyState.Disassembled; @@ -363,16 +371,16 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI } /** - * Called when this machine is consumed by another controller. - * Essentially, forcibly tear down this object. + * Called when this machine is consumed by another controller. Essentially, forcibly tear down this object. + * * @param otherController The controller consuming this controller. */ @Override public void _onAssimilated(IMultiblockControllerInternal otherController) { if (referenceCoord != null) { if (worldObj.getChunkProvider().chunkExists(referenceCoord.posX >> 4, referenceCoord.posZ >> 4)) { - TileEntity te = - this.worldObj.getTileEntity(referenceCoord.posX, referenceCoord.posY, referenceCoord.posZ); + TileEntity te = this.worldObj + .getTileEntity(referenceCoord.posX, referenceCoord.posY, referenceCoord.posZ); if (te instanceof IMultiblockComponent) { IMultiblockComponent part = (IMultiblockComponent) te; MultiblockLogic logic = (MultiblockLogic) part.getMultiblockLogic(); @@ -386,18 +394,17 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI } /** - * Callback. Called after this controller assimilates all the blocks - * from another controller. - * Use this to absorb that controller's game data. + * Callback. Called after this controller assimilates all the blocks from another controller. Use this to absorb + * that controller's game data. + * * @param assimilated The controller whose uniqueness was added to our own. */ protected abstract void onAssimilate(IMultiblockControllerInternal assimilated); /** - * Callback. Called after this controller is assimilated into another controller. - * All blocks have been stripped out of this object and handed over to the - * other controller. - * This is intended primarily for cleanup. + * Callback. Called after this controller is assimilated into another controller. All blocks have been stripped out + * of this object and handed over to the other controller. This is intended primarily for cleanup. + * * @param assimilator The controller which has assimilated this controller. */ @Override @@ -423,8 +430,7 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI } else if (updateServer(tickCount)) { // If this returns true, the server has changed its internal data. // If our chunks are loaded (they should be), we must mark our chunks as dirty. - if (minimumCoord != null - && maximumCoord != null + if (minimumCoord != null && maximumCoord != null && this.worldObj.checkChunksExist( minimumCoord.posX, minimumCoord.posY, @@ -450,17 +456,17 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI } /** - * The server-side update loop! Use this similarly to a TileEntity's update loop. - * You do not need to call your superclass' update() if you're directly - * derived from MultiblockControllerBase. This is a callback. - * Note that this will only be called when the machine is assembled. + * The server-side update loop! Use this similarly to a TileEntity's update loop. You do not need to call your + * superclass' update() if you're directly derived from MultiblockControllerBase. This is a callback. Note that this + * will only be called when the machine is assembled. + * * @return True if the multiblock should save data, i.e. its internal game state has changed. False otherwise. */ protected abstract boolean updateServer(int tickCount); /** - * Client-side update loop. Generally, this shouldn't do anything, but if you want - * to do some interpolation or something, do it here. + * Client-side update loop. Generally, this shouldn't do anything, but if you want to do some interpolation or + * something, do it here. */ protected abstract void updateClient(int tickCount); @@ -473,30 +479,41 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI /** * @param level the level of the block on the multiblock, starting at 0 for the bottom. * @param world World object for the world in which this controller is located. - * @param x X coordinate of the block being tested - * @param y Y coordinate of the block being tested - * @param z Z coordinate of the block being tested + * @param x X coordinate of the block being tested + * @param y Y coordinate of the block being tested + * @param z Z coordinate of the block being tested * @throws MultiblockValidationException if the tested block is not allowed on the machine's side faces */ protected void isBlockGoodForExteriorLevel(int level, World world, int x, int y, int z) throws MultiblockValidationException { Block block = world.getBlock(x, y, z); - throw new MultiblockValidationException(StringUtil.localizeAndFormatRaw( - "for.multiblock.error.invalid.interior", x, y, z, block.getLocalizedName())); + throw new MultiblockValidationException( + StringUtil.localizeAndFormatRaw( + "for.multiblock.error.invalid.interior", + x, + y, + z, + block.getLocalizedName())); } /** * The interior is any block that does not touch blocks outside the machine. + * * @param world World object for the world in which this controller is located. - * @param x X coordinate of the block being tested - * @param y Y coordinate of the block being tested - * @param z Z coordinate of the block being tested + * @param x X coordinate of the block being tested + * @param y Y coordinate of the block being tested + * @param z Z coordinate of the block being tested * @throws MultiblockValidationException if the tested block is not allowed in the machine's interior */ protected void isBlockGoodForInterior(World world, int x, int y, int z) throws MultiblockValidationException { Block block = world.getBlock(x, y, z); - throw new MultiblockValidationException(StringUtil.localizeAndFormatRaw( - "for.multiblock.error.invalid.interior", x, y, z, block.getLocalizedName())); + throw new MultiblockValidationException( + StringUtil.localizeAndFormatRaw( + "for.multiblock.error.invalid.interior", + x, + y, + z, + block.getLocalizedName())); } @Override @@ -577,12 +594,13 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI ChunkCoordinates maxCoord = getMaximumCoord(); return new ChunkCoordinates( - (minCoord.posX + maxCoord.posX) / 2, maxCoord.posY, (minCoord.posZ + maxCoord.posZ) / 2); + (minCoord.posX + maxCoord.posX) / 2, + maxCoord.posY, + (minCoord.posZ + maxCoord.posZ) / 2); } protected final boolean isCoordInMultiblock(int x, int y, int z) { - return (x >= minimumCoord.posX && x <= maximumCoord.posX) - && (y >= minimumCoord.posY && y <= maximumCoord.posY) + return (x >= minimumCoord.posX && x <= maximumCoord.posX) && (y >= minimumCoord.posY && y <= maximumCoord.posY) && (z >= minimumCoord.posZ && z <= maximumCoord.posZ); } @@ -623,14 +641,17 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI } else { Log.severe( "My Controller (%d): size (%d), parts: %s", - hashCode(), connectedParts.size(), getPartsListString()); + hashCode(), + connectedParts.size(), + getPartsListString()); Log.severe( "Other Controller (%d): size (%d), coords: %s", otherController.hashCode(), otherController.getComponents().size(), otherController.getPartsListString()); throw new IllegalArgumentException( - "[" + (worldObj.isRemote ? "CLIENT" : "SERVER") + "] " + "[" + (worldObj.isRemote ? "CLIENT" : "SERVER") + + "] " + "Two controllers with the same reference coord that somehow both have valid parts - this should never happen!"); } } @@ -680,7 +701,9 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI connectedParts.removeAll(deadParts); Log.warning( "[%s] Controller found %d dead parts during an audit, %d parts remain attached", - worldObj.isRemote ? "CLIENT" : "SERVER", deadParts.size(), connectedParts.size()); + worldObj.isRemote ? "CLIENT" : "SERVER", + deadParts.size(), + connectedParts.size()); } @Override @@ -761,8 +784,10 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI MultiblockLogic partLogic = (MultiblockLogic) part.getMultiblockLogic(); partLogic.setVisited(); - List nearbyParts = - MultiblockUtil.getNeighboringParts(worldObj, part); // Chunk-safe on server, but not on client + List nearbyParts = MultiblockUtil.getNeighboringParts(worldObj, part); // Chunk-safe + // on server, + // but not on + // client for (IMultiblockComponent nearbyPart : nearbyParts) { // Ignore different machines MultiblockLogic nearbyPartLogic = (MultiblockLogic) nearbyPart.getMultiblockLogic(); @@ -860,10 +885,9 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI /** * Marks the reference coord dirty & updateable. * - * On the server, this will mark the for a data-update, so that - * nearby clients will receive an updated description packet from the server - * after a short time. The block's chunk will also be marked dirty and the - * block's chunk will be saved to disk the next time chunks are saved. + * On the server, this will mark the for a data-update, so that nearby clients will receive an updated description + * packet from the server after a short time. The block's chunk will also be marked dirty and the block's chunk will + * be saved to disk the next time chunks are saved. * * On the client, this will mark the block for a rendering update. */ @@ -877,11 +901,11 @@ public abstract class MultiblockControllerBase implements IMultiblockControllerI /** * Marks the reference coord dirty. * - * On the server, this marks the reference coord's chunk as dirty; the block (and chunk) - * will be saved to disk the next time chunks are saved. This does NOT mark it dirty for - * a description-packet update. + * On the server, this marks the reference coord's chunk as dirty; the block (and chunk) will be saved to disk the + * next time chunks are saved. This does NOT mark it dirty for a description-packet update. * * On the client, does nothing. + * * @see MultiblockControllerBase#markReferenceCoordForUpdate() */ protected void markReferenceCoordDirty() { diff --git a/src/main/java/forestry/core/multiblock/MultiblockControllerForestry.java b/src/main/java/forestry/core/multiblock/MultiblockControllerForestry.java index f16ed90a8..6749fcfbd 100644 --- a/src/main/java/forestry/core/multiblock/MultiblockControllerForestry.java +++ b/src/main/java/forestry/core/multiblock/MultiblockControllerForestry.java @@ -1,18 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.multiblock; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + import com.google.common.collect.HashMultiset; import com.google.common.collect.Multiset; import com.mojang.authlib.GameProfile; + import forestry.api.core.ForestryAPI; import forestry.api.core.IErrorLogic; import forestry.api.core.IErrorLogicSource; @@ -23,14 +28,10 @@ import forestry.core.access.IRestrictedAccess; import forestry.core.inventory.FakeInventoryAdapter; import forestry.core.inventory.IInventoryAdapter; import forestry.core.tiles.ILocatable; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; public abstract class MultiblockControllerForestry extends MultiblockControllerBase implements ISidedInventory, IRestrictedAccess, IErrorLogicSource, ILocatable { + private final AccessHandler accessHandler; private final IErrorLogic errorLogic; diff --git a/src/main/java/forestry/core/multiblock/MultiblockEventHandler.java b/src/main/java/forestry/core/multiblock/MultiblockEventHandler.java index fcbc63722..aa81c1636 100644 --- a/src/main/java/forestry/core/multiblock/MultiblockEventHandler.java +++ b/src/main/java/forestry/core/multiblock/MultiblockEventHandler.java @@ -1,19 +1,20 @@ package forestry.core.multiblock; -import cpw.mods.fml.common.eventhandler.EventPriority; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.event.world.ChunkEvent; import net.minecraftforge.event.world.WorldEvent; +import cpw.mods.fml.common.eventhandler.EventPriority; +import cpw.mods.fml.common.eventhandler.SubscribeEvent; + /** - * In your mod, subscribe this on both the client and server sides side to handle chunk - * load events for your multiblock machines. - * Chunks can load asynchronously in environments like MCPC+, so we cannot - * process any blocks that are in chunks which are still loading. + * In your mod, subscribe this on both the client and server sides side to handle chunk load events for your multiblock + * machines. Chunks can load asynchronously in environments like MCPC+, so we cannot process any blocks that are in + * chunks which are still loading. */ public class MultiblockEventHandler { + @SubscribeEvent(priority = EventPriority.NORMAL) public void onChunkLoad(ChunkEvent.Load loadEvent) { Chunk chunk = loadEvent.getChunk(); diff --git a/src/main/java/forestry/core/multiblock/MultiblockLogic.java b/src/main/java/forestry/core/multiblock/MultiblockLogic.java index e1604c339..87446b593 100644 --- a/src/main/java/forestry/core/multiblock/MultiblockLogic.java +++ b/src/main/java/forestry/core/multiblock/MultiblockLogic.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.multiblock; -import forestry.api.multiblock.IMultiblockComponent; -import forestry.api.multiblock.IMultiblockLogic; -import forestry.core.utils.Log; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; +import forestry.api.multiblock.IMultiblockComponent; +import forestry.api.multiblock.IMultiblockLogic; +import forestry.core.utils.Log; + public abstract class MultiblockLogic implements IMultiblockLogic { + private final Class controllerClass; private boolean visited; private boolean saveMultiblockData; @@ -50,13 +50,13 @@ public abstract class MultiblockLogic i public abstract T createNewController(World world); /** - * This is called when a block is being marked as valid by the chunk, but has not yet fully - * been placed into the world's TileEntity cache. this.worldObj, xCoord, yCoord and zCoord have - * been initialized, but any attempts to read data about the world can cause infinite loops - - * if you call getTileEntity on this TileEntity's coordinate from within validate(), you will - * blow your call stack. + * This is called when a block is being marked as valid by the chunk, but has not yet fully been placed into the + * world's TileEntity cache. this.worldObj, xCoord, yCoord and zCoord have been initialized, but any attempts to + * read data about the world can cause infinite loops - if you call getTileEntity on this TileEntity's coordinate + * from within validate(), you will blow your call stack. * * TL;DR: Here there be dragons. + * * @see net.minecraft.tileentity.TileEntity#validate() */ @Override @@ -65,8 +65,9 @@ public abstract class MultiblockLogic i } /** - * Called when a block is removed by game actions, such as a player breaking the block - * or the block being changed into another block. + * Called when a block is removed by game actions, such as a player breaking the block or the block being changed + * into another block. + * * @see net.minecraft.tileentity.TileEntity#invalidate() */ @Override @@ -75,9 +76,9 @@ public abstract class MultiblockLogic i } /** - * Called from Minecraft's tile entity loop, after all tile entities have been ticked, - * as the chunk in which this tile entity is contained is unloading. - * Happens before the Forge TickEnd event. + * Called from Minecraft's tile entity loop, after all tile entities have been ticked, as the chunk in which this + * tile entity is contained is unloading. Happens before the Forge TickEnd event. + * * @see net.minecraft.tileentity.TileEntity#onChunkUnload() */ @Override @@ -124,7 +125,9 @@ public abstract class MultiblockLogic i ChunkCoordinates coords = part.getCoordinates(); Log.info( "[assert] Part @ (%d, %d, %d) should be detached already, but detected that it was not. This is not a fatal error, and will be repaired, but is unusual.", - coords.posX, coords.posY, coords.posZ); + coords.posX, + coords.posY, + coords.posZ); this.controller = null; } } @@ -171,9 +174,9 @@ public abstract class MultiblockLogic i } /** - * Override this to easily modify the description packet's data without having - * to worry about sending the packet itself. - * Decode this data in decodeDescriptionPacket. + * Override this to easily modify the description packet's data without having to worry about sending the packet + * itself. Decode this data in decodeDescriptionPacket. + * * @param packetData An NBT compound tag into which you should write your custom description data. */ @Override @@ -186,8 +189,8 @@ public abstract class MultiblockLogic i } /** - * Override this to easily read in data from a TileEntity's description packet. - * Encoded in encodeDescriptionPacket. + * Override this to easily read in data from a TileEntity's description packet. Encoded in encodeDescriptionPacket. + * * @param packetData The NBT data from the tile entity's description packet. */ @Override diff --git a/src/main/java/forestry/core/multiblock/MultiblockLogicFactory.java b/src/main/java/forestry/core/multiblock/MultiblockLogicFactory.java index 03773e79e..733981e6c 100644 --- a/src/main/java/forestry/core/multiblock/MultiblockLogicFactory.java +++ b/src/main/java/forestry/core/multiblock/MultiblockLogicFactory.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.multiblock; diff --git a/src/main/java/forestry/core/multiblock/MultiblockRegistry.java b/src/main/java/forestry/core/multiblock/MultiblockRegistry.java index 6b1bfca9e..2ff3076aa 100644 --- a/src/main/java/forestry/core/multiblock/MultiblockRegistry.java +++ b/src/main/java/forestry/core/multiblock/MultiblockRegistry.java @@ -1,23 +1,28 @@ package forestry.core.multiblock; -import forestry.api.multiblock.IMultiblockComponent; -import forestry.core.utils.Log; import java.util.HashMap; import java.util.Map; import java.util.Set; + import net.minecraft.world.World; +import forestry.api.multiblock.IMultiblockComponent; +import forestry.core.utils.Log; + /** - * This is a very static singleton registry class which directs incoming events to sub-objects, which - * actually manage each individual world's multiblocks. + * This is a very static singleton registry class which directs incoming events to sub-objects, which actually manage + * each individual world's multiblocks. + * * @author Erogenous Beef */ public class MultiblockRegistry { + // World > WorldRegistry map private static final Map registries = new HashMap<>(); /** * Called before Tile Entities are ticked in the world. Do bookkeeping here. + * * @param world The world being ticked */ public static void tickStart(World world) { @@ -30,7 +35,8 @@ public class MultiblockRegistry { /** * Called when the world has finished loading a chunk. - * @param world The world which has finished loading a chunk + * + * @param world The world which has finished loading a chunk * @param chunkX The X coordinate of the chunk * @param chunkZ The Z coordinate of the chunk */ @@ -42,8 +48,9 @@ public class MultiblockRegistry { /** * Register a new part in the system. The part has been created either through user action or via a chunk loading. + * * @param world The world into which this part is loading. - * @param part The part being loaded. + * @param part The part being loaded. */ public static void onPartAdded(World world, IMultiblockComponent part) { MultiblockWorldRegistry registry = getOrCreateRegistry(world); @@ -52,8 +59,9 @@ public class MultiblockRegistry { /** * Call to remove a part from world lists. + * * @param world The world from which a multiblock part is being removed. - * @param part The part being removed. + * @param part The part being removed. */ public static void onPartRemovedFromWorld(World world, IMultiblockComponent part) { if (registries.containsKey(world)) { @@ -63,6 +71,7 @@ public class MultiblockRegistry { /** * Called whenever a world is unloaded. Unload the relevant registry, if we have one. + * * @param world The world being unloaded. */ public static void onWorldUnloaded(World world) { @@ -73,9 +82,9 @@ public class MultiblockRegistry { } /** - * Call to mark a controller as dirty. Dirty means that parts have - * been added or removed this tick. - * @param world The world containing the multiblock + * Call to mark a controller as dirty. Dirty means that parts have been added or removed this tick. + * + * @param world The world containing the multiblock * @param controller The dirty controller */ public static void addDirtyController(World world, IMultiblockControllerInternal controller) { @@ -88,9 +97,10 @@ public class MultiblockRegistry { } /** - * Call to mark a controller as dead. It should only be marked as dead - * when it has no connected parts. It will be removed after the next world tick. - * @param world The world formerly containing the multiblock + * Call to mark a controller as dead. It should only be marked as dead when it has no connected parts. It will be + * removed after the next world tick. + * + * @param world The world formerly containing the multiblock * @param controller The dead controller */ public static void addDeadController(World world, IMultiblockControllerInternal controller) { @@ -99,7 +109,8 @@ public class MultiblockRegistry { } else { Log.warning( "Controller %d in world %s marked as dead, but that world is not tracked! Controller is being ignored.", - controller.hashCode(), world); + controller.hashCode(), + world); } } diff --git a/src/main/java/forestry/core/multiblock/MultiblockServerTickHandler.java b/src/main/java/forestry/core/multiblock/MultiblockServerTickHandler.java index be14027b7..fcb244267 100644 --- a/src/main/java/forestry/core/multiblock/MultiblockServerTickHandler.java +++ b/src/main/java/forestry/core/multiblock/MultiblockServerTickHandler.java @@ -4,13 +4,10 @@ import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.TickEvent; /** - * This is a generic multiblock tick handler. If you are using this code on your own, - * you will need to register this with the Forge TickRegistry on both the - * client AND server sides. - * Note that different types of ticks run on different parts of the system. - * CLIENT ticks only run on the client, at the start/end of each game loop. - * SERVER and WORLD ticks only run on the server. - * WORLDLOAD ticks run only on the server, and only when worlds are loaded. + * This is a generic multiblock tick handler. If you are using this code on your own, you will need to register this + * with the Forge TickRegistry on both the client AND server sides. Note that different types of ticks run on different + * parts of the system. CLIENT ticks only run on the client, at the start/end of each game loop. SERVER and WORLD ticks + * only run on the server. WORLDLOAD ticks run only on the server, and only when worlds are loaded. */ public class MultiblockServerTickHandler { diff --git a/src/main/java/forestry/core/multiblock/MultiblockTileEntityForestry.java b/src/main/java/forestry/core/multiblock/MultiblockTileEntityForestry.java index aa1609a33..953306548 100644 --- a/src/main/java/forestry/core/multiblock/MultiblockTileEntityForestry.java +++ b/src/main/java/forestry/core/multiblock/MultiblockTileEntityForestry.java @@ -1,16 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.multiblock; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.world.World; + import com.mojang.authlib.GameProfile; + import forestry.api.multiblock.IMultiblockLogic; import forestry.api.multiblock.MultiblockTileEntityBase; import forestry.core.config.Constants; @@ -20,15 +26,10 @@ import forestry.core.inventory.FakeInventoryAdapter; import forestry.core.inventory.IInventoryAdapter; import forestry.core.tiles.IFilterSlotDelegate; import forestry.core.tiles.ILocatable; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTUtil; -import net.minecraft.world.World; public abstract class MultiblockTileEntityForestry extends MultiblockTileEntityBase implements ISidedInventory, IFilterSlotDelegate, ILocatable, IGuiHandlerTile { + private GameProfile owner; public MultiblockTileEntityForestry(T multiblockLogic) { diff --git a/src/main/java/forestry/core/multiblock/MultiblockUtil.java b/src/main/java/forestry/core/multiblock/MultiblockUtil.java index 5308d3b62..9217a2121 100644 --- a/src/main/java/forestry/core/multiblock/MultiblockUtil.java +++ b/src/main/java/forestry/core/multiblock/MultiblockUtil.java @@ -1,31 +1,33 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.multiblock; -import forestry.api.multiblock.IMultiblockComponent; import java.util.ArrayList; import java.util.List; + import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; import net.minecraftforge.common.util.ForgeDirection; +import forestry.api.multiblock.IMultiblockComponent; + public class MultiblockUtil { + /** - * Returns an array containing references to neighboring IMultiblockComponent tile entities. - * Primarily a utility method. Only works after tileentity construction. + * Returns an array containing references to neighboring IMultiblockComponent tile entities. Primarily a utility + * method. Only works after tileentity construction. * - * This method is chunk-safe on the server; it will not query for parts in chunks that are unloaded. - * Note that no method is chunk-safe on the client, because ChunkProviderClient is stupid. + * This method is chunk-safe on the server; it will not query for parts in chunks that are unloaded. Note that no + * method is chunk-safe on the client, because ChunkProviderClient is stupid. + * * @return An array of references to neighboring IMultiblockComponent tile entities. */ public static List getNeighboringParts(World world, IMultiblockComponent part) { diff --git a/src/main/java/forestry/core/multiblock/MultiblockValidationException.java b/src/main/java/forestry/core/multiblock/MultiblockValidationException.java index 54ebd3d73..84a942b18 100644 --- a/src/main/java/forestry/core/multiblock/MultiblockValidationException.java +++ b/src/main/java/forestry/core/multiblock/MultiblockValidationException.java @@ -1,8 +1,9 @@ package forestry.core.multiblock; /** - * An exception thrown when trying to validate a multiblock. Requires a string describing why the multiblock - * could not assemble. + * An exception thrown when trying to validate a multiblock. Requires a string describing why the multiblock could not + * assemble. + * * @author Erogenous Beef */ public class MultiblockValidationException extends Exception { diff --git a/src/main/java/forestry/core/multiblock/MultiblockWorldRegistry.java b/src/main/java/forestry/core/multiblock/MultiblockWorldRegistry.java index f97d7a65b..b29111fcf 100644 --- a/src/main/java/forestry/core/multiblock/MultiblockWorldRegistry.java +++ b/src/main/java/forestry/core/multiblock/MultiblockWorldRegistry.java @@ -1,8 +1,5 @@ package forestry.core.multiblock; -import forestry.api.multiblock.IMultiblockComponent; -import forestry.api.multiblock.IMultiblockLogic; -import forestry.core.utils.Log; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; @@ -10,16 +7,20 @@ import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Set; + import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.ChunkCoordIntPair; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; +import forestry.api.multiblock.IMultiblockComponent; +import forestry.api.multiblock.IMultiblockLogic; +import forestry.core.utils.Log; + /** - * This class manages all the multiblock controllers that exist in a given world, - * either client- or server-side. - * You must create different registries for server and client worlds. + * This class manages all the multiblock controllers that exist in a given world, either client- or server-side. You + * must create different registries for server and client worlds. * * @author Erogenous Beef */ @@ -307,9 +308,10 @@ public class MultiblockWorldRegistry { } /** - * Called when a multiblock part is added to the world, either via chunk-load or user action. - * If its chunk is loaded, it will be processed during the next tick. - * If the chunk is not loaded, it will be added to a list of objects waiting for a chunkload. + * Called when a multiblock part is added to the world, either via chunk-load or user action. If its chunk is + * loaded, it will be processed during the next tick. If the chunk is not loaded, it will be added to a list of + * objects waiting for a chunkload. + * * @param part The part which is being added to this world. */ public void onPartAdded(IMultiblockComponent part) { @@ -336,8 +338,9 @@ public class MultiblockWorldRegistry { } /** - * Called when a part is removed from the world, via user action or via chunk unloads. - * This part is removed from any lists in which it may be, and its machine is marked for recalculation. + * Called when a part is removed from the world, via user action or via chunk unloads. This part is removed from any + * lists in which it may be, and its machine is marked for recalculation. + * * @param part The part which is being removed. */ public void onPartRemovedFromWorld(IMultiblockComponent part) { @@ -369,8 +372,8 @@ public class MultiblockWorldRegistry { } /** - * Called when the world which this World Registry represents is fully unloaded from the system. - * Does some housekeeping just to be nice. + * Called when the world which this World Registry represents is fully unloaded from the system. Does some + * housekeeping just to be nice. */ public void onWorldUnloaded() { controllers.clear(); @@ -391,9 +394,8 @@ public class MultiblockWorldRegistry { } /** - * Called when a chunk has finished loading. Adds all of the parts which are awaiting - * load to the list of parts which are orphans and therefore will be added to machines - * after the next world tick. + * Called when a chunk has finished loading. Adds all of the parts which are awaiting load to the list of parts + * which are orphans and therefore will be added to machines after the next world tick. * * @param chunkX Chunk X coordinate (world coordate >> 4) of the chunk that was loaded * @param chunkZ Chunk Z coordinate (world coordate >> 4) of the chunk that was loaded @@ -411,9 +413,8 @@ public class MultiblockWorldRegistry { } /** - * Registers a controller as dead. It will be cleaned up at the end of the next world tick. - * Note that a controller must shed all of its blocks before being marked as dead, or the system - * will complain at you. + * Registers a controller as dead. It will be cleaned up at the end of the next world tick. Note that a controller + * must shed all of its blocks before being marked as dead, or the system will complain at you. * * @param deadController The controller which is dead. */ @@ -422,8 +423,8 @@ public class MultiblockWorldRegistry { } /** - * Registers a controller as dirty - its list of attached blocks has changed, and it - * must be re-checked for assembly and, possibly, for orphans. + * Registers a controller as dirty - its list of attached blocks has changed, and it must be re-checked for assembly + * and, possibly, for orphans. * * @param dirtyController The dirty controller. */ @@ -432,8 +433,7 @@ public class MultiblockWorldRegistry { } /** - * Use this only if you know what you're doing. You should rarely need to iterate - * over all controllers in a world! + * Use this only if you know what you're doing. You should rarely need to iterate over all controllers in a world! * * @return An (unmodifiable) set of controllers which are active in this world. */ diff --git a/src/main/java/forestry/core/multiblock/RectangularMultiblockControllerBase.java b/src/main/java/forestry/core/multiblock/RectangularMultiblockControllerBase.java index f407c9608..ace1d5fd7 100644 --- a/src/main/java/forestry/core/multiblock/RectangularMultiblockControllerBase.java +++ b/src/main/java/forestry/core/multiblock/RectangularMultiblockControllerBase.java @@ -1,11 +1,12 @@ package forestry.core.multiblock; -import forestry.api.multiblock.IMultiblockComponent; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.StatCollector; import net.minecraft.world.World; +import forestry.api.multiblock.IMultiblockComponent; + public abstract class RectangularMultiblockControllerBase extends MultiblockControllerForestry { private final IMultiblockSizeLimits sizeLimits; @@ -79,10 +80,14 @@ public abstract class RectangularMultiblockControllerBase extends MultiblockCont part = (IMultiblockComponent) te; // Ensure this part should actually be allowed within a cube of this controller's type - if (!myClass.equals( - part.getMultiblockLogic().getController().getClass())) { - throw new MultiblockValidationException(StatCollector.translateToLocalFormatted( - "for.multiblock.error.invalid.part", x, y, z, myClass.getSimpleName())); + if (!myClass.equals(part.getMultiblockLogic().getController().getClass())) { + throw new MultiblockValidationException( + StatCollector.translateToLocalFormatted( + "for.multiblock.error.invalid.part", + x, + y, + z, + myClass.getSimpleName())); } } else { // This is permitted so that we can incorporate certain non-multiblock parts inside interiors diff --git a/src/main/java/forestry/core/network/DataInputStreamForestry.java b/src/main/java/forestry/core/network/DataInputStreamForestry.java index 4db7963ad..5e28ecd9c 100644 --- a/src/main/java/forestry/core/network/DataInputStreamForestry.java +++ b/src/main/java/forestry/core/network/DataInputStreamForestry.java @@ -1,6 +1,5 @@ package forestry.core.network; -import cpw.mods.fml.common.registry.GameData; import java.io.ByteArrayInputStream; import java.io.DataInputStream; import java.io.IOException; @@ -8,6 +7,7 @@ import java.io.InputStream; import java.io.InvalidObjectException; import java.util.Collection; import java.util.List; + import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -17,6 +17,8 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; +import cpw.mods.fml.common.registry.GameData; + public class DataInputStreamForestry extends DataInputStream { public DataInputStreamForestry(InputStream in) { diff --git a/src/main/java/forestry/core/network/DataOutputStreamForestry.java b/src/main/java/forestry/core/network/DataOutputStreamForestry.java index 4a237e571..e480c80e3 100644 --- a/src/main/java/forestry/core/network/DataOutputStreamForestry.java +++ b/src/main/java/forestry/core/network/DataOutputStreamForestry.java @@ -1,17 +1,19 @@ package forestry.core.network; -import cpw.mods.fml.common.registry.GameData; import java.io.DataOutputStream; import java.io.IOException; import java.io.OutputStream; import java.util.Collection; import java.util.List; + import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompressedStreamTools; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidStack; +import cpw.mods.fml.common.registry.GameData; + public class DataOutputStreamForestry extends DataOutputStream { public DataOutputStreamForestry(OutputStream out) { diff --git a/src/main/java/forestry/core/network/ForestryPacket.java b/src/main/java/forestry/core/network/ForestryPacket.java index 85b2e9b70..645642723 100755 --- a/src/main/java/forestry/core/network/ForestryPacket.java +++ b/src/main/java/forestry/core/network/ForestryPacket.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network; -import cpw.mods.fml.common.network.internal.FMLProxyPacket; -import io.netty.buffer.Unpooled; import java.io.ByteArrayOutputStream; import java.io.IOException; +import cpw.mods.fml.common.network.internal.FMLProxyPacket; +import io.netty.buffer.Unpooled; + public abstract class ForestryPacket implements IForestryPacket { + private final IPacketId id = getPacketId(); public final FMLProxyPacket getPacket() { diff --git a/src/main/java/forestry/core/network/IForestryPacket.java b/src/main/java/forestry/core/network/IForestryPacket.java index f5377173b..92fc4ffa4 100644 --- a/src/main/java/forestry/core/network/IForestryPacket.java +++ b/src/main/java/forestry/core/network/IForestryPacket.java @@ -1,19 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network; -import cpw.mods.fml.common.network.internal.FMLProxyPacket; import java.io.IOException; +import cpw.mods.fml.common.network.internal.FMLProxyPacket; + public interface IForestryPacket { + void readData(DataInputStreamForestry data) throws IOException; FMLProxyPacket getPacket(); diff --git a/src/main/java/forestry/core/network/IForestryPacketClient.java b/src/main/java/forestry/core/network/IForestryPacketClient.java index 45c20687e..597baf486 100644 --- a/src/main/java/forestry/core/network/IForestryPacketClient.java +++ b/src/main/java/forestry/core/network/IForestryPacketClient.java @@ -1,19 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network; import java.io.IOException; + import net.minecraft.entity.player.EntityPlayer; public interface IForestryPacketClient extends IForestryPacket { + void onPacketData(DataInputStreamForestry data, EntityPlayer player) throws IOException; @Override diff --git a/src/main/java/forestry/core/network/IForestryPacketServer.java b/src/main/java/forestry/core/network/IForestryPacketServer.java index eb81fadbb..6d74f2345 100644 --- a/src/main/java/forestry/core/network/IForestryPacketServer.java +++ b/src/main/java/forestry/core/network/IForestryPacketServer.java @@ -1,19 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network; import java.io.IOException; + import net.minecraft.entity.player.EntityPlayerMP; public interface IForestryPacketServer extends IForestryPacket { + void onPacketData(DataInputStreamForestry data, EntityPlayerMP player) throws IOException; @Override diff --git a/src/main/java/forestry/core/network/ILocatedPacket.java b/src/main/java/forestry/core/network/ILocatedPacket.java index ad8bc6aec..305f0d215 100755 --- a/src/main/java/forestry/core/network/ILocatedPacket.java +++ b/src/main/java/forestry/core/network/ILocatedPacket.java @@ -1,16 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network; public interface ILocatedPacket { + int getPosX(); int getPosY(); diff --git a/src/main/java/forestry/core/network/IPacketId.java b/src/main/java/forestry/core/network/IPacketId.java index 0582c64cb..ab9237d4b 100644 --- a/src/main/java/forestry/core/network/IPacketId.java +++ b/src/main/java/forestry/core/network/IPacketId.java @@ -1,15 +1,14 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network; public interface IPacketId { + int ordinal(); } diff --git a/src/main/java/forestry/core/network/IPacketRegistry.java b/src/main/java/forestry/core/network/IPacketRegistry.java index 4aceea840..d7e04eca8 100644 --- a/src/main/java/forestry/core/network/IPacketRegistry.java +++ b/src/main/java/forestry/core/network/IPacketRegistry.java @@ -1,15 +1,14 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network; public interface IPacketRegistry { + void registerPackets(); } diff --git a/src/main/java/forestry/core/network/IStreamable.java b/src/main/java/forestry/core/network/IStreamable.java index cac088037..40f300134 100644 --- a/src/main/java/forestry/core/network/IStreamable.java +++ b/src/main/java/forestry/core/network/IStreamable.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network; import java.io.IOException; public interface IStreamable { + void writeData(DataOutputStreamForestry data) throws IOException; void readData(DataInputStreamForestry data) throws IOException; diff --git a/src/main/java/forestry/core/network/IStreamableGui.java b/src/main/java/forestry/core/network/IStreamableGui.java index 3c7313f03..d7ffe7d00 100644 --- a/src/main/java/forestry/core/network/IStreamableGui.java +++ b/src/main/java/forestry/core/network/IStreamableGui.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network; import java.io.IOException; public interface IStreamableGui { + void writeGuiData(DataOutputStreamForestry data) throws IOException; void readGuiData(DataInputStreamForestry data) throws IOException; diff --git a/src/main/java/forestry/core/network/PacketHandler.java b/src/main/java/forestry/core/network/PacketHandler.java index 2cc270aa7..f3c863abe 100644 --- a/src/main/java/forestry/core/network/PacketHandler.java +++ b/src/main/java/forestry/core/network/PacketHandler.java @@ -1,15 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network; +import java.io.InputStream; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.network.NetHandlerPlayServer; + import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.network.FMLEventChannel; import cpw.mods.fml.common.network.FMLNetworkEvent.ClientCustomPacketEvent; @@ -18,12 +22,9 @@ import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.network.internal.FMLProxyPacket; import forestry.core.proxy.Proxies; import io.netty.buffer.ByteBufInputStream; -import java.io.InputStream; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.network.NetHandlerPlayServer; public class PacketHandler { + public static final String channelId = "FOR"; private final FMLEventChannel channel; diff --git a/src/main/java/forestry/core/network/PacketIdClient.java b/src/main/java/forestry/core/network/PacketIdClient.java index 327193eaa..4b4d1c7c4 100644 --- a/src/main/java/forestry/core/network/PacketIdClient.java +++ b/src/main/java/forestry/core/network/PacketIdClient.java @@ -1,19 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network; -import forestry.core.network.packets.PacketDummyClient; import javax.annotation.Nonnull; +import forestry.core.network.packets.PacketDummyClient; + public enum PacketIdClient implements IPacketId { + INVALID, // Core Gui diff --git a/src/main/java/forestry/core/network/PacketIdServer.java b/src/main/java/forestry/core/network/PacketIdServer.java index acfeb4f0e..6b31de278 100644 --- a/src/main/java/forestry/core/network/PacketIdServer.java +++ b/src/main/java/forestry/core/network/PacketIdServer.java @@ -1,19 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network; -import forestry.core.network.packets.PacketDummyServer; import javax.annotation.Nonnull; +import forestry.core.network.packets.PacketDummyServer; + public enum PacketIdServer implements IPacketId { + INVALID, // Core Gui diff --git a/src/main/java/forestry/core/network/PacketRegistry.java b/src/main/java/forestry/core/network/PacketRegistry.java index b87f90713..cd55bd0ff 100644 --- a/src/main/java/forestry/core/network/PacketRegistry.java +++ b/src/main/java/forestry/core/network/PacketRegistry.java @@ -1,16 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network; public abstract class PacketRegistry implements IPacketRegistry { + protected static void registerClientPacket(IForestryPacketClient packet) { packet.getPacketId().setPacketHandler(packet); } diff --git a/src/main/java/forestry/core/network/PacketRegistryCore.java b/src/main/java/forestry/core/network/PacketRegistryCore.java index 848e105af..5f6bd8314 100644 --- a/src/main/java/forestry/core/network/PacketRegistryCore.java +++ b/src/main/java/forestry/core/network/PacketRegistryCore.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network; @@ -32,6 +30,7 @@ import forestry.core.network.packets.PacketTankLevelUpdate; import forestry.core.network.packets.PacketTileStream; public class PacketRegistryCore extends PacketRegistry { + @Override public void registerPackets() { registerClientPacket(new PacketErrorUpdate()); diff --git a/src/main/java/forestry/core/network/PacketRegistryDummy.java b/src/main/java/forestry/core/network/PacketRegistryDummy.java index 764b7b6b9..0a60c7d7f 100644 --- a/src/main/java/forestry/core/network/PacketRegistryDummy.java +++ b/src/main/java/forestry/core/network/PacketRegistryDummy.java @@ -1,16 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network; public class PacketRegistryDummy implements IPacketRegistry { + public static final PacketRegistryDummy instance = new PacketRegistryDummy(); private PacketRegistryDummy() {} diff --git a/src/main/java/forestry/core/network/packets/PacketAccessSwitch.java b/src/main/java/forestry/core/network/packets/PacketAccessSwitch.java index eb04bb83f..d6d82d42b 100644 --- a/src/main/java/forestry/core/network/packets/PacketAccessSwitch.java +++ b/src/main/java/forestry/core/network/packets/PacketAccessSwitch.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.tileentity.TileEntity; + import forestry.core.access.IRestrictedAccess; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.IForestryPacketServer; import forestry.core.network.PacketIdServer; import forestry.core.tiles.ILocatable; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.tileentity.TileEntity; public class PacketAccessSwitch extends PacketCoordinates implements IForestryPacketServer { diff --git a/src/main/java/forestry/core/network/packets/PacketAccessSwitchEntity.java b/src/main/java/forestry/core/network/packets/PacketAccessSwitchEntity.java index a1ca6fd98..f863b85c8 100644 --- a/src/main/java/forestry/core/network/packets/PacketAccessSwitchEntity.java +++ b/src/main/java/forestry/core/network/packets/PacketAccessSwitchEntity.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayerMP; + import forestry.core.access.IRestrictedAccess; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.IForestryPacketServer; import forestry.core.network.PacketIdServer; -import java.io.IOException; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayerMP; public class PacketAccessSwitchEntity extends PacketEntityUpdate implements IForestryPacketServer { diff --git a/src/main/java/forestry/core/network/packets/PacketAccessUpdate.java b/src/main/java/forestry/core/network/packets/PacketAccessUpdate.java index 330d91f05..13e34c361 100644 --- a/src/main/java/forestry/core/network/packets/PacketAccessUpdate.java +++ b/src/main/java/forestry/core/network/packets/PacketAccessUpdate.java @@ -1,26 +1,27 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; + import forestry.core.access.IAccessHandler; import forestry.core.access.IRestrictedAccess; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IForestryPacketClient; import forestry.core.network.PacketIdClient; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; public class PacketAccessUpdate extends PacketCoordinates implements IForestryPacketClient { + private IAccessHandler accessHandler; public PacketAccessUpdate() {} diff --git a/src/main/java/forestry/core/network/packets/PacketAccessUpdateEntity.java b/src/main/java/forestry/core/network/packets/PacketAccessUpdateEntity.java index dae6ea9f1..752b98109 100644 --- a/src/main/java/forestry/core/network/packets/PacketAccessUpdateEntity.java +++ b/src/main/java/forestry/core/network/packets/PacketAccessUpdateEntity.java @@ -1,26 +1,27 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; + import forestry.core.access.IAccessHandler; import forestry.core.access.IRestrictedAccess; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IForestryPacketClient; import forestry.core.network.PacketIdClient; -import java.io.IOException; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; public class PacketAccessUpdateEntity extends PacketEntityUpdate implements IForestryPacketClient { + private IAccessHandler accessHandler; public PacketAccessUpdateEntity() {} diff --git a/src/main/java/forestry/core/network/packets/PacketChipsetClick.java b/src/main/java/forestry/core/network/packets/PacketChipsetClick.java index c44de6864..1627cf01d 100644 --- a/src/main/java/forestry/core/network/packets/PacketChipsetClick.java +++ b/src/main/java/forestry/core/network/packets/PacketChipsetClick.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; + import forestry.core.circuits.ItemCircuitBoard; import forestry.core.gui.IContainerSocketed; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.IForestryPacketServer; import forestry.core.network.PacketIdServer; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; public class PacketChipsetClick extends PacketSlotClick implements IForestryPacketServer { diff --git a/src/main/java/forestry/core/network/packets/PacketCoordinates.java b/src/main/java/forestry/core/network/packets/PacketCoordinates.java index 3d0b3174e..c3e46fe0e 100644 --- a/src/main/java/forestry/core/network/packets/PacketCoordinates.java +++ b/src/main/java/forestry/core/network/packets/PacketCoordinates.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.world.World; + import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.ForestryPacket; import forestry.core.network.ILocatedPacket; -import java.io.IOException; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.world.World; public abstract class PacketCoordinates extends ForestryPacket implements ILocatedPacket { diff --git a/src/main/java/forestry/core/network/packets/PacketDummy.java b/src/main/java/forestry/core/network/packets/PacketDummy.java index ffe5e15dc..0a7b0990e 100644 --- a/src/main/java/forestry/core/network/packets/PacketDummy.java +++ b/src/main/java/forestry/core/network/packets/PacketDummy.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + import cpw.mods.fml.common.network.internal.FMLProxyPacket; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.IForestryPacket; -import java.io.IOException; public abstract class PacketDummy implements IForestryPacket { + protected PacketDummy() {} @Override diff --git a/src/main/java/forestry/core/network/packets/PacketDummyClient.java b/src/main/java/forestry/core/network/packets/PacketDummyClient.java index 64790ba0a..6b402d446 100644 --- a/src/main/java/forestry/core/network/packets/PacketDummyClient.java +++ b/src/main/java/forestry/core/network/packets/PacketDummyClient.java @@ -1,22 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; + import forestry.core.network.DataInputStreamForestry; import forestry.core.network.IForestryPacketClient; import forestry.core.network.PacketIdClient; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; public class PacketDummyClient extends PacketDummy implements IForestryPacketClient { + public static final PacketDummyClient instance = new PacketDummyClient(); private PacketDummyClient() {} diff --git a/src/main/java/forestry/core/network/packets/PacketDummyServer.java b/src/main/java/forestry/core/network/packets/PacketDummyServer.java index 0952e88dd..d5da27368 100644 --- a/src/main/java/forestry/core/network/packets/PacketDummyServer.java +++ b/src/main/java/forestry/core/network/packets/PacketDummyServer.java @@ -1,22 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayerMP; + import forestry.core.network.DataInputStreamForestry; import forestry.core.network.IForestryPacketServer; import forestry.core.network.PacketIdServer; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayerMP; public class PacketDummyServer extends PacketDummy implements IForestryPacketServer { + public static final PacketDummyServer instance = new PacketDummyServer(); private PacketDummyServer() {} diff --git a/src/main/java/forestry/core/network/packets/PacketEntityUpdate.java b/src/main/java/forestry/core/network/packets/PacketEntityUpdate.java index b6566f496..32880e2cb 100644 --- a/src/main/java/forestry/core/network/packets/PacketEntityUpdate.java +++ b/src/main/java/forestry/core/network/packets/PacketEntityUpdate.java @@ -1,24 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + +import net.minecraft.entity.Entity; +import net.minecraft.world.World; + import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.ForestryPacket; import forestry.core.network.ILocatedPacket; -import java.io.IOException; -import net.minecraft.entity.Entity; -import net.minecraft.world.World; public abstract class PacketEntityUpdate extends ForestryPacket implements ILocatedPacket { + // sending private Entity entity; // receiving diff --git a/src/main/java/forestry/core/network/packets/PacketErrorUpdate.java b/src/main/java/forestry/core/network/packets/PacketErrorUpdate.java index f60501065..022c94da8 100644 --- a/src/main/java/forestry/core/network/packets/PacketErrorUpdate.java +++ b/src/main/java/forestry/core/network/packets/PacketErrorUpdate.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; + import forestry.api.core.IErrorLogic; import forestry.api.core.IErrorLogicSource; import forestry.core.network.DataInputStreamForestry; @@ -17,9 +20,6 @@ import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IForestryPacketClient; import forestry.core.network.PacketIdClient; import forestry.core.proxy.Proxies; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; public class PacketErrorUpdate extends PacketCoordinates implements IForestryPacketClient { diff --git a/src/main/java/forestry/core/network/packets/PacketErrorUpdateEntity.java b/src/main/java/forestry/core/network/packets/PacketErrorUpdateEntity.java index ad9a1c74a..579215ecd 100644 --- a/src/main/java/forestry/core/network/packets/PacketErrorUpdateEntity.java +++ b/src/main/java/forestry/core/network/packets/PacketErrorUpdateEntity.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; + import forestry.api.core.IErrorLogic; import forestry.api.core.IErrorLogicSource; import forestry.core.network.DataInputStreamForestry; @@ -17,11 +20,9 @@ import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IForestryPacketClient; import forestry.core.network.PacketIdClient; import forestry.core.proxy.Proxies; -import java.io.IOException; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; public class PacketErrorUpdateEntity extends PacketEntityUpdate implements IForestryPacketClient { + private IErrorLogic errorLogic; public PacketErrorUpdateEntity() {} diff --git a/src/main/java/forestry/core/network/packets/PacketFXSignal.java b/src/main/java/forestry/core/network/packets/PacketFXSignal.java index 1174c29fa..16ad4e31e 100644 --- a/src/main/java/forestry/core/network/packets/PacketFXSignal.java +++ b/src/main/java/forestry/core/network/packets/PacketFXSignal.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; + import cpw.mods.fml.common.registry.GameData; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IForestryPacketClient; import forestry.core.network.PacketIdClient; import forestry.core.proxy.Proxies; -import java.io.IOException; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; public class PacketFXSignal extends PacketCoordinates implements IForestryPacketClient { @@ -29,6 +29,7 @@ public class PacketFXSignal extends PacketCoordinates implements IForestryPacket } public enum SoundFXType { + NONE(""), BLOCK_DESTROY(""), BLOCK_PLACE(""), @@ -63,8 +64,8 @@ public class PacketFXSignal extends PacketCoordinates implements IForestryPacket this(VisualFXType.NONE, type, xCoord, yCoord, zCoord, block, meta); } - public PacketFXSignal( - VisualFXType visualFX, SoundFXType soundFX, int xCoord, int yCoord, int zCoord, Block block, int meta) { + public PacketFXSignal(VisualFXType visualFX, SoundFXType soundFX, int xCoord, int yCoord, int zCoord, Block block, + int meta) { super(xCoord, yCoord, zCoord); this.visualFX = visualFX; this.soundFX = soundFX; @@ -94,15 +95,20 @@ public class PacketFXSignal extends PacketCoordinates implements IForestryPacket public void onPacketData(DataInputStreamForestry data, EntityPlayer player) throws IOException { if (visualFX != VisualFXType.NONE) { Proxies.common.addBlockDestroyEffects( - Proxies.common.getRenderWorld(), getPosX(), getPosY(), getPosZ(), block, meta); + Proxies.common.getRenderWorld(), + getPosX(), + getPosY(), + getPosZ(), + block, + meta); } if (soundFX != SoundFXType.NONE) { if (soundFX == SoundFXType.BLOCK_DESTROY) { - Proxies.common.playBlockBreakSoundFX( - Proxies.common.getRenderWorld(), getPosX(), getPosY(), getPosZ(), block); + Proxies.common + .playBlockBreakSoundFX(Proxies.common.getRenderWorld(), getPosX(), getPosY(), getPosZ(), block); } else if (soundFX == SoundFXType.BLOCK_PLACE) { - Proxies.common.playBlockPlaceSoundFX( - Proxies.common.getRenderWorld(), getPosX(), getPosY(), getPosZ(), block); + Proxies.common + .playBlockPlaceSoundFX(Proxies.common.getRenderWorld(), getPosX(), getPosY(), getPosZ(), block); } else { Proxies.common.playSoundFX( Proxies.common.getRenderWorld(), diff --git a/src/main/java/forestry/core/network/packets/PacketGenomeTrackerSync.java b/src/main/java/forestry/core/network/packets/PacketGenomeTrackerSync.java index 0bfa07f3b..66313a24c 100644 --- a/src/main/java/forestry/core/network/packets/PacketGenomeTrackerSync.java +++ b/src/main/java/forestry/core/network/packets/PacketGenomeTrackerSync.java @@ -1,15 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.MinecraftForge; + import forestry.api.core.ForestryEvent; import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IBreedingTracker; @@ -19,10 +23,6 @@ import forestry.core.network.DataInputStreamForestry; import forestry.core.network.IForestryPacketClient; import forestry.core.network.PacketIdClient; import forestry.core.proxy.Proxies; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.MinecraftForge; public class PacketGenomeTrackerSync extends PacketNBT implements IForestryPacketClient { diff --git a/src/main/java/forestry/core/network/packets/PacketGuiEnergy.java b/src/main/java/forestry/core/network/packets/PacketGuiEnergy.java index c4bcfd4c3..4022bffb2 100644 --- a/src/main/java/forestry/core/network/packets/PacketGuiEnergy.java +++ b/src/main/java/forestry/core/network/packets/PacketGuiEnergy.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; + import forestry.core.gui.ContainerTile; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.ForestryPacket; import forestry.core.network.IForestryPacketClient; import forestry.core.network.PacketIdClient; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; public class PacketGuiEnergy extends ForestryPacket implements IForestryPacketClient { diff --git a/src/main/java/forestry/core/network/packets/PacketGuiLayoutSelect.java b/src/main/java/forestry/core/network/packets/PacketGuiLayoutSelect.java index 41855168b..c2e4a47ca 100644 --- a/src/main/java/forestry/core/network/packets/PacketGuiLayoutSelect.java +++ b/src/main/java/forestry/core/network/packets/PacketGuiLayoutSelect.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; + import forestry.core.circuits.ContainerSolderingIron; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.IForestryPacketClient; import forestry.core.network.PacketIdClient; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; public class PacketGuiLayoutSelect extends PacketString implements IForestryPacketClient { diff --git a/src/main/java/forestry/core/network/packets/PacketGuiSelect.java b/src/main/java/forestry/core/network/packets/PacketGuiSelect.java index df2f43402..2564de16d 100644 --- a/src/main/java/forestry/core/network/packets/PacketGuiSelect.java +++ b/src/main/java/forestry/core/network/packets/PacketGuiSelect.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.ForestryPacket; -import java.io.IOException; public abstract class PacketGuiSelect extends ForestryPacket { + private int primaryIndex; private int secondaryIndex; diff --git a/src/main/java/forestry/core/network/packets/PacketGuiSelectRequest.java b/src/main/java/forestry/core/network/packets/PacketGuiSelectRequest.java index 22617a3b9..98e89b764 100644 --- a/src/main/java/forestry/core/network/packets/PacketGuiSelectRequest.java +++ b/src/main/java/forestry/core/network/packets/PacketGuiSelectRequest.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.inventory.Container; + import forestry.core.gui.IGuiSelectable; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.IForestryPacketServer; import forestry.core.network.PacketIdServer; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.inventory.Container; public class PacketGuiSelectRequest extends PacketGuiSelect implements IForestryPacketServer { diff --git a/src/main/java/forestry/core/network/packets/PacketGuiUpdate.java b/src/main/java/forestry/core/network/packets/PacketGuiUpdate.java index e7977ff05..6ca645ea8 100644 --- a/src/main/java/forestry/core/network/packets/PacketGuiUpdate.java +++ b/src/main/java/forestry/core/network/packets/PacketGuiUpdate.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; + import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IForestryPacketClient; @@ -17,9 +20,6 @@ import forestry.core.network.IStreamableGui; import forestry.core.network.PacketIdClient; import forestry.core.proxy.Proxies; import forestry.core.tiles.ILocatable; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; public class PacketGuiUpdate extends PacketCoordinates implements IForestryPacketClient { diff --git a/src/main/java/forestry/core/network/packets/PacketGuiUpdateEntity.java b/src/main/java/forestry/core/network/packets/PacketGuiUpdateEntity.java index f35cd069f..03157edea 100644 --- a/src/main/java/forestry/core/network/packets/PacketGuiUpdateEntity.java +++ b/src/main/java/forestry/core/network/packets/PacketGuiUpdateEntity.java @@ -1,26 +1,27 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayer; + import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IForestryPacketClient; import forestry.core.network.IStreamableGui; import forestry.core.network.PacketIdClient; import forestry.core.proxy.Proxies; -import java.io.IOException; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayer; public class PacketGuiUpdateEntity extends PacketEntityUpdate implements IForestryPacketClient { + private IStreamableGui streamableGui; public PacketGuiUpdateEntity() {} diff --git a/src/main/java/forestry/core/network/packets/PacketItemStackDisplay.java b/src/main/java/forestry/core/network/packets/PacketItemStackDisplay.java index 6e2d9b1e7..b63b9a87c 100644 --- a/src/main/java/forestry/core/network/packets/PacketItemStackDisplay.java +++ b/src/main/java/forestry/core/network/packets/PacketItemStackDisplay.java @@ -1,15 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; + import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IForestryPacketClient; @@ -17,10 +21,6 @@ import forestry.core.network.PacketIdClient; import forestry.core.proxy.Proxies; import forestry.core.tiles.IItemStackDisplay; import forestry.core.tiles.TileForestry; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; public class PacketItemStackDisplay extends PacketCoordinates implements IForestryPacketClient { diff --git a/src/main/java/forestry/core/network/packets/PacketNBT.java b/src/main/java/forestry/core/network/packets/PacketNBT.java index be87f01af..f8c7ab0ac 100644 --- a/src/main/java/forestry/core/network/packets/PacketNBT.java +++ b/src/main/java/forestry/core/network/packets/PacketNBT.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + +import net.minecraft.nbt.NBTTagCompound; + import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.ForestryPacket; -import java.io.IOException; -import net.minecraft.nbt.NBTTagCompound; public abstract class PacketNBT extends ForestryPacket { diff --git a/src/main/java/forestry/core/network/packets/PacketPipetteClick.java b/src/main/java/forestry/core/network/packets/PacketPipetteClick.java index f8dd21f4a..28f8f4c9d 100644 --- a/src/main/java/forestry/core/network/packets/PacketPipetteClick.java +++ b/src/main/java/forestry/core/network/packets/PacketPipetteClick.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.tileentity.TileEntity; + import forestry.core.gui.IContainerLiquidTanks; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.IForestryPacketServer; import forestry.core.network.PacketIdServer; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.tileentity.TileEntity; public class PacketPipetteClick extends PacketSlotClick implements IForestryPacketServer { diff --git a/src/main/java/forestry/core/network/packets/PacketSlotClick.java b/src/main/java/forestry/core/network/packets/PacketSlotClick.java index 36f80565a..b49c02c38 100644 --- a/src/main/java/forestry/core/network/packets/PacketSlotClick.java +++ b/src/main/java/forestry/core/network/packets/PacketSlotClick.java @@ -1,21 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; -import forestry.core.network.DataInputStreamForestry; -import forestry.core.network.DataOutputStreamForestry; import java.io.IOException; + import net.minecraft.tileentity.TileEntity; +import forestry.core.network.DataInputStreamForestry; +import forestry.core.network.DataOutputStreamForestry; + public abstract class PacketSlotClick extends PacketCoordinates { + private int slot; protected PacketSlotClick() {} diff --git a/src/main/java/forestry/core/network/packets/PacketSocketUpdate.java b/src/main/java/forestry/core/network/packets/PacketSocketUpdate.java index 45535ba3d..e91e8db84 100644 --- a/src/main/java/forestry/core/network/packets/PacketSocketUpdate.java +++ b/src/main/java/forestry/core/network/packets/PacketSocketUpdate.java @@ -1,25 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; + import forestry.core.circuits.ISocketable; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IForestryPacketClient; import forestry.core.network.PacketIdClient; import forestry.core.proxy.Proxies; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; public class PacketSocketUpdate extends PacketCoordinates implements IForestryPacketClient { diff --git a/src/main/java/forestry/core/network/packets/PacketSolderingIronClick.java b/src/main/java/forestry/core/network/packets/PacketSolderingIronClick.java index 327813c41..4e90c98c2 100644 --- a/src/main/java/forestry/core/network/packets/PacketSolderingIronClick.java +++ b/src/main/java/forestry/core/network/packets/PacketSolderingIronClick.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; + import forestry.core.gui.IContainerSocketed; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.IForestryPacketServer; import forestry.core.network.PacketIdServer; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; public class PacketSolderingIronClick extends PacketSlotClick implements IForestryPacketServer { diff --git a/src/main/java/forestry/core/network/packets/PacketString.java b/src/main/java/forestry/core/network/packets/PacketString.java index 59e3d115a..d0d195ce7 100644 --- a/src/main/java/forestry/core/network/packets/PacketString.java +++ b/src/main/java/forestry/core/network/packets/PacketString.java @@ -1,19 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.ForestryPacket; -import java.io.IOException; public abstract class PacketString extends ForestryPacket { diff --git a/src/main/java/forestry/core/network/packets/PacketTankLevelUpdate.java b/src/main/java/forestry/core/network/packets/PacketTankLevelUpdate.java index 8d03663d0..aa9be0c88 100644 --- a/src/main/java/forestry/core/network/packets/PacketTankLevelUpdate.java +++ b/src/main/java/forestry/core/network/packets/PacketTankLevelUpdate.java @@ -1,15 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.fluids.FluidStack; + import forestry.core.fluids.ITankManager; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; @@ -17,10 +21,6 @@ import forestry.core.network.IForestryPacketClient; import forestry.core.network.PacketIdClient; import forestry.core.proxy.Proxies; import forestry.core.tiles.ILiquidTankTile; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.fluids.FluidStack; public class PacketTankLevelUpdate extends PacketCoordinates implements IForestryPacketClient { diff --git a/src/main/java/forestry/core/network/packets/PacketTileStream.java b/src/main/java/forestry/core/network/packets/PacketTileStream.java index a0d4ba7e4..37d22481f 100644 --- a/src/main/java/forestry/core/network/packets/PacketTileStream.java +++ b/src/main/java/forestry/core/network/packets/PacketTileStream.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; + import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IForestryPacketClient; import forestry.core.network.IStreamable; import forestry.core.network.PacketIdClient; import forestry.core.proxy.Proxies; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; public class PacketTileStream extends PacketCoordinates implements IForestryPacketClient { diff --git a/src/main/java/forestry/core/proxy/Proxies.java b/src/main/java/forestry/core/proxy/Proxies.java index 47c1dac54..a38f550b7 100755 --- a/src/main/java/forestry/core/proxy/Proxies.java +++ b/src/main/java/forestry/core/proxy/Proxies.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.proxy; import cpw.mods.fml.common.SidedProxy; public class Proxies { + @SidedProxy(clientSide = "forestry.core.proxy.ProxyCommonClient", serverSide = "forestry.core.proxy.ProxyCommon") public static ProxyCommon common; diff --git a/src/main/java/forestry/core/proxy/ProxyCommon.java b/src/main/java/forestry/core/proxy/ProxyCommon.java index 9ff47e384..fa81c312a 100755 --- a/src/main/java/forestry/core/proxy/ProxyCommon.java +++ b/src/main/java/forestry/core/proxy/ProxyCommon.java @@ -1,15 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.proxy; +import java.io.File; + +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; + import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.Loader; @@ -17,14 +25,6 @@ import forestry.core.TickHandlerCoreServer; import forestry.core.multiblock.MultiblockServerTickHandler; import forestry.core.network.packets.PacketFXSignal; import forestry.core.worldgen.WorldGenerator; -import java.io.File; -import net.minecraft.block.Block; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.server.MinecraftServer; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; public class ProxyCommon { @@ -95,18 +95,11 @@ public class ProxyCommon { public void playBlockPlaceSoundFX(World world, int x, int y, int z, Block block) {} - public void sendFXSignal( - PacketFXSignal.VisualFXType visualFX, - PacketFXSignal.SoundFXType soundFX, - World world, - int xCoord, - int yCoord, - int zCoord, - Block block, - int i) { + public void sendFXSignal(PacketFXSignal.VisualFXType visualFX, PacketFXSignal.SoundFXType soundFX, World world, + int xCoord, int yCoord, int zCoord, Block block, int i) { if (!world.isRemote) { - Proxies.net.sendNetworkPacket( - new PacketFXSignal(visualFX, soundFX, xCoord, yCoord, zCoord, block, i), world); + Proxies.net + .sendNetworkPacket(new PacketFXSignal(visualFX, soundFX, xCoord, yCoord, zCoord, block, i), world); } } diff --git a/src/main/java/forestry/core/proxy/ProxyCommonClient.java b/src/main/java/forestry/core/proxy/ProxyCommonClient.java index 61ccef9cd..97720e1be 100644 --- a/src/main/java/forestry/core/proxy/ProxyCommonClient.java +++ b/src/main/java/forestry/core/proxy/ProxyCommonClient.java @@ -1,28 +1,29 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.proxy; -import cpw.mods.fml.common.FMLCommonHandler; -import forestry.core.TickHandlerCoreClient; -import forestry.core.multiblock.MultiblockClientTickHandler; -import forestry.core.worldgen.WorldGenerator; import java.io.File; + import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; + import org.lwjgl.input.Keyboard; +import cpw.mods.fml.common.FMLCommonHandler; +import forestry.core.TickHandlerCoreClient; +import forestry.core.multiblock.MultiblockClientTickHandler; +import forestry.core.worldgen.WorldGenerator; + public class ProxyCommonClient extends ProxyCommon { @Override diff --git a/src/main/java/forestry/core/proxy/ProxyNetwork.java b/src/main/java/forestry/core/proxy/ProxyNetwork.java index dd6cf3ca2..8dd024ea0 100755 --- a/src/main/java/forestry/core/proxy/ProxyNetwork.java +++ b/src/main/java/forestry/core/proxy/ProxyNetwork.java @@ -1,19 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.proxy; -import forestry.Forestry; -import forestry.core.network.IForestryPacketClient; -import forestry.core.network.IForestryPacketServer; -import forestry.core.network.ILocatedPacket; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.server.management.PlayerManager; @@ -21,6 +15,11 @@ import net.minecraft.world.World; import net.minecraft.world.WorldServer; import net.minecraftforge.common.util.FakePlayer; +import forestry.Forestry; +import forestry.core.network.IForestryPacketClient; +import forestry.core.network.IForestryPacketServer; +import forestry.core.network.ILocatedPacket; + public class ProxyNetwork { public

void sendNetworkPacket(P packet, World world) { diff --git a/src/main/java/forestry/core/proxy/ProxyNetworkClient.java b/src/main/java/forestry/core/proxy/ProxyNetworkClient.java index dba4b6dfc..f14f1129c 100644 --- a/src/main/java/forestry/core/proxy/ProxyNetworkClient.java +++ b/src/main/java/forestry/core/proxy/ProxyNetworkClient.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.proxy; -import forestry.core.network.IForestryPacketServer; import net.minecraft.client.network.NetHandlerPlayClient; +import forestry.core.network.IForestryPacketServer; + public class ProxyNetworkClient extends ProxyNetwork { @Override diff --git a/src/main/java/forestry/core/proxy/ProxyRender.java b/src/main/java/forestry/core/proxy/ProxyRender.java index 8c632d56d..5bd3eea31 100755 --- a/src/main/java/forestry/core/proxy/ProxyRender.java +++ b/src/main/java/forestry/core/proxy/ProxyRender.java @@ -1,24 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.proxy; -import forestry.core.render.IBlockRenderer; -import forestry.core.render.SpriteSheet; -import forestry.core.tiles.MachineDefinition; import net.minecraft.client.resources.IResourceManager; import net.minecraft.entity.Entity; import net.minecraft.util.ChunkCoordinates; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; +import forestry.core.render.IBlockRenderer; +import forestry.core.render.SpriteSheet; +import forestry.core.tiles.MachineDefinition; + public class ProxyRender { public void init() {} diff --git a/src/main/java/forestry/core/proxy/ProxyRenderClient.java b/src/main/java/forestry/core/proxy/ProxyRenderClient.java index e7797104c..b5fac7b14 100644 --- a/src/main/java/forestry/core/proxy/ProxyRenderClient.java +++ b/src/main/java/forestry/core/proxy/ProxyRenderClient.java @@ -1,15 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.proxy; +import net.minecraft.client.Minecraft; +import net.minecraft.client.particle.EntityExplodeFX; +import net.minecraft.client.particle.EntityFX; +import net.minecraft.client.particle.EntitySpellParticleFX; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.client.resources.IResourceManager; +import net.minecraft.entity.Entity; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.client.registry.ClientRegistry; import cpw.mods.fml.client.registry.RenderingRegistry; @@ -33,16 +42,6 @@ import forestry.core.render.SpriteSheet; import forestry.core.render.TextureManager; import forestry.core.render.TileRendererIndex; import forestry.core.tiles.MachineDefinition; -import net.minecraft.client.Minecraft; -import net.minecraft.client.particle.EntityExplodeFX; -import net.minecraft.client.particle.EntityFX; -import net.minecraft.client.particle.EntitySpellParticleFX; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.client.resources.IResourceManager; -import net.minecraft.entity.Entity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; public class ProxyRenderClient extends ProxyRender { @@ -81,10 +80,10 @@ public class ProxyRenderClient extends ProxyRender { @Override public void registerTESR(MachineDefinition definition) { - RenderBlock.byBlockRenderer.put( - new TileRendererIndex(definition.getBlock(), definition.getMeta()), definition.renderer); - ClientRegistry.bindTileEntitySpecialRenderer( - definition.teClass, (TileEntitySpecialRenderer) definition.renderer); + RenderBlock.byBlockRenderer + .put(new TileRendererIndex(definition.getBlock(), definition.getMeta()), definition.renderer); + ClientRegistry + .bindTileEntitySpecialRenderer(definition.teClass, (TileEntitySpecialRenderer) definition.renderer); } @Override @@ -197,9 +196,7 @@ public class ProxyRenderClient extends ProxyRender { return; } - Proxies.common - .getClientInstance() - .effectRenderer + Proxies.common.getClientInstance().effectRenderer .addEffect(new EntityFXSnow(world, d1 + world.rand.nextGaussian(), d2, d3 + world.rand.nextGaussian())); } diff --git a/src/main/java/forestry/core/recipes/RecipeUtil.java b/src/main/java/forestry/core/recipes/RecipeUtil.java index 8096f9be7..19cd08a4b 100644 --- a/src/main/java/forestry/core/recipes/RecipeUtil.java +++ b/src/main/java/forestry/core/recipes/RecipeUtil.java @@ -1,26 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.recipes; -import cpw.mods.fml.common.registry.GameRegistry; -import forestry.api.recipes.IDescriptiveRecipe; -import forestry.api.recipes.RecipeManagers; -import forestry.core.config.Config; -import forestry.core.fluids.Fluids; -import forestry.core.utils.ItemStackUtil; -import forestry.core.utils.Log; -import forestry.factory.inventory.InventoryCraftingForestry; import java.util.ArrayList; import java.util.Collections; import java.util.List; + import net.minecraft.inventory.IInventory; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.Item; @@ -32,7 +23,17 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapelessOreRecipe; +import cpw.mods.fml.common.registry.GameRegistry; +import forestry.api.recipes.IDescriptiveRecipe; +import forestry.api.recipes.RecipeManagers; +import forestry.core.config.Config; +import forestry.core.fluids.Fluids; +import forestry.core.utils.ItemStackUtil; +import forestry.core.utils.Log; +import forestry.factory.inventory.InventoryCraftingForestry; + public abstract class RecipeUtil { + static List cachedRecipes = new ArrayList(); public static void addFermenterRecipes(ItemStack resource, int fermentationValue, Fluids output) { @@ -40,24 +41,24 @@ public abstract class RecipeUtil { return; } - RecipeManagers.fermenterManager.addRecipe( - resource, fermentationValue, 1.0f, output.getFluid(1), Fluids.WATER.getFluid(1)); + RecipeManagers.fermenterManager + .addRecipe(resource, fermentationValue, 1.0f, output.getFluid(1), Fluids.WATER.getFluid(1)); if (FluidRegistry.isFluidRegistered(Fluids.JUICE.getFluid())) { - RecipeManagers.fermenterManager.addRecipe( - resource, fermentationValue, 1.5f, output.getFluid(1), Fluids.JUICE.getFluid(1)); + RecipeManagers.fermenterManager + .addRecipe(resource, fermentationValue, 1.5f, output.getFluid(1), Fluids.JUICE.getFluid(1)); } if (FluidRegistry.isFluidRegistered(Fluids.HONEY.getFluid())) { - RecipeManagers.fermenterManager.addRecipe( - resource, fermentationValue, 1.5f, output.getFluid(1), Fluids.HONEY.getFluid(1)); + RecipeManagers.fermenterManager + .addRecipe(resource, fermentationValue, 1.5f, output.getFluid(1), Fluids.HONEY.getFluid(1)); } } /** - * Returns a list of the ore dictionary names if they exist. - * Returns a list containing itemStack if there are no ore dictionary names. - * Used for creating recipes that should accept equivalent itemStacks, based on the ore dictionary. + * Returns a list of the ore dictionary names if they exist. Returns a list containing itemStack if there are no ore + * dictionary names. Used for creating recipes that should accept equivalent itemStacks, based on the ore + * dictionary. */ public static List getOreDictRecipeEquivalents(ItemStack itemStack) { int[] oreDictIds = OreDictionary.getOreIDs(itemStack); @@ -76,7 +77,10 @@ public abstract class RecipeUtil { try { return getShapedRecipeAsArray( - recipe.getWidth(), recipe.getHeight(), recipe.getIngredients(), recipe.getRecipeOutput()); + recipe.getWidth(), + recipe.getHeight(), + recipe.getIngredients(), + recipe.getRecipeOutput()); } catch (Exception ex) { Log.warning("Exception while trying to parse an ItemStack[10] from an IRecipe:"); Log.warning(ex.getMessage()); @@ -96,8 +100,8 @@ public abstract class RecipeUtil { return result; } - public static InventoryCraftingForestry getCraftRecipe( - ItemStack[] recipeItems, ItemStack[] availableItems, World world, ItemStack recipeOutput) { + public static InventoryCraftingForestry getCraftRecipe(ItemStack[] recipeItems, ItemStack[] availableItems, + World world, ItemStack recipeOutput) { // Need at least one matched set if (ItemStackUtil.containsSets(recipeItems, availableItems, true, true) == 0) { return null; @@ -227,9 +231,8 @@ public abstract class RecipeUtil { // System.out.println( "Highest recipe found at " + matchingIndex.get(matchingIndex.size()-1) + ", // moving " + matchingIndex.size() + " to front" ); // System.out.println( "Size of recipe map " + recipeMap.size() ); - for (index = 0; - index < matchingIndex.size(); - index++) { // index is reused here, it goes through the matching groups. + for (index = 0; index < matchingIndex.size(); index++) { // index is reused here, it goes through + // the matching groups. // Remove recipe and add back at the front int target = matchingIndex.get(index); // remove requires int // System.out.println("Removing recipe at " + target); @@ -268,8 +271,7 @@ public abstract class RecipeUtil { } } - if (craftIngredientCount == 2 - && itemstack0.getItem() == itemstack1.getItem() + if (craftIngredientCount == 2 && itemstack0.getItem() == itemstack1.getItem() && itemstack0.stackSize == 1 && itemstack1.stackSize == 1 && itemstack0.getItem().isRepairable()) { @@ -365,14 +367,8 @@ public abstract class RecipeUtil { return false; } - private static boolean checkMatch( - Object[] recipeIngredients, - int width, - int height, - ItemStack[][] resources, - int xInGrid, - int yInGrid, - boolean mirror) { + private static boolean checkMatch(Object[] recipeIngredients, int width, int height, ItemStack[][] resources, + int xInGrid, int yInGrid, boolean mirror) { for (int k = 0; k < 3; k++) { for (int l = 0; l < 3; l++) { ItemStack resource = resources[k][l]; diff --git a/src/main/java/forestry/core/recipes/ShapedRecipeCustom.java b/src/main/java/forestry/core/recipes/ShapedRecipeCustom.java index 9b6afb792..d895017a8 100644 --- a/src/main/java/forestry/core/recipes/ShapedRecipeCustom.java +++ b/src/main/java/forestry/core/recipes/ShapedRecipeCustom.java @@ -1,20 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.recipes; -import forestry.api.recipes.IDescriptiveRecipe; -import forestry.core.utils.ItemStackUtil; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; + import net.minecraft.block.Block; import net.minecraft.inventory.IInventory; import net.minecraft.inventory.InventoryCrafting; @@ -24,7 +21,11 @@ import net.minecraft.world.World; import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.ShapedOreRecipe; +import forestry.api.recipes.IDescriptiveRecipe; +import forestry.core.utils.ItemStackUtil; + public class ShapedRecipeCustom extends ShapedOreRecipe implements IDescriptiveRecipe { + // 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; diff --git a/src/main/java/forestry/core/recipes/craftguide/CraftGuideCustomRecipes.java b/src/main/java/forestry/core/recipes/craftguide/CraftGuideCustomRecipes.java index 5840bd06f..76e26f2f8 100644 --- a/src/main/java/forestry/core/recipes/craftguide/CraftGuideCustomRecipes.java +++ b/src/main/java/forestry/core/recipes/craftguide/CraftGuideCustomRecipes.java @@ -1,25 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.recipes.craftguide; -import forestry.api.recipes.IDescriptiveRecipe; -import forestry.core.recipes.RecipeUtil; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.CraftingManager; + import uristqwerty.CraftGuide.api.ItemSlot; import uristqwerty.CraftGuide.api.RecipeGenerator; import uristqwerty.CraftGuide.api.RecipeProvider; import uristqwerty.CraftGuide.api.RecipeTemplate; import uristqwerty.CraftGuide.api.SlotType; +import forestry.api.recipes.IDescriptiveRecipe; +import forestry.core.recipes.RecipeUtil; public class CraftGuideCustomRecipes implements RecipeProvider { @@ -38,8 +37,8 @@ public class CraftGuideCustomRecipes implements RecipeProvider { public void generateRecipes(RecipeGenerator generator) { ItemStack machine = new ItemStack(Blocks.crafting_table); - RecipeTemplate template = - generator.createRecipeTemplate(slots, machine, "/gui/CraftGuideRecipe.png", 1, 1, 82, 1); + RecipeTemplate template = generator + .createRecipeTemplate(slots, machine, "/gui/CraftGuideRecipe.png", 1, 1, 82, 1); for (Object rec : CraftingManager.getInstance().getRecipeList()) { if (!(rec instanceof IDescriptiveRecipe)) { diff --git a/src/main/java/forestry/core/recipes/craftguide/CraftGuideIntegration.java b/src/main/java/forestry/core/recipes/craftguide/CraftGuideIntegration.java index 98defb3f9..925a9e7a7 100644 --- a/src/main/java/forestry/core/recipes/craftguide/CraftGuideIntegration.java +++ b/src/main/java/forestry/core/recipes/craftguide/CraftGuideIntegration.java @@ -1,15 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.recipes.craftguide; +import java.lang.reflect.Method; + import forestry.core.utils.Log; import forestry.factory.recipes.craftguide.CraftGuideBottler; import forestry.factory.recipes.craftguide.CraftGuideCarpenter; @@ -18,7 +18,6 @@ import forestry.factory.recipes.craftguide.CraftGuideFabricator; import forestry.factory.recipes.craftguide.CraftGuideFermenter; import forestry.factory.recipes.craftguide.CraftGuideSqueezer; import forestry.factory.recipes.craftguide.CraftGuideStill; -import java.lang.reflect.Method; public class CraftGuideIntegration { diff --git a/src/main/java/forestry/core/recipes/nei/CustomOverlayHandler.java b/src/main/java/forestry/core/recipes/nei/CustomOverlayHandler.java index b95307048..1b21f6920 100644 --- a/src/main/java/forestry/core/recipes/nei/CustomOverlayHandler.java +++ b/src/main/java/forestry/core/recipes/nei/CustomOverlayHandler.java @@ -1,15 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.recipes.nei; +import java.util.List; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; + import codechicken.nei.LayoutManager; import codechicken.nei.OffsetPositioner; import codechicken.nei.PositionedStack; @@ -19,16 +24,12 @@ import codechicken.nei.api.IStackPositioner; import codechicken.nei.recipe.IRecipeHandler; import forestry.core.proxy.Proxies; import forestry.factory.network.packets.PacketWorktableNEISelect; -import java.util.List; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; /** * @author bdew */ public class CustomOverlayHandler implements IOverlayHandler { + private final int xOffs; private final int yOffs; private final boolean forceShift; diff --git a/src/main/java/forestry/core/recipes/nei/IRecipeHandlerBase.java b/src/main/java/forestry/core/recipes/nei/IRecipeHandlerBase.java index 0d4c0086a..1635cb212 100644 --- a/src/main/java/forestry/core/recipes/nei/IRecipeHandlerBase.java +++ b/src/main/java/forestry/core/recipes/nei/IRecipeHandlerBase.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.recipes.nei; @@ -14,5 +12,6 @@ import codechicken.nei.recipe.ICraftingHandler; import codechicken.nei.recipe.IUsageHandler; public interface IRecipeHandlerBase extends ICraftingHandler, IUsageHandler { + void prepare(); } diff --git a/src/main/java/forestry/core/recipes/nei/ItemFilterForestry.java b/src/main/java/forestry/core/recipes/nei/ItemFilterForestry.java index 0ef7411e3..b472354cb 100644 --- a/src/main/java/forestry/core/recipes/nei/ItemFilterForestry.java +++ b/src/main/java/forestry/core/recipes/nei/ItemFilterForestry.java @@ -1,25 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.recipes.nei; -import codechicken.nei.api.ItemFilter; -import forestry.core.config.Constants; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; +import codechicken.nei.api.ItemFilter; +import forestry.core.config.Constants; + /** * @author bdew */ public class ItemFilterForestry implements ItemFilter { + private final boolean items; public ItemFilterForestry(Boolean items) { diff --git a/src/main/java/forestry/core/recipes/nei/ItemFilterGenetic.java b/src/main/java/forestry/core/recipes/nei/ItemFilterGenetic.java index ef3567732..2bc40d3ef 100644 --- a/src/main/java/forestry/core/recipes/nei/ItemFilterGenetic.java +++ b/src/main/java/forestry/core/recipes/nei/ItemFilterGenetic.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.recipes.nei; +import net.minecraft.item.ItemStack; + import codechicken.nei.api.ItemFilter; import forestry.api.genetics.IIndividual; import forestry.api.genetics.ISpeciesRoot; -import net.minecraft.item.ItemStack; /** * @author bdew */ public class ItemFilterGenetic implements ItemFilter { + private final ISpeciesRoot root; private final int type; private final boolean analyzedOnly; diff --git a/src/main/java/forestry/core/recipes/nei/ItemFilterOther.java b/src/main/java/forestry/core/recipes/nei/ItemFilterOther.java index 6d1645ab6..9b56e873a 100644 --- a/src/main/java/forestry/core/recipes/nei/ItemFilterOther.java +++ b/src/main/java/forestry/core/recipes/nei/ItemFilterOther.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.recipes.nei; -import forestry.api.genetics.AlleleManager; import net.minecraft.item.ItemStack; +import forestry.api.genetics.AlleleManager; + /** * @author bdew */ diff --git a/src/main/java/forestry/core/recipes/nei/NEIIntegrationConfig.java b/src/main/java/forestry/core/recipes/nei/NEIIntegrationConfig.java index 096ad74e6..44d71bff9 100644 --- a/src/main/java/forestry/core/recipes/nei/NEIIntegrationConfig.java +++ b/src/main/java/forestry/core/recipes/nei/NEIIntegrationConfig.java @@ -1,15 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.recipes.nei; +import net.minecraftforge.oredict.OreDictionary; + import codechicken.nei.api.API; import codechicken.nei.api.IConfigureNEI; import forestry.api.apiculture.BeeManager; @@ -28,7 +28,6 @@ import forestry.factory.recipes.nei.NEIHandlerFermenter; import forestry.factory.recipes.nei.NEIHandlerMoistener; import forestry.factory.recipes.nei.NEIHandlerSqueezer; import forestry.factory.recipes.nei.NEIHandlerStill; -import net.minecraftforge.oredict.OreDictionary; public class NEIIntegrationConfig implements IConfigureNEI { @@ -52,9 +51,11 @@ public class NEIIntegrationConfig implements IConfigureNEI { "Forestry.Bees.Princesses", new ItemFilterGenetic(BeeManager.beeRoot, EnumBeeType.PRINCESS.ordinal(), true)); API.addSubset( - "Forestry.Bees.Drones", new ItemFilterGenetic(BeeManager.beeRoot, EnumBeeType.DRONE.ordinal(), true)); + "Forestry.Bees.Drones", + new ItemFilterGenetic(BeeManager.beeRoot, EnumBeeType.DRONE.ordinal(), true)); API.addSubset( - "Forestry.Bees.Larvae", new ItemFilterGenetic(BeeManager.beeRoot, EnumBeeType.LARVAE.ordinal(), true)); + "Forestry.Bees.Larvae", + new ItemFilterGenetic(BeeManager.beeRoot, EnumBeeType.LARVAE.ordinal(), true)); API.addSubset( "Forestry.Trees.Saplings", diff --git a/src/main/java/forestry/core/recipes/nei/NEIUtils.java b/src/main/java/forestry/core/recipes/nei/NEIUtils.java index 3aaab251b..bc18b7046 100644 --- a/src/main/java/forestry/core/recipes/nei/NEIUtils.java +++ b/src/main/java/forestry/core/recipes/nei/NEIUtils.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.recipes.nei; @@ -14,6 +12,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.Iterator; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; diff --git a/src/main/java/forestry/core/recipes/nei/PositionedFluidTank.java b/src/main/java/forestry/core/recipes/nei/PositionedFluidTank.java index 7616eeaac..b53154d68 100644 --- a/src/main/java/forestry/core/recipes/nei/PositionedFluidTank.java +++ b/src/main/java/forestry/core/recipes/nei/PositionedFluidTank.java @@ -1,31 +1,32 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.recipes.nei; -import codechicken.lib.gui.GuiDraw; -import codechicken.nei.recipe.GuiCraftingRecipe; -import codechicken.nei.recipe.GuiUsageRecipe; import java.awt.Point; import java.awt.Rectangle; import java.util.Collection; import java.util.Collections; import java.util.List; + import net.minecraft.client.renderer.Tessellator; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IIcon; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTank; + import org.lwjgl.opengl.GL11; +import codechicken.lib.gui.GuiDraw; +import codechicken.nei.recipe.GuiCraftingRecipe; +import codechicken.nei.recipe.GuiUsageRecipe; + public class PositionedFluidTank { public FluidTank[] tanks; @@ -45,17 +46,13 @@ public class PositionedFluidTank { this.overlayTexturePos = overlayTexturePos; } - public PositionedFluidTank( - Collection fluids, - int capacity, - Rectangle position, - String overlayTexture, + public PositionedFluidTank(Collection fluids, int capacity, Rectangle position, String overlayTexture, Point overlayTexturePos) { this(createFluidTanks(capacity, fluids), position, overlayTexture, overlayTexturePos); } - public PositionedFluidTank( - FluidStack fluid, int capacity, Rectangle position, String overlayTexture, Point overlayTexturePos) { + public PositionedFluidTank(FluidStack fluid, int capacity, Rectangle position, String overlayTexture, + Point overlayTexturePos) { this(createFluidTanks(capacity, Collections.singletonList(fluid)), position, overlayTexture, overlayTexturePos); } @@ -73,17 +70,16 @@ public class PositionedFluidTank { } public List handleTooltip(List currenttip) { - if (this.tank == null - || this.tank.getFluid() == null + if (this.tank == null || this.tank.getFluid() == null || this.tank.getFluid().getFluid() == null || this.tank.getFluid().amount <= 0) { return currenttip; } currenttip.add(this.tank.getFluid().getLocalizedName()); if (this.showAmount) { - currenttip.add(EnumChatFormatting.GRAY.toString() - + this.tank.getFluid().amount - + (this.perTick ? " mB/t" : " mB")); + currenttip.add( + EnumChatFormatting.GRAY.toString() + this.tank.getFluid().amount + + (this.perTick ? " mB/t" : " mB")); } return currenttip; } @@ -105,8 +101,7 @@ public class PositionedFluidTank { } public void draw() { - if (this.tank == null - || this.tank.getFluid() == null + if (this.tank == null || this.tank.getFluid() == null || this.tank.getFluid().getFluid() == null || this.tank.getFluid().amount <= 0) { return; @@ -146,8 +141,8 @@ public class PositionedFluidTank { Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); - tessellator.addVertexWithUV( - drawX, drawY + drawHeight, 0, minU, minV + (maxV - minV) * drawHeight / 16F); + tessellator + .addVertexWithUV(drawX, drawY + drawHeight, 0, minU, minV + (maxV - minV) * drawHeight / 16F); tessellator.addVertexWithUV( drawX + drawWidth, drawY + drawHeight, diff --git a/src/main/java/forestry/core/recipes/nei/PositionedStackAdv.java b/src/main/java/forestry/core/recipes/nei/PositionedStackAdv.java index 7b1050169..a16cf3f5a 100644 --- a/src/main/java/forestry/core/recipes/nei/PositionedStackAdv.java +++ b/src/main/java/forestry/core/recipes/nei/PositionedStackAdv.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.recipes.nei; -import codechicken.nei.PositionedStack; -import codechicken.nei.recipe.GuiRecipe; import java.awt.Rectangle; import java.text.NumberFormat; import java.util.ArrayList; import java.util.List; + import net.minecraft.util.EnumChatFormatting; +import codechicken.nei.PositionedStack; +import codechicken.nei.recipe.GuiRecipe; + public class PositionedStackAdv extends PositionedStack { private final List tooltip = new ArrayList<>(); @@ -58,16 +58,19 @@ public class PositionedStackAdv extends PositionedStack { public PositionedStackAdv setChance(float chance) { if (chance <= 0.0F) { - this.tooltip.add(EnumChatFormatting.GRAY - + String.format(NEIUtils.translate("chance"), NEIUtils.translate("chance.never"))); + this.tooltip.add( + EnumChatFormatting.GRAY + + String.format(NEIUtils.translate("chance"), NEIUtils.translate("chance.never"))); } else if (chance < 0.01F) { - this.tooltip.add(EnumChatFormatting.GRAY - + String.format(NEIUtils.translate("chance"), NEIUtils.translate("chance.lessThan1"))); + this.tooltip.add( + EnumChatFormatting.GRAY + + String.format(NEIUtils.translate("chance"), NEIUtils.translate("chance.lessThan1"))); } else if (chance != 1.0F) { NumberFormat percentFormat = NumberFormat.getPercentInstance(); percentFormat.setMaximumFractionDigits(2); - this.tooltip.add(EnumChatFormatting.GRAY - + String.format(NEIUtils.translate("chance"), String.valueOf(percentFormat.format(chance)))); + this.tooltip.add( + EnumChatFormatting.GRAY + String + .format(NEIUtils.translate("chance"), String.valueOf(percentFormat.format(chance)))); } return this; } diff --git a/src/main/java/forestry/core/recipes/nei/RecipeHandlerBase.java b/src/main/java/forestry/core/recipes/nei/RecipeHandlerBase.java index 1dbe8337f..54f7fecd5 100644 --- a/src/main/java/forestry/core/recipes/nei/RecipeHandlerBase.java +++ b/src/main/java/forestry/core/recipes/nei/RecipeHandlerBase.java @@ -1,28 +1,29 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.recipes.nei; +import java.awt.Point; +import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + +import org.lwjgl.opengl.GL11; + import codechicken.lib.gui.GuiDraw; import codechicken.nei.NEIClientConfig; import codechicken.nei.PositionedStack; import codechicken.nei.guihook.GuiContainerManager; import codechicken.nei.recipe.GuiRecipe; import codechicken.nei.recipe.TemplateRecipeHandler; -import java.awt.Point; -import java.awt.Rectangle; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; -import org.lwjgl.opengl.GL11; public abstract class RecipeHandlerBase extends TemplateRecipeHandler implements IRecipeHandlerBase { @@ -65,8 +66,7 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler implements @Override public void loadCraftingRecipes(String outputId, Object... results) { - if (outputId.equals("liquid") - && results[0] instanceof FluidStack + if (outputId.equals("liquid") && results[0] instanceof FluidStack && ((FluidStack) results[0]).getFluid() != null) { this.loadCraftingRecipes((FluidStack) results[0]); } else if (outputId.equals(this.getRecipeID())) { @@ -90,8 +90,7 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler implements @Override public void loadUsageRecipes(String inputId, Object... ingredients) { - if (inputId.equals("liquid") - && ingredients[0] instanceof FluidStack + if (inputId.equals("liquid") && ingredients[0] instanceof FluidStack && ((FluidStack) ingredients[0]).getFluid() != null) { this.loadUsageRecipes((FluidStack) ingredients[0]); } else { @@ -126,21 +125,22 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler implements } @Override - public List handleItemTooltip( - GuiRecipe guiRecipe, ItemStack itemStack, List currenttip, int recipe) { + public List handleItemTooltip(GuiRecipe guiRecipe, ItemStack itemStack, List currenttip, + int recipe) { super.handleItemTooltip(guiRecipe, itemStack, currenttip, recipe); CachedBaseRecipe crecipe = (CachedBaseRecipe) this.arecipes.get(recipe); Point mouse = GuiDraw.getMousePosition(); Point offset = guiRecipe.getRecipePosition(recipe); Point relMouse = new Point( - mouse.x - (guiRecipe.width - 176) / 2 - offset.x, mouse.y - (guiRecipe.height - 166) / 2 - offset.y); + mouse.x - (guiRecipe.width - 176) / 2 - offset.x, + mouse.y - (guiRecipe.height - 166) / 2 - offset.y); currenttip = this.provideItemTooltip(guiRecipe, itemStack, currenttip, crecipe, relMouse); return currenttip; } - public List provideTooltip( - GuiRecipe guiRecipe, List currenttip, CachedBaseRecipe crecipe, Point relMouse) { + public List provideTooltip(GuiRecipe guiRecipe, List currenttip, CachedBaseRecipe crecipe, + Point relMouse) { if (crecipe.getFluidTanks() != null) { for (PositionedFluidTank tank : crecipe.getFluidTanks()) { if (tank.position.contains(relMouse)) { @@ -151,27 +151,20 @@ public abstract class RecipeHandlerBase extends TemplateRecipeHandler implements return currenttip; } - public List provideItemTooltip( - GuiRecipe guiRecipe, - ItemStack itemStack, - List currenttip, - CachedBaseRecipe crecipe, - Point relMouse) { + public List provideItemTooltip(GuiRecipe guiRecipe, ItemStack itemStack, List currenttip, + CachedBaseRecipe crecipe, Point relMouse) { for (PositionedStack stack : crecipe.getIngredients()) { - if (stack instanceof PositionedStackAdv - && ((PositionedStackAdv) stack).getRect().contains(relMouse)) { + if (stack instanceof PositionedStackAdv && ((PositionedStackAdv) stack).getRect().contains(relMouse)) { currenttip = ((PositionedStackAdv) stack).handleTooltip(guiRecipe, currenttip); } } for (PositionedStack stack : crecipe.getOtherStacks()) { - if (stack instanceof PositionedStackAdv - && ((PositionedStackAdv) stack).getRect().contains(relMouse)) { + if (stack instanceof PositionedStackAdv && ((PositionedStackAdv) stack).getRect().contains(relMouse)) { currenttip = ((PositionedStackAdv) stack).handleTooltip(guiRecipe, currenttip); } } PositionedStack stack = crecipe.getResult(); - if (stack instanceof PositionedStackAdv - && ((PositionedStackAdv) stack).getRect().contains(relMouse)) { + if (stack instanceof PositionedStackAdv && ((PositionedStackAdv) stack).getRect().contains(relMouse)) { currenttip = ((PositionedStackAdv) stack).handleTooltip(guiRecipe, currenttip); } return currenttip; diff --git a/src/main/java/forestry/core/recipes/nei/SetRecipeCommandHandler.java b/src/main/java/forestry/core/recipes/nei/SetRecipeCommandHandler.java index 0b4a2633f..780997c55 100644 --- a/src/main/java/forestry/core/recipes/nei/SetRecipeCommandHandler.java +++ b/src/main/java/forestry/core/recipes/nei/SetRecipeCommandHandler.java @@ -1,17 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.recipes.nei; import java.util.HashMap; import java.util.Map; + import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.inventory.Container; import net.minecraft.inventory.Slot; @@ -23,6 +22,7 @@ import net.minecraft.nbt.NBTTagList; * @author bdew */ public class SetRecipeCommandHandler { + private final Class containerClass; private final Class slotClass; diff --git a/src/main/java/forestry/core/render/EnumTankLevel.java b/src/main/java/forestry/core/render/EnumTankLevel.java index c98d8ae8b..5f9199382 100644 --- a/src/main/java/forestry/core/render/EnumTankLevel.java +++ b/src/main/java/forestry/core/render/EnumTankLevel.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.render; import net.minecraftforge.fluids.IFluidTank; public enum EnumTankLevel { + EMPTY(0), LOW(25), MEDIUM(50), diff --git a/src/main/java/forestry/core/render/FontColour.java b/src/main/java/forestry/core/render/FontColour.java index 353807cbd..cad1e2317 100644 --- a/src/main/java/forestry/core/render/FontColour.java +++ b/src/main/java/forestry/core/render/FontColour.java @@ -1,17 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.render; import java.io.InputStream; import java.util.Properties; + import net.minecraft.client.resources.IResourceManager; public class FontColour { @@ -39,7 +38,7 @@ public class FontColour { defaultMappings.load(defaultFontStream); // if (fontStream != null) - // fontStream.close(); + // fontStream.close(); defaultFontStream.close(); } catch (Exception e) { e.printStackTrace(); diff --git a/src/main/java/forestry/core/render/ForestryResource.java b/src/main/java/forestry/core/render/ForestryResource.java index 5db00459f..eecf94085 100644 --- a/src/main/java/forestry/core/render/ForestryResource.java +++ b/src/main/java/forestry/core/render/ForestryResource.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.render; -import forestry.core.config.Constants; import net.minecraft.util.ResourceLocation; +import forestry.core.config.Constants; + public class ForestryResource extends ResourceLocation { public ForestryResource(String path) { diff --git a/src/main/java/forestry/core/render/IBlockRenderer.java b/src/main/java/forestry/core/render/IBlockRenderer.java index 0b99f57af..44877364a 100644 --- a/src/main/java/forestry/core/render/IBlockRenderer.java +++ b/src/main/java/forestry/core/render/IBlockRenderer.java @@ -1,15 +1,14 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.render; public interface IBlockRenderer { + void inventoryRender(double x, double y, double z); } diff --git a/src/main/java/forestry/core/render/ModelEscritoire.java b/src/main/java/forestry/core/render/ModelEscritoire.java index cad691882..f2a5ca813 100755 --- a/src/main/java/forestry/core/render/ModelEscritoire.java +++ b/src/main/java/forestry/core/render/ModelEscritoire.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.render; @@ -93,67 +91,28 @@ public class ModelEscritoire extends ModelBase { standLowLB.mirror = true; setRotation(standLowLB, 0F, 0F, 0F); /* - desk = new ModelRenderer(this, 0, 0); - desk.addBox(0F, 0F, 0F, 16, 2, 15); - desk.setRotationPoint(-8F, 4F, -7.5F); - desk.setTextureSize(64, 32); - desk.mirror = true; - setRotation(desk, 0.0872665F, 0F, 0F); - standRB = new ModelRenderer(this, 38, 18); - standRB.addBox(0F, 0F, 0F, 2, 6, 2); - standRB.setRotationPoint(5F, 4F, 5F); - standRB.setTextureSize(64, 32); - standRB.mirror = true; - setRotation(standRB, 0F, 0F, 0F); - standRF = new ModelRenderer(this, 38, 18); - standRF.addBox(0F, 0F, 0F, 2, 6, 2); - standRF.setRotationPoint(5F, 4F, -7F); - standRF.setTextureSize(64, 32); - standRF.mirror = true; - setRotation(standRF, 0F, 0F, 0F); - standLB = new ModelRenderer(this, 38, 18); - standLB.addBox(0F, 0F, 0F, 2, 6, 2); - standLB.setRotationPoint(-7F, 4F, 5F); - standLB.setTextureSize(64, 32); - standLB.mirror = true; - setRotation(standLB, 0F, 0F, 0F); - standLF = new ModelRenderer(this, 38, 18); - standLF.addBox(0F, 0F, 0F, 2, 6, 2); - standLF.setRotationPoint(-7F, 4F, -7F); - standLF.setTextureSize(64, 32); - standLF.mirror = true; - setRotation(standLF, 0F, 0F, 0F); - drawers = new ModelRenderer(this, 0, 18); - drawers.addBox(0F, 0F, 0F, 16, 5, 3); - drawers.setRotationPoint(-8F, -2F, 4.5F); - drawers.setTextureSize(64, 32); - drawers.mirror = true; - setRotation(drawers, 0F, 0F, 0F); - standLowLF = new ModelRenderer(this, 0, 25); - standLowLF.addBox(0F, 0F, 0F, 1, 4, 1); - standLowLF.setRotationPoint(-6.5F, 10F, -6.5F); - standLowLF.setTextureSize(64, 32); - standLowLF.mirror = true; - setRotation(standLowLF, 0F, 0F, 0F); - standLowRB = new ModelRenderer(this, 0, 25); - standLowRB.addBox(0F, 0F, 0F, 1, 4, 1); - standLowRB.setRotationPoint(5.5F, 10F, 5.5F); - standLowRB.setTextureSize(64, 32); - standLowRB.mirror = true; - setRotation(standLowRB, 0F, 0F, 0F); - standLowRF = new ModelRenderer(this, 0, 25); - standLowRF.addBox(0F, 0F, 0F, 1, 4, 1); - standLowRF.setRotationPoint(5.5F, 10F, -6.5F); - standLowRF.setTextureSize(64, 32); - standLowRF.mirror = true; - setRotation(standLowRF, 0F, 0F, 0F); - standLowLB = new ModelRenderer(this, 0, 25); - standLowLB.addBox(0F, 0F, 0F, 1, 4, 1); - standLowLB.setRotationPoint(-6.5F, 10F, 5.5F); - standLowLB.setTextureSize(64, 32); - standLowLB.mirror = true; - setRotation(standLowLB, 0F, 0F, 0F); - */ + * desk = new ModelRenderer(this, 0, 0); desk.addBox(0F, 0F, 0F, 16, 2, 15); desk.setRotationPoint(-8F, 4F, + * -7.5F); desk.setTextureSize(64, 32); desk.mirror = true; setRotation(desk, 0.0872665F, 0F, 0F); standRB = new + * ModelRenderer(this, 38, 18); standRB.addBox(0F, 0F, 0F, 2, 6, 2); standRB.setRotationPoint(5F, 4F, 5F); + * standRB.setTextureSize(64, 32); standRB.mirror = true; setRotation(standRB, 0F, 0F, 0F); standRF = new + * ModelRenderer(this, 38, 18); standRF.addBox(0F, 0F, 0F, 2, 6, 2); standRF.setRotationPoint(5F, 4F, -7F); + * standRF.setTextureSize(64, 32); standRF.mirror = true; setRotation(standRF, 0F, 0F, 0F); standLB = new + * ModelRenderer(this, 38, 18); standLB.addBox(0F, 0F, 0F, 2, 6, 2); standLB.setRotationPoint(-7F, 4F, 5F); + * standLB.setTextureSize(64, 32); standLB.mirror = true; setRotation(standLB, 0F, 0F, 0F); standLF = new + * ModelRenderer(this, 38, 18); standLF.addBox(0F, 0F, 0F, 2, 6, 2); standLF.setRotationPoint(-7F, 4F, -7F); + * standLF.setTextureSize(64, 32); standLF.mirror = true; setRotation(standLF, 0F, 0F, 0F); drawers = new + * ModelRenderer(this, 0, 18); drawers.addBox(0F, 0F, 0F, 16, 5, 3); drawers.setRotationPoint(-8F, -2F, 4.5F); + * drawers.setTextureSize(64, 32); drawers.mirror = true; setRotation(drawers, 0F, 0F, 0F); standLowLF = new + * ModelRenderer(this, 0, 25); standLowLF.addBox(0F, 0F, 0F, 1, 4, 1); standLowLF.setRotationPoint(-6.5F, 10F, + * -6.5F); standLowLF.setTextureSize(64, 32); standLowLF.mirror = true; setRotation(standLowLF, 0F, 0F, 0F); + * standLowRB = new ModelRenderer(this, 0, 25); standLowRB.addBox(0F, 0F, 0F, 1, 4, 1); + * standLowRB.setRotationPoint(5.5F, 10F, 5.5F); standLowRB.setTextureSize(64, 32); standLowRB.mirror = true; + * setRotation(standLowRB, 0F, 0F, 0F); standLowRF = new ModelRenderer(this, 0, 25); standLowRF.addBox(0F, 0F, + * 0F, 1, 4, 1); standLowRF.setRotationPoint(5.5F, 10F, -6.5F); standLowRF.setTextureSize(64, 32); + * standLowRF.mirror = true; setRotation(standLowRF, 0F, 0F, 0F); standLowLB = new ModelRenderer(this, 0, 25); + * standLowLB.addBox(0F, 0F, 0F, 1, 4, 1); standLowLB.setRotationPoint(-6.5F, 10F, 5.5F); + * standLowLB.setTextureSize(64, 32); standLowLB.mirror = true; setRotation(standLowLB, 0F, 0F, 0F); + */ } @Override diff --git a/src/main/java/forestry/core/render/ParticleHelper.java b/src/main/java/forestry/core/render/ParticleHelper.java index 4b6e5daaa..4d37a7d2e 100644 --- a/src/main/java/forestry/core/render/ParticleHelper.java +++ b/src/main/java/forestry/core/render/ParticleHelper.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.render; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.client.particle.EffectRenderer; import net.minecraft.client.particle.EntityDiggingFX; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; + /** * @author CovertJaguar */ @@ -27,8 +27,8 @@ public class ParticleHelper { private static final Random rand = new Random(); @SideOnly(Side.CLIENT) - public static boolean addHitEffects( - World world, Block block, MovingObjectPosition target, EffectRenderer effectRenderer, Callback callback) { + public static boolean addHitEffects(World world, Block block, MovingObjectPosition target, + EffectRenderer effectRenderer, Callback callback) { int x = target.blockX; int y = target.blockY; int z = target.blockZ; @@ -42,16 +42,13 @@ public class ParticleHelper { int meta = world.getBlockMetadata(x, y, z); float b = 0.1F; - double px = x - + rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - (b * 2.0F)) + double px = x + rand.nextDouble() * (block.getBlockBoundsMaxX() - block.getBlockBoundsMinX() - (b * 2.0F)) + b + block.getBlockBoundsMinX(); - double py = y - + rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - (b * 2.0F)) + double py = y + rand.nextDouble() * (block.getBlockBoundsMaxY() - block.getBlockBoundsMinY() - (b * 2.0F)) + b + block.getBlockBoundsMinY(); - double pz = z - + rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - (b * 2.0F)) + double pz = z + rand.nextDouble() * (block.getBlockBoundsMaxZ() - block.getBlockBoundsMinZ() - (b * 2.0F)) + b + block.getBlockBoundsMinZ(); @@ -71,17 +68,16 @@ public class ParticleHelper { EntityDiggingFX fx = new EntityDiggingFX(world, px, py, pz, 0.0D, 0.0D, 0.0D, block, sideHit, meta); callback.addHitEffects(fx, world, x, y, z, meta, sideHit); - effectRenderer.addEffect( - fx.applyColourMultiplier(x, y, z).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F)); + effectRenderer + .addEffect(fx.applyColourMultiplier(x, y, z).multiplyVelocity(0.2F).multipleParticleScaleBy(0.6F)); return true; } /** - * Spawn particles for when the block is destroyed. Due to the nature of how - * this is invoked, the x/y/z locations are not always guaranteed to host - * your block. So be sure to do proper sanity checks before assuming that - * the location is this block. + * Spawn particles for when the block is destroyed. Due to the nature of how this is invoked, the x/y/z locations + * are not always guaranteed to host your block. So be sure to do proper sanity checks before assuming that the + * location is this block. * * @param world The current world * @param x X position to spawn the particle @@ -93,8 +89,8 @@ public class ParticleHelper { * @return True to prevent vanilla break particles from spawning. */ @SideOnly(Side.CLIENT) - public static boolean addDestroyEffects( - World world, Block block, int x, int y, int z, int meta, EffectRenderer effectRenderer, Callback callback) { + public static boolean addDestroyEffects(World world, Block block, int x, int y, int z, int meta, + EffectRenderer effectRenderer, Callback callback) { if (block != world.getBlock(x, y, z)) { return true; } @@ -109,7 +105,16 @@ public class ParticleHelper { int random = rand.nextInt(6); EntityDiggingFX fx = new EntityDiggingFX( - world, px, py, pz, px - x - 0.5D, py - y - 0.5D, pz - z - 0.5D, block, random, meta); + world, + px, + py, + pz, + px - x - 0.5D, + py - y - 0.5D, + pz - z - 0.5D, + block, + random, + meta); callback.addDestroyEffects(fx, world, x, y, z, meta); effectRenderer.addEffect(fx.applyColourMultiplier(x, y, z)); } diff --git a/src/main/java/forestry/core/render/RenderAnalyzer.java b/src/main/java/forestry/core/render/RenderAnalyzer.java index e07e271af..ddd47ee9c 100755 --- a/src/main/java/forestry/core/render/RenderAnalyzer.java +++ b/src/main/java/forestry/core/render/RenderAnalyzer.java @@ -1,17 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.render; -import forestry.apiculture.render.ModelAnalyzer; -import forestry.core.tiles.TileAnalyzer; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; @@ -20,8 +16,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; + import org.lwjgl.opengl.GL11; +import forestry.apiculture.render.ModelAnalyzer; +import forestry.core.tiles.TileAnalyzer; + public class RenderAnalyzer extends TileEntitySpecialRenderer implements IBlockRenderer { private final ModelAnalyzer model; @@ -31,6 +31,7 @@ public class RenderAnalyzer extends TileEntitySpecialRenderer implements IBlockR public RenderAnalyzer(String baseTexture) { customRenderItem = new RenderItem() { + @Override public boolean shouldBob() { return true; diff --git a/src/main/java/forestry/core/render/RenderBlock.java b/src/main/java/forestry/core/render/RenderBlock.java index 892b7a45c..a8f2453d8 100644 --- a/src/main/java/forestry/core/render/RenderBlock.java +++ b/src/main/java/forestry/core/render/RenderBlock.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.render; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; -import forestry.core.proxy.Proxies; import java.util.HashMap; + import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.world.IBlockAccess; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; +import forestry.core.proxy.Proxies; + public class RenderBlock implements ISimpleBlockRenderingHandler { public static final HashMap byBlockRenderer = new HashMap<>(); @@ -33,8 +33,8 @@ public class RenderBlock implements ISimpleBlockRenderingHandler { } @Override - public boolean renderWorldBlock( - IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, + RenderBlocks renderer) { return true; } diff --git a/src/main/java/forestry/core/render/RenderCrateItem.java b/src/main/java/forestry/core/render/RenderCrateItem.java index 3eccb9d4e..2875648df 100644 --- a/src/main/java/forestry/core/render/RenderCrateItem.java +++ b/src/main/java/forestry/core/render/RenderCrateItem.java @@ -1,17 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.render; -import forestry.core.items.ItemCrated; import java.util.Random; + import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.ItemRenderer; import net.minecraft.client.renderer.Tessellator; @@ -25,8 +23,11 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.opengl.GL11; +import forestry.core.items.ItemCrated; + /** * Adapted from RenderTankCartItem by CovertJaguar */ @@ -34,8 +35,8 @@ public class RenderCrateItem implements IItemRenderer { private static final ResourceLocation BLOCK_TEXTURE = TextureMap.locationBlocksTexture; private static final ResourceLocation ITEM_TEXTURE = TextureMap.locationItemsTexture; - private static final ResourceLocation GLINT_TEXTURE = - new ResourceLocation("textures/misc/enchanted_item_glint.png"); + private static final ResourceLocation GLINT_TEXTURE = new ResourceLocation( + "textures/misc/enchanted_item_glint.png"); private static final float PIXEL = 1.0f / 16.0f; @@ -114,8 +115,8 @@ public class RenderCrateItem implements IItemRenderer { float uv3 = icon.getMinV(); float uv4 = icon.getMaxV(); - ItemRenderer.renderItemIn2D( - tessellator, uv2, uv3, uv1, uv4, icon.getIconWidth(), icon.getIconHeight(), PIXEL); + ItemRenderer + .renderItemIn2D(tessellator, uv2, uv3, uv1, uv4, icon.getIconWidth(), icon.getIconHeight(), PIXEL); } GL11.glPopMatrix(); @@ -139,7 +140,10 @@ public class RenderCrateItem implements IItemRenderer { float offsetZ = PIXEL + 0.021875F; GL11.glRotatef( - (((float) entity.age + 1.0F) / 20.0F + entity.hoverStart) * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F); + (((float) entity.age + 1.0F) / 20.0F + entity.hoverStart) * (180F / (float) Math.PI), + 0.0F, + 1.0F, + 0.0F); GL11.glTranslatef(-0.5F, -0.25F, -(offsetZ * (float) iterations / 2.0F)); for (int count = 0; count < iterations; ++count) { @@ -201,7 +205,14 @@ public class RenderCrateItem implements IItemRenderer { } ItemRenderer.renderItemIn2D( - tessellator, maxU, minV, minU, maxV, icon.getIconWidth(), icon.getIconHeight(), PIXEL); + tessellator, + maxU, + minV, + minU, + maxV, + icon.getIconWidth(), + icon.getIconHeight(), + PIXEL); if (stack.hasEffect(pass)) { GL11.glPushAttrib(GL11.GL_ENABLE_BIT); diff --git a/src/main/java/forestry/core/render/RenderEscritoire.java b/src/main/java/forestry/core/render/RenderEscritoire.java index 89ae848c7..9b57b25d1 100755 --- a/src/main/java/forestry/core/render/RenderEscritoire.java +++ b/src/main/java/forestry/core/render/RenderEscritoire.java @@ -1,19 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.render; -import forestry.core.config.Constants; -import forestry.core.inventory.InventoryEscritoire; -import forestry.core.proxy.Proxies; -import forestry.core.tiles.TileEscritoire; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; @@ -21,18 +15,25 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; + import org.lwjgl.opengl.GL11; +import forestry.core.config.Constants; +import forestry.core.inventory.InventoryEscritoire; +import forestry.core.proxy.Proxies; +import forestry.core.tiles.TileEscritoire; + public class RenderEscritoire extends TileEntitySpecialRenderer implements IBlockRenderer { - private static final ResourceLocation texture = - new ForestryResource(Constants.TEXTURE_PATH_BLOCKS + "/escritoire.png"); + private static final ResourceLocation texture = new ForestryResource( + Constants.TEXTURE_PATH_BLOCKS + "/escritoire.png"); private final ModelEscritoire modelEscritoire; public RenderEscritoire() { modelEscritoire = new ModelEscritoire(); RenderItem customRenderItem = new RenderItem() { + @Override public boolean shouldBob() { return false; @@ -63,7 +64,7 @@ public class RenderEscritoire extends TileEntitySpecialRenderer implements IBloc GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5f, (float) y + 0.875f, (float) z + 0.5f); - float[] angle = {(float) Math.PI, 0, 0}; + float[] angle = { (float) Math.PI, 0, 0 }; if (orientation == null) { orientation = ForgeDirection.WEST; @@ -89,21 +90,11 @@ public class RenderEscritoire extends TileEntitySpecialRenderer implements IBloc GL11.glPopMatrix(); /* - if(itemstack != null) { - float renderScale = 1.0f; - - GL11.glPushMatrix(); - GL11.glTranslatef((float) x, (float) y, (float) z); - GL11.glTranslatef(0.6f, 0.8f, 0.5f); - GL11.glRotatef(90.0f, 1.0F, 0.0F, 0.0F); - GL11.glScalef(renderScale, renderScale, renderScale); - - RenderItem.renderInFrame = true; - dummyEntityItem.setEntityItemStack(itemstack); - customRenderItem.doRenderItem(dummyEntityItem, 0, 0, 0, 0, 0); - RenderItem.renderInFrame = false; - GL11.glPopMatrix(); - } + * if(itemstack != null) { float renderScale = 1.0f; GL11.glPushMatrix(); GL11.glTranslatef((float) x, (float) + * y, (float) z); GL11.glTranslatef(0.6f, 0.8f, 0.5f); GL11.glRotatef(90.0f, 1.0F, 0.0F, 0.0F); + * GL11.glScalef(renderScale, renderScale, renderScale); RenderItem.renderInFrame = true; + * dummyEntityItem.setEntityItemStack(itemstack); customRenderItem.doRenderItem(dummyEntityItem, 0, 0, 0, 0, 0); + * RenderItem.renderInFrame = false; GL11.glPopMatrix(); } */ } diff --git a/src/main/java/forestry/core/render/RenderMachine.java b/src/main/java/forestry/core/render/RenderMachine.java index 1eea051c7..9fee1afd9 100755 --- a/src/main/java/forestry/core/render/RenderMachine.java +++ b/src/main/java/forestry/core/render/RenderMachine.java @@ -1,28 +1,29 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.render; -import forestry.core.proxy.Proxies; -import forestry.core.tiles.IRenderableTile; import java.awt.Color; import java.util.EnumMap; import java.util.Locale; + import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; + import org.lwjgl.opengl.GL11; +import forestry.core.proxy.Proxies; +import forestry.core.tiles.IRenderableTile; + public class RenderMachine extends TileEntitySpecialRenderer implements IBlockRenderer { private final ModelRenderer basefront; @@ -76,8 +77,8 @@ public class RenderMachine extends TileEntitySpecialRenderer implements IBlockRe continue; } String tankLevelString = tankLevel.toString().toLowerCase(Locale.ENGLISH); - texturesTankLevels.put( - tankLevel, new ForestryResource("textures/blocks/machine_tank_" + tankLevelString + ".png")); + texturesTankLevels + .put(tankLevel, new ForestryResource("textures/blocks/machine_tank_" + tankLevelString + ".png")); } } @@ -92,17 +93,12 @@ public class RenderMachine extends TileEntitySpecialRenderer implements IBlockRe render(generator.getResourceTankInfo(), generator.getProductTankInfo(), generator.getOrientation(), d, d1, d2); } - private void render( - TankRenderInfo resourceTankInfo, - TankRenderInfo productTankInfo, - ForgeDirection orientation, - double x, - double y, - double z) { + private void render(TankRenderInfo resourceTankInfo, TankRenderInfo productTankInfo, ForgeDirection orientation, + double x, double y, double z) { GL11.glPushMatrix(); GL11.glTranslatef((float) x, (float) y, (float) z); - float[] angle = {0, 0, 0}; + float[] angle = { 0, 0, 0 }; if (orientation == null) { orientation = ForgeDirection.WEST; @@ -159,8 +155,8 @@ public class RenderMachine extends TileEntitySpecialRenderer implements IBlockRe GL11.glPopMatrix(); } - private void renderTank( - ModelRenderer tankModel, ResourceLocation textureBase, TankRenderInfo renderInfo, float factor) { + private void renderTank(ModelRenderer tankModel, ResourceLocation textureBase, TankRenderInfo renderInfo, + float factor) { Proxies.render.bindTexture(textureBase); tankModel.render(factor); @@ -180,5 +176,6 @@ public class RenderMachine extends TileEntitySpecialRenderer implements IBlockRe GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); } - private static class RenderModelBase extends ModelBase {} + private static class RenderModelBase extends ModelBase { + } } diff --git a/src/main/java/forestry/core/render/RenderMill.java b/src/main/java/forestry/core/render/RenderMill.java index 6887f992c..6d8d6736a 100755 --- a/src/main/java/forestry/core/render/RenderMill.java +++ b/src/main/java/forestry/core/render/RenderMill.java @@ -1,25 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.render; -import forestry.core.proxy.Proxies; -import forestry.core.tiles.TileMill; import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; + import org.lwjgl.opengl.GL11; +import forestry.core.proxy.Proxies; +import forestry.core.tiles.TileMill; + public class RenderMill extends TileEntitySpecialRenderer implements IBlockRenderer { private final ModelBase model = new ModelBase() {}; @@ -117,8 +117,8 @@ public class RenderMill extends TileEntitySpecialRenderer implements IBlockRende step = progress * 2F * 3.99F; } - float[] angle = {0, 0, 0}; - float[] translate = {0, 0, 0}; + float[] angle = { 0, 0, 0 }; + float[] translate = { 0, 0, 0 }; float tfactor = step / 16; if (orientation == null) { diff --git a/src/main/java/forestry/core/render/RenderNaturalistChest.java b/src/main/java/forestry/core/render/RenderNaturalistChest.java index 80b31ae20..8620830cd 100644 --- a/src/main/java/forestry/core/render/RenderNaturalistChest.java +++ b/src/main/java/forestry/core/render/RenderNaturalistChest.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.render; -import forestry.core.config.Constants; -import forestry.core.tiles.TileNaturalistChest; import net.minecraft.client.model.ModelChest; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ResourceLocation; import net.minecraftforge.common.util.ForgeDirection; + import org.lwjgl.opengl.GL11; +import forestry.core.config.Constants; +import forestry.core.tiles.TileNaturalistChest; + public class RenderNaturalistChest extends TileEntitySpecialRenderer implements IBlockRenderer { private final ModelChest chestModel = new ModelChest(); @@ -39,13 +39,7 @@ public class RenderNaturalistChest extends TileEntitySpecialRenderer implements render(chest.getOrientation(), chest.prevLidAngle, chest.lidAngle, x, y, z, partialTick); } - public void render( - ForgeDirection orientation, - float prevLidAngle, - float lidAngle, - double x, - double y, - double z, + public void render(ForgeDirection orientation, float prevLidAngle, float lidAngle, double x, double y, double z, float partialTick) { GL11.glPushMatrix(); bindTexture(texture); diff --git a/src/main/java/forestry/core/render/RenderOverlayBlock.java b/src/main/java/forestry/core/render/RenderOverlayBlock.java index a18bf1add..e82551c17 100644 --- a/src/main/java/forestry/core/render/RenderOverlayBlock.java +++ b/src/main/java/forestry/core/render/RenderOverlayBlock.java @@ -1,43 +1,32 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.render; -import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; import net.minecraft.block.Block; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; +import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler; + public abstract class RenderOverlayBlock implements ISimpleBlockRenderingHandler { protected static final double OVERLAY_SHIFT = 0.001; - private static int determineMixedBrightness( - IBlockAccess world, Block block, int x, int y, int z, RenderBlocks renderer, int mixedBrightness) { + private static int determineMixedBrightness(IBlockAccess world, Block block, int x, int y, int z, + RenderBlocks renderer, int mixedBrightness) { return renderer.renderMinY > 0.0D ? mixedBrightness : block.getMixedBrightnessForBlock(world, x, y, z); } - protected static void renderBottomFace( - IBlockAccess world, - Block block, - int x, - int y, - int z, - RenderBlocks renderer, - IIcon textureIndex, - int mixedBrightness, - float r, - float g, - float b) { + protected static void renderBottomFace(IBlockAccess world, Block block, int x, int y, int z, RenderBlocks renderer, + IIcon textureIndex, int mixedBrightness, float r, float g, float b) { if (!renderer.renderAllFaces && !block.shouldSideBeRendered(world, x, y - 1, z, 0)) { return; @@ -50,18 +39,8 @@ public abstract class RenderOverlayBlock implements ISimpleBlockRenderingHandler renderer.renderFaceYNeg(block, x, y - OVERLAY_SHIFT, z, textureIndex); } - protected static void renderTopFace( - IBlockAccess world, - Block block, - int x, - int y, - int z, - RenderBlocks renderer, - IIcon textureIndex, - int mixedBrightness, - float r, - float g, - float b) { + protected static void renderTopFace(IBlockAccess world, Block block, int x, int y, int z, RenderBlocks renderer, + IIcon textureIndex, int mixedBrightness, float r, float g, float b) { if (!renderer.renderAllFaces && !block.shouldSideBeRendered(world, x, y + 1, z, 1)) { return; @@ -74,18 +53,8 @@ public abstract class RenderOverlayBlock implements ISimpleBlockRenderingHandler renderer.renderFaceYPos(block, x, y + OVERLAY_SHIFT, z, textureIndex); } - protected static void renderEastFace( - IBlockAccess world, - Block block, - int x, - int y, - int z, - RenderBlocks renderer, - IIcon textureIndex, - int mixedBrightness, - float r, - float g, - float b) { + protected static void renderEastFace(IBlockAccess world, Block block, int x, int y, int z, RenderBlocks renderer, + IIcon textureIndex, int mixedBrightness, float r, float g, float b) { if (!renderer.renderAllFaces && !block.shouldSideBeRendered(world, x, y, z - 1, 2)) { return; @@ -98,18 +67,8 @@ public abstract class RenderOverlayBlock implements ISimpleBlockRenderingHandler renderer.renderFaceZNeg(block, x, y, z - OVERLAY_SHIFT, textureIndex); } - protected static void renderWestFace( - IBlockAccess world, - Block block, - int x, - int y, - int z, - RenderBlocks renderer, - IIcon textureIndex, - int mixedBrightness, - float r, - float g, - float b) { + protected static void renderWestFace(IBlockAccess world, Block block, int x, int y, int z, RenderBlocks renderer, + IIcon textureIndex, int mixedBrightness, float r, float g, float b) { if (!renderer.renderAllFaces && !block.shouldSideBeRendered(world, x, y, z + 1, 3)) { return; @@ -122,18 +81,8 @@ public abstract class RenderOverlayBlock implements ISimpleBlockRenderingHandler renderer.renderFaceZPos(block, x, y, z + OVERLAY_SHIFT, textureIndex); } - protected static void renderNorthFace( - IBlockAccess world, - Block block, - int x, - int y, - int z, - RenderBlocks renderer, - IIcon textureIndex, - int mixedBrightness, - float r, - float g, - float b) { + protected static void renderNorthFace(IBlockAccess world, Block block, int x, int y, int z, RenderBlocks renderer, + IIcon textureIndex, int mixedBrightness, float r, float g, float b) { if (!renderer.renderAllFaces && !block.shouldSideBeRendered(world, x - 1, y, z, 4)) { return; @@ -146,18 +95,8 @@ public abstract class RenderOverlayBlock implements ISimpleBlockRenderingHandler renderer.renderFaceXNeg(block, x - OVERLAY_SHIFT, y, z, textureIndex); } - protected static void renderSouthFace( - IBlockAccess world, - Block block, - int x, - int y, - int z, - RenderBlocks renderer, - IIcon textureIndex, - int mixedBrightness, - float r, - float g, - float b) { + protected static void renderSouthFace(IBlockAccess world, Block block, int x, int y, int z, RenderBlocks renderer, + IIcon textureIndex, int mixedBrightness, float r, float g, float b) { if (!renderer.renderAllFaces && !block.shouldSideBeRendered(world, x + 1, y, z, 5)) { return; diff --git a/src/main/java/forestry/core/render/SpriteSheet.java b/src/main/java/forestry/core/render/SpriteSheet.java index 7520b902d..fcbce779f 100755 --- a/src/main/java/forestry/core/render/SpriteSheet.java +++ b/src/main/java/forestry/core/render/SpriteSheet.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.render; @@ -14,6 +12,7 @@ import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.util.ResourceLocation; public enum SpriteSheet { + BLOCKS, ITEMS; diff --git a/src/main/java/forestry/core/render/TankRenderInfo.java b/src/main/java/forestry/core/render/TankRenderInfo.java index 5f254eef1..2ffbbc796 100644 --- a/src/main/java/forestry/core/render/TankRenderInfo.java +++ b/src/main/java/forestry/core/render/TankRenderInfo.java @@ -1,21 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.render; -import forestry.core.fluids.Fluids; import java.awt.Color; + import javax.annotation.Nonnull; + import net.minecraftforge.fluids.IFluidTank; +import forestry.core.fluids.Fluids; + public class TankRenderInfo { + public static final TankRenderInfo EMPTY = new TankRenderInfo(Fluids.WATER.getColor(), EnumTankLevel.EMPTY); @Nonnull diff --git a/src/main/java/forestry/core/render/TextureManager.java b/src/main/java/forestry/core/render/TextureManager.java index 4c5c6f93d..12a793f2d 100755 --- a/src/main/java/forestry/core/render/TextureManager.java +++ b/src/main/java/forestry/core/render/TextureManager.java @@ -1,26 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.render; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.core.ForestryAPI; import forestry.api.core.IIconProvider; import forestry.api.core.ITextureManager; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.util.IIcon; @SideOnly(Side.CLIENT) public class TextureManager implements ITextureManager { @@ -43,49 +43,15 @@ public class TextureManager implements ITextureManager { private TextureManager() {} public static void initDefaultIcons(IIconRegister register) { - String[] defaultIconNames = new String[] { - "habitats/desert", - "habitats/end", - "habitats/forest", - "habitats/hills", - "habitats/jungle", - "habitats/mushroom", - "habitats/nether", - "habitats/ocean", - "habitats/plains", - "habitats/snow", - "habitats/swamp", - "habitats/taiga", - "misc/access.private", - "misc/access.viewable", - "misc/access.shared", - "misc/energy", - "misc/hint", - "analyzer/anything", - "analyzer/bee", - "analyzer/cave", - "analyzer/closed", - "analyzer/drone", - "analyzer/flyer", - "analyzer/item", - "analyzer/nocturnal", - "analyzer/princess", - "analyzer/pure_breed", - "analyzer/pure_cave", - "analyzer/pure_flyer", - "analyzer/pure_nocturnal", - "analyzer/queen", - "particles/swarm_bee", - "errors/errored", - "errors/unknown", - "slots/blocked", - "slots/blocked_2", - "slots/liquid", - "slots/container", - "slots/locked", - "mail/carrier.player", - "mail/carrier.trader" - }; + String[] defaultIconNames = new String[] { "habitats/desert", "habitats/end", "habitats/forest", + "habitats/hills", "habitats/jungle", "habitats/mushroom", "habitats/nether", "habitats/ocean", + "habitats/plains", "habitats/snow", "habitats/swamp", "habitats/taiga", "misc/access.private", + "misc/access.viewable", "misc/access.shared", "misc/energy", "misc/hint", "analyzer/anything", + "analyzer/bee", "analyzer/cave", "analyzer/closed", "analyzer/drone", "analyzer/flyer", "analyzer/item", + "analyzer/nocturnal", "analyzer/princess", "analyzer/pure_breed", "analyzer/pure_cave", + "analyzer/pure_flyer", "analyzer/pure_nocturnal", "analyzer/queen", "particles/swarm_bee", + "errors/errored", "errors/unknown", "slots/blocked", "slots/blocked_2", "slots/liquid", + "slots/container", "slots/locked", "mail/carrier.player", "mail/carrier.trader" }; for (String str : defaultIconNames) { IIcon icon = registerTex(register, str); defaultIcons.put(str, icon); @@ -129,6 +95,7 @@ public class TextureManager implements ITextureManager { } private static class DefaultIconProvider implements IIconProvider { + private final Map textures = new HashMap<>(); public void addTexture(short texUID, IIcon texture) { diff --git a/src/main/java/forestry/core/render/TileRendererIndex.java b/src/main/java/forestry/core/render/TileRendererIndex.java index 5f71b53b5..344b6daba 100755 --- a/src/main/java/forestry/core/render/TileRendererIndex.java +++ b/src/main/java/forestry/core/render/TileRendererIndex.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.render; import net.minecraft.block.Block; public class TileRendererIndex { + private final Block block; private final int meta; diff --git a/src/main/java/forestry/core/tiles/AdjacentTileCache.java b/src/main/java/forestry/core/tiles/AdjacentTileCache.java index ef432a169..658e401a3 100644 --- a/src/main/java/forestry/core/tiles/AdjacentTileCache.java +++ b/src/main/java/forestry/core/tiles/AdjacentTileCache.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.tiles; import java.util.Arrays; import java.util.LinkedHashSet; import java.util.Set; + import net.minecraft.init.Blocks; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; @@ -98,8 +97,7 @@ public final class AdjacentTileCache { } private boolean areCoordinatesOnSide(ForgeDirection side, TileEntity target) { - return source.xCoord + side.offsetX == target.xCoord - && source.yCoord + side.offsetY == target.yCoord + return source.xCoord + side.offsetX == target.xCoord && source.yCoord + side.offsetY == target.yCoord && source.zCoord + side.offsetZ == target.zCoord; } diff --git a/src/main/java/forestry/core/tiles/EscritoireGame.java b/src/main/java/forestry/core/tiles/EscritoireGame.java index 92aef0fa1..4981b16df 100644 --- a/src/main/java/forestry/core/tiles/EscritoireGame.java +++ b/src/main/java/forestry/core/tiles/EscritoireGame.java @@ -1,15 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.tiles; +import java.io.IOException; +import java.util.Random; + +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import forestry.api.core.INBTTagable; import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IAlleleSpecies; @@ -17,21 +22,19 @@ import forestry.api.genetics.IIndividual; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IStreamable; -import java.io.IOException; -import java.util.Random; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class EscritoireGame implements INBTTagable, IStreamable { + private static final Random rand = new Random(); public static final int BOUNTY_MAX = 16; public enum Status { + EMPTY, PLAYING, FAILURE, SUCCESS; + public static final Status[] VALUES = values(); } diff --git a/src/main/java/forestry/core/tiles/EscritoireGameBoard.java b/src/main/java/forestry/core/tiles/EscritoireGameBoard.java index 87b8444c5..e39ba2e61 100644 --- a/src/main/java/forestry/core/tiles/EscritoireGameBoard.java +++ b/src/main/java/forestry/core/tiles/EscritoireGameBoard.java @@ -1,15 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.tiles; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Random; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; + import forestry.api.core.INBTTagable; import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IAlleleSpecies; @@ -19,16 +27,9 @@ import forestry.api.genetics.ISpeciesRoot; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IStreamable; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Random; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; public class EscritoireGameBoard implements INBTTagable, IStreamable { + private static final Random rand = new Random(); private static final int TOKEN_COUNT_MAX = 22; private static final int TOKEN_COUNT_MIN = 6; diff --git a/src/main/java/forestry/core/tiles/EscritoireGameToken.java b/src/main/java/forestry/core/tiles/EscritoireGameToken.java index fa0a1299c..658cea311 100644 --- a/src/main/java/forestry/core/tiles/EscritoireGameToken.java +++ b/src/main/java/forestry/core/tiles/EscritoireGameToken.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.tiles; +import java.io.IOException; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import forestry.api.core.INBTTagable; import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IIndividual; @@ -18,24 +21,23 @@ import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IStreamable; import forestry.core.utils.ColourUtil; import forestry.core.utils.StringUtil; -import java.io.IOException; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class EscritoireGameToken implements INBTTagable, IStreamable { private enum State { + UNREVEALED, // face down PROBED, // shown by escritoire probe action SELECTED, // selected by the user as the first half of a match MATCHED, // successfully matched FAILED; // failed to match + public static final State[] VALUES = values(); } private static final String[] OVERLAY_NONE = new String[0]; - private static final String[] OVERLAY_FAILED = new String[] {"errors/errored"}; - private static final String[] OVERLAY_SELECTED = new String[] {"errors/unknown"}; + private static final String[] OVERLAY_FAILED = new String[] { "errors/errored" }; + private static final String[] OVERLAY_SELECTED = new String[] { "errors/unknown" }; private ItemStack tokenStack; private State state = State.UNREVEALED; diff --git a/src/main/java/forestry/core/tiles/EscritoireTextSource.java b/src/main/java/forestry/core/tiles/EscritoireTextSource.java index f87842044..6cc6e3c94 100644 --- a/src/main/java/forestry/core/tiles/EscritoireTextSource.java +++ b/src/main/java/forestry/core/tiles/EscritoireTextSource.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.tiles; +import java.util.EnumSet; +import java.util.List; +import java.util.Random; + import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.ListMultimap; import forestry.core.utils.StringUtil; -import java.util.EnumSet; -import java.util.List; -import java.util.Random; public class EscritoireTextSource { @@ -34,8 +33,8 @@ public class EscritoireTextSource { static { researchNotes = ArrayListMultimap.create(); - EnumSet multipleTranslationNoteLevels = - EnumSet.of(Notes.level1, Notes.level2, Notes.level3, Notes.level4, Notes.success, Notes.failure); + EnumSet multipleTranslationNoteLevels = EnumSet + .of(Notes.level1, Notes.level2, Notes.level3, Notes.level4, Notes.success, Notes.failure); for (Notes notesLevel : multipleTranslationNoteLevels) { int levelCount = Integer.valueOf(StringUtil.localize("gui.escritoire.notes." + notesLevel + ".count")); for (int i = 1; i <= levelCount; i++) { diff --git a/src/main/java/forestry/core/tiles/IActivatable.java b/src/main/java/forestry/core/tiles/IActivatable.java index aef36532d..3b9796f9b 100644 --- a/src/main/java/forestry/core/tiles/IActivatable.java +++ b/src/main/java/forestry/core/tiles/IActivatable.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.tiles; diff --git a/src/main/java/forestry/core/tiles/IClimatised.java b/src/main/java/forestry/core/tiles/IClimatised.java index 5e032a56c..5c4273363 100644 --- a/src/main/java/forestry/core/tiles/IClimatised.java +++ b/src/main/java/forestry/core/tiles/IClimatised.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.tiles; diff --git a/src/main/java/forestry/core/tiles/IFilterSlotDelegate.java b/src/main/java/forestry/core/tiles/IFilterSlotDelegate.java index 16491eaa9..7732c35a1 100644 --- a/src/main/java/forestry/core/tiles/IFilterSlotDelegate.java +++ b/src/main/java/forestry/core/tiles/IFilterSlotDelegate.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.tiles; @@ -15,16 +13,15 @@ import net.minecraft.item.ItemStack; public interface IFilterSlotDelegate { /** - * Non-automation version of IInventory's isItemValidForSlot. - * Used to determine if a player can place a stack in a slot. + * Non-automation version of IInventory's isItemValidForSlot. Used to determine if a player can place a stack in a + * slot. * * Combine this with Forestry's access permissions to implement isItemValidForSlot. */ boolean canSlotAccept(int slotIndex, ItemStack itemStack); /** - * Used to lock slots under special conditions. - * Locked slots will have an X over them. + * Used to lock slots under special conditions. Locked slots will have an X over them. */ boolean isLocked(int slotIndex); } diff --git a/src/main/java/forestry/core/tiles/IItemStackDisplay.java b/src/main/java/forestry/core/tiles/IItemStackDisplay.java index d46caf5e6..0b44a20d0 100644 --- a/src/main/java/forestry/core/tiles/IItemStackDisplay.java +++ b/src/main/java/forestry/core/tiles/IItemStackDisplay.java @@ -1,17 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.tiles; import net.minecraft.item.ItemStack; public interface IItemStackDisplay { + void handleItemStackForDisplay(ItemStack itemStack); } diff --git a/src/main/java/forestry/core/tiles/ILiquidTankTile.java b/src/main/java/forestry/core/tiles/ILiquidTankTile.java index 6bc195f3b..252aeb581 100644 --- a/src/main/java/forestry/core/tiles/ILiquidTankTile.java +++ b/src/main/java/forestry/core/tiles/ILiquidTankTile.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.tiles; diff --git a/src/main/java/forestry/core/tiles/ILocatable.java b/src/main/java/forestry/core/tiles/ILocatable.java index 0bf52c6c1..801c45ae6 100644 --- a/src/main/java/forestry/core/tiles/ILocatable.java +++ b/src/main/java/forestry/core/tiles/ILocatable.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.tiles; @@ -14,6 +12,7 @@ import net.minecraft.util.ChunkCoordinates; import net.minecraft.world.World; public interface ILocatable { + ChunkCoordinates getCoordinates(); World getWorld(); diff --git a/src/main/java/forestry/core/tiles/IPowerHandler.java b/src/main/java/forestry/core/tiles/IPowerHandler.java index 3f967e301..827e174c3 100644 --- a/src/main/java/forestry/core/tiles/IPowerHandler.java +++ b/src/main/java/forestry/core/tiles/IPowerHandler.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.tiles; @@ -14,5 +12,6 @@ import cofh.api.energy.IEnergyHandler; import forestry.energy.EnergyManager; public interface IPowerHandler extends IEnergyHandler { + EnergyManager getEnergyManager(); } diff --git a/src/main/java/forestry/core/tiles/IRenderableTile.java b/src/main/java/forestry/core/tiles/IRenderableTile.java index 3c35d4bef..a9829a39b 100644 --- a/src/main/java/forestry/core/tiles/IRenderableTile.java +++ b/src/main/java/forestry/core/tiles/IRenderableTile.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.tiles; -import forestry.core.render.TankRenderInfo; import net.minecraftforge.common.util.ForgeDirection; +import forestry.core.render.TankRenderInfo; + public interface IRenderableTile { ForgeDirection getOrientation(); diff --git a/src/main/java/forestry/core/tiles/ITitled.java b/src/main/java/forestry/core/tiles/ITitled.java index 9c86f0ce6..a6668f603 100644 --- a/src/main/java/forestry/core/tiles/ITitled.java +++ b/src/main/java/forestry/core/tiles/ITitled.java @@ -1,5 +1,6 @@ package forestry.core.tiles; public interface ITitled { + String getUnlocalizedTitle(); } diff --git a/src/main/java/forestry/core/tiles/MachineDefinition.java b/src/main/java/forestry/core/tiles/MachineDefinition.java index 039a90102..f88d40ea5 100644 --- a/src/main/java/forestry/core/tiles/MachineDefinition.java +++ b/src/main/java/forestry/core/tiles/MachineDefinition.java @@ -1,26 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.tiles; -import cpw.mods.fml.common.registry.GameRegistry; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.core.blocks.IMachineProperties; -import forestry.core.blocks.IMachinePropertiesTESR; -import forestry.core.proxy.Proxies; -import forestry.core.render.IBlockRenderer; -import forestry.core.render.TextureManager; -import forestry.core.utils.BlockUtil; import java.util.List; import java.util.Locale; + import net.minecraft.block.Block; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; @@ -35,6 +25,16 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import cpw.mods.fml.common.registry.GameRegistry; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.core.blocks.IMachineProperties; +import forestry.core.blocks.IMachinePropertiesTESR; +import forestry.core.proxy.Proxies; +import forestry.core.render.IBlockRenderer; +import forestry.core.render.TextureManager; +import forestry.core.utils.BlockUtil; + public class MachineDefinition { public final Class teClass; @@ -132,7 +132,7 @@ public class MachineDefinition { } } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) public void getSubBlocks(Item item, CreativeTabs tab, List list) { if (legacy) { return; @@ -183,7 +183,8 @@ public class MachineDefinition { for (int i = 0; i < 8; i++) { icons[i] = TextureManager.registerTex( - register, teIdent.replace("forestry.", "").toLowerCase(Locale.ENGLISH) + "." + faceMap[i]); + register, + teIdent.replace("forestry.", "").toLowerCase(Locale.ENGLISH) + "." + faceMap[i]); } } diff --git a/src/main/java/forestry/core/tiles/TemperatureState.java b/src/main/java/forestry/core/tiles/TemperatureState.java index 5969ee549..2524cc071 100644 --- a/src/main/java/forestry/core/tiles/TemperatureState.java +++ b/src/main/java/forestry/core/tiles/TemperatureState.java @@ -1,16 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.tiles; public enum TemperatureState { + UNKNOWN, COOL, WARMED_UP, diff --git a/src/main/java/forestry/core/tiles/TileAnalyzer.java b/src/main/java/forestry/core/tiles/TileAnalyzer.java index 470988652..4cd32f96f 100644 --- a/src/main/java/forestry/core/tiles/TileAnalyzer.java +++ b/src/main/java/forestry/core/tiles/TileAnalyzer.java @@ -1,15 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.tiles; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + import forestry.api.arboriculture.TreeManager; import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IIndividual; @@ -32,20 +43,10 @@ import forestry.core.proxy.Proxies; import forestry.core.utils.GeneticsUtil; import forestry.core.utils.InventoryUtil; import forestry.plugins.PluginManager; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; public class TileAnalyzer extends TilePowered implements ISidedInventory, ILiquidTankTile, IFluidHandler, IItemStackDisplay { + private static final int TIME_TO_ANALYZE = 125; private static final int HONEY_REQUIRED = 100; private static final int ENERGY_PER_WORK_CYCLE = 20320; @@ -65,9 +66,13 @@ public class TileAnalyzer extends TilePowered resourceTank = new FilteredTank(Constants.PROCESSOR_TANK_CAPACITY, Fluids.HONEY.getFluid()); tankManager = new TankManager(this, resourceTank); invInput = new InventoryMapper( - getInternalInventory(), InventoryAnalyzer.SLOT_INPUT_1, InventoryAnalyzer.SLOT_INPUT_COUNT); + getInternalInventory(), + InventoryAnalyzer.SLOT_INPUT_1, + InventoryAnalyzer.SLOT_INPUT_COUNT); invOutput = new InventoryMapper( - getInternalInventory(), InventoryAnalyzer.SLOT_OUTPUT_1, InventoryAnalyzer.SLOT_OUTPUT_COUNT); + getInternalInventory(), + InventoryAnalyzer.SLOT_OUTPUT_1, + InventoryAnalyzer.SLOT_OUTPUT_COUNT); } /* SAVING & LOADING */ diff --git a/src/main/java/forestry/core/tiles/TileBase.java b/src/main/java/forestry/core/tiles/TileBase.java index 0f3b2a44b..3a85a5d7a 100644 --- a/src/main/java/forestry/core/tiles/TileBase.java +++ b/src/main/java/forestry/core/tiles/TileBase.java @@ -1,23 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.tiles; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; + import forestry.core.config.Config; import forestry.core.gui.GuiHandler; import forestry.core.gui.IHintSource; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; public abstract class TileBase extends TileForestry implements IHintSource { + protected final List hints; protected TileBase(String hintKey) { diff --git a/src/main/java/forestry/core/tiles/TileEngine.java b/src/main/java/forestry/core/tiles/TileEngine.java index 496341315..08b7db17e 100644 --- a/src/main/java/forestry/core/tiles/TileEngine.java +++ b/src/main/java/forestry/core/tiles/TileEngine.java @@ -1,15 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.tiles; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import cofh.api.energy.IEnergyConnection; import forestry.api.core.IErrorLogic; import forestry.apiculture.network.packets.PacketActiveUpdate; @@ -21,22 +28,15 @@ import forestry.core.network.DataOutputStreamForestry; import forestry.core.proxy.Proxies; import forestry.core.utils.BlockUtil; import forestry.energy.EnergyManager; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public abstract class TileEngine extends TileBase implements IEnergyConnection, IActivatable { + private static final int CANT_SEND_ENERGY_TIME = 20; private boolean active = false; // Used for smp. private int cantSendEnergyCountdown = CANT_SEND_ENERGY_TIME; /** - * Indicates whether the piston is receding from or approaching the - * combustion chamber + * Indicates whether the piston is receding from or approaching the combustion chamber */ private int stagePiston = 0; /** @@ -144,8 +144,7 @@ public abstract class TileEngine extends TileBase implements IEnergyConnection, progress = 0; stagePiston = 0; } - } else if (enabledRedstone - && BlockUtil.isEnergyReceiverOrEngine(getOrientation().getOpposite(), tile)) { + } else if (enabledRedstone && BlockUtil.isEnergyReceiverOrEngine(getOrientation().getOpposite(), tile)) { if (energyManager.canSendEnergy(getOrientation(), tile)) { stagePiston = 1; // If we can transfer energy, start running setActive(true); @@ -210,7 +209,9 @@ public abstract class TileEngine extends TileBase implements IEnergyConnection, private boolean isOrientedAtEnergyReciever(ForgeDirection orientation) { TileEntity tile = worldObj.getTileEntity( - xCoord + orientation.offsetX, yCoord + orientation.offsetY, zCoord + orientation.offsetZ); + xCoord + orientation.offsetX, + yCoord + orientation.offsetY, + zCoord + orientation.offsetZ); return BlockUtil.isEnergyReceiverOrEngine(getOrientation().getOpposite(), tile); } diff --git a/src/main/java/forestry/core/tiles/TileEscritoire.java b/src/main/java/forestry/core/tiles/TileEscritoire.java index 314cd5504..5a783d39f 100644 --- a/src/main/java/forestry/core/tiles/TileEscritoire.java +++ b/src/main/java/forestry/core/tiles/TileEscritoire.java @@ -1,16 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.tiles; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import com.mojang.authlib.GameProfile; + import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IAlleleSpecies; import forestry.api.genetics.IIndividual; @@ -22,11 +28,6 @@ import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IStreamableGui; import forestry.core.utils.InventoryUtil; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class TileEscritoire extends TileBase implements ISidedInventory, ISlotPickupWatcher, IStreamableGui { @@ -65,15 +66,15 @@ public class TileEscritoire extends TileBase implements ISidedInventory, ISlotPi return; } - IIndividual individual = - AlleleManager.alleleRegistry.getIndividual(getStackInSlot(InventoryEscritoire.SLOT_ANALYZE)); + IIndividual individual = AlleleManager.alleleRegistry + .getIndividual(getStackInSlot(InventoryEscritoire.SLOT_ANALYZE)); if (individual == null) { return; } IAlleleSpecies species = individual.getGenome().getPrimary(); - for (ItemStack itemstack : - species.getResearchBounty(worldObj, gameProfile, individual, game.getBountyLevel())) { + for (ItemStack itemstack : species + .getResearchBounty(worldObj, gameProfile, individual, game.getBountyLevel())) { InventoryUtil.addStack( getInternalInventory(), itemstack, diff --git a/src/main/java/forestry/core/tiles/TileForestry.java b/src/main/java/forestry/core/tiles/TileForestry.java index 4dc6d0b05..c458d7f30 100644 --- a/src/main/java/forestry/core/tiles/TileForestry.java +++ b/src/main/java/forestry/core/tiles/TileForestry.java @@ -1,15 +1,29 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.tiles; +import java.io.IOException; +import java.util.Collection; +import java.util.Random; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChunkCoordinates; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.ITriggerExternal; import buildcraft.api.statements.ITriggerInternal; @@ -30,32 +44,11 @@ import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IStreamable; import forestry.core.network.packets.PacketTileStream; import forestry.core.proxy.Proxies; -import java.io.IOException; -import java.util.Collection; -import java.util.Random; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.Packet; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChunkCoordinates; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; @Optional.Interface(iface = "buildcraft.api.statements.ITriggerProvider", modid = "BuildCraftAPI|statements") -public abstract class TileForestry extends TileEntity - implements IStreamable, - IErrorLogicSource, - ITriggerProvider, - ISidedInventory, - IFilterSlotDelegate, - IRestrictedAccess, - ITitled, - ILocatable, - IGuiHandlerTile { +public abstract class TileForestry extends TileEntity implements IStreamable, IErrorLogicSource, ITriggerProvider, + ISidedInventory, IFilterSlotDelegate, IRestrictedAccess, ITitled, ILocatable, IGuiHandlerTile { + private static final ForgeDirection[] forgeDirections = ForgeDirection.values(); private static final Random rand = new Random(); diff --git a/src/main/java/forestry/core/tiles/TileMill.java b/src/main/java/forestry/core/tiles/TileMill.java index 1f914e949..e89b68473 100644 --- a/src/main/java/forestry/core/tiles/TileMill.java +++ b/src/main/java/forestry/core/tiles/TileMill.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.tiles; +import java.io.IOException; + import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; -import java.io.IOException; public abstract class TileMill extends TileBase { diff --git a/src/main/java/forestry/core/tiles/TileNaturalistChest.java b/src/main/java/forestry/core/tiles/TileNaturalistChest.java index 70f42859e..019a38880 100644 --- a/src/main/java/forestry/core/tiles/TileNaturalistChest.java +++ b/src/main/java/forestry/core/tiles/TileNaturalistChest.java @@ -1,15 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.tiles; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; + import forestry.api.genetics.ISpeciesRoot; import forestry.core.gui.ContainerNaturalistInventory; import forestry.core.gui.GuiHandler; @@ -18,10 +20,9 @@ import forestry.core.gui.IPagedInventory; import forestry.core.inventory.InventoryNaturalistChest; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; public abstract class TileNaturalistChest extends TileBase implements IPagedInventory { + private static final float lidAngleVariationPerTick = 0.1F; private final ISpeciesRoot speciesRoot; @@ -84,7 +85,12 @@ public abstract class TileNaturalistChest extends TileBase implements IPagedInve private void playLidSound(String sound) { worldObj.playSoundEffect( - xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, sound, 0.5F, worldObj.rand.nextFloat() * 0.1F + 0.9F); + xCoord + 0.5, + yCoord + 0.5, + zCoord + 0.5, + sound, + 0.5F, + worldObj.rand.nextFloat() * 0.1F + 0.9F); } @Override diff --git a/src/main/java/forestry/core/tiles/TilePowered.java b/src/main/java/forestry/core/tiles/TilePowered.java index eb8a7e8a9..54e7267cd 100644 --- a/src/main/java/forestry/core/tiles/TilePowered.java +++ b/src/main/java/forestry/core/tiles/TilePowered.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.tiles; +import java.io.IOException; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; + import buildcraft.api.tiles.IHasWork; import cpw.mods.fml.common.Optional; import forestry.api.core.IErrorLogic; @@ -21,15 +24,13 @@ import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IStreamableGui; import forestry.core.render.TankRenderInfo; import forestry.energy.EnergyManager; -import java.io.IOException; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; @Optional.Interface(iface = "buildcraft.api.tiles.IHasWork", modid = "BuildCraftAPI|tiles") public abstract class TilePowered extends TileBase implements IRenderableTile, IPowerHandler, IHasWork, ISpeedUpgradable, IStreamableGui { - private static final int WORK_TICK_INTERVAL = - 5; // one Forestry work tick happens every WORK_TICK_INTERVAL game ticks + + private static final int WORK_TICK_INTERVAL = 5; // one Forestry work tick happens every WORK_TICK_INTERVAL game + // ticks private final EnergyManager energyManager; diff --git a/src/main/java/forestry/core/tiles/TileUtil.java b/src/main/java/forestry/core/tiles/TileUtil.java index e031c948a..24b1b4576 100644 --- a/src/main/java/forestry/core/tiles/TileUtil.java +++ b/src/main/java/forestry/core/tiles/TileUtil.java @@ -1,17 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.tiles; -import forestry.core.inventory.wrappers.ChestWrapper; -import forestry.core.utils.InventoryUtil; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.tileentity.TileEntity; @@ -20,6 +16,9 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import forestry.core.inventory.wrappers.ChestWrapper; +import forestry.core.utils.InventoryUtil; + public abstract class TileUtil { public static boolean isUsableByPlayer(EntityPlayer player, TileEntity tile) { diff --git a/src/main/java/forestry/core/triggers/Trigger.java b/src/main/java/forestry/core/triggers/Trigger.java index 4894464df..4494ef565 100755 --- a/src/main/java/forestry/core/triggers/Trigger.java +++ b/src/main/java/forestry/core/triggers/Trigger.java @@ -1,15 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.triggers; +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; + import buildcraft.api.statements.IStatement; import buildcraft.api.statements.IStatementParameter; import buildcraft.api.statements.ITriggerExternal; @@ -18,8 +19,6 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.core.render.TextureManager; import forestry.core.utils.StringUtil; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.util.IIcon; public abstract class Trigger implements ITriggerExternal { diff --git a/src/main/java/forestry/core/utils/BlockUtil.java b/src/main/java/forestry/core/utils/BlockUtil.java index 909a0e611..d743b32f8 100644 --- a/src/main/java/forestry/core/utils/BlockUtil.java +++ b/src/main/java/forestry/core/utils/BlockUtil.java @@ -1,23 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.utils; -import cofh.api.energy.IEnergyConnection; -import cofh.api.energy.IEnergyReceiver; -import cpw.mods.fml.common.Loader; -import forestry.core.config.Constants; -import forestry.core.tiles.TileEngine; -import forestry.core.utils.vect.Vect; import java.util.ArrayList; import java.util.function.Predicate; + import net.minecraft.block.Block; import net.minecraft.block.BlockCocoa; import net.minecraft.block.BlockLog; @@ -31,6 +24,13 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.oredict.OreDictionary; +import cofh.api.energy.IEnergyConnection; +import cofh.api.energy.IEnergyReceiver; +import cpw.mods.fml.common.Loader; +import forestry.core.config.Constants; +import forestry.core.tiles.TileEngine; +import forestry.core.utils.vect.Vect; + public abstract class BlockUtil { private static final int slabWoodId = OreDictionary.getOreID("slabWood"); @@ -105,8 +105,7 @@ public abstract class BlockUtil { } public static boolean isReplaceableBlock(Block block) { - return block == Blocks.vine - || block == Blocks.tallgrass + return block == Blocks.vine || block == Blocks.tallgrass || block == Blocks.deadbush || block == Blocks.snow_layer || block.getMaterial().isReplaceable(); @@ -115,19 +114,8 @@ public abstract class BlockUtil { /** * Ray traces through the blocks collision from start vector to end vector returning a ray trace hit. */ - public static MovingObjectPosition collisionRayTrace( - World world, - int x, - int y, - int z, - Vec3 startVec, - Vec3 endVec, - float minX, - float minY, - float minZ, - float maxX, - float maxY, - float maxZ) { + public static MovingObjectPosition collisionRayTrace(World world, int x, int y, int z, Vec3 startVec, Vec3 endVec, + float minX, float minY, float minZ, float maxX, float maxY, float maxZ) { startVec = startVec.addVector((double) (-x), (double) (-y), (double) (-z)); endVec = endVec.addVector((double) (-x), (double) (-y), (double) (-z)); Vec3 vec32 = startVec.getIntermediateWithXValue(endVec, minX); @@ -246,20 +234,18 @@ public abstract class BlockUtil { private static boolean bw = Loader.isModLoaded("bartworks"); static { - if (bw) - try { - BW_MetaGenerated_WerkstoffBlocksClass = (Class) Class.forName( - "com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_WerkstoffBlocks"); - BWBlocks = (Block) Class.forName("com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader") - .getField("BWBlocks") - .get(null); - } catch (ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) { - e.printStackTrace(); - } + if (bw) try { + BW_MetaGenerated_WerkstoffBlocksClass = (Class) Class + .forName("com.github.bartimaeusnek.bartworks.system.material.BW_MetaGenerated_WerkstoffBlocks"); + BWBlocks = (Block) Class.forName("com.github.bartimaeusnek.bartworks.system.material.WerkstoffLoader") + .getField("BWBlocks").get(null); + } catch (ClassNotFoundException | NoSuchFieldException | IllegalAccessException e) { + e.printStackTrace(); + } } - public static ItemStack getItemStackFromBlockBelow( - World world, int x, int y, int z, Predicate stillInside) { + public static ItemStack getItemStackFromBlockBelow(World world, int x, int y, int z, + Predicate stillInside) { TileEntity tile; Block block; int depth = 0; diff --git a/src/main/java/forestry/core/utils/ClimateUtil.java b/src/main/java/forestry/core/utils/ClimateUtil.java index 6af399c60..b3ff096a0 100644 --- a/src/main/java/forestry/core/utils/ClimateUtil.java +++ b/src/main/java/forestry/core/utils/ClimateUtil.java @@ -1,31 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.utils; +import java.util.ArrayList; +import java.util.Locale; + import forestry.api.core.EnumHumidity; import forestry.api.core.EnumTemperature; import forestry.api.genetics.EnumTolerance; import forestry.api.genetics.IClimateHelper; -import java.util.ArrayList; -import java.util.Locale; public class ClimateUtil implements IClimateHelper { - public boolean isWithinLimits( - EnumTemperature temperature, - EnumHumidity humidity, - EnumTemperature baseTemp, - EnumTolerance tolTemp, - EnumHumidity baseHumid, - EnumTolerance tolHumid) { + public boolean isWithinLimits(EnumTemperature temperature, EnumHumidity humidity, EnumTemperature baseTemp, + EnumTolerance tolTemp, EnumHumidity baseHumid, EnumTolerance tolHumid) { if (!getToleratedTemperature(baseTemp, tolTemp).contains(temperature)) { return false; } diff --git a/src/main/java/forestry/core/utils/ColourUtil.java b/src/main/java/forestry/core/utils/ColourUtil.java index 147450779..9a7e35bed 100644 --- a/src/main/java/forestry/core/utils/ColourUtil.java +++ b/src/main/java/forestry/core/utils/ColourUtil.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.utils; diff --git a/src/main/java/forestry/core/utils/DamageSourceForestry.java b/src/main/java/forestry/core/utils/DamageSourceForestry.java index cbad6da50..e3c5bfe65 100755 --- a/src/main/java/forestry/core/utils/DamageSourceForestry.java +++ b/src/main/java/forestry/core/utils/DamageSourceForestry.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.utils; diff --git a/src/main/java/forestry/core/utils/DayMonth.java b/src/main/java/forestry/core/utils/DayMonth.java index 1a89d1572..6e14006b1 100644 --- a/src/main/java/forestry/core/utils/DayMonth.java +++ b/src/main/java/forestry/core/utils/DayMonth.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.utils; diff --git a/src/main/java/forestry/core/utils/EntityUtil.java b/src/main/java/forestry/core/utils/EntityUtil.java index eaff72e98..aefa40ec3 100644 --- a/src/main/java/forestry/core/utils/EntityUtil.java +++ b/src/main/java/forestry/core/utils/EntityUtil.java @@ -1,19 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.utils; -import cpw.mods.fml.common.registry.EntityRegistry; -import forestry.api.core.ForestryAPI; -import forestry.core.entities.EntitySelector; import java.util.List; + import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityLiving; @@ -21,9 +17,14 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.MathHelper; import net.minecraft.world.World; +import cpw.mods.fml.common.registry.EntityRegistry; +import forestry.api.core.ForestryAPI; +import forestry.core.entities.EntitySelector; + public abstract class EntityUtil { - public static E spawnEntity( - World world, Class entityClass, double x, double y, double z) { + + public static E spawnEntity(World world, Class entityClass, double x, double y, + double z) { E entityLiving = createEntity(world, entityClass); if (entityLiving == null) { return null; @@ -45,29 +46,28 @@ public abstract class EntityUtil { return living; } - public static void registerEntity( - Class entityClass, - String ident, - int id, - int eggForeground, - int eggBackground, - int trackingRange, - int updateFrequency, - boolean sendVelocity) { + public static void registerEntity(Class entityClass, String ident, int id, int eggForeground, + int eggBackground, int trackingRange, int updateFrequency, boolean sendVelocity) { EntityRegistry.registerModEntity( - entityClass, ident, id, ForestryAPI.instance, trackingRange, updateFrequency, sendVelocity); + entityClass, + ident, + id, + ForestryAPI.instance, + trackingRange, + updateFrequency, + sendVelocity); Log.finer("Registered entity %s (%s) with id %s.", ident, entityClass.toString(), id); } @SuppressWarnings("unchecked") - public static List getEntitiesWithinAABB( - World world, Class entityClass, AxisAlignedBB boundingBox) { + public static List getEntitiesWithinAABB(World world, Class entityClass, + AxisAlignedBB boundingBox) { return world.getEntitiesWithinAABB(entityClass, boundingBox); } @SuppressWarnings("unchecked") - public static List selectEntitiesWithinAABB( - World world, EntitySelector entitySelector, AxisAlignedBB boundingBox) { + public static List selectEntitiesWithinAABB(World world, EntitySelector entitySelector, + AxisAlignedBB boundingBox) { return world.selectEntitiesWithinAABB(entitySelector.getEntityClass(), boundingBox, entitySelector); } diff --git a/src/main/java/forestry/core/utils/ForestryModEnvWarningCallable.java b/src/main/java/forestry/core/utils/ForestryModEnvWarningCallable.java index 52ea9e75d..e05767b2e 100755 --- a/src/main/java/forestry/core/utils/ForestryModEnvWarningCallable.java +++ b/src/main/java/forestry/core/utils/ForestryModEnvWarningCallable.java @@ -1,15 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.utils; +import java.util.ArrayList; +import java.util.List; + import cpw.mods.fml.client.FMLClientHandler; import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.ICrashCallable; @@ -17,8 +18,6 @@ import cpw.mods.fml.common.Loader; import cpw.mods.fml.relauncher.Side; import forestry.core.config.Constants; import forestry.plugins.PluginManager; -import java.util.ArrayList; -import java.util.List; /** * ICrashCallable for highlighting certain mods and listing disabled modules for crash reports. @@ -38,8 +37,7 @@ public class ForestryModEnvWarningCallable implements ICrashCallable { private ForestryModEnvWarningCallable() { this.modIDs = new ArrayList<>(); - if (FMLCommonHandler.instance().getSide() == Side.CLIENT - && FMLClientHandler.instance().hasOptifine()) { + if (FMLCommonHandler.instance().getSide() == Side.CLIENT && FMLClientHandler.instance().hasOptifine()) { modIDs.add("Optifine"); } diff --git a/src/main/java/forestry/core/utils/GeneticsUtil.java b/src/main/java/forestry/core/utils/GeneticsUtil.java index f1ff5bf88..a5a546189 100644 --- a/src/main/java/forestry/core/utils/GeneticsUtil.java +++ b/src/main/java/forestry/core/utils/GeneticsUtil.java @@ -1,16 +1,27 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.utils; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + import com.mojang.authlib.GameProfile; + import forestry.api.arboriculture.EnumGermlingType; import forestry.api.arboriculture.ITree; import forestry.api.arboriculture.TreeManager; @@ -28,16 +39,6 @@ import forestry.arboriculture.genetics.pollination.CheckPollinatableTree; import forestry.arboriculture.genetics.pollination.ICheckPollinatable; import forestry.core.config.Config; import forestry.core.genetics.ItemGE; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; public class GeneticsUtil { @@ -91,8 +92,8 @@ public class GeneticsUtil { } /** - * Returns an ICheckPollinatable that can be checked but not mated. - * Used to check for pollination traits without altering the world by changing vanilla leaves to forestry ones. + * Returns an ICheckPollinatable that can be checked but not mated. Used to check for pollination traits without + * altering the world by changing vanilla leaves to forestry ones. */ public static ICheckPollinatable getCheckPollinatable(World world, final int x, final int y, final int z) { TileEntity tile = world.getTileEntity(x, y, z); @@ -109,8 +110,8 @@ public class GeneticsUtil { return null; } - public static IPollinatable getOrCreatePollinatable( - GameProfile owner, World world, final int x, final int y, final int z) { + public static IPollinatable getOrCreatePollinatable(GameProfile owner, World world, final int x, final int y, + final int z) { TileEntity tile = world.getTileEntity(x, y, z); if (tile instanceof IPollinatable) { @@ -192,8 +193,8 @@ public class GeneticsUtil { return 1 + getGeneticAdvancement(species, new HashSet(), speciesChromosome); } - private static int getGeneticAdvancement( - IAlleleSpecies species, Set exclude, IChromosomeType speciesChromosome) { + private static int getGeneticAdvancement(IAlleleSpecies species, Set exclude, + IChromosomeType speciesChromosome) { int highest = 0; exclude.add(species); @@ -205,10 +206,7 @@ public class GeneticsUtil { return 1 + highest; } - private static int getHighestAdvancement( - IAlleleSpecies mutationSpecies, - int highest, - Set exclude, + private static int getHighestAdvancement(IAlleleSpecies mutationSpecies, int highest, Set exclude, IChromosomeType speciesChromosome) { if (exclude.contains(mutationSpecies) || AlleleManager.alleleRegistry.isBlacklisted(mutationSpecies.getUID())) { return highest; diff --git a/src/main/java/forestry/core/utils/InventoryUtil.java b/src/main/java/forestry/core/utils/InventoryUtil.java index f9ee1d504..b668b447f 100644 --- a/src/main/java/forestry/core/utils/InventoryUtil.java +++ b/src/main/java/forestry/core/utils/InventoryUtil.java @@ -1,15 +1,32 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.utils; +import java.util.AbstractMap; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; + +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; +import net.minecraftforge.oredict.OreDictionary; + import buildcraft.api.transport.IPipeTile; import cpw.mods.fml.common.Optional; import forestry.core.circuits.ISocketable; @@ -23,23 +40,6 @@ import forestry.core.inventory.wrappers.InventoryIterator; import forestry.core.inventory.wrappers.SidedInventoryMapper; import forestry.core.tiles.AdjacentTileCache; import forestry.plugins.PluginManager; -import java.util.AbstractMap; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; -import net.minecraftforge.oredict.OreDictionary; public abstract class InventoryUtil { @@ -77,8 +77,7 @@ public abstract class InventoryUtil { * * Two null stacks will return true, unlike the other functions. * - * This function is primarily intended to be used to track changes to an - * ItemStack. + * This function is primarily intended to be used to track changes to an ItemStack. * * @param a An ItemStack * @param b An ItemStack @@ -104,8 +103,7 @@ public abstract class InventoryUtil { } /** - * A more robust item comparison function. Supports items with damage = -1 - * matching any sub-type. + * A more robust item comparison function. Supports items with damage = -1 matching any sub-type. * * @param a An ItemStack * @param b An ItemStack @@ -115,8 +113,8 @@ public abstract class InventoryUtil { return isItemEqual(a, b, true, true); } - public static boolean isItemEqual( - final ItemStack a, final ItemStack b, final boolean matchDamage, final boolean matchNBT) { + public static boolean isItemEqual(final ItemStack a, final ItemStack b, final boolean matchDamage, + final boolean matchNBT) { if (a == null || b == null) { return false; } @@ -148,13 +146,13 @@ public abstract class InventoryUtil { } /** - * Places an ItemStack in a destination IInventory. Will attempt to move as - * much of the stack as possible, returning any remainder. + * Places an ItemStack in a destination IInventory. Will attempt to move as much of the stack as possible, returning + * any remainder. * * @param stack The ItemStack to put in the inventory. * @param dest The destination IInventory. - * @return Null if itemStack was completely moved, a new itemStack with - * remaining stackSize if part or none of the stack was moved. + * @return Null if itemStack was completely moved, a new itemStack with remaining stackSize if part or none of the + * stack was moved. */ public static ItemStack moveItemStack(ItemStack stack, IInventory dest) { InventoryManipulator im = InventoryManipulator.get(dest); @@ -208,8 +206,7 @@ public abstract class InventoryUtil { } /** - * Removes and returns a single item from the inventory that matches the - * filter. + * Removes and returns a single item from the inventory that matches the filter. * * @param inv The inventory * @param filter ItemStack to match against @@ -220,8 +217,7 @@ public abstract class InventoryUtil { } /** - * Removes and returns a single item from the inventory that matches the - * filter. + * Removes and returns a single item from the inventory that matches the filter. * * @param inv The inventory * @param filter EnumItemType to match against @@ -233,8 +229,8 @@ public abstract class InventoryUtil { } /** - * Attempts to move a single item from the source inventory into a adjacent Buildcraft pipe. - * If the attempt fails, the source Inventory will not be modified. + * Attempts to move a single item from the source inventory into a adjacent Buildcraft pipe. If the attempt fails, + * the source Inventory will not be modified. * * @param source The source inventory * @param tileCache The tile cache of the source block. @@ -244,8 +240,8 @@ public abstract class InventoryUtil { return moveOneItemToPipe(source, tileCache, ForgeDirection.VALID_DIRECTIONS); } - public static boolean moveOneItemToPipe( - IInventory source, AdjacentTileCache tileCache, ForgeDirection[] directions) { + public static boolean moveOneItemToPipe(IInventory source, AdjacentTileCache tileCache, + ForgeDirection[] directions) { if (PluginManager.Module.BUILDCRAFT_TRANSPORT.isEnabled()) { return internal_moveOneItemToPipe(source, tileCache, directions); } @@ -254,8 +250,8 @@ public abstract class InventoryUtil { } @Optional.Method(modid = "BuildCraftAPI|transport") - private static boolean internal_moveOneItemToPipe( - IInventory source, AdjacentTileCache tileCache, ForgeDirection[] directions) { + private static boolean internal_moveOneItemToPipe(IInventory source, AdjacentTileCache tileCache, + ForgeDirection[] directions) { IInventory invClone = new InventoryCopy(source); ItemStack stackToMove = removeOneItem(invClone); if (stackToMove == null) { @@ -296,39 +292,31 @@ public abstract class InventoryUtil { /* REMOVAL */ /** - * Removes a set of items from an inventory. - * Removes the exact items first if they exist, and then removes crafting equivalents. - * If the inventory doesn't have all the required items, returns false without removing anything. - * If stowContainer is true, items with containers will have their container stowed. + * Removes a set of items from an inventory. Removes the exact items first if they exist, and then removes crafting + * equivalents. If the inventory doesn't have all the required items, returns false without removing anything. If + * stowContainer is true, items with containers will have their container stowed. */ - public static boolean removeSets( - IInventory inventory, - int count, - ItemStack[] set, - EntityPlayer player, - boolean stowContainer, - boolean oreDictionary, - boolean craftingTools, - boolean doRemove) { + public static boolean removeSets(IInventory inventory, int count, ItemStack[] set, EntityPlayer player, + boolean stowContainer, boolean oreDictionary, boolean craftingTools, boolean doRemove) { ItemStack[] stock = getStacks(inventory); if (doRemove) { - ItemStack[] removed = - removeSets(inventory, count, set, player, stowContainer, oreDictionary, craftingTools); + ItemStack[] removed = removeSets( + inventory, + count, + set, + player, + stowContainer, + oreDictionary, + craftingTools); return removed != null && removed.length >= count; } else { return ItemStackUtil.containsSets(set, stock, oreDictionary, craftingTools) >= count; } } - public static ItemStack[] removeSets( - IInventory inventory, - int count, - ItemStack[] set, - EntityPlayer player, - boolean stowContainer, - boolean oreDictionary, - boolean craftingTools) { + public static ItemStack[] removeSets(IInventory inventory, int count, ItemStack[] set, EntityPlayer player, + boolean stowContainer, boolean oreDictionary, boolean craftingTools) { ItemStack[] removed = new ItemStack[set.length]; ItemStack[] stock = getStacks(inventory); @@ -347,8 +335,13 @@ public abstract class InventoryUtil { ItemStack removedStack = removeStack(inventory, stackToRemove, player, stowContainer, false, false); if (removedStack == null) { // remove crafting equivalents next - removedStack = - removeStack(inventory, stackToRemove, player, stowContainer, oreDictionary, craftingTools); + removedStack = removeStack( + inventory, + stackToRemove, + player, + stowContainer, + oreDictionary, + craftingTools); } removed[i] = removedStack; @@ -359,13 +352,8 @@ public abstract class InventoryUtil { /** * Private Helper for removeSetsFromInventory. Assumes removal is possible. */ - private static ItemStack removeStack( - IInventory inventory, - ItemStack stackToRemove, - EntityPlayer player, - boolean stowContainer, - boolean oreDictionary, - boolean craftingTools) { + private static ItemStack removeStack(IInventory inventory, ItemStack stackToRemove, EntityPlayer player, + boolean stowContainer, boolean oreDictionary, boolean craftingTools) { for (int j = 0; j < inventory.getSizeInventory(); j++) { ItemStack stackInSlot = inventory.getStackInSlot(j); if (stackInSlot == null) { @@ -464,8 +452,8 @@ public abstract class InventoryUtil { return result; } - public static boolean tryAddStacksCopy( - IInventory inventory, ItemStack[] stacks, int startSlot, int slots, boolean all) { + public static boolean tryAddStacksCopy(IInventory inventory, ItemStack[] stacks, int startSlot, int slots, + boolean all) { for (ItemStack stack : stacks) { if (stack == null) { @@ -495,8 +483,8 @@ public abstract class InventoryUtil { return tryAddStack(inventory, stack, startSlot, slots, all, true); } - public static boolean tryAddStack( - IInventory inventory, ItemStack stack, int startSlot, int slots, boolean all, boolean doAdd) { + public static boolean tryAddStack(IInventory inventory, ItemStack stack, int startSlot, int slots, boolean all, + boolean doAdd) { int added = addStack(inventory, stack, startSlot, slots, false); boolean success = all ? (added == stack.stackSize) : (added > 0); @@ -579,8 +567,8 @@ public abstract class InventoryUtil { return stowInInventory(itemstack, inventory, doAdd, 0, inventory.getSizeInventory()); } - public static boolean stowInInventory( - ItemStack itemstack, IInventory inventory, boolean doAdd, int slot1, int count) { + public static boolean stowInInventory(ItemStack itemstack, IInventory inventory, boolean doAdd, int slot1, + int count) { boolean added = false; diff --git a/src/main/java/forestry/core/utils/ItemStackUtil.java b/src/main/java/forestry/core/utils/ItemStackUtil.java index 75b21f987..457acc3e2 100644 --- a/src/main/java/forestry/core/utils/ItemStackUtil.java +++ b/src/main/java/forestry/core/utils/ItemStackUtil.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.utils; @@ -14,6 +12,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.entity.item.EntityItem; import net.minecraft.item.Item; @@ -76,14 +75,12 @@ public abstract class ItemStackUtil { } /** - * Creates a split stack of the specified amount, preserving NBT data, - * without decreasing the source stack. + * Creates a split stack of the specified amount, preserving NBT data, without decreasing the source stack. */ public static ItemStack createSplitStack(ItemStack stack, int amount) { ItemStack split = new ItemStack(stack.getItem(), amount, stack.getItemDamage()); if (stack.getTagCompound() != null) { - NBTTagCompound nbttagcompound = - (NBTTagCompound) stack.getTagCompound().copy(); + NBTTagCompound nbttagcompound = (NBTTagCompound) stack.getTagCompound().copy(); split.setTagCompound(nbttagcompound); } return split; @@ -145,8 +142,8 @@ public abstract class ItemStackUtil { /** * Counts how many full sets are contained in the passed stock */ - public static int containsSets( - ItemStack[] set, ItemStack[] stock, boolean oreDictionary, boolean craftingTools, boolean matchTags) { + public static int containsSets(ItemStack[] set, ItemStack[] stock, boolean oreDictionary, boolean craftingTools, + boolean matchTags) { int totalSets = 0; ItemStack[] condensedRequired = ItemStackUtil.condenseStacks(set); @@ -226,8 +223,8 @@ public abstract class ItemStackUtil { /** * Compare two item stacks for crafting equivalency. */ - public static boolean isCraftingEquivalent( - ItemStack base, ItemStack comparison, boolean oreDictionary, boolean craftingTools) { + public static boolean isCraftingEquivalent(ItemStack base, ItemStack comparison, boolean oreDictionary, + boolean craftingTools) { if (isCraftingEquivalent(base, comparison)) { return true; } @@ -299,8 +296,8 @@ public abstract class ItemStackUtil { dropItemStackAsEntity(items, world, x, y, z, 10); } - public static void dropItemStackAsEntity( - ItemStack items, World world, double x, double y, double z, int delayForPickup) { + public static void dropItemStackAsEntity(ItemStack items, World world, double x, double y, double z, + int delayForPickup) { if (items.stackSize <= 0 || world.isRemote) { return; } diff --git a/src/main/java/forestry/core/utils/Log.java b/src/main/java/forestry/core/utils/Log.java index ab3793e8b..b2bb52803 100644 --- a/src/main/java/forestry/core/utils/Log.java +++ b/src/main/java/forestry/core/utils/Log.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.utils; -import forestry.core.config.Constants; import org.apache.logging.log4j.Level; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.message.MessageFormatMessage; +import forestry.core.config.Constants; + public abstract class Log { /* FINEST */ @@ -131,9 +130,7 @@ public abstract class Log { if (classFile != null) { msg = new StringBuilder(mod); - msg.append(" API error: ") - .append(classFile.getSimpleName()) - .append(" is loaded from ") + msg.append(" API error: ").append(classFile.getSimpleName()).append(" is loaded from ") .append(classFile.getProtectionDomain().getCodeSource().getLocation()); log(Level.ERROR, msg.toString()); } diff --git a/src/main/java/forestry/core/utils/ModUtil.java b/src/main/java/forestry/core/utils/ModUtil.java index ec09985ad..7699d3229 100644 --- a/src/main/java/forestry/core/utils/ModUtil.java +++ b/src/main/java/forestry/core/utils/ModUtil.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.utils; @@ -19,6 +17,7 @@ import cpw.mods.fml.common.versioning.VersionParser; import cpw.mods.fml.common.versioning.VersionRange; public abstract class ModUtil { + public static boolean isModLoaded(String modname) { return Loader.isModLoaded(modname); } diff --git a/src/main/java/forestry/core/utils/NBTUtil.java b/src/main/java/forestry/core/utils/NBTUtil.java index ad4b4ce73..895bfc404 100644 --- a/src/main/java/forestry/core/utils/NBTUtil.java +++ b/src/main/java/forestry/core/utils/NBTUtil.java @@ -1,19 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.utils; -import com.google.common.collect.ForwardingList; -import cpw.mods.fml.common.ObfuscationReflectionHelper; import java.util.ArrayList; import java.util.List; + import net.minecraft.nbt.NBTBase; import net.minecraft.nbt.NBTTagByte; import net.minecraft.nbt.NBTTagByteArray; @@ -28,12 +25,16 @@ import net.minecraft.nbt.NBTTagLong; import net.minecraft.nbt.NBTTagShort; import net.minecraft.nbt.NBTTagString; +import com.google.common.collect.ForwardingList; +import cpw.mods.fml.common.ObfuscationReflectionHelper; + /** * @author CovertJaguar */ public abstract class NBTUtil { public enum EnumNBTType { + END(NBTTagEnd.class), BYTE(NBTTagByte.class), SHORT(NBTTagShort.class), @@ -46,6 +47,7 @@ public abstract class NBTUtil { LIST(NBTTagList.class), COMPOUND(NBTTagCompound.class), INT_ARRAY(NBTTagIntArray.class); + public static final EnumNBTType[] VALUES = values(); public final Class classObject; diff --git a/src/main/java/forestry/core/utils/PlayerUtil.java b/src/main/java/forestry/core/utils/PlayerUtil.java index bbbaccd5d..7c6bb427a 100644 --- a/src/main/java/forestry/core/utils/PlayerUtil.java +++ b/src/main/java/forestry/core/utils/PlayerUtil.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.utils; -import com.mojang.authlib.GameProfile; -import forestry.core.access.IOwnable; import java.util.UUID; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.world.World; import net.minecraft.world.WorldServer; import net.minecraftforge.common.util.FakePlayerFactory; +import com.mojang.authlib.GameProfile; +import forestry.core.access.IOwnable; + public abstract class PlayerUtil { // TODO: use null everywhere instead of an emptyUUID @@ -47,9 +47,8 @@ public abstract class PlayerUtil { } /** - * Get a player for a given World and GameProfile. - * If they are not in the World, returns a FakePlayer. - * Do not store references to the return value, to prevent worlds staying in memory. + * Get a player for a given World and GameProfile. If they are not in the World, returns a FakePlayer. Do not store + * references to the return value, to prevent worlds staying in memory. */ public static EntityPlayer getPlayer(World world, GameProfile profile) { if (world == null) { diff --git a/src/main/java/forestry/core/utils/SlotUtil.java b/src/main/java/forestry/core/utils/SlotUtil.java index 6e53032b2..8c5a2aa90 100644 --- a/src/main/java/forestry/core/utils/SlotUtil.java +++ b/src/main/java/forestry/core/utils/SlotUtil.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.utils; -import forestry.core.gui.slots.SlotForestry; import java.util.List; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.InventoryPlayer; import net.minecraft.inventory.Slot; import net.minecraft.inventory.SlotCrafting; import net.minecraft.item.ItemStack; +import forestry.core.gui.slots.SlotForestry; + public abstract class SlotUtil { public static boolean isSlotInRange(int slotIndex, int start, int count) { @@ -93,8 +93,8 @@ public abstract class SlotUtil { return originalStack; } - private static boolean shiftItemStack( - List inventorySlots, ItemStack stackInSlot, int slotIndex, int numSlots, boolean fromCraftingSlot) { + private static boolean shiftItemStack(List inventorySlots, ItemStack stackInSlot, int slotIndex, int numSlots, + boolean fromCraftingSlot) { if (isInPlayerInventory(slotIndex)) { if (shiftToMachineInventory(inventorySlots, stackInSlot, numSlots)) { return true; @@ -166,8 +166,8 @@ public abstract class SlotUtil { return changed; } - private static boolean shiftItemStackToRangeMerge( - List inventorySlots, ItemStack stackToShift, int start, int count) { + private static boolean shiftItemStackToRangeMerge(List inventorySlots, ItemStack stackToShift, int start, + int count) { if (stackToShift == null || !stackToShift.isStackable() || stackToShift.stackSize <= 0) { return false; } @@ -195,8 +195,8 @@ public abstract class SlotUtil { return changed; } - private static boolean shiftItemStackToRangeOpenSlots( - List inventorySlots, ItemStack stackToShift, int start, int count) { + private static boolean shiftItemStackToRangeOpenSlots(List inventorySlots, ItemStack stackToShift, int start, + int count) { if (stackToShift == null || stackToShift.stackSize <= 0) { return false; } @@ -264,10 +264,10 @@ public abstract class SlotUtil { } // if mergeOnly = true, don't shift into empty slots. - private static boolean shiftToMachineInventory( - List inventorySlots, ItemStack stackToShift, int numSlots, boolean mergeOnly) { + private static boolean shiftToMachineInventory(List inventorySlots, ItemStack stackToShift, int numSlots, + boolean mergeOnly) { for (int machineIndex = playerInventorySize; machineIndex < numSlots; machineIndex++) { - // System.out.println("SlotUtil::shiftToMachineinventory"); + // System.out.println("SlotUtil::shiftToMachineinventory"); Slot slot = (Slot) inventorySlots.get(machineIndex); if (mergeOnly && slot.getStack() == null) { continue; diff --git a/src/main/java/forestry/core/utils/Stack.java b/src/main/java/forestry/core/utils/Stack.java index e39fead9b..db2492cdd 100644 --- a/src/main/java/forestry/core/utils/Stack.java +++ b/src/main/java/forestry/core/utils/Stack.java @@ -1,25 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.utils; -import cpw.mods.fml.common.registry.GameData; import java.text.NumberFormat; import java.text.ParseException; import java.util.ArrayList; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraftforge.oredict.OreDictionary; +import cpw.mods.fml.common.registry.GameData; + public class Stack { + private final String name; private final int meta; @@ -73,12 +74,12 @@ public class Stack { meta = missingMetaValue; } else { try { - meta = parts[2].equals("*") - ? OreDictionary.WILDCARD_VALUE + meta = parts[2].equals("*") ? OreDictionary.WILDCARD_VALUE : NumberFormat.getIntegerInstance().parse(parts[2]).intValue(); } catch (ParseException e) { - Log.warning("ItemStack string (" + stackString - + ") has improperly formatted metadata. Suitable metadata are integer values or *."); + Log.warning( + "ItemStack string (" + stackString + + ") has improperly formatted metadata. Suitable metadata are integer values or *."); return null; } } diff --git a/src/main/java/forestry/core/utils/StringUtil.java b/src/main/java/forestry/core/utils/StringUtil.java index 7074f9cbc..841966f5d 100755 --- a/src/main/java/forestry/core/utils/StringUtil.java +++ b/src/main/java/forestry/core/utils/StringUtil.java @@ -1,17 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.utils; -import forestry.core.proxy.Proxies; import java.util.IllegalFormatException; + import net.minecraft.block.Block; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; @@ -19,6 +17,8 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; +import forestry.core.proxy.Proxies; + public class StringUtil { public static boolean canTranslate(String key) { @@ -30,16 +30,11 @@ public class StringUtil { } public static String localize(String key) { - return StatCollector.translateToLocal("for." + key) - .replace("\\n", "\n") - .replace("@", "%") - .replace("\\%", "@"); + return StatCollector.translateToLocal("for." + key).replace("\\n", "\n").replace("@", "%").replace("\\%", "@"); } public static String localizeTile(String key) { - return StatCollector.translateToLocal("tile.for." + key) - .replace("\\n", "\n") - .replace("@", "%") + return StatCollector.translateToLocal("tile.for." + key).replace("\\n", "\n").replace("@", "%") .replace("\\%", "@"); } @@ -51,10 +46,7 @@ public class StringUtil { * Same as localizeAndFormat, only without the "for." prefix. Used for specific items. */ public static String localizeAndFormatRaw(String key, Object... args) { - String text = StatCollector.translateToLocal(key) - .replace("\\n", "\n") - .replace("@", "%") - .replace("\\%", "@"); + String text = StatCollector.translateToLocal(key).replace("\\n", "\n").replace("@", "%").replace("\\%", "@"); try { return String.format(text, args); @@ -64,10 +56,8 @@ public class StringUtil { } public static String cleanTags(String tag) { - return tag.replaceAll("[Ff]orestry\\p{Punct}", "") - .replaceAll("\\.[Ff]or\\p{Punct}", ".") - .replaceFirst("^tile\\.", "") - .replaceFirst("^item\\.", ""); + return tag.replaceAll("[Ff]orestry\\p{Punct}", "").replaceAll("\\.[Ff]or\\p{Punct}", ".") + .replaceFirst("^tile\\.", "").replaceFirst("^item\\.", ""); } public static String cleanItemName(ItemStack stack) { @@ -121,8 +111,7 @@ public class StringUtil { int lineCount = 0; for (String string : strings) { - lineCount += - fontRenderer.listFormattedStringToWidth(string, maxWidth).size(); + lineCount += fontRenderer.listFormattedStringToWidth(string, maxWidth).size(); } return lineCount * fontRenderer.FONT_HEIGHT; diff --git a/src/main/java/forestry/core/utils/datastructures/FluidMap.java b/src/main/java/forestry/core/utils/datastructures/FluidMap.java index 03181e19d..9858f90d0 100644 --- a/src/main/java/forestry/core/utils/datastructures/FluidMap.java +++ b/src/main/java/forestry/core/utils/datastructures/FluidMap.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.utils.datastructures; @@ -15,6 +13,7 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; public class FluidMap extends StackMap { + private static final long serialVersionUID = 15891293315299994L; @Override diff --git a/src/main/java/forestry/core/utils/datastructures/ItemStackMap.java b/src/main/java/forestry/core/utils/datastructures/ItemStackMap.java index 0ab715318..e4c90b192 100644 --- a/src/main/java/forestry/core/utils/datastructures/ItemStackMap.java +++ b/src/main/java/forestry/core/utils/datastructures/ItemStackMap.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.utils.datastructures; @@ -15,6 +13,7 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.oredict.OreDictionary; public class ItemStackMap extends StackMap { + private static final long serialVersionUID = -8511966739130702305L; @Override diff --git a/src/main/java/forestry/core/utils/datastructures/RevolvingList.java b/src/main/java/forestry/core/utils/datastructures/RevolvingList.java index 679d06cfb..495725252 100644 --- a/src/main/java/forestry/core/utils/datastructures/RevolvingList.java +++ b/src/main/java/forestry/core/utils/datastructures/RevolvingList.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.utils.datastructures; -import com.google.common.collect.ForwardingCollection; import java.util.Collection; import java.util.Deque; import java.util.LinkedList; +import com.google.common.collect.ForwardingCollection; + /** * @param * @author CovertJaguar diff --git a/src/main/java/forestry/core/utils/datastructures/StackMap.java b/src/main/java/forestry/core/utils/datastructures/StackMap.java index 0edbc20b1..2d104e013 100644 --- a/src/main/java/forestry/core/utils/datastructures/StackMap.java +++ b/src/main/java/forestry/core/utils/datastructures/StackMap.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.utils.datastructures; diff --git a/src/main/java/forestry/core/utils/vect/IVect.java b/src/main/java/forestry/core/utils/vect/IVect.java index 124517e80..c0418dc5d 100644 --- a/src/main/java/forestry/core/utils/vect/IVect.java +++ b/src/main/java/forestry/core/utils/vect/IVect.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.utils.vect; -import forestry.api.farming.FarmDirection; import net.minecraft.util.ChunkCoordinates; import net.minecraftforge.common.util.ForgeDirection; +import forestry.api.farming.FarmDirection; + /** * Represents a position or dimensions. */ public interface IVect { + int getX(); int getY(); diff --git a/src/main/java/forestry/core/utils/vect/MutableVect.java b/src/main/java/forestry/core/utils/vect/MutableVect.java index ddd58aae5..70c58acc4 100644 --- a/src/main/java/forestry/core/utils/vect/MutableVect.java +++ b/src/main/java/forestry/core/utils/vect/MutableVect.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.utils.vect; -import forestry.api.farming.FarmDirection; import net.minecraft.util.ChunkCoordinates; import net.minecraftforge.common.util.ForgeDirection; +import forestry.api.farming.FarmDirection; + /** * Represents changeable positions or dimensions. */ public class MutableVect implements IVect { + public int x; public int y; public int z; @@ -93,7 +93,7 @@ public class MutableVect implements IVect { @Override public int[] toArray() { - return new int[] {x, y, z}; + return new int[] { x, y, z }; } public MutableVect multiply(float factor) { diff --git a/src/main/java/forestry/core/utils/vect/Vect.java b/src/main/java/forestry/core/utils/vect/Vect.java index faa02b4e6..6837f2027 100644 --- a/src/main/java/forestry/core/utils/vect/Vect.java +++ b/src/main/java/forestry/core/utils/vect/Vect.java @@ -1,26 +1,27 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.utils.vect; -import forestry.api.farming.FarmDirection; import java.util.Random; + import net.minecraft.entity.Entity; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.ChunkCoordinates; import net.minecraftforge.common.util.ForgeDirection; +import forestry.api.farming.FarmDirection; + /** * Represents an unchangeable position or dimensions. */ public class Vect implements IVect { + public final int x; public final int y; public final int z; @@ -117,7 +118,7 @@ public class Vect implements IVect { @Override public int[] toArray() { - return new int[] {x, y, z}; + return new int[] { x, y, z }; } public Vect multiply(int factor) { diff --git a/src/main/java/forestry/core/utils/vect/VectUtil.java b/src/main/java/forestry/core/utils/vect/VectUtil.java index 7f8e0f38d..75deab76c 100644 --- a/src/main/java/forestry/core/utils/vect/VectUtil.java +++ b/src/main/java/forestry/core/utils/vect/VectUtil.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.utils.vect; @@ -16,6 +14,7 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; public final class VectUtil { + public static boolean isAirBlock(World world, IVect position) { return world.isAirBlock(position.getX(), position.getY(), position.getZ()); } diff --git a/src/main/java/forestry/core/worldgen/BlockType.java b/src/main/java/forestry/core/worldgen/BlockType.java index d0c175bf3..e28cd06bf 100755 --- a/src/main/java/forestry/core/worldgen/BlockType.java +++ b/src/main/java/forestry/core/worldgen/BlockType.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.worldgen; -import forestry.core.config.Constants; import net.minecraft.block.Block; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import forestry.core.config.Constants; + public class BlockType implements IBlockType { + private final Block block; protected int meta; diff --git a/src/main/java/forestry/core/worldgen/BlockTypeTileForestry.java b/src/main/java/forestry/core/worldgen/BlockTypeTileForestry.java index 75ad5f6bb..4fefee5af 100644 --- a/src/main/java/forestry/core/worldgen/BlockTypeTileForestry.java +++ b/src/main/java/forestry/core/worldgen/BlockTypeTileForestry.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.worldgen; -import forestry.core.config.Constants; -import forestry.core.tiles.TileForestry; import net.minecraft.block.Block; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import forestry.core.config.Constants; +import forestry.core.tiles.TileForestry; + public class BlockTypeTileForestry implements IBlockType { + private final Block block; private final int meta; private ForgeDirection direction; diff --git a/src/main/java/forestry/core/worldgen/BlockTypeVoid.java b/src/main/java/forestry/core/worldgen/BlockTypeVoid.java index 0b54589cc..cbb9b507f 100644 --- a/src/main/java/forestry/core/worldgen/BlockTypeVoid.java +++ b/src/main/java/forestry/core/worldgen/BlockTypeVoid.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.worldgen; diff --git a/src/main/java/forestry/core/worldgen/IBlockType.java b/src/main/java/forestry/core/worldgen/IBlockType.java index db7c9d919..c7ae179b8 100644 --- a/src/main/java/forestry/core/worldgen/IBlockType.java +++ b/src/main/java/forestry/core/worldgen/IBlockType.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.worldgen; @@ -14,6 +12,7 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; public interface IBlockType { + void setDirection(ForgeDirection facing); void setBlock(World world, int x, int y, int z); diff --git a/src/main/java/forestry/core/worldgen/WorldGenBase.java b/src/main/java/forestry/core/worldgen/WorldGenBase.java index 293f8ff1d..efe490f9f 100755 --- a/src/main/java/forestry/core/worldgen/WorldGenBase.java +++ b/src/main/java/forestry/core/worldgen/WorldGenBase.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.worldgen; -import forestry.arboriculture.worldgen.ITreeBlockType; import java.util.Random; + import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; import net.minecraftforge.common.util.ForgeDirection; +import forestry.arboriculture.worldgen.ITreeBlockType; + public abstract class WorldGenBase extends WorldGenerator { protected enum EnumReplaceMode { @@ -66,8 +66,8 @@ public abstract class WorldGenBase extends WorldGenerator { protected abstract boolean addBlock(World world, int x, int y, int z, ITreeBlockType type, EnumReplaceMode replace); - protected final void generateCuboid( - World world, Vector start, Vector area, ITreeBlockType block, EnumReplaceMode replace) { + protected final void generateCuboid(World world, Vector start, Vector area, ITreeBlockType block, + EnumReplaceMode replace) { for (int x = (int) start.x; x < (int) start.x + area.x; x++) { for (int y = (int) start.y; y < (int) start.y + area.y; y++) { for (int z = (int) start.z; z < (int) start.z + area.z; z++) { @@ -80,8 +80,8 @@ public abstract class WorldGenBase extends WorldGenerator { /* * Center is the bottom middle of the cylinder */ - protected final void generateCylinder( - World world, Vector center, float radius, int height, ITreeBlockType block, EnumReplaceMode replace) { + protected final void generateCylinder(World world, Vector center, float radius, int height, ITreeBlockType block, + EnumReplaceMode replace) { Vector start = new Vector(center.x - radius, center.y, center.z - radius); Vector area = new Vector(radius * 2 + 1, height, radius * 2 + 1); for (int x = (int) start.x; x < (int) start.x + area.x; x++) { @@ -99,26 +99,13 @@ public abstract class WorldGenBase extends WorldGenerator { } } - protected final void generateCircle( - World world, - Vector center, - float radius, - int width, - int height, - ITreeBlockType block, - EnumReplaceMode replace) { + protected final void generateCircle(World world, Vector center, float radius, int width, int height, + ITreeBlockType block, EnumReplaceMode replace) { generateCircle(world, center, radius, width, height, block, 1.0f, replace); } - protected final void generateCircle( - World world, - Vector center, - float radius, - int width, - int height, - ITreeBlockType block, - float chance, - EnumReplaceMode replace) { + protected final void generateCircle(World world, Vector center, float radius, int width, int height, + ITreeBlockType block, float chance, EnumReplaceMode replace) { Vector start = new Vector(center.x - radius, center.y, center.z - radius); Vector area = new Vector(radius * 2 + 1, height, radius * 2 + 1); @@ -139,8 +126,8 @@ public abstract class WorldGenBase extends WorldGenerator { } } - protected final void generateSphere( - World world, Vector center, int radius, ITreeBlockType block, EnumReplaceMode replace) { + protected final void generateSphere(World world, Vector center, int radius, ITreeBlockType block, + EnumReplaceMode replace) { Vector start = new Vector(center.x - radius, center.y - radius, center.z - radius); Vector area = new Vector(radius * 2 + 1, radius * 2 + 1, radius * 2 + 1); for (int x = (int) start.x; x < (int) start.x + area.x; x++) { diff --git a/src/main/java/forestry/core/worldgen/WorldGenMinableMeta.java b/src/main/java/forestry/core/worldgen/WorldGenMinableMeta.java index 6dc865856..767948e34 100755 --- a/src/main/java/forestry/core/worldgen/WorldGenMinableMeta.java +++ b/src/main/java/forestry/core/worldgen/WorldGenMinableMeta.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.worldgen; -import forestry.core.config.Constants; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.util.MathHelper; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenerator; +import forestry.core.config.Constants; + public class WorldGenMinableMeta extends WorldGenerator { private final Block mineableBlock; diff --git a/src/main/java/forestry/core/worldgen/WorldGenerator.java b/src/main/java/forestry/core/worldgen/WorldGenerator.java index 8f8baef2c..d982433d2 100644 --- a/src/main/java/forestry/core/worldgen/WorldGenerator.java +++ b/src/main/java/forestry/core/worldgen/WorldGenerator.java @@ -1,26 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.core.worldgen; +import java.util.Random; + +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.terraingen.PopulateChunkEvent; + import cpw.mods.fml.common.IWorldGenerator; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import forestry.core.blocks.BlockResourceOre; import forestry.core.config.Config; import forestry.plugins.PluginCore; import forestry.plugins.PluginManager; -import java.util.Random; -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.terraingen.PopulateChunkEvent; public class WorldGenerator implements IWorldGenerator { @@ -33,12 +33,7 @@ public class WorldGenerator implements IWorldGenerator { } @Override - public void generate( - Random random, - int chunkX, - int chunkZ, - World world, - IChunkProvider chunkGenerator, + public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { generateWorld(random, chunkX, chunkZ, world); } @@ -47,7 +42,12 @@ public class WorldGenerator implements IWorldGenerator { public void populateChunk(PopulateChunkEvent.Post event) { // / PLUGIN WORLD GENERATION PluginManager.populateChunk( - event.chunkProvider, event.world, event.rand, event.chunkX, event.chunkZ, event.hasVillageGenerated); + event.chunkProvider, + event.world, + event.rand, + event.chunkX, + event.chunkZ, + event.hasVillageGenerated); } public void retroGen(Random random, int chunkX, int chunkZ, World world) { @@ -60,11 +60,17 @@ public class WorldGenerator implements IWorldGenerator { if (apatiteGenerator == null) { apatiteGenerator = new WorldGenMinableMeta( - PluginCore.blocks.resources, BlockResourceOre.ResourceType.APATITE.ordinal(), 36); + PluginCore.blocks.resources, + BlockResourceOre.ResourceType.APATITE.ordinal(), + 36); copperGenerator = new WorldGenMinableMeta( - PluginCore.blocks.resources, BlockResourceOre.ResourceType.COPPER.ordinal(), 6); + PluginCore.blocks.resources, + BlockResourceOre.ResourceType.COPPER.ordinal(), + 6); tinGenerator = new WorldGenMinableMeta( - PluginCore.blocks.resources, BlockResourceOre.ResourceType.TIN.ordinal(), 6); + PluginCore.blocks.resources, + BlockResourceOre.ResourceType.TIN.ordinal(), + 6); } // shift to world coordinates diff --git a/src/main/java/forestry/energy/EnergyManager.java b/src/main/java/forestry/energy/EnergyManager.java index d29e64870..aa0dfe62d 100644 --- a/src/main/java/forestry/energy/EnergyManager.java +++ b/src/main/java/forestry/energy/EnergyManager.java @@ -1,5 +1,11 @@ package forestry.energy; +import java.io.IOException; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import cofh.api.energy.EnergyStorage; import cofh.api.energy.IEnergyHandler; import cofh.api.energy.IEnergyReceiver; @@ -9,12 +15,9 @@ import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IStreamable; import forestry.core.tiles.TileEngine; import forestry.core.utils.BlockUtil; -import java.io.IOException; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class EnergyManager implements IEnergyHandler, IStreamable { + private enum EnergyTransferMode { EXTRACT, RECEIVE, @@ -26,7 +29,9 @@ public class EnergyManager implements IEnergyHandler, IStreamable { public EnergyManager(int maxTransfer, int capacity) { this.energyStorage = new EnergyStorage( - scaleForDifficulty(capacity), scaleForDifficulty(maxTransfer), scaleForDifficulty(maxTransfer)); + scaleForDifficulty(capacity), + scaleForDifficulty(maxTransfer), + scaleForDifficulty(maxTransfer)); } public static int scaleForDifficulty(int energyPerUse) { @@ -169,8 +174,7 @@ public class EnergyManager implements IEnergyHandler, IStreamable { } /** - * Sends as much energy as it can to the tile at orientation. - * For power sources. Ignores canExtract() + * Sends as much energy as it can to the tile at orientation. For power sources. Ignores canExtract() * * @return amount sent */ @@ -179,8 +183,7 @@ public class EnergyManager implements IEnergyHandler, IStreamable { } /** - * Sends amount of energy to the tile at orientation. - * For power sources. Ignores canExtract() + * Sends amount of energy to the tile at orientation. For power sources. Ignores canExtract() * * @return amount sent */ diff --git a/src/main/java/forestry/energy/blocks/BlockEngine.java b/src/main/java/forestry/energy/blocks/BlockEngine.java index bba977fe7..edff6e51e 100644 --- a/src/main/java/forestry/energy/blocks/BlockEngine.java +++ b/src/main/java/forestry/energy/blocks/BlockEngine.java @@ -1,21 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.blocks; -import com.google.common.collect.ImmutableList; -import forestry.core.blocks.BlockBase; -import forestry.core.tiles.TileEngine; -import forestry.core.tiles.TileUtil; import java.util.EnumMap; import java.util.List; + import net.minecraft.entity.Entity; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.MovingObjectPosition; @@ -23,9 +18,16 @@ import net.minecraft.util.Vec3; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import com.google.common.collect.ImmutableList; + +import forestry.core.blocks.BlockBase; +import forestry.core.tiles.TileEngine; +import forestry.core.tiles.TileUtil; + public class BlockEngine extends BlockBase { - private static final EnumMap> boundingBoxesForDirections = - new EnumMap<>(ForgeDirection.class); + + private static final EnumMap> boundingBoxesForDirections = new EnumMap<>( + ForgeDirection.class); static { boundingBoxesForDirections.put( @@ -66,8 +68,8 @@ public class BlockEngine extends BlockBase { @Override @SuppressWarnings("unchecked") - public void addCollisionBoxesToList( - World world, int x, int y, int z, AxisAlignedBB mask, List list, Entity colliding) { + public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB mask, List list, + Entity colliding) { TileEngine tile = TileUtil.getTile(world, x, y, z, TileEngine.class); if (tile == null) { super.addCollisionBoxesToList(world, x, y, z, mask, list, colliding); diff --git a/src/main/java/forestry/energy/blocks/BlockEngineType.java b/src/main/java/forestry/energy/blocks/BlockEngineType.java index b22e4dbd2..176a3e73c 100644 --- a/src/main/java/forestry/energy/blocks/BlockEngineType.java +++ b/src/main/java/forestry/energy/blocks/BlockEngineType.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.blocks; @@ -23,10 +21,12 @@ import forestry.energy.tiles.TileGenerator; import forestry.plugins.PluginEnergy; public enum BlockEngineType implements IMachinePropertiesTESR { + ELECTRIC(TileEngineElectric.class, "EngineTin", "/engine_tin_"), PEAT(TileEnginePeat.class, "EngineCopper", "/engine_copper_"), BIOGAS(TileEngineBiogas.class, "EngineBronze", "/engine_bronze_"), GENERATOR(TileGenerator.class, "Generator", "/generator_") { + @Override public IBlockRenderer getRenderer() { return Proxies.render.getRenderDefaultMachine(texturePath); diff --git a/src/main/java/forestry/energy/blocks/BlockRegistryEnergy.java b/src/main/java/forestry/energy/blocks/BlockRegistryEnergy.java index 5dd7e24c0..b0d45f8e5 100644 --- a/src/main/java/forestry/energy/blocks/BlockRegistryEnergy.java +++ b/src/main/java/forestry/energy/blocks/BlockRegistryEnergy.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.blocks; @@ -14,6 +12,7 @@ import forestry.core.blocks.BlockRegistry; import forestry.core.items.ItemBlockForestry; public class BlockRegistryEnergy extends BlockRegistry { + public final BlockEngine engine; public BlockRegistryEnergy() { diff --git a/src/main/java/forestry/energy/circuits/CircuitElectricBoost.java b/src/main/java/forestry/energy/circuits/CircuitElectricBoost.java index 1cd7f01ac..112f0bc08 100755 --- a/src/main/java/forestry/energy/circuits/CircuitElectricBoost.java +++ b/src/main/java/forestry/energy/circuits/CircuitElectricBoost.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.circuits; diff --git a/src/main/java/forestry/energy/circuits/CircuitElectricChange.java b/src/main/java/forestry/energy/circuits/CircuitElectricChange.java index d5590d1ad..58711ac11 100755 --- a/src/main/java/forestry/energy/circuits/CircuitElectricChange.java +++ b/src/main/java/forestry/energy/circuits/CircuitElectricChange.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.circuits; diff --git a/src/main/java/forestry/energy/circuits/CircuitElectricChoke.java b/src/main/java/forestry/energy/circuits/CircuitElectricChoke.java index cd940c53f..51645b166 100755 --- a/src/main/java/forestry/energy/circuits/CircuitElectricChoke.java +++ b/src/main/java/forestry/energy/circuits/CircuitElectricChoke.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.circuits; diff --git a/src/main/java/forestry/energy/circuits/CircuitElectricEfficiency.java b/src/main/java/forestry/energy/circuits/CircuitElectricEfficiency.java index 878195d6d..5b5641606 100755 --- a/src/main/java/forestry/energy/circuits/CircuitElectricEfficiency.java +++ b/src/main/java/forestry/energy/circuits/CircuitElectricEfficiency.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.circuits; diff --git a/src/main/java/forestry/energy/gui/ContainerEngineBiogas.java b/src/main/java/forestry/energy/gui/ContainerEngineBiogas.java index caa8406e3..21b474204 100644 --- a/src/main/java/forestry/energy/gui/ContainerEngineBiogas.java +++ b/src/main/java/forestry/energy/gui/ContainerEngineBiogas.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.gui; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; + import forestry.core.gui.ContainerLiquidTanks; import forestry.core.gui.slots.SlotFiltered; import forestry.energy.inventory.InventoryEngineBiogas; import forestry.energy.tiles.TileEngineBiogas; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; public class ContainerEngineBiogas extends ContainerLiquidTanks { diff --git a/src/main/java/forestry/energy/gui/ContainerEngineElectric.java b/src/main/java/forestry/energy/gui/ContainerEngineElectric.java index 16fb53599..665026f87 100644 --- a/src/main/java/forestry/energy/gui/ContainerEngineElectric.java +++ b/src/main/java/forestry/energy/gui/ContainerEngineElectric.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.core.gui.ContainerSocketed; import forestry.core.gui.slots.SlotFiltered; import forestry.core.network.packets.PacketGuiUpdate; import forestry.energy.tiles.InventoryEngineElectric; import forestry.energy.tiles.TileEngineElectric; -import net.minecraft.entity.player.InventoryPlayer; public class ContainerEngineElectric extends ContainerSocketed { diff --git a/src/main/java/forestry/energy/gui/ContainerEnginePeat.java b/src/main/java/forestry/energy/gui/ContainerEnginePeat.java index a637a7844..dac88a6ad 100644 --- a/src/main/java/forestry/energy/gui/ContainerEnginePeat.java +++ b/src/main/java/forestry/energy/gui/ContainerEnginePeat.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.gui; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; + import forestry.core.gui.ContainerTile; import forestry.core.gui.slots.SlotFiltered; import forestry.core.gui.slots.SlotOutput; import forestry.energy.tiles.TileEnginePeat; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; public class ContainerEnginePeat extends ContainerTile { diff --git a/src/main/java/forestry/energy/gui/ContainerGenerator.java b/src/main/java/forestry/energy/gui/ContainerGenerator.java index 9b826b0db..64b083768 100755 --- a/src/main/java/forestry/energy/gui/ContainerGenerator.java +++ b/src/main/java/forestry/energy/gui/ContainerGenerator.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.gui; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; + import forestry.core.gui.ContainerLiquidTanks; import forestry.core.gui.slots.SlotFiltered; import forestry.energy.inventory.InventoryGenerator; import forestry.energy.tiles.TileGenerator; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; public class ContainerGenerator extends ContainerLiquidTanks { diff --git a/src/main/java/forestry/energy/gui/GuiEngine.java b/src/main/java/forestry/energy/gui/GuiEngine.java index bc2a74080..0d5057309 100755 --- a/src/main/java/forestry/energy/gui/GuiEngine.java +++ b/src/main/java/forestry/energy/gui/GuiEngine.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.gui; +import net.minecraft.inventory.Container; + import forestry.core.gui.GuiForestryTitled; import forestry.core.gui.ledgers.Ledger; import forestry.core.render.TextureManager; import forestry.core.tiles.TileEngine; import forestry.core.utils.StringUtil; -import net.minecraft.inventory.Container; public abstract class GuiEngine extends GuiForestryTitled { diff --git a/src/main/java/forestry/energy/gui/GuiEngineBiogas.java b/src/main/java/forestry/energy/gui/GuiEngineBiogas.java index ff4ab7fd1..244f53235 100644 --- a/src/main/java/forestry/energy/gui/GuiEngineBiogas.java +++ b/src/main/java/forestry/energy/gui/GuiEngineBiogas.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.core.config.Constants; import forestry.core.gui.widgets.TankWidget; import forestry.energy.gui.widgets.BiogasSlot; import forestry.energy.tiles.TileEngineBiogas; -import net.minecraft.entity.player.InventoryPlayer; public class GuiEngineBiogas extends GuiEngine { + public GuiEngineBiogas(InventoryPlayer inventory, TileEngineBiogas tile) { super(Constants.TEXTURE_PATH_GUI + "/bioengine.png", new ContainerEngineBiogas(inventory, tile), tile); widgetManager.add(new TankWidget(widgetManager, 89, 19, 0)); @@ -35,7 +35,12 @@ public class GuiEngineBiogas extends GuiEngine 0) { drawTexturedModalRect( - guiLeft + 53, guiTop + 47 + 16 - temperature, 176, 60 + 16 - temperature, 4, temperature); + guiLeft + 53, + guiTop + 47 + 16 - temperature, + 176, + 60 + 16 - temperature, + 4, + temperature); } } } diff --git a/src/main/java/forestry/energy/gui/GuiEngineElectric.java b/src/main/java/forestry/energy/gui/GuiEngineElectric.java index 26f7c6afa..8d9617906 100644 --- a/src/main/java/forestry/energy/gui/GuiEngineElectric.java +++ b/src/main/java/forestry/energy/gui/GuiEngineElectric.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.core.config.Constants; import forestry.core.gui.widgets.SocketWidget; import forestry.core.render.EnumTankLevel; import forestry.energy.tiles.TileEngineElectric; -import net.minecraft.entity.player.InventoryPlayer; public class GuiEngineElectric extends GuiEngine { diff --git a/src/main/java/forestry/energy/gui/GuiEnginePeat.java b/src/main/java/forestry/energy/gui/GuiEnginePeat.java index 81202aa86..c85d7ace5 100644 --- a/src/main/java/forestry/energy/gui/GuiEnginePeat.java +++ b/src/main/java/forestry/energy/gui/GuiEnginePeat.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.core.config.Constants; import forestry.energy.tiles.TileEnginePeat; -import net.minecraft.entity.player.InventoryPlayer; public class GuiEnginePeat extends GuiEngine { diff --git a/src/main/java/forestry/energy/gui/GuiGenerator.java b/src/main/java/forestry/energy/gui/GuiGenerator.java index 9bc2fb39c..adf6db493 100755 --- a/src/main/java/forestry/energy/gui/GuiGenerator.java +++ b/src/main/java/forestry/energy/gui/GuiGenerator.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.core.config.Constants; import forestry.core.gui.GuiForestryTitled; import forestry.core.gui.widgets.TankWidget; import forestry.energy.tiles.TileGenerator; -import net.minecraft.entity.player.InventoryPlayer; public class GuiGenerator extends GuiForestryTitled { diff --git a/src/main/java/forestry/energy/gui/widgets/BiogasSlot.java b/src/main/java/forestry/energy/gui/widgets/BiogasSlot.java index cb80b50b1..81b25f207 100644 --- a/src/main/java/forestry/energy/gui/widgets/BiogasSlot.java +++ b/src/main/java/forestry/energy/gui/widgets/BiogasSlot.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.gui.widgets; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.IFluidTank; + import forestry.core.gui.tooltips.ToolTip; import forestry.core.gui.widgets.ReservoirWidget; import forestry.core.gui.widgets.WidgetManager; import forestry.core.utils.StringUtil; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.IFluidTank; public class BiogasSlot extends ReservoirWidget { + public BiogasSlot(WidgetManager manager, int xPos, int yPos, int slot) { super(manager, xPos, yPos, slot); } diff --git a/src/main/java/forestry/energy/inventory/InventoryEngineBiogas.java b/src/main/java/forestry/energy/inventory/InventoryEngineBiogas.java index c33476429..bccf6c974 100644 --- a/src/main/java/forestry/energy/inventory/InventoryEngineBiogas.java +++ b/src/main/java/forestry/energy/inventory/InventoryEngineBiogas.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.inventory; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; + import forestry.core.fluids.FluidHelper; import forestry.core.inventory.InventoryAdapterTile; import forestry.energy.tiles.TileEngineBiogas; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; public class InventoryEngineBiogas extends InventoryAdapterTile { + public static final short SLOT_CAN = 0; public InventoryEngineBiogas(TileEngineBiogas engineBronze) { diff --git a/src/main/java/forestry/energy/inventory/InventoryEnginePeat.java b/src/main/java/forestry/energy/inventory/InventoryEnginePeat.java index 62f186a21..47ab88bf3 100644 --- a/src/main/java/forestry/energy/inventory/InventoryEnginePeat.java +++ b/src/main/java/forestry/energy/inventory/InventoryEnginePeat.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.inventory; +import net.minecraft.item.ItemStack; + import forestry.api.fuels.FuelManager; import forestry.core.inventory.InventoryAdapterTile; import forestry.core.utils.SlotUtil; import forestry.energy.tiles.TileEnginePeat; -import net.minecraft.item.ItemStack; public class InventoryEnginePeat extends InventoryAdapterTile { + public static final short SLOT_FUEL = 0; public static final short SLOT_WASTE_1 = 1; public static final short SLOT_WASTE_COUNT = 4; diff --git a/src/main/java/forestry/energy/inventory/InventoryGenerator.java b/src/main/java/forestry/energy/inventory/InventoryGenerator.java index 41bfe81f6..775f7ad39 100644 --- a/src/main/java/forestry/energy/inventory/InventoryGenerator.java +++ b/src/main/java/forestry/energy/inventory/InventoryGenerator.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.inventory; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; + import forestry.core.fluids.FluidHelper; import forestry.core.inventory.InventoryAdapterTile; import forestry.energy.tiles.TileGenerator; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; public class InventoryGenerator extends InventoryAdapterTile { + public static final short SLOT_CAN = 0; public InventoryGenerator(TileGenerator generator) { diff --git a/src/main/java/forestry/energy/proxy/ProxyEnergy.java b/src/main/java/forestry/energy/proxy/ProxyEnergy.java index 74539574f..660dd989a 100755 --- a/src/main/java/forestry/energy/proxy/ProxyEnergy.java +++ b/src/main/java/forestry/energy/proxy/ProxyEnergy.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.proxy; import forestry.core.render.IBlockRenderer; public class ProxyEnergy { + public IBlockRenderer getRenderDefaultEngine(String gfxBase) { return null; } diff --git a/src/main/java/forestry/energy/proxy/ProxyEnergyClient.java b/src/main/java/forestry/energy/proxy/ProxyEnergyClient.java index a49ca950a..21135c9ba 100644 --- a/src/main/java/forestry/energy/proxy/ProxyEnergyClient.java +++ b/src/main/java/forestry/energy/proxy/ProxyEnergyClient.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.proxy; diff --git a/src/main/java/forestry/energy/render/RenderEngine.java b/src/main/java/forestry/energy/render/RenderEngine.java index 84d3a3581..c2dbf2332 100755 --- a/src/main/java/forestry/energy/render/RenderEngine.java +++ b/src/main/java/forestry/energy/render/RenderEngine.java @@ -1,15 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.render; +import net.minecraft.client.model.ModelBase; +import net.minecraft.client.model.ModelRenderer; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.common.util.ForgeDirection; + +import org.lwjgl.opengl.GL11; + import forestry.core.config.Constants; import forestry.core.proxy.Proxies; import forestry.core.render.ForestryResource; @@ -17,13 +24,6 @@ import forestry.core.render.IBlockRenderer; import forestry.core.tiles.TemperatureState; import forestry.core.tiles.TileEngine; import forestry.core.utils.Log; -import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelRenderer; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ResourceLocation; -import net.minecraftforge.common.util.ForgeDirection; -import org.lwjgl.opengl.GL11; public class RenderEngine extends TileEntitySpecialRenderer implements IBlockRenderer { @@ -85,16 +85,13 @@ public class RenderEngine extends TileEntitySpecialRenderer implements IBlockRen public RenderEngine(String baseTexture) { this(); - textures = new ResourceLocation[] { - new ForestryResource(baseTexture + "base.png"), - new ForestryResource(baseTexture + "piston.png"), - new ForestryResource(baseTexture + "extension.png"), - new ForestryResource(Constants.TEXTURE_PATH_BLOCKS + "/engine_trunk_highest.png"), - new ForestryResource(Constants.TEXTURE_PATH_BLOCKS + "/engine_trunk_higher.png"), - new ForestryResource(Constants.TEXTURE_PATH_BLOCKS + "/engine_trunk_high.png"), - new ForestryResource(Constants.TEXTURE_PATH_BLOCKS + "/engine_trunk_medium.png"), - new ForestryResource(Constants.TEXTURE_PATH_BLOCKS + "/engine_trunk_low.png"), - }; + textures = new ResourceLocation[] { new ForestryResource(baseTexture + "base.png"), + new ForestryResource(baseTexture + "piston.png"), new ForestryResource(baseTexture + "extension.png"), + new ForestryResource(Constants.TEXTURE_PATH_BLOCKS + "/engine_trunk_highest.png"), + new ForestryResource(Constants.TEXTURE_PATH_BLOCKS + "/engine_trunk_higher.png"), + new ForestryResource(Constants.TEXTURE_PATH_BLOCKS + "/engine_trunk_high.png"), + new ForestryResource(Constants.TEXTURE_PATH_BLOCKS + "/engine_trunk_medium.png"), + new ForestryResource(Constants.TEXTURE_PATH_BLOCKS + "/engine_trunk_low.png"), }; } @Override @@ -112,8 +109,8 @@ public class RenderEngine extends TileEntitySpecialRenderer implements IBlockRen } } - private void render( - TemperatureState state, float progress, ForgeDirection orientation, double x, double y, double z) { + private void render(TemperatureState state, float progress, ForgeDirection orientation, double x, double y, + double z) { GL11.glPushMatrix(); GL11.glPushAttrib(GL11.GL_ENABLE_BIT); @@ -134,8 +131,8 @@ public class RenderEngine extends TileEntitySpecialRenderer implements IBlockRen float tfactor = step / 16; - float[] angle = {0, 0, 0}; - float[] translate = {orientation.offsetX, orientation.offsetY, orientation.offsetZ}; + float[] angle = { 0, 0, 0 }; + float[] translate = { orientation.offsetX, orientation.offsetY, orientation.offsetZ }; switch (orientation) { case EAST: diff --git a/src/main/java/forestry/energy/tiles/EngineDefinition.java b/src/main/java/forestry/energy/tiles/EngineDefinition.java index 9919256ad..786c36593 100644 --- a/src/main/java/forestry/energy/tiles/EngineDefinition.java +++ b/src/main/java/forestry/energy/tiles/EngineDefinition.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.tiles; +import net.minecraft.world.IBlockAccess; + import forestry.core.blocks.IMachinePropertiesTESR; import forestry.core.tiles.MachineDefinition; import forestry.core.tiles.TileEngine; import forestry.core.tiles.TileUtil; -import net.minecraft.world.IBlockAccess; public class EngineDefinition extends MachineDefinition { diff --git a/src/main/java/forestry/energy/tiles/InventoryEngineElectric.java b/src/main/java/forestry/energy/tiles/InventoryEngineElectric.java index 9dea8bf51..df24df254 100644 --- a/src/main/java/forestry/energy/tiles/InventoryEngineElectric.java +++ b/src/main/java/forestry/energy/tiles/InventoryEngineElectric.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.tiles; -import forestry.core.inventory.InventoryAdapterTile; -import ic2.api.item.ElectricItem; import net.minecraft.item.ItemStack; +import forestry.core.inventory.InventoryAdapterTile; +import ic2.api.item.ElectricItem; + public class InventoryEngineElectric extends InventoryAdapterTile { + public static final short SLOT_BATTERY = 0; public InventoryEngineElectric(TileEngineElectric engineTin) { diff --git a/src/main/java/forestry/energy/tiles/TileEngineBiogas.java b/src/main/java/forestry/energy/tiles/TileEngineBiogas.java index be9dbdf75..6c9cb6ca3 100644 --- a/src/main/java/forestry/energy/tiles/TileEngineBiogas.java +++ b/src/main/java/forestry/energy/tiles/TileEngineBiogas.java @@ -1,15 +1,27 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.tiles; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + import forestry.api.core.IErrorLogic; import forestry.api.fuels.EngineBronzeFuel; import forestry.api.fuels.FuelManager; @@ -27,20 +39,9 @@ import forestry.core.tiles.TileEngine; import forestry.energy.gui.ContainerEngineBiogas; import forestry.energy.gui.GuiEngineBiogas; import forestry.energy.inventory.InventoryEngineBiogas; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; public class TileEngineBiogas extends TileEngine implements ISidedInventory, ILiquidTankTile, IFluidHandler { + private final FilteredTank fuelTank; private final FilteredTank heatingTank; private final StandardTank burnTank; diff --git a/src/main/java/forestry/energy/tiles/TileEngineClockwork.java b/src/main/java/forestry/energy/tiles/TileEngineClockwork.java index 102db4580..32bebebfc 100644 --- a/src/main/java/forestry/energy/tiles/TileEngineClockwork.java +++ b/src/main/java/forestry/energy/tiles/TileEngineClockwork.java @@ -1,19 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.tiles; -import forestry.core.config.Constants; -import forestry.core.tiles.TemperatureState; -import forestry.core.tiles.TileEngine; -import forestry.core.utils.DamageSourceForestry; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.inventory.Container; @@ -21,6 +15,11 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.common.util.FakePlayer; +import forestry.core.config.Constants; +import forestry.core.tiles.TemperatureState; +import forestry.core.tiles.TileEngine; +import forestry.core.utils.DamageSourceForestry; + public class TileEngineClockwork extends TileEngine { private static final float WIND_EXHAUSTION = 0.05f; @@ -31,8 +30,8 @@ public class TileEngineClockwork extends TileEngine { private static final int ENGINE_CLOCKWORK_ENERGY_PER_CYCLE = 2; private static final float ENGINE_CLOCKWORK_WIND_MAX = 8f; - private static final DamageSourceForestry damageSourceEngineClockwork = - new DamageSourceForestry("engine.clockwork"); + private static final DamageSourceForestry damageSourceEngineClockwork = new DamageSourceForestry( + "engine.clockwork"); private float tension = 0.0f; private short delay = 0; diff --git a/src/main/java/forestry/energy/tiles/TileEngineElectric.java b/src/main/java/forestry/energy/tiles/TileEngineElectric.java index 441a0c5ba..77658516f 100644 --- a/src/main/java/forestry/energy/tiles/TileEngineElectric.java +++ b/src/main/java/forestry/energy/tiles/TileEngineElectric.java @@ -1,15 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.tiles; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import forestry.api.circuits.ChipsetManager; import forestry.api.circuits.CircuitSocketType; import forestry.api.circuits.ICircuitBoard; @@ -28,15 +35,9 @@ import forestry.energy.gui.ContainerEngineElectric; import forestry.energy.gui.GuiEngineElectric; import forestry.plugins.compat.PluginIC2; import ic2.api.energy.prefab.BasicSink; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class TileEngineElectric extends TileEngine implements ISocketable, IInventory, IStreamableGui { + protected static class EuConfig { public int euForCycle; diff --git a/src/main/java/forestry/energy/tiles/TileEnginePeat.java b/src/main/java/forestry/energy/tiles/TileEnginePeat.java index 1de97b698..36216c9bc 100644 --- a/src/main/java/forestry/energy/tiles/TileEnginePeat.java +++ b/src/main/java/forestry/energy/tiles/TileEnginePeat.java @@ -1,15 +1,27 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.tiles; +import java.util.Collection; +import java.util.LinkedList; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import buildcraft.api.statements.ITriggerExternal; import cpw.mods.fml.common.Optional; import cpw.mods.fml.common.registry.GameData; @@ -27,20 +39,9 @@ import forestry.energy.gui.GuiEnginePeat; import forestry.energy.inventory.InventoryEnginePeat; import forestry.factory.triggers.FactoryTriggers; import forestry.plugins.PluginCore; -import java.util.Collection; -import java.util.LinkedList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class TileEnginePeat extends TileEngine implements ISidedInventory { + private Item fuelItem; private int fuelItemMeta; private int burnTime; @@ -100,8 +101,7 @@ public class TileEnginePeat extends TileEngine implements ISidedInventory { dumpStash(); int fuelSlot = getFuelSlot(); - boolean hasFuel = - fuelSlot >= 0 && determineBurnDuration(getInternalInventory().getStackInSlot(fuelSlot)) > 0; + boolean hasFuel = fuelSlot >= 0 && determineBurnDuration(getInternalInventory().getStackInSlot(fuelSlot)) > 0; getErrorLogic().setCondition(!hasFuel, EnumErrorCode.NO_FUEL); } @@ -260,8 +260,7 @@ public class TileEnginePeat extends TileEngine implements ISidedInventory { IInventoryAdapter inventory = getInternalInventory(); return ((float) inventory.getStackInSlot(fuelSlot).stackSize - / (float) inventory.getStackInSlot(fuelSlot).getMaxStackSize()) - > percentage; + / (float) inventory.getStackInSlot(fuelSlot).getMaxStackSize()) > percentage; } // / LOADING AND SAVING @@ -288,8 +287,7 @@ public class TileEnginePeat extends TileEngine implements ISidedInventory { super.writeToNBT(nbttagcompound); if (fuelItem != null) { - nbttagcompound.setString( - "EngineFuelItem", GameData.getItemRegistry().getNameForObject(fuelItem)); + nbttagcompound.setString("EngineFuelItem", GameData.getItemRegistry().getNameForObject(fuelItem)); } nbttagcompound.setInteger("EngineFuelMeta", fuelItemMeta); diff --git a/src/main/java/forestry/energy/tiles/TileGenerator.java b/src/main/java/forestry/energy/tiles/TileGenerator.java index 0ce2b54d9..22ca35d48 100644 --- a/src/main/java/forestry/energy/tiles/TileGenerator.java +++ b/src/main/java/forestry/energy/tiles/TileGenerator.java @@ -1,15 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.energy.tiles; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + import forestry.api.core.IErrorLogic; import forestry.api.fuels.FuelManager; import forestry.api.fuels.GeneratorFuel; @@ -29,20 +40,10 @@ import forestry.energy.gui.GuiGenerator; import forestry.energy.inventory.InventoryGenerator; import forestry.plugins.compat.PluginIC2; import ic2.api.energy.prefab.BasicSource; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; public class TileGenerator extends TileBase implements ISidedInventory, ILiquidTankTile, IFluidHandler, IRenderableTile { + private static final int maxEnergy = 30000; private final TankManager tankManager; @@ -133,8 +134,7 @@ public class TileGenerator extends TileBase ic2EnergySource.updateEntity(); if (resourceTank.getFluidAmount() > 0) { - GeneratorFuel fuel = - FuelManager.generatorFuel.get(resourceTank.getFluid().getFluid()); + GeneratorFuel fuel = FuelManager.generatorFuel.get(resourceTank.getFluid().getFluid()); if (resourceTank.canDrain(fuel.fuelConsumed) && ic2EnergySource.getFreeCapacity() >= fuel.eu) { ic2EnergySource.addEnergy(fuel.eu); this.tickCount++; diff --git a/src/main/java/forestry/factory/DummyManagers.java b/src/main/java/forestry/factory/DummyManagers.java index 88547ef13..d84047973 100644 --- a/src/main/java/forestry/factory/DummyManagers.java +++ b/src/main/java/forestry/factory/DummyManagers.java @@ -1,17 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory; +import java.util.Map; +import java.util.Set; + +import javax.annotation.Nullable; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableSet; + import forestry.api.recipes.ICarpenterManager; import forestry.api.recipes.ICarpenterRecipe; import forestry.api.recipes.ICentrifugeManager; @@ -30,15 +37,11 @@ import forestry.api.recipes.ISqueezerManager; import forestry.api.recipes.ISqueezerRecipe; import forestry.api.recipes.IStillManager; import forestry.api.recipes.IStillRecipe; -import java.util.Map; -import java.util.Set; -import javax.annotation.Nullable; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class DummyManagers { public abstract static class DummyCraftingProvider implements ICraftingProvider { + @Override public boolean addRecipe(T recipe) { return false; @@ -70,8 +73,8 @@ public class DummyManagers { public void addRecipe(int packagingTime, ItemStack box, ItemStack product, Object... materials) {} @Override - public void addRecipe( - int packagingTime, FluidStack liquid, ItemStack box, ItemStack product, Object... materials) {} + public void addRecipe(int packagingTime, FluidStack liquid, ItemStack box, ItemStack product, + Object... materials) {} } public static class DummyCentrifugeManager extends DummyCraftingProvider @@ -102,8 +105,8 @@ public class DummyManagers { implements IFermenterManager { @Override - public void addRecipe( - ItemStack resource, int fermentationValue, float modifier, FluidStack output, FluidStack liquid) {} + public void addRecipe(ItemStack resource, int fermentationValue, float modifier, FluidStack output, + FluidStack liquid) {} @Override public void addRecipe(ItemStack resource, int fermentationValue, float modifier, FluidStack output) {} @@ -120,15 +123,15 @@ public class DummyManagers { implements ISqueezerManager { @Override - public void addRecipe( - int timePerItem, ItemStack[] resources, FluidStack liquid, ItemStack remnants, int chance) {} + public void addRecipe(int timePerItem, ItemStack[] resources, FluidStack liquid, ItemStack remnants, + int chance) {} @Override public void addRecipe(int timePerItem, ItemStack[] resources, FluidStack liquid) {} @Override - public void addContainerRecipe( - int timePerItem, ItemStack emptyContainer, @Nullable ItemStack remnants, float chance) {} + public void addContainerRecipe(int timePerItem, ItemStack emptyContainer, @Nullable ItemStack remnants, + float chance) {} } public static class DummyStillManager extends DummyCraftingProvider implements IStillManager { diff --git a/src/main/java/forestry/factory/blocks/BlockFactoryPlain.java b/src/main/java/forestry/factory/blocks/BlockFactoryPlain.java index 4baeed21d..3c7f229c8 100644 --- a/src/main/java/forestry/factory/blocks/BlockFactoryPlain.java +++ b/src/main/java/forestry/factory/blocks/BlockFactoryPlain.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.blocks; import forestry.core.blocks.BlockBase; public class BlockFactoryPlain extends BlockBase { + public BlockFactoryPlain() { super(); } diff --git a/src/main/java/forestry/factory/blocks/BlockFactoryPlainType.java b/src/main/java/forestry/factory/blocks/BlockFactoryPlainType.java index debce92ad..9f20993b1 100644 --- a/src/main/java/forestry/factory/blocks/BlockFactoryPlainType.java +++ b/src/main/java/forestry/factory/blocks/BlockFactoryPlainType.java @@ -1,24 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.blocks; +import java.util.Locale; + +import org.apache.commons.lang3.text.WordUtils; + import forestry.core.blocks.IMachineProperties; import forestry.core.tiles.TileForestry; import forestry.factory.tiles.TileFabricator; import forestry.factory.tiles.TileRaintank; import forestry.factory.tiles.TileWorktable; -import java.util.Locale; -import org.apache.commons.lang3.text.WordUtils; public enum BlockFactoryPlainType implements IMachineProperties { + FABRICATOR(TileFabricator.class), RAINTANK(TileRaintank.class), WORKTABLE(TileWorktable.class); diff --git a/src/main/java/forestry/factory/blocks/BlockFactoryTESR.java b/src/main/java/forestry/factory/blocks/BlockFactoryTESR.java index 9543d577f..c4730f194 100644 --- a/src/main/java/forestry/factory/blocks/BlockFactoryTESR.java +++ b/src/main/java/forestry/factory/blocks/BlockFactoryTESR.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.blocks; import forestry.core.blocks.BlockBase; public class BlockFactoryTESR extends BlockBase { + public BlockFactoryTESR() { super(true); } diff --git a/src/main/java/forestry/factory/blocks/BlockFactoryTesrType.java b/src/main/java/forestry/factory/blocks/BlockFactoryTesrType.java index 64b6335d9..f7dd68a47 100644 --- a/src/main/java/forestry/factory/blocks/BlockFactoryTesrType.java +++ b/src/main/java/forestry/factory/blocks/BlockFactoryTesrType.java @@ -1,15 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.blocks; +import java.util.Locale; + +import org.apache.commons.lang3.text.WordUtils; + import forestry.core.blocks.IMachinePropertiesTESR; import forestry.core.config.Constants; import forestry.core.proxy.Proxies; @@ -23,10 +25,9 @@ import forestry.factory.tiles.TileMillRainmaker; import forestry.factory.tiles.TileMoistener; import forestry.factory.tiles.TileSqueezer; import forestry.factory.tiles.TileStill; -import java.util.Locale; -import org.apache.commons.lang3.text.WordUtils; public enum BlockFactoryTesrType implements IMachinePropertiesTESR { + BOTTLER(TileBottler.class), CARPENTER(TileCarpenter.class), CENTRIFUGE(TileCentrifuge.class), @@ -35,6 +36,7 @@ public enum BlockFactoryTesrType implements IMachinePropertiesTESR { SQUEEZER(TileSqueezer.class), STILL(TileStill.class), RAINMAKER(TileMillRainmaker.class) { + @Override public IBlockRenderer getRenderer() { return Proxies.render.getRenderMill(Constants.TEXTURE_PATH_BLOCKS + "/rainmaker_"); diff --git a/src/main/java/forestry/factory/blocks/BlockRegistryFactory.java b/src/main/java/forestry/factory/blocks/BlockRegistryFactory.java index 43431cf7b..414adf8d0 100644 --- a/src/main/java/forestry/factory/blocks/BlockRegistryFactory.java +++ b/src/main/java/forestry/factory/blocks/BlockRegistryFactory.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.blocks; @@ -15,6 +13,7 @@ import forestry.core.items.ItemBlockForestry; import forestry.core.items.ItemBlockNBT; public class BlockRegistryFactory extends BlockRegistry { + public final BlockFactoryTESR factoryTESR; public final BlockFactoryPlain factoryPlain; diff --git a/src/main/java/forestry/factory/circuits/CircuitSpeedUpgrade.java b/src/main/java/forestry/factory/circuits/CircuitSpeedUpgrade.java index 6ee876661..32d4a448b 100644 --- a/src/main/java/forestry/factory/circuits/CircuitSpeedUpgrade.java +++ b/src/main/java/forestry/factory/circuits/CircuitSpeedUpgrade.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.circuits; diff --git a/src/main/java/forestry/factory/gui/ContainerBottler.java b/src/main/java/forestry/factory/gui/ContainerBottler.java index 27b403551..cc436a4a4 100755 --- a/src/main/java/forestry/factory/gui/ContainerBottler.java +++ b/src/main/java/forestry/factory/gui/ContainerBottler.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.core.gui.ContainerLiquidTanks; import forestry.core.gui.slots.SlotFiltered; import forestry.core.gui.slots.SlotOutput; import forestry.factory.inventory.InventoryBottler; import forestry.factory.tiles.TileBottler; -import net.minecraft.entity.player.InventoryPlayer; public class ContainerBottler extends ContainerLiquidTanks { diff --git a/src/main/java/forestry/factory/gui/ContainerCarpenter.java b/src/main/java/forestry/factory/gui/ContainerCarpenter.java index 0af372415..705a74944 100755 --- a/src/main/java/forestry/factory/gui/ContainerCarpenter.java +++ b/src/main/java/forestry/factory/gui/ContainerCarpenter.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.gui; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + import forestry.core.gui.ContainerLiquidTanks; import forestry.core.gui.IContainerCrafting; import forestry.core.gui.slots.SlotCraftMatrix; @@ -19,10 +22,6 @@ import forestry.core.gui.slots.SlotOutput; import forestry.core.network.packets.PacketItemStackDisplay; import forestry.factory.inventory.InventoryCarpenter; import forestry.factory.tiles.TileCarpenter; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; public class ContainerCarpenter extends ContainerLiquidTanks implements IContainerCrafting { diff --git a/src/main/java/forestry/factory/gui/ContainerCentrifuge.java b/src/main/java/forestry/factory/gui/ContainerCentrifuge.java index c438cfddb..f7922c999 100755 --- a/src/main/java/forestry/factory/gui/ContainerCentrifuge.java +++ b/src/main/java/forestry/factory/gui/ContainerCentrifuge.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.core.gui.ContainerSocketed; import forestry.core.gui.slots.SlotFiltered; import forestry.core.gui.slots.SlotOutput; import forestry.factory.tiles.TileCentrifuge; -import net.minecraft.entity.player.InventoryPlayer; public class ContainerCentrifuge extends ContainerSocketed { diff --git a/src/main/java/forestry/factory/gui/ContainerFabricator.java b/src/main/java/forestry/factory/gui/ContainerFabricator.java index eb0e5850d..2987c16f1 100755 --- a/src/main/java/forestry/factory/gui/ContainerFabricator.java +++ b/src/main/java/forestry/factory/gui/ContainerFabricator.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.gui; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; + import forestry.core.gui.ContainerLiquidTanks; import forestry.core.gui.IContainerCrafting; import forestry.core.gui.slots.SlotCraftMatrix; @@ -18,10 +21,6 @@ import forestry.core.gui.slots.SlotOutput; import forestry.factory.inventory.InventoryFabricator; import forestry.factory.inventory.InventoryGhostCrafting; import forestry.factory.tiles.TileFabricator; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; public class ContainerFabricator extends ContainerLiquidTanks implements IContainerCrafting { @@ -48,12 +47,13 @@ public class ContainerFabricator extends ContainerLiquidTanks im // Crafting matrix for (int l = 0; l < 3; l++) { for (int k = 0; k < 3; k++) { - addSlotToContainer(new SlotCraftMatrix( - this, - tile.getCraftingInventory(), - InventoryGhostCrafting.SLOT_CRAFTING_1 + k + l * 3, - 67 + k * 18, - 17 + l * 18)); + addSlotToContainer( + new SlotCraftMatrix( + this, + tile.getCraftingInventory(), + InventoryGhostCrafting.SLOT_CRAFTING_1 + k + l * 3, + 67 + k * 18, + 17 + l * 18)); } } } diff --git a/src/main/java/forestry/factory/gui/ContainerFermenter.java b/src/main/java/forestry/factory/gui/ContainerFermenter.java index efcd58725..907a8160d 100755 --- a/src/main/java/forestry/factory/gui/ContainerFermenter.java +++ b/src/main/java/forestry/factory/gui/ContainerFermenter.java @@ -1,22 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.gui; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; + import forestry.core.gui.ContainerLiquidTanks; import forestry.core.gui.slots.SlotFiltered; import forestry.core.gui.slots.SlotOutput; import forestry.factory.inventory.InventoryFermenter; import forestry.factory.tiles.TileFermenter; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; public class ContainerFermenter extends ContainerLiquidTanks { diff --git a/src/main/java/forestry/factory/gui/ContainerMoistener.java b/src/main/java/forestry/factory/gui/ContainerMoistener.java index 1e4fc56db..80a2e2044 100755 --- a/src/main/java/forestry/factory/gui/ContainerMoistener.java +++ b/src/main/java/forestry/factory/gui/ContainerMoistener.java @@ -1,24 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.gui; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.IInventory; + import forestry.core.gui.ContainerLiquidTanks; import forestry.core.gui.slots.SlotFiltered; import forestry.core.gui.slots.SlotWatched; import forestry.core.gui.slots.SlotWorking; import forestry.core.inventory.watchers.ISlotChangeWatcher; import forestry.factory.tiles.TileMoistener; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.IInventory; public class ContainerMoistener extends ContainerLiquidTanks implements ISlotChangeWatcher { diff --git a/src/main/java/forestry/factory/gui/ContainerRaintank.java b/src/main/java/forestry/factory/gui/ContainerRaintank.java index 2d7c76077..71996308f 100755 --- a/src/main/java/forestry/factory/gui/ContainerRaintank.java +++ b/src/main/java/forestry/factory/gui/ContainerRaintank.java @@ -1,22 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.gui; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ICrafting; + import forestry.core.gui.ContainerLiquidTanks; import forestry.core.gui.slots.SlotFiltered; import forestry.core.gui.slots.SlotOutput; import forestry.factory.inventory.InventoryRaintank; import forestry.factory.tiles.TileRaintank; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ICrafting; public class ContainerRaintank extends ContainerLiquidTanks { diff --git a/src/main/java/forestry/factory/gui/ContainerSqueezer.java b/src/main/java/forestry/factory/gui/ContainerSqueezer.java index 925dbcdbf..1698cec64 100755 --- a/src/main/java/forestry/factory/gui/ContainerSqueezer.java +++ b/src/main/java/forestry/factory/gui/ContainerSqueezer.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.core.gui.ContainerLiquidTanksSocketed; import forestry.core.gui.slots.SlotFiltered; import forestry.core.gui.slots.SlotOutput; import forestry.factory.inventory.InventorySqueezer; import forestry.factory.tiles.TileSqueezer; -import net.minecraft.entity.player.InventoryPlayer; public class ContainerSqueezer extends ContainerLiquidTanksSocketed { diff --git a/src/main/java/forestry/factory/gui/ContainerStill.java b/src/main/java/forestry/factory/gui/ContainerStill.java index 025ceddf4..37f506a5c 100755 --- a/src/main/java/forestry/factory/gui/ContainerStill.java +++ b/src/main/java/forestry/factory/gui/ContainerStill.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.core.gui.ContainerLiquidTanks; import forestry.core.gui.slots.SlotFiltered; import forestry.core.gui.slots.SlotOutput; import forestry.factory.inventory.InventoryStill; import forestry.factory.tiles.TileStill; -import net.minecraft.entity.player.InventoryPlayer; public class ContainerStill extends ContainerLiquidTanks { diff --git a/src/main/java/forestry/factory/gui/ContainerWorktable.java b/src/main/java/forestry/factory/gui/ContainerWorktable.java index 108b15b12..ee19d2f58 100755 --- a/src/main/java/forestry/factory/gui/ContainerWorktable.java +++ b/src/main/java/forestry/factory/gui/ContainerWorktable.java @@ -1,15 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.gui; +import java.lang.reflect.Method; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + import cpw.mods.fml.common.gameevent.PlayerEvent; import forestry.core.gui.ContainerTile; import forestry.core.gui.IContainerCrafting; @@ -27,14 +33,9 @@ import forestry.factory.network.packets.PacketWorktableMemoryUpdate; import forestry.factory.network.packets.PacketWorktableRecipeUpdate; import forestry.factory.recipes.RecipeMemory; import forestry.factory.tiles.TileWorktable; -import java.lang.reflect.Method; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; public class ContainerWorktable extends ContainerTile implements IContainerCrafting, IGuiSelectable { + private static final Method craftingEventHandler; private static final Object craftingEventHandlerInstance; @@ -78,8 +79,12 @@ public class ContainerWorktable extends ContainerTile implements // Internal inventory for (int i = 0; i < 2; i++) { for (int k = 0; k < 9; k++) { - addSlotToContainer(new Slot( - internalInventory, InventoryWorktable.SLOT_INVENTORY_1 + k + i * 9, 8 + k * 18, 90 + i * 18)); + addSlotToContainer( + new Slot( + internalInventory, + InventoryWorktable.SLOT_INVENTORY_1 + k + i * 9, + 8 + k * 18, + 90 + i * 18)); } } diff --git a/src/main/java/forestry/factory/gui/GuiBottler.java b/src/main/java/forestry/factory/gui/GuiBottler.java index aefab401c..bbd10172e 100755 --- a/src/main/java/forestry/factory/gui/GuiBottler.java +++ b/src/main/java/forestry/factory/gui/GuiBottler.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.core.config.Constants; import forestry.core.gui.GuiForestryTitled; import forestry.core.gui.widgets.TankWidget; import forestry.factory.tiles.TileBottler; -import net.minecraft.entity.player.InventoryPlayer; public class GuiBottler extends GuiForestryTitled { diff --git a/src/main/java/forestry/factory/gui/GuiCarpenter.java b/src/main/java/forestry/factory/gui/GuiCarpenter.java index 5b8217c85..25667e50a 100755 --- a/src/main/java/forestry/factory/gui/GuiCarpenter.java +++ b/src/main/java/forestry/factory/gui/GuiCarpenter.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.core.config.Constants; import forestry.core.gui.GuiForestryTitled; import forestry.core.gui.widgets.TankWidget; import forestry.factory.tiles.TileCarpenter; -import net.minecraft.entity.player.InventoryPlayer; public class GuiCarpenter extends GuiForestryTitled { @@ -30,6 +29,11 @@ public class GuiCarpenter extends GuiForestryTitled { diff --git a/src/main/java/forestry/factory/gui/GuiFabricator.java b/src/main/java/forestry/factory/gui/GuiFabricator.java index e87a94433..1bb8c2647 100755 --- a/src/main/java/forestry/factory/gui/GuiFabricator.java +++ b/src/main/java/forestry/factory/gui/GuiFabricator.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.core.config.Constants; import forestry.core.gui.GuiForestryTitled; import forestry.core.gui.widgets.ReservoirWidget; import forestry.factory.tiles.TileFabricator; -import net.minecraft.entity.player.InventoryPlayer; public class GuiFabricator extends GuiForestryTitled { diff --git a/src/main/java/forestry/factory/gui/GuiFermenter.java b/src/main/java/forestry/factory/gui/GuiFermenter.java index e5f74dca9..d9aebb929 100755 --- a/src/main/java/forestry/factory/gui/GuiFermenter.java +++ b/src/main/java/forestry/factory/gui/GuiFermenter.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.core.config.Constants; import forestry.core.gui.GuiForestryTitled; import forestry.core.gui.widgets.TankWidget; import forestry.factory.tiles.TileFermenter; -import net.minecraft.entity.player.InventoryPlayer; public class GuiFermenter extends GuiForestryTitled { @@ -32,7 +31,12 @@ public class GuiFermenter extends GuiForestryTitled 0) { drawTexturedModalRect( - guiLeft + 98, guiTop + 46 + 17 - fuelRemain, 176, 78 + 17 - fuelRemain, 4, fuelRemain); + guiLeft + 98, + guiTop + 46 + 17 - fuelRemain, + 176, + 78 + 17 - fuelRemain, + 4, + fuelRemain); } // Raw bio mush remaining diff --git a/src/main/java/forestry/factory/gui/GuiMoistener.java b/src/main/java/forestry/factory/gui/GuiMoistener.java index d0e40b564..236b1b0e4 100755 --- a/src/main/java/forestry/factory/gui/GuiMoistener.java +++ b/src/main/java/forestry/factory/gui/GuiMoistener.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.core.config.Constants; import forestry.core.gui.GuiForestryTitled; import forestry.core.gui.widgets.TankWidget; import forestry.factory.tiles.TileMoistener; -import net.minecraft.entity.player.InventoryPlayer; public class GuiMoistener extends GuiForestryTitled { diff --git a/src/main/java/forestry/factory/gui/GuiRaintank.java b/src/main/java/forestry/factory/gui/GuiRaintank.java index c6c500167..d283a5106 100755 --- a/src/main/java/forestry/factory/gui/GuiRaintank.java +++ b/src/main/java/forestry/factory/gui/GuiRaintank.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.core.config.Constants; import forestry.core.gui.GuiForestryTitled; import forestry.core.gui.widgets.TankWidget; import forestry.factory.tiles.TileRaintank; -import net.minecraft.entity.player.InventoryPlayer; public class GuiRaintank extends GuiForestryTitled { diff --git a/src/main/java/forestry/factory/gui/GuiSqueezer.java b/src/main/java/forestry/factory/gui/GuiSqueezer.java index fed5f432a..9a4a75acd 100755 --- a/src/main/java/forestry/factory/gui/GuiSqueezer.java +++ b/src/main/java/forestry/factory/gui/GuiSqueezer.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.core.config.Constants; import forestry.core.gui.GuiForestryTitled; import forestry.core.gui.widgets.SocketWidget; import forestry.core.gui.widgets.TankWidget; import forestry.factory.tiles.TileSqueezer; -import net.minecraft.entity.player.InventoryPlayer; public class GuiSqueezer extends GuiForestryTitled { diff --git a/src/main/java/forestry/factory/gui/GuiStill.java b/src/main/java/forestry/factory/gui/GuiStill.java index a65b37d82..45b56079d 100755 --- a/src/main/java/forestry/factory/gui/GuiStill.java +++ b/src/main/java/forestry/factory/gui/GuiStill.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.core.config.Constants; import forestry.core.gui.GuiForestryTitled; import forestry.core.gui.widgets.TankWidget; import forestry.factory.tiles.TileStill; -import net.minecraft.entity.player.InventoryPlayer; public class GuiStill extends GuiForestryTitled { @@ -34,7 +33,12 @@ public class GuiStill extends GuiForestryTitled { if (still.getWorkCounter() > 0) { int massRemaining = still.getProgressScaled(16); drawTexturedModalRect( - guiLeft + 84, guiTop + 17 + massRemaining, 176, 74 + massRemaining, 4, 17 - massRemaining); + guiLeft + 84, + guiTop + 17 + massRemaining, + 176, + 74 + massRemaining, + 4, + 17 - massRemaining); } } } diff --git a/src/main/java/forestry/factory/gui/GuiWorktable.java b/src/main/java/forestry/factory/gui/GuiWorktable.java index ad9b281c1..b06eae6f4 100755 --- a/src/main/java/forestry/factory/gui/GuiWorktable.java +++ b/src/main/java/forestry/factory/gui/GuiWorktable.java @@ -1,15 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.gui; +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +import org.lwjgl.opengl.GL11; + import forestry.core.config.Constants; import forestry.core.gui.GuiForestryTitled; import forestry.core.gui.buttons.GuiBetterButton; @@ -24,13 +29,9 @@ import forestry.factory.inventory.InventoryGhostCrafting; import forestry.factory.recipes.MemorizedRecipe; import forestry.factory.recipes.RecipeMemory; import forestry.factory.tiles.TileWorktable; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import org.lwjgl.opengl.GL11; public class GuiWorktable extends GuiForestryTitled { + private static final int SPACING = 18; private boolean hasRecipeConflict = false; @@ -46,8 +47,12 @@ public class GuiWorktable extends GuiForestryTitled { + public static final short SLOT_INPUT_EMPTY_CAN = 0; public static final short SLOT_OUTPUT = 1; public static final short SLOT_INPUT_FULL_CAN = 2; diff --git a/src/main/java/forestry/factory/inventory/InventoryCarpenter.java b/src/main/java/forestry/factory/inventory/InventoryCarpenter.java index d57b78a6a..b45970908 100644 --- a/src/main/java/forestry/factory/inventory/InventoryCarpenter.java +++ b/src/main/java/forestry/factory/inventory/InventoryCarpenter.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.inventory; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; + import forestry.core.fluids.FluidHelper; import forestry.core.inventory.InventoryAdapterTile; import forestry.core.utils.SlotUtil; import forestry.factory.recipes.CarpenterRecipeManager; import forestry.factory.tiles.TileCarpenter; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; public class InventoryCarpenter extends InventoryAdapterTile { + public static final int SLOT_BOX = 9; public static final int SLOT_PRODUCT = 10; public static final int SLOT_PRODUCT_COUNT = 1; diff --git a/src/main/java/forestry/factory/inventory/InventoryCentrifuge.java b/src/main/java/forestry/factory/inventory/InventoryCentrifuge.java index 74b9c1177..016687726 100644 --- a/src/main/java/forestry/factory/inventory/InventoryCentrifuge.java +++ b/src/main/java/forestry/factory/inventory/InventoryCentrifuge.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.inventory; +import net.minecraft.item.ItemStack; + import forestry.core.inventory.InventoryAdapterTile; import forestry.core.utils.SlotUtil; import forestry.factory.recipes.CentrifugeRecipeManager; import forestry.factory.tiles.TileCentrifuge; -import net.minecraft.item.ItemStack; public class InventoryCentrifuge extends InventoryAdapterTile { + public static final int SLOT_RESOURCE = 0; public static final int SLOT_PRODUCT_1 = 1; public static final int SLOT_PRODUCT_COUNT = 9; diff --git a/src/main/java/forestry/factory/inventory/InventoryCraftingForestry.java b/src/main/java/forestry/factory/inventory/InventoryCraftingForestry.java index 412dba030..6079fffd7 100644 --- a/src/main/java/forestry/factory/inventory/InventoryCraftingForestry.java +++ b/src/main/java/forestry/factory/inventory/InventoryCraftingForestry.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.inventory; -import forestry.core.gui.ContainerDummy; -import forestry.factory.gui.ContainerWorktable; import net.minecraft.inventory.InventoryCrafting; +import forestry.core.gui.ContainerDummy; +import forestry.factory.gui.ContainerWorktable; + public class InventoryCraftingForestry extends InventoryCrafting { + public InventoryCraftingForestry(ContainerWorktable containerWorktable) { super(containerWorktable, 3, 3); } diff --git a/src/main/java/forestry/factory/inventory/InventoryFabricator.java b/src/main/java/forestry/factory/inventory/InventoryFabricator.java index 500ad44c3..3582d4146 100644 --- a/src/main/java/forestry/factory/inventory/InventoryFabricator.java +++ b/src/main/java/forestry/factory/inventory/InventoryFabricator.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.inventory; +import net.minecraft.item.ItemStack; + import forestry.core.inventory.InventoryAdapterTile; import forestry.core.utils.SlotUtil; import forestry.factory.recipes.FabricatorRecipeManager; import forestry.factory.recipes.FabricatorSmeltingRecipeManager; import forestry.factory.tiles.TileFabricator; -import net.minecraft.item.ItemStack; public class InventoryFabricator extends InventoryAdapterTile { + public static final short SLOT_METAL = 0; public static final short SLOT_PLAN = 1; public static final short SLOT_RESULT = 2; diff --git a/src/main/java/forestry/factory/inventory/InventoryFermenter.java b/src/main/java/forestry/factory/inventory/InventoryFermenter.java index 6a7cc3bad..70e8c128b 100644 --- a/src/main/java/forestry/factory/inventory/InventoryFermenter.java +++ b/src/main/java/forestry/factory/inventory/InventoryFermenter.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.inventory; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; + import forestry.api.fuels.FuelManager; import forestry.core.fluids.FluidHelper; import forestry.core.inventory.InventoryAdapterTile; import forestry.factory.recipes.FermenterRecipeManager; import forestry.factory.tiles.TileFermenter; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; public class InventoryFermenter extends InventoryAdapterTile { + public static final short SLOT_RESOURCE = 0; public static final short SLOT_FUEL = 1; public static final short SLOT_CAN_OUTPUT = 2; diff --git a/src/main/java/forestry/factory/inventory/InventoryGhostCrafting.java b/src/main/java/forestry/factory/inventory/InventoryGhostCrafting.java index 3dc515a59..19031d0da 100644 --- a/src/main/java/forestry/factory/inventory/InventoryGhostCrafting.java +++ b/src/main/java/forestry/factory/inventory/InventoryGhostCrafting.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.inventory; -import forestry.core.access.IRestrictedAccess; -import forestry.core.inventory.InventoryAdapterTile; import net.minecraft.tileentity.TileEntity; +import forestry.core.access.IRestrictedAccess; +import forestry.core.inventory.InventoryAdapterTile; + public class InventoryGhostCrafting extends InventoryAdapterTile { + public static final int SLOT_CRAFTING_1 = 0; public static final int SLOT_CRAFTING_COUNT = 9; public static final int SLOT_CRAFTING_RESULT = 9; diff --git a/src/main/java/forestry/factory/inventory/InventoryMoistener.java b/src/main/java/forestry/factory/inventory/InventoryMoistener.java index afbaf2b8d..771fa3104 100644 --- a/src/main/java/forestry/factory/inventory/InventoryMoistener.java +++ b/src/main/java/forestry/factory/inventory/InventoryMoistener.java @@ -1,25 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.inventory; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; + import forestry.api.fuels.FuelManager; import forestry.core.fluids.FluidHelper; import forestry.core.inventory.InventoryAdapterTile; import forestry.core.utils.SlotUtil; import forestry.factory.recipes.MoistenerRecipeManager; import forestry.factory.tiles.TileMoistener; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; public class InventoryMoistener extends InventoryAdapterTile { + public static final short SLOT_STASH_1 = 0; public static final short SLOT_STASH_COUNT = 6; public static final short SLOT_RESERVOIR_1 = 6; diff --git a/src/main/java/forestry/factory/inventory/InventoryRainmaker.java b/src/main/java/forestry/factory/inventory/InventoryRainmaker.java index f03e81260..21290d418 100644 --- a/src/main/java/forestry/factory/inventory/InventoryRainmaker.java +++ b/src/main/java/forestry/factory/inventory/InventoryRainmaker.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.inventory; +import net.minecraft.item.ItemStack; + import forestry.api.fuels.FuelManager; import forestry.api.fuels.RainSubstrate; import forestry.core.inventory.InventoryAdapterTile; import forestry.factory.tiles.TileMillRainmaker; -import net.minecraft.item.ItemStack; public class InventoryRainmaker extends InventoryAdapterTile { + private static final int SLOT_SUBSTRATE = 0; public InventoryRainmaker(TileMillRainmaker tile) { diff --git a/src/main/java/forestry/factory/inventory/InventoryRaintank.java b/src/main/java/forestry/factory/inventory/InventoryRaintank.java index cd371ca0c..768170cd9 100644 --- a/src/main/java/forestry/factory/inventory/InventoryRaintank.java +++ b/src/main/java/forestry/factory/inventory/InventoryRaintank.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.inventory; +import net.minecraft.item.ItemStack; + import forestry.core.fluids.FluidHelper; import forestry.core.fluids.Fluids; import forestry.core.inventory.InventoryAdapterTile; import forestry.factory.tiles.TileRaintank; -import net.minecraft.item.ItemStack; public class InventoryRaintank extends InventoryAdapterTile { + public static final short SLOT_RESOURCE = 0; public static final short SLOT_PRODUCT = 1; diff --git a/src/main/java/forestry/factory/inventory/InventorySqueezer.java b/src/main/java/forestry/factory/inventory/InventorySqueezer.java index a370c7088..bdd52b32d 100644 --- a/src/main/java/forestry/factory/inventory/InventorySqueezer.java +++ b/src/main/java/forestry/factory/inventory/InventorySqueezer.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.inventory; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import forestry.core.fluids.FluidHelper; import forestry.core.fluids.TankManager; import forestry.core.inventory.InventoryAdapterTile; @@ -17,12 +20,9 @@ import forestry.core.inventory.wrappers.InventoryMapper; import forestry.core.utils.InventoryUtil; import forestry.factory.recipes.SqueezerRecipeManager; import forestry.factory.tiles.TileSqueezer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class InventorySqueezer extends InventoryAdapterTile { + public static final short SLOT_RESOURCE_1 = 0; public static final short SLOTS_RESOURCE_COUNT = 9; public static final short SLOT_REMNANT = 9; diff --git a/src/main/java/forestry/factory/inventory/InventoryStill.java b/src/main/java/forestry/factory/inventory/InventoryStill.java index d4ecc687b..8e3ec1cd1 100644 --- a/src/main/java/forestry/factory/inventory/InventoryStill.java +++ b/src/main/java/forestry/factory/inventory/InventoryStill.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.inventory; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; + import forestry.core.fluids.FluidHelper; import forestry.core.inventory.InventoryAdapterTile; import forestry.factory.tiles.TileStill; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; public class InventoryStill extends InventoryAdapterTile { + public static final short SLOT_PRODUCT = 0; public static final short SLOT_RESOURCE = 1; public static final short SLOT_CAN = 2; diff --git a/src/main/java/forestry/factory/inventory/InventoryWorktable.java b/src/main/java/forestry/factory/inventory/InventoryWorktable.java index 21610ae83..4a32e06c5 100644 --- a/src/main/java/forestry/factory/inventory/InventoryWorktable.java +++ b/src/main/java/forestry/factory/inventory/InventoryWorktable.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.inventory; +import net.minecraft.item.ItemStack; + import forestry.core.inventory.InventoryAdapterTile; import forestry.core.utils.SlotUtil; import forestry.factory.tiles.TileWorktable; -import net.minecraft.item.ItemStack; public class InventoryWorktable extends InventoryAdapterTile { + public static final short SLOT_INVENTORY_1 = 0; public static final short SLOT_INVENTORY_COUNT = 18; diff --git a/src/main/java/forestry/factory/network/PacketRegistryFactory.java b/src/main/java/forestry/factory/network/PacketRegistryFactory.java index e75210d90..49f93f35d 100644 --- a/src/main/java/forestry/factory/network/PacketRegistryFactory.java +++ b/src/main/java/forestry/factory/network/PacketRegistryFactory.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.network; @@ -16,6 +14,7 @@ import forestry.factory.network.packets.PacketWorktableNEISelect; import forestry.factory.network.packets.PacketWorktableRecipeUpdate; public class PacketRegistryFactory extends PacketRegistry { + @Override public void registerPackets() { registerServerPacket(new PacketWorktableNEISelect()); diff --git a/src/main/java/forestry/factory/network/packets/PacketWorktableMemoryUpdate.java b/src/main/java/forestry/factory/network/packets/PacketWorktableMemoryUpdate.java index 1b2ff4b7c..921440d29 100644 --- a/src/main/java/forestry/factory/network/packets/PacketWorktableMemoryUpdate.java +++ b/src/main/java/forestry/factory/network/packets/PacketWorktableMemoryUpdate.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; + import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IForestryPacketClient; @@ -18,9 +21,6 @@ import forestry.core.network.packets.PacketCoordinates; import forestry.core.proxy.Proxies; import forestry.factory.recipes.RecipeMemory; import forestry.factory.tiles.TileWorktable; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; public class PacketWorktableMemoryUpdate extends PacketCoordinates implements IForestryPacketClient { diff --git a/src/main/java/forestry/factory/network/packets/PacketWorktableNEISelect.java b/src/main/java/forestry/factory/network/packets/PacketWorktableNEISelect.java index f46b9dee3..7e35b6748 100644 --- a/src/main/java/forestry/factory/network/packets/PacketWorktableNEISelect.java +++ b/src/main/java/forestry/factory/network/packets/PacketWorktableNEISelect.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; + import forestry.core.gui.slots.SlotCraftMatrix; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.IForestryPacketServer; @@ -17,13 +20,12 @@ import forestry.core.network.PacketIdServer; import forestry.core.network.packets.PacketNBT; import forestry.core.recipes.nei.SetRecipeCommandHandler; import forestry.factory.gui.ContainerWorktable; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.nbt.NBTTagCompound; public class PacketWorktableNEISelect extends PacketNBT implements IForestryPacketServer { - private static final SetRecipeCommandHandler worktableNEISelectHandler = - new SetRecipeCommandHandler(ContainerWorktable.class, SlotCraftMatrix.class); + + private static final SetRecipeCommandHandler worktableNEISelectHandler = new SetRecipeCommandHandler( + ContainerWorktable.class, + SlotCraftMatrix.class); public PacketWorktableNEISelect() {} diff --git a/src/main/java/forestry/factory/network/packets/PacketWorktableRecipeUpdate.java b/src/main/java/forestry/factory/network/packets/PacketWorktableRecipeUpdate.java index aee775a14..5b993b0b0 100644 --- a/src/main/java/forestry/factory/network/packets/PacketWorktableRecipeUpdate.java +++ b/src/main/java/forestry/factory/network/packets/PacketWorktableRecipeUpdate.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; + import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IForestryPacketClient; @@ -18,14 +21,12 @@ import forestry.core.network.packets.PacketCoordinates; import forestry.core.proxy.Proxies; import forestry.factory.recipes.MemorizedRecipe; import forestry.factory.tiles.TileWorktable; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; /** * Used to sync the worktable crafting result from Server to Client. */ public class PacketWorktableRecipeUpdate extends PacketCoordinates implements IForestryPacketClient { + private MemorizedRecipe recipe; public PacketWorktableRecipeUpdate() {} diff --git a/src/main/java/forestry/factory/recipes/BottlerRecipe.java b/src/main/java/forestry/factory/recipes/BottlerRecipe.java index d02a2ba20..472e23bad 100644 --- a/src/main/java/forestry/factory/recipes/BottlerRecipe.java +++ b/src/main/java/forestry/factory/recipes/BottlerRecipe.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes; -import forestry.core.config.Constants; -import forestry.core.fluids.FluidHelper; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidContainerItem; +import forestry.core.config.Constants; +import forestry.core.fluids.FluidHelper; + public class BottlerRecipe { + public final FluidStack input; public final ItemStack empty; public final ItemStack filled; diff --git a/src/main/java/forestry/factory/recipes/CarpenterRecipe.java b/src/main/java/forestry/factory/recipes/CarpenterRecipe.java index 182ef1165..1600842e6 100644 --- a/src/main/java/forestry/factory/recipes/CarpenterRecipe.java +++ b/src/main/java/forestry/factory/recipes/CarpenterRecipe.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes; +import javax.annotation.Nullable; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import forestry.api.recipes.ICarpenterRecipe; import forestry.api.recipes.IDescriptiveRecipe; import forestry.core.recipes.ShapedRecipeCustom; -import javax.annotation.Nullable; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class CarpenterRecipe implements ICarpenterRecipe { @@ -29,8 +29,8 @@ public class CarpenterRecipe implements ICarpenterRecipe { private final ShapedRecipeCustom internal; - public CarpenterRecipe( - int packagingTime, @Nullable FluidStack liquid, @Nullable ItemStack box, ShapedRecipeCustom internal) { + public CarpenterRecipe(int packagingTime, @Nullable FluidStack liquid, @Nullable ItemStack box, + ShapedRecipeCustom internal) { this.packagingTime = packagingTime; this.liquid = liquid; this.box = box; diff --git a/src/main/java/forestry/factory/recipes/CarpenterRecipeManager.java b/src/main/java/forestry/factory/recipes/CarpenterRecipeManager.java index c025c20c9..4fbc4312b 100644 --- a/src/main/java/forestry/factory/recipes/CarpenterRecipeManager.java +++ b/src/main/java/forestry/factory/recipes/CarpenterRecipeManager.java @@ -1,30 +1,30 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + import forestry.api.recipes.ICarpenterManager; import forestry.api.recipes.ICarpenterRecipe; import forestry.api.recipes.IDescriptiveRecipe; import forestry.core.recipes.RecipeUtil; import forestry.core.recipes.ShapedRecipeCustom; import forestry.core.utils.ItemStackUtil; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; public class CarpenterRecipeManager implements ICarpenterManager { @@ -44,7 +44,10 @@ public class CarpenterRecipeManager implements ICarpenterManager { @Override public void addRecipe(int packagingTime, FluidStack liquid, ItemStack box, ItemStack product, Object materials[]) { ICarpenterRecipe recipe = new CarpenterRecipe( - packagingTime, liquid, box, ShapedRecipeCustom.createShapedRecipe(product, materials)); + packagingTime, + liquid, + box, + ShapedRecipeCustom.createShapedRecipe(product, materials)); addRecipe(recipe); } @@ -57,8 +60,8 @@ public class CarpenterRecipeManager implements ICarpenterManager { return null; } - public static boolean matches( - ICarpenterRecipe recipe, FluidStack resource, ItemStack item, IInventory inventoryCrafting) { + public static boolean matches(ICarpenterRecipe recipe, FluidStack resource, ItemStack item, + IInventory inventoryCrafting) { if (recipe == null) { return false; } @@ -133,7 +136,7 @@ public class CarpenterRecipeManager implements ICarpenterManager { for (ICarpenterRecipe recipe : recipes) { recipeList.put( recipe.getCraftingGridRecipe().getIngredients(), - new Object[] {recipe.getCraftingGridRecipe().getRecipeOutput()}); + new Object[] { recipe.getCraftingGridRecipe().getRecipeOutput() }); } return recipeList; diff --git a/src/main/java/forestry/factory/recipes/CentrifugeRecipe.java b/src/main/java/forestry/factory/recipes/CentrifugeRecipe.java index 9b321ea41..2cb699b70 100644 --- a/src/main/java/forestry/factory/recipes/CentrifugeRecipe.java +++ b/src/main/java/forestry/factory/recipes/CentrifugeRecipe.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes; -import com.google.common.collect.ImmutableMap; -import forestry.api.recipes.ICentrifugeRecipe; import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; import java.util.Random; + import net.minecraft.item.ItemStack; +import com.google.common.collect.ImmutableMap; +import forestry.api.recipes.ICentrifugeRecipe; + public class CentrifugeRecipe implements ICentrifugeRecipe { private final int processingTime; diff --git a/src/main/java/forestry/factory/recipes/CentrifugeRecipeManager.java b/src/main/java/forestry/factory/recipes/CentrifugeRecipeManager.java index c34846b54..7d9838d86 100644 --- a/src/main/java/forestry/factory/recipes/CentrifugeRecipeManager.java +++ b/src/main/java/forestry/factory/recipes/CentrifugeRecipeManager.java @@ -1,25 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes; -import forestry.api.recipes.ICentrifugeManager; -import forestry.api.recipes.ICentrifugeRecipe; -import forestry.core.utils.ItemStackUtil; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; + import net.minecraft.item.ItemStack; +import forestry.api.recipes.ICentrifugeManager; +import forestry.api.recipes.ICentrifugeRecipe; +import forestry.core.utils.ItemStackUtil; + public class CentrifugeRecipeManager implements ICentrifugeManager { private static final Set recipes = new HashSet<>(); @@ -66,7 +66,8 @@ public class CentrifugeRecipeManager implements ICentrifugeManager { for (ICentrifugeRecipe recipe : recipes) { Set productsKeys = recipe.getAllProducts().keySet(); - recipeList.put(new Object[] {recipe.getInput()}, productsKeys.toArray(new ItemStack[productsKeys.size()])); + recipeList + .put(new Object[] { recipe.getInput() }, productsKeys.toArray(new ItemStack[productsKeys.size()])); } return recipeList; diff --git a/src/main/java/forestry/factory/recipes/FabricatorRecipe.java b/src/main/java/forestry/factory/recipes/FabricatorRecipe.java index 5414e1769..fe96e78a0 100644 --- a/src/main/java/forestry/factory/recipes/FabricatorRecipe.java +++ b/src/main/java/forestry/factory/recipes/FabricatorRecipe.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes; +import javax.annotation.Nullable; + +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import forestry.api.recipes.IFabricatorRecipe; import forestry.core.recipes.RecipeUtil; import forestry.core.recipes.ShapedRecipeCustom; import forestry.core.utils.ItemStackUtil; -import javax.annotation.Nullable; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class FabricatorRecipe implements IFabricatorRecipe { diff --git a/src/main/java/forestry/factory/recipes/FabricatorRecipeManager.java b/src/main/java/forestry/factory/recipes/FabricatorRecipeManager.java index bb83b0824..689210f67 100644 --- a/src/main/java/forestry/factory/recipes/FabricatorRecipeManager.java +++ b/src/main/java/forestry/factory/recipes/FabricatorRecipeManager.java @@ -1,29 +1,29 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import forestry.api.recipes.IFabricatorManager; import forestry.api.recipes.IFabricatorRecipe; import forestry.api.recipes.RecipeManagers; import forestry.core.recipes.RecipeUtil; import forestry.core.recipes.ShapedRecipeCustom; import forestry.core.utils.ItemStackUtil; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class FabricatorRecipeManager implements IFabricatorManager { @@ -31,8 +31,10 @@ public class FabricatorRecipeManager implements IFabricatorManager { @Override public void addRecipe(ItemStack plan, FluidStack molten, ItemStack result, Object[] pattern) { - IFabricatorRecipe recipe = - new FabricatorRecipe(plan, molten, ShapedRecipeCustom.createShapedRecipe(result, pattern)); + IFabricatorRecipe recipe = new FabricatorRecipe( + plan, + molten, + ShapedRecipeCustom.createShapedRecipe(result, pattern)); addRecipe(recipe); } @@ -86,7 +88,7 @@ public class FabricatorRecipeManager implements IFabricatorManager { HashMap recipeList = new HashMap<>(); for (IFabricatorRecipe recipe : recipes) { - recipeList.put(recipe.getIngredients(), new Object[] {recipe.getRecipeOutput()}); + recipeList.put(recipe.getIngredients(), new Object[] { recipe.getRecipeOutput() }); } return recipeList; diff --git a/src/main/java/forestry/factory/recipes/FabricatorSmeltingRecipe.java b/src/main/java/forestry/factory/recipes/FabricatorSmeltingRecipe.java index 31ec2742b..006b943d1 100644 --- a/src/main/java/forestry/factory/recipes/FabricatorSmeltingRecipe.java +++ b/src/main/java/forestry/factory/recipes/FabricatorSmeltingRecipe.java @@ -1,19 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes; -import forestry.api.recipes.IFabricatorSmeltingRecipe; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import forestry.api.recipes.IFabricatorSmeltingRecipe; + public class FabricatorSmeltingRecipe implements IFabricatorSmeltingRecipe { private final ItemStack resource; diff --git a/src/main/java/forestry/factory/recipes/FabricatorSmeltingRecipeManager.java b/src/main/java/forestry/factory/recipes/FabricatorSmeltingRecipeManager.java index addb89212..4aed12988 100644 --- a/src/main/java/forestry/factory/recipes/FabricatorSmeltingRecipeManager.java +++ b/src/main/java/forestry/factory/recipes/FabricatorSmeltingRecipeManager.java @@ -1,28 +1,29 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes; -import forestry.api.recipes.IFabricatorSmeltingManager; -import forestry.api.recipes.IFabricatorSmeltingRecipe; -import forestry.core.utils.ItemStackUtil; import java.util.Collection; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; + import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import forestry.api.recipes.IFabricatorSmeltingManager; +import forestry.api.recipes.IFabricatorSmeltingRecipe; +import forestry.core.utils.ItemStackUtil; + public class FabricatorSmeltingRecipeManager implements IFabricatorSmeltingManager { + public static final Set recipes = new HashSet<>(); public static IFabricatorSmeltingRecipe findMatchingSmelting(ItemStack resource) { @@ -67,7 +68,7 @@ public class FabricatorSmeltingRecipeManager implements IFabricatorSmeltingManag HashMap recipeList = new HashMap<>(); for (IFabricatorSmeltingRecipe recipe : recipes) { - recipeList.put(new Object[] {recipe.getResource()}, new Object[] {recipe.getProduct()}); + recipeList.put(new Object[] { recipe.getResource() }, new Object[] { recipe.getProduct() }); } return recipeList; diff --git a/src/main/java/forestry/factory/recipes/FermenterRecipe.java b/src/main/java/forestry/factory/recipes/FermenterRecipe.java index 10d18c6b2..37f056ef6 100644 --- a/src/main/java/forestry/factory/recipes/FermenterRecipe.java +++ b/src/main/java/forestry/factory/recipes/FermenterRecipe.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes; -import forestry.api.recipes.IFermenterRecipe; -import forestry.core.fluids.Fluids; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; +import forestry.api.recipes.IFermenterRecipe; +import forestry.core.fluids.Fluids; + public class FermenterRecipe implements IFermenterRecipe { private final ItemStack resource; @@ -24,8 +23,8 @@ public class FermenterRecipe implements IFermenterRecipe { private final Fluid output; private final FluidStack fluidResource; - public FermenterRecipe( - ItemStack resource, int fermentationValue, float modifier, Fluid output, FluidStack fluidResource) { + public FermenterRecipe(ItemStack resource, int fermentationValue, float modifier, Fluid output, + FluidStack fluidResource) { // assume that fermenter recipes want to use Forestry's honey and not the legacy "fluid.honey" if (Fluids.LEGACY_HONEY.is(fluidResource)) { fluidResource = Fluids.HONEY.getFluid(fluidResource.amount); diff --git a/src/main/java/forestry/factory/recipes/FermenterRecipeManager.java b/src/main/java/forestry/factory/recipes/FermenterRecipeManager.java index dfa0fec8b..5b36b378d 100644 --- a/src/main/java/forestry/factory/recipes/FermenterRecipeManager.java +++ b/src/main/java/forestry/factory/recipes/FermenterRecipeManager.java @@ -1,28 +1,28 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes; -import forestry.api.recipes.IFermenterManager; -import forestry.api.recipes.IFermenterRecipe; -import forestry.core.fluids.Fluids; -import forestry.core.utils.ItemStackUtil; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; + import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; +import forestry.api.recipes.IFermenterManager; +import forestry.api.recipes.IFermenterRecipe; +import forestry.core.fluids.Fluids; +import forestry.core.utils.ItemStackUtil; + public class FermenterRecipeManager implements IFermenterManager { private static final Set recipes = new HashSet<>(); @@ -30,8 +30,8 @@ public class FermenterRecipeManager implements IFermenterManager { public static final Set recipeFluidOutputs = new HashSet<>(); @Override - public void addRecipe( - ItemStack resource, int fermentationValue, float modifier, FluidStack output, FluidStack liquid) { + public void addRecipe(ItemStack resource, int fermentationValue, float modifier, FluidStack output, + FluidStack liquid) { IFermenterRecipe recipe = new FermenterRecipe(resource, fermentationValue, modifier, output.getFluid(), liquid); addRecipe(recipe); } @@ -106,7 +106,8 @@ public class FermenterRecipeManager implements IFermenterManager { for (IFermenterRecipe recipe : recipes) { recipeList.put( - new Object[] {recipe.getResource(), recipe.getFluidResource()}, new Object[] {recipe.getOutput()}); + new Object[] { recipe.getResource(), recipe.getFluidResource() }, + new Object[] { recipe.getOutput() }); } return recipeList; diff --git a/src/main/java/forestry/factory/recipes/ISqueezerContainerRecipe.java b/src/main/java/forestry/factory/recipes/ISqueezerContainerRecipe.java index d1ce3e80d..535299c12 100644 --- a/src/main/java/forestry/factory/recipes/ISqueezerContainerRecipe.java +++ b/src/main/java/forestry/factory/recipes/ISqueezerContainerRecipe.java @@ -1,19 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes; -import forestry.api.recipes.ISqueezerRecipe; import net.minecraft.item.ItemStack; +import forestry.api.recipes.ISqueezerRecipe; + public interface ISqueezerContainerRecipe { + ItemStack getEmptyContainer(); int getProcessingTime(); diff --git a/src/main/java/forestry/factory/recipes/MemorizedRecipe.java b/src/main/java/forestry/factory/recipes/MemorizedRecipe.java index 43e904783..5cfa54ffd 100644 --- a/src/main/java/forestry/factory/recipes/MemorizedRecipe.java +++ b/src/main/java/forestry/factory/recipes/MemorizedRecipe.java @@ -1,15 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes; +import java.io.IOException; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + import forestry.api.core.INBTTagable; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; @@ -18,14 +24,9 @@ import forestry.core.recipes.RecipeUtil; import forestry.core.utils.InventoryUtil; import forestry.core.utils.ItemStackUtil; import forestry.factory.inventory.InventoryCraftingForestry; -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; public final class MemorizedRecipe implements INBTTagable, IStreamable { + private final InventoryCraftingForestry craftMatrix = new InventoryCraftingForestry(); private final List recipeOutputs = new ArrayList<>(); private int selectedRecipe; diff --git a/src/main/java/forestry/factory/recipes/MoistenerRecipe.java b/src/main/java/forestry/factory/recipes/MoistenerRecipe.java index d1903b44c..63ecd62db 100644 --- a/src/main/java/forestry/factory/recipes/MoistenerRecipe.java +++ b/src/main/java/forestry/factory/recipes/MoistenerRecipe.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes; -import forestry.api.recipes.IMoistenerRecipe; import net.minecraft.item.ItemStack; +import forestry.api.recipes.IMoistenerRecipe; + public class MoistenerRecipe implements IMoistenerRecipe { private final int timePerItem; diff --git a/src/main/java/forestry/factory/recipes/MoistenerRecipeManager.java b/src/main/java/forestry/factory/recipes/MoistenerRecipeManager.java index aac66ed78..78d511243 100644 --- a/src/main/java/forestry/factory/recipes/MoistenerRecipeManager.java +++ b/src/main/java/forestry/factory/recipes/MoistenerRecipeManager.java @@ -1,25 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes; -import forestry.api.recipes.IMoistenerManager; -import forestry.api.recipes.IMoistenerRecipe; -import forestry.core.utils.ItemStackUtil; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; + import net.minecraft.item.ItemStack; +import forestry.api.recipes.IMoistenerManager; +import forestry.api.recipes.IMoistenerRecipe; +import forestry.core.utils.ItemStackUtil; + public class MoistenerRecipeManager implements IMoistenerManager { private static final Set recipes = new HashSet<>(); @@ -73,7 +73,7 @@ public class MoistenerRecipeManager implements IMoistenerManager { HashMap recipeList = new HashMap<>(); for (IMoistenerRecipe recipe : recipes) { - recipeList.put(new ItemStack[] {recipe.getResource()}, new ItemStack[] {recipe.getProduct()}); + recipeList.put(new ItemStack[] { recipe.getResource() }, new ItemStack[] { recipe.getProduct() }); } return recipeList; diff --git a/src/main/java/forestry/factory/recipes/RecipeMemory.java b/src/main/java/forestry/factory/recipes/RecipeMemory.java index c24b1edfe..b4a0753c4 100644 --- a/src/main/java/forestry/factory/recipes/RecipeMemory.java +++ b/src/main/java/forestry/factory/recipes/RecipeMemory.java @@ -1,32 +1,33 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes; -import forestry.api.core.INBTTagable; -import forestry.core.network.DataInputStreamForestry; -import forestry.core.network.DataOutputStreamForestry; -import forestry.core.network.IStreamable; -import forestry.core.utils.Log; import java.io.IOException; import java.util.ArrayList; import java.util.LinkedList; import java.util.List; + import net.minecraft.item.Item; import net.minecraft.item.ItemMap; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.world.World; + import org.apache.logging.log4j.Level; +import forestry.api.core.INBTTagable; +import forestry.core.network.DataInputStreamForestry; +import forestry.core.network.DataOutputStreamForestry; +import forestry.core.network.IStreamable; +import forestry.core.utils.Log; + public class RecipeMemory implements INBTTagable, IStreamable { public static final int capacity = 9; diff --git a/src/main/java/forestry/factory/recipes/SqueezerContainerRecipe.java b/src/main/java/forestry/factory/recipes/SqueezerContainerRecipe.java index be67ade02..d6a510eb9 100644 --- a/src/main/java/forestry/factory/recipes/SqueezerContainerRecipe.java +++ b/src/main/java/forestry/factory/recipes/SqueezerContainerRecipe.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import forestry.api.recipes.ISqueezerRecipe; import forestry.core.fluids.FluidHelper; import forestry.core.utils.ItemStackUtil; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class SqueezerContainerRecipe implements ISqueezerContainerRecipe { @@ -23,8 +22,8 @@ public class SqueezerContainerRecipe implements ISqueezerContainerRecipe { private final ItemStack remnants; private final float remnantsChance; - public SqueezerContainerRecipe( - ItemStack emptyContainer, int processingTime, ItemStack remnants, float remnantsChance) { + public SqueezerContainerRecipe(ItemStack emptyContainer, int processingTime, ItemStack remnants, + float remnantsChance) { this.emptyContainer = emptyContainer; this.processingTime = processingTime; this.remnants = remnants; @@ -62,6 +61,10 @@ public class SqueezerContainerRecipe implements ISqueezerContainerRecipe { } ItemStack filledContainerCopy = ItemStackUtil.createSplitStack(filledContainer, 1); return new SqueezerRecipe( - processingTime, new ItemStack[] {filledContainerCopy}, fluidOutput, remnants, remnantsChance); + processingTime, + new ItemStack[] { filledContainerCopy }, + fluidOutput, + remnants, + remnantsChance); } } diff --git a/src/main/java/forestry/factory/recipes/SqueezerRecipe.java b/src/main/java/forestry/factory/recipes/SqueezerRecipe.java index 09072f6c9..ba78c971b 100644 --- a/src/main/java/forestry/factory/recipes/SqueezerRecipe.java +++ b/src/main/java/forestry/factory/recipes/SqueezerRecipe.java @@ -1,19 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes; -import forestry.api.recipes.ISqueezerRecipe; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; +import forestry.api.recipes.ISqueezerRecipe; + public class SqueezerRecipe implements ISqueezerRecipe { private final int processingTime; @@ -22,11 +21,7 @@ public class SqueezerRecipe implements ISqueezerRecipe { private final ItemStack remnants; private final float remnantsChance; - public SqueezerRecipe( - int processingTime, - ItemStack[] resources, - FluidStack fluidOutput, - ItemStack remnants, + public SqueezerRecipe(int processingTime, ItemStack[] resources, FluidStack fluidOutput, ItemStack remnants, float remnantsChance) { this.processingTime = processingTime; this.resources = resources; diff --git a/src/main/java/forestry/factory/recipes/SqueezerRecipeManager.java b/src/main/java/forestry/factory/recipes/SqueezerRecipeManager.java index e097c2626..51443a0b1 100644 --- a/src/main/java/forestry/factory/recipes/SqueezerRecipeManager.java +++ b/src/main/java/forestry/factory/recipes/SqueezerRecipeManager.java @@ -1,28 +1,29 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +import javax.annotation.Nullable; + +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import forestry.api.recipes.ISqueezerManager; import forestry.api.recipes.ISqueezerRecipe; import forestry.core.fluids.FluidHelper; import forestry.core.utils.ItemStackUtil; import forestry.core.utils.datastructures.ItemStackMap; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; -import javax.annotation.Nullable; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; public class SqueezerRecipeManager implements ISqueezerManager { @@ -30,8 +31,8 @@ public class SqueezerRecipeManager implements ISqueezerManager { public static final ItemStackMap containerRecipes = new ItemStackMap<>(); @Override - public void addRecipe( - int timePerItem, ItemStack[] resources, FluidStack liquid, @Nullable ItemStack remnants, int chance) { + public void addRecipe(int timePerItem, ItemStack[] resources, FluidStack liquid, @Nullable ItemStack remnants, + int chance) { ISqueezerRecipe recipe = new SqueezerRecipe(timePerItem, resources, liquid, remnants, chance / 100.0f); addRecipe(recipe); } @@ -42,10 +43,10 @@ public class SqueezerRecipeManager implements ISqueezerManager { } @Override - public void addContainerRecipe( - int timePerItem, ItemStack emptyContainer, @Nullable ItemStack remnants, float chance) { - containerRecipes.put( - emptyContainer, new SqueezerContainerRecipe(emptyContainer, timePerItem, remnants, chance)); + public void addContainerRecipe(int timePerItem, ItemStack emptyContainer, @Nullable ItemStack remnants, + float chance) { + containerRecipes + .put(emptyContainer, new SqueezerContainerRecipe(emptyContainer, timePerItem, remnants, chance)); } @Nullable @@ -123,7 +124,7 @@ public class SqueezerRecipeManager implements ISqueezerManager { HashMap recipeList = new HashMap<>(); for (ISqueezerRecipe recipe : recipes) { - recipeList.put(recipe.getResources(), new Object[] {recipe.getRemnants(), recipe.getFluidOutput()}); + recipeList.put(recipe.getResources(), new Object[] { recipe.getRemnants(), recipe.getFluidOutput() }); } return recipeList; diff --git a/src/main/java/forestry/factory/recipes/StillRecipe.java b/src/main/java/forestry/factory/recipes/StillRecipe.java index 0e5ec0044..0044350d5 100644 --- a/src/main/java/forestry/factory/recipes/StillRecipe.java +++ b/src/main/java/forestry/factory/recipes/StillRecipe.java @@ -1,19 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes; -import forestry.api.recipes.IStillRecipe; import net.minecraftforge.fluids.FluidStack; +import forestry.api.recipes.IStillRecipe; + public class StillRecipe implements IStillRecipe { + private final int timePerUnit; private final FluidStack input; private final FluidStack output; diff --git a/src/main/java/forestry/factory/recipes/StillRecipeManager.java b/src/main/java/forestry/factory/recipes/StillRecipeManager.java index 8af813b70..9adc4dcea 100644 --- a/src/main/java/forestry/factory/recipes/StillRecipeManager.java +++ b/src/main/java/forestry/factory/recipes/StillRecipeManager.java @@ -1,25 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes; -import forestry.api.recipes.IStillManager; -import forestry.api.recipes.IStillRecipe; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; + import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; +import forestry.api.recipes.IStillManager; +import forestry.api.recipes.IStillRecipe; + public class StillRecipeManager implements IStillManager { private static final Set recipes = new HashSet<>(); @@ -83,7 +83,7 @@ public class StillRecipeManager implements IStillManager { HashMap recipeList = new HashMap<>(); for (IStillRecipe recipe : recipes) { - recipeList.put(new Object[] {recipe.getInput()}, new Object[] {recipe.getOutput()}); + recipeList.put(new Object[] { recipe.getInput() }, new Object[] { recipe.getOutput() }); } return recipeList; diff --git a/src/main/java/forestry/factory/recipes/craftguide/CraftGuideBottler.java b/src/main/java/forestry/factory/recipes/craftguide/CraftGuideBottler.java index b5d386fb3..15876a58d 100644 --- a/src/main/java/forestry/factory/recipes/craftguide/CraftGuideBottler.java +++ b/src/main/java/forestry/factory/recipes/craftguide/CraftGuideBottler.java @@ -1,20 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes.craftguide; -import forestry.factory.blocks.BlockFactoryTesrType; -import forestry.factory.recipes.BottlerRecipe; -import forestry.plugins.PluginFactory; import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidContainerRegistry; + import uristqwerty.CraftGuide.api.ItemSlot; import uristqwerty.CraftGuide.api.LiquidSlot; import uristqwerty.CraftGuide.api.RecipeGenerator; @@ -22,6 +18,9 @@ import uristqwerty.CraftGuide.api.RecipeProvider; import uristqwerty.CraftGuide.api.RecipeTemplate; import uristqwerty.CraftGuide.api.Slot; import uristqwerty.CraftGuide.api.SlotType; +import forestry.factory.blocks.BlockFactoryTesrType; +import forestry.factory.recipes.BottlerRecipe; +import forestry.plugins.PluginFactory; public class CraftGuideBottler implements RecipeProvider { @@ -30,8 +29,7 @@ public class CraftGuideBottler implements RecipeProvider { public CraftGuideBottler() { slots[0] = new ItemSlot(12, 12, 16, 16).drawOwnBackground(); slots[1] = new LiquidSlot(12, 30); - slots[2] = - new ItemSlot(50, 21, 16, 16).setSlotType(SlotType.OUTPUT_SLOT).drawOwnBackground(); + slots[2] = new ItemSlot(50, 21, 16, 16).setSlotType(SlotType.OUTPUT_SLOT).drawOwnBackground(); slots[3] = new ItemSlot(31, 21, 16, 16).setSlotType(SlotType.MACHINE_SLOT); } @@ -44,8 +42,8 @@ public class CraftGuideBottler implements RecipeProvider { ItemStack machine = PluginFactory.blocks.factoryTESR.get(BlockFactoryTesrType.BOTTLER); RecipeTemplate template = generator.createRecipeTemplate(slots, machine); - for (FluidContainerRegistry.FluidContainerData container : - FluidContainerRegistry.getRegisteredFluidContainerData()) { + for (FluidContainerRegistry.FluidContainerData container : FluidContainerRegistry + .getRegisteredFluidContainerData()) { BottlerRecipe recipe = BottlerRecipe.getRecipe(container.fluid, container.emptyContainer); if (recipe != null) { Object[] array = new Object[4]; diff --git a/src/main/java/forestry/factory/recipes/craftguide/CraftGuideCarpenter.java b/src/main/java/forestry/factory/recipes/craftguide/CraftGuideCarpenter.java index d7ca376a2..1940facd8 100644 --- a/src/main/java/forestry/factory/recipes/craftguide/CraftGuideCarpenter.java +++ b/src/main/java/forestry/factory/recipes/craftguide/CraftGuideCarpenter.java @@ -1,21 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes.craftguide; -import forestry.api.recipes.ICarpenterRecipe; -import forestry.api.recipes.RecipeManagers; -import forestry.core.recipes.RecipeUtil; -import forestry.factory.blocks.BlockFactoryTesrType; -import forestry.plugins.PluginFactory; import net.minecraft.item.ItemStack; + import uristqwerty.CraftGuide.api.ItemSlot; import uristqwerty.CraftGuide.api.LiquidSlot; import uristqwerty.CraftGuide.api.RecipeGenerator; @@ -23,6 +17,11 @@ import uristqwerty.CraftGuide.api.RecipeProvider; import uristqwerty.CraftGuide.api.RecipeTemplate; import uristqwerty.CraftGuide.api.Slot; import uristqwerty.CraftGuide.api.SlotType; +import forestry.api.recipes.ICarpenterRecipe; +import forestry.api.recipes.RecipeManagers; +import forestry.core.recipes.RecipeUtil; +import forestry.factory.blocks.BlockFactoryTesrType; +import forestry.plugins.PluginFactory; public class CraftGuideCarpenter implements RecipeProvider { @@ -34,9 +33,7 @@ public class CraftGuideCarpenter implements RecipeProvider { slots[i + j * 3] = new ItemSlot(i * 18 + 3, j * 18 + 3, 16, 16).drawOwnBackground(); } } - slots[9] = new ItemSlot(59, 21, 16, 16, true) - .setSlotType(SlotType.OUTPUT_SLOT) - .drawOwnBackground(); + slots[9] = new ItemSlot(59, 21, 16, 16, true).setSlotType(SlotType.OUTPUT_SLOT).drawOwnBackground(); slots[10] = new LiquidSlot(59, 39); slots[11] = new ItemSlot(59, 3, 16, 16).setSlotType(SlotType.MACHINE_SLOT); } diff --git a/src/main/java/forestry/factory/recipes/craftguide/CraftGuideCentrifuge.java b/src/main/java/forestry/factory/recipes/craftguide/CraftGuideCentrifuge.java index 6f2f3f67e..d68bb97ec 100644 --- a/src/main/java/forestry/factory/recipes/craftguide/CraftGuideCentrifuge.java +++ b/src/main/java/forestry/factory/recipes/craftguide/CraftGuideCentrifuge.java @@ -1,23 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes.craftguide; -import forestry.api.recipes.ICentrifugeRecipe; -import forestry.api.recipes.RecipeManagers; -import forestry.factory.blocks.BlockFactoryTesrType; -import forestry.plugins.PluginFactory; import java.util.ArrayList; import java.util.List; import java.util.Map.Entry; + import net.minecraft.item.ItemStack; + import uristqwerty.CraftGuide.api.ChanceSlot; import uristqwerty.CraftGuide.api.ItemSlot; import uristqwerty.CraftGuide.api.RecipeGenerator; @@ -25,6 +21,10 @@ import uristqwerty.CraftGuide.api.RecipeProvider; import uristqwerty.CraftGuide.api.RecipeTemplate; import uristqwerty.CraftGuide.api.Slot; import uristqwerty.CraftGuide.api.SlotType; +import forestry.api.recipes.ICentrifugeRecipe; +import forestry.api.recipes.RecipeManagers; +import forestry.factory.blocks.BlockFactoryTesrType; +import forestry.plugins.PluginFactory; public class CraftGuideCentrifuge implements RecipeProvider { @@ -33,10 +33,8 @@ public class CraftGuideCentrifuge implements RecipeProvider { public CraftGuideCentrifuge() { for (int i = 0; i < 3; i++) { for (int j = 0; j < 3; j++) { - slots[i + j * 3] = new ChanceSlot(i * 18 + 24, j * 18 + 3, 16, 16) - .setRatio(100) - .setSlotType(SlotType.OUTPUT_SLOT) - .drawOwnBackground(); + slots[i + j * 3] = new ChanceSlot(i * 18 + 24, j * 18 + 3, 16, 16).setRatio(100) + .setSlotType(SlotType.OUTPUT_SLOT).drawOwnBackground(); } } slots[9] = new ItemSlot(4, 31, 16, 16, true).drawOwnBackground(); @@ -56,12 +54,11 @@ public class CraftGuideCentrifuge implements RecipeProvider { for (ICentrifugeRecipe recipe : RecipeManagers.centrifugeManager.recipes()) { Object[] array = new Object[11]; - List> entries = - new ArrayList<>(recipe.getAllProducts().entrySet()); + List> entries = new ArrayList<>(recipe.getAllProducts().entrySet()); for (int i = 0; i < Math.min(entries.size(), 9); i++) { Entry entry = entries.get(i); - array[i] = entry.getValue() > 0 ? new Object[] {entry.getKey(), entry.getValue()} : null; + array[i] = entry.getValue() > 0 ? new Object[] { entry.getKey(), entry.getValue() } : null; } array[9] = recipe.getInput(); diff --git a/src/main/java/forestry/factory/recipes/craftguide/CraftGuideFabricator.java b/src/main/java/forestry/factory/recipes/craftguide/CraftGuideFabricator.java index 3300b0973..2d5f3f5fd 100644 --- a/src/main/java/forestry/factory/recipes/craftguide/CraftGuideFabricator.java +++ b/src/main/java/forestry/factory/recipes/craftguide/CraftGuideFabricator.java @@ -1,20 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes.craftguide; -import forestry.api.recipes.IFabricatorRecipe; -import forestry.api.recipes.RecipeManagers; -import forestry.factory.blocks.BlockFactoryPlainType; -import forestry.plugins.PluginFactory; import net.minecraft.item.ItemStack; + import uristqwerty.CraftGuide.api.ItemSlot; import uristqwerty.CraftGuide.api.LiquidSlot; import uristqwerty.CraftGuide.api.RecipeGenerator; @@ -22,6 +17,10 @@ import uristqwerty.CraftGuide.api.RecipeProvider; import uristqwerty.CraftGuide.api.RecipeTemplate; import uristqwerty.CraftGuide.api.Slot; import uristqwerty.CraftGuide.api.SlotType; +import forestry.api.recipes.IFabricatorRecipe; +import forestry.api.recipes.RecipeManagers; +import forestry.factory.blocks.BlockFactoryPlainType; +import forestry.plugins.PluginFactory; public class CraftGuideFabricator implements RecipeProvider { @@ -33,9 +32,7 @@ public class CraftGuideFabricator implements RecipeProvider { slots[i + j * 3] = new ItemSlot(i * 18 + 3, j * 18 + 3, 16, 16).drawOwnBackground(); } } - slots[9] = new ItemSlot(59, 21, 16, 16, true) - .setSlotType(SlotType.OUTPUT_SLOT) - .drawOwnBackground(); + slots[9] = new ItemSlot(59, 21, 16, 16, true).setSlotType(SlotType.OUTPUT_SLOT).drawOwnBackground(); slots[10] = new LiquidSlot(59, 39); slots[11] = new ItemSlot(59, 3, 16, 16).setSlotType(SlotType.MACHINE_SLOT); } diff --git a/src/main/java/forestry/factory/recipes/craftguide/CraftGuideFermenter.java b/src/main/java/forestry/factory/recipes/craftguide/CraftGuideFermenter.java index a79aec3b4..73295ab3b 100644 --- a/src/main/java/forestry/factory/recipes/craftguide/CraftGuideFermenter.java +++ b/src/main/java/forestry/factory/recipes/craftguide/CraftGuideFermenter.java @@ -1,24 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes.craftguide; -import forestry.api.fuels.FuelManager; -import forestry.api.recipes.IFermenterRecipe; -import forestry.api.recipes.RecipeManagers; -import forestry.factory.blocks.BlockFactoryTesrType; -import forestry.plugins.PluginFactory; import java.util.ArrayList; import java.util.List; + import net.minecraft.item.ItemStack; import net.minecraftforge.fluids.FluidStack; + import uristqwerty.CraftGuide.api.ItemSlot; import uristqwerty.CraftGuide.api.LiquidSlot; import uristqwerty.CraftGuide.api.RecipeGenerator; @@ -26,6 +21,11 @@ import uristqwerty.CraftGuide.api.RecipeProvider; import uristqwerty.CraftGuide.api.RecipeTemplate; import uristqwerty.CraftGuide.api.Slot; import uristqwerty.CraftGuide.api.SlotType; +import forestry.api.fuels.FuelManager; +import forestry.api.recipes.IFermenterRecipe; +import forestry.api.recipes.RecipeManagers; +import forestry.factory.blocks.BlockFactoryTesrType; +import forestry.plugins.PluginFactory; public class CraftGuideFermenter implements RecipeProvider { diff --git a/src/main/java/forestry/factory/recipes/craftguide/CraftGuideSqueezer.java b/src/main/java/forestry/factory/recipes/craftguide/CraftGuideSqueezer.java index 47676605b..7ed366b5c 100644 --- a/src/main/java/forestry/factory/recipes/craftguide/CraftGuideSqueezer.java +++ b/src/main/java/forestry/factory/recipes/craftguide/CraftGuideSqueezer.java @@ -1,20 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes.craftguide; -import forestry.api.recipes.ISqueezerRecipe; -import forestry.api.recipes.RecipeManagers; -import forestry.factory.blocks.BlockFactoryTesrType; -import forestry.plugins.PluginFactory; import net.minecraft.item.ItemStack; + import uristqwerty.CraftGuide.api.ChanceSlot; import uristqwerty.CraftGuide.api.ItemSlot; import uristqwerty.CraftGuide.api.LiquidSlot; @@ -23,6 +18,10 @@ import uristqwerty.CraftGuide.api.RecipeProvider; import uristqwerty.CraftGuide.api.RecipeTemplate; import uristqwerty.CraftGuide.api.Slot; import uristqwerty.CraftGuide.api.SlotType; +import forestry.api.recipes.ISqueezerRecipe; +import forestry.api.recipes.RecipeManagers; +import forestry.factory.blocks.BlockFactoryTesrType; +import forestry.plugins.PluginFactory; public class CraftGuideSqueezer implements RecipeProvider { @@ -34,9 +33,7 @@ public class CraftGuideSqueezer implements RecipeProvider { slots[i + j * 3] = new ItemSlot(i * 18 + 3, j * 18 + 3, 16, 16).drawOwnBackground(); } } - slots[9] = new ChanceSlot(59, 39, 16, 16, true) - .setRatio(100) - .setSlotType(SlotType.OUTPUT_SLOT) + slots[9] = new ChanceSlot(59, 39, 16, 16, true).setRatio(100).setSlotType(SlotType.OUTPUT_SLOT) .drawOwnBackground(); slots[10] = new LiquidSlot(59, 21).setSlotType(SlotType.OUTPUT_SLOT); slots[11] = new ItemSlot(59, 3, 16, 16).setSlotType(SlotType.MACHINE_SLOT); @@ -58,7 +55,7 @@ public class CraftGuideSqueezer implements RecipeProvider { System.arraycopy(recipe.getResources(), 0, array, 0, recipe.getResources().length); if (recipe.getRemnants() != null) { array[9] = recipe.getRemnantsChance() > 0 - ? new Object[] {recipe.getRemnants().copy(), recipe.getRemnantsChance()} + ? new Object[] { recipe.getRemnants().copy(), recipe.getRemnantsChance() } : null; } if (recipe.getFluidOutput() != null) { diff --git a/src/main/java/forestry/factory/recipes/craftguide/CraftGuideStill.java b/src/main/java/forestry/factory/recipes/craftguide/CraftGuideStill.java index ad45c0d54..b5918c8d0 100644 --- a/src/main/java/forestry/factory/recipes/craftguide/CraftGuideStill.java +++ b/src/main/java/forestry/factory/recipes/craftguide/CraftGuideStill.java @@ -1,20 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes.craftguide; -import forestry.api.recipes.IStillRecipe; -import forestry.api.recipes.RecipeManagers; -import forestry.factory.blocks.BlockFactoryTesrType; -import forestry.plugins.PluginFactory; import net.minecraft.item.ItemStack; + import uristqwerty.CraftGuide.api.ItemSlot; import uristqwerty.CraftGuide.api.LiquidSlot; import uristqwerty.CraftGuide.api.RecipeGenerator; @@ -22,6 +17,10 @@ import uristqwerty.CraftGuide.api.RecipeProvider; import uristqwerty.CraftGuide.api.RecipeTemplate; import uristqwerty.CraftGuide.api.Slot; import uristqwerty.CraftGuide.api.SlotType; +import forestry.api.recipes.IStillRecipe; +import forestry.api.recipes.RecipeManagers; +import forestry.factory.blocks.BlockFactoryTesrType; +import forestry.plugins.PluginFactory; public class CraftGuideStill implements RecipeProvider { diff --git a/src/main/java/forestry/factory/recipes/nei/NEIHandlerBottler.java b/src/main/java/forestry/factory/recipes/nei/NEIHandlerBottler.java index f8b172d27..694104b17 100644 --- a/src/main/java/forestry/factory/recipes/nei/NEIHandlerBottler.java +++ b/src/main/java/forestry/factory/recipes/nei/NEIHandlerBottler.java @@ -1,15 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes.nei; +import java.awt.Point; +import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; +import net.minecraftforge.fluids.FluidStack; + import codechicken.lib.gui.GuiDraw; import codechicken.nei.NEIServerUtils; import codechicken.nei.PositionedStack; @@ -18,16 +28,6 @@ import forestry.core.recipes.nei.PositionedFluidTank; import forestry.core.recipes.nei.RecipeHandlerBase; import forestry.factory.gui.GuiBottler; import forestry.factory.recipes.BottlerRecipe; -import java.awt.Point; -import java.awt.Rectangle; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; -import net.minecraftforge.fluids.FluidStack; public class NEIHandlerBottler extends RecipeHandlerBase { diff --git a/src/main/java/forestry/factory/recipes/nei/NEIHandlerCarpenter.java b/src/main/java/forestry/factory/recipes/nei/NEIHandlerCarpenter.java index de7189975..a014a749a 100644 --- a/src/main/java/forestry/factory/recipes/nei/NEIHandlerCarpenter.java +++ b/src/main/java/forestry/factory/recipes/nei/NEIHandlerCarpenter.java @@ -1,15 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes.nei; +import java.awt.Point; +import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.FluidStack; + import codechicken.lib.gui.GuiDraw; import codechicken.nei.NEIServerUtils; import codechicken.nei.PositionedStack; @@ -21,14 +29,6 @@ import forestry.core.recipes.nei.NEIUtils; import forestry.core.recipes.nei.PositionedFluidTank; import forestry.core.recipes.nei.RecipeHandlerBase; import forestry.factory.gui.GuiCarpenter; -import java.awt.Point; -import java.awt.Rectangle; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.FluidStack; public class NEIHandlerCarpenter extends RecipeHandlerBase { @@ -64,8 +64,7 @@ public class NEIHandlerCarpenter extends RecipeHandlerBase { new Point(176, 0)); } if (recipe.getCraftingGridRecipe().getRecipeOutput() != null) { - this.output = - new PositionedStack(recipe.getCraftingGridRecipe().getRecipeOutput(), 75, 37); + this.output = new PositionedStack(recipe.getCraftingGridRecipe().getRecipeOutput(), 75, 37); } } @@ -165,8 +164,7 @@ public class NEIHandlerCarpenter extends RecipeHandlerBase { @Override public void loadCraftingRecipes(ItemStack result) { for (ICarpenterRecipe recipe : RecipeManagers.carpenterManager.recipes()) { - if (NEIServerUtils.areStacksSameTypeCrafting( - recipe.getCraftingGridRecipe().getRecipeOutput(), result)) { + if (NEIServerUtils.areStacksSameTypeCrafting(recipe.getCraftingGridRecipe().getRecipeOutput(), result)) { this.arecipes.add(new CachedCarpenterRecipe(recipe, true)); } } diff --git a/src/main/java/forestry/factory/recipes/nei/NEIHandlerCentrifuge.java b/src/main/java/forestry/factory/recipes/nei/NEIHandlerCentrifuge.java index 2bbde9368..87668655b 100644 --- a/src/main/java/forestry/factory/recipes/nei/NEIHandlerCentrifuge.java +++ b/src/main/java/forestry/factory/recipes/nei/NEIHandlerCentrifuge.java @@ -1,15 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes.nei; +import java.util.ArrayList; +import java.util.Comparator; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; +import java.util.PriorityQueue; +import java.util.Set; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; + import codechicken.nei.NEIServerUtils; import codechicken.nei.PositionedStack; import forestry.api.recipes.ICentrifugeRecipe; @@ -17,29 +27,19 @@ import forestry.api.recipes.RecipeManagers; import forestry.core.recipes.nei.PositionedStackAdv; import forestry.core.recipes.nei.RecipeHandlerBase; import forestry.factory.gui.GuiCentrifuge; -import java.util.ArrayList; -import java.util.Comparator; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.PriorityQueue; -import java.util.Set; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; public class NEIHandlerCentrifuge extends RecipeHandlerBase { - private static final int[][] OUTPUTS = - new int[][] {{0, 0}, {1, 0}, {2, 0}, {0, 1}, {1, 1}, {2, 1}, {0, 2}, {1, 2}, {2, 2}}; + private static final int[][] OUTPUTS = new int[][] { { 0, 0 }, { 1, 0 }, { 2, 0 }, { 0, 1 }, { 1, 1 }, { 2, 1 }, + { 0, 2 }, { 1, 2 }, { 2, 2 } }; - private static final Comparator> highestChanceComparator = - new Comparator>() { - @Override - public int compare(Entry o1, Entry o2) { - return o2.getValue().compareTo(o1.getValue()); - } - }; + private static final Comparator> highestChanceComparator = new Comparator>() { + + @Override + public int compare(Entry o1, Entry o2) { + return o2.getValue().compareTo(o1.getValue()); + } + }; public class CachedCentrifugeRecipe extends CachedBaseRecipe { @@ -64,8 +64,9 @@ public class NEIHandlerCentrifuge extends RecipeHandlerBase { if (entrySet.size() == 0) { return; } - PriorityQueue> sortByChance = - new PriorityQueue<>(entrySet.size(), highestChanceComparator); + PriorityQueue> sortByChance = new PriorityQueue<>( + entrySet.size(), + highestChanceComparator); sortByChance.addAll(entrySet); int i = 0; @@ -74,8 +75,10 @@ public class NEIHandlerCentrifuge extends RecipeHandlerBase { if (i >= OUTPUTS.length) { return; } - PositionedStackAdv output = - new PositionedStackAdv(stack.getKey(), 93 + OUTPUTS[i][0] * 18, 8 + OUTPUTS[i][1] * 18); + PositionedStackAdv output = new PositionedStackAdv( + stack.getKey(), + 93 + OUTPUTS[i][0] * 18, + 8 + OUTPUTS[i][1] * 18); output.setChance(stack.getValue()); this.outputs.add(output); i++; diff --git a/src/main/java/forestry/factory/recipes/nei/NEIHandlerFabricator.java b/src/main/java/forestry/factory/recipes/nei/NEIHandlerFabricator.java index 65ca03a7f..1d107b774 100644 --- a/src/main/java/forestry/factory/recipes/nei/NEIHandlerFabricator.java +++ b/src/main/java/forestry/factory/recipes/nei/NEIHandlerFabricator.java @@ -1,15 +1,27 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes.nei; +import java.awt.Point; +import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; + import codechicken.nei.NEIServerUtils; import codechicken.nei.PositionedStack; import codechicken.nei.recipe.GuiRecipe; @@ -21,22 +33,11 @@ import forestry.core.recipes.nei.PositionedFluidTank; import forestry.core.recipes.nei.RecipeHandlerBase; import forestry.factory.gui.GuiFabricator; import forestry.factory.recipes.FabricatorSmeltingRecipeManager; -import java.awt.Point; -import java.awt.Rectangle; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; public class NEIHandlerFabricator extends RecipeHandlerBase { public class CachedFabricatorRecipe extends CachedBaseRecipe { + public List smeltingInput = new ArrayList<>(); public PositionedFluidTank tank; public List inputs = new ArrayList<>(); @@ -46,8 +47,7 @@ public class NEIHandlerFabricator extends RecipeHandlerBase { if (recipe.getLiquid() != null) { this.tank = new PositionedFluidTank(recipe.getLiquid(), 2000, new Rectangle(21, 37, 16, 16)); List smeltingInput = new ArrayList<>(); - for (IFabricatorSmeltingRecipe s : - getSmeltingInputs().get(recipe.getLiquid().getFluid())) { + for (IFabricatorSmeltingRecipe s : getSmeltingInputs().get(recipe.getLiquid().getFluid())) { smeltingInput.add(s.getResource()); } if (!smeltingInput.isEmpty()) { @@ -199,20 +199,19 @@ public class NEIHandlerFabricator extends RecipeHandlerBase { } @Override - public List provideItemTooltip( - GuiRecipe guiRecipe, - ItemStack itemStack, - List currenttip, - CachedBaseRecipe crecipe, - Point relMouse) { + public List provideItemTooltip(GuiRecipe guiRecipe, ItemStack itemStack, List currenttip, + CachedBaseRecipe crecipe, Point relMouse) { super.provideItemTooltip(guiRecipe, itemStack, currenttip, crecipe, relMouse); if (new Rectangle(20, 9, 18, 18).contains(relMouse)) { for (IFabricatorSmeltingRecipe smelting : FabricatorSmeltingRecipeManager.recipes) { if (NEIServerUtils.areStacksSameTypeCrafting(smelting.getResource(), itemStack) && smelting.getProduct() != null) { - currenttip.add(EnumChatFormatting.GRAY + NEIUtils.translate("handler.forestry.fabricator.worth") - + " " + smelting.getProduct().amount + " mB"); + currenttip.add( + EnumChatFormatting.GRAY + NEIUtils.translate("handler.forestry.fabricator.worth") + + " " + + smelting.getProduct().amount + + " mB"); } } } diff --git a/src/main/java/forestry/factory/recipes/nei/NEIHandlerFermenter.java b/src/main/java/forestry/factory/recipes/nei/NEIHandlerFermenter.java index a7cb3319b..c1b024b7f 100644 --- a/src/main/java/forestry/factory/recipes/nei/NEIHandlerFermenter.java +++ b/src/main/java/forestry/factory/recipes/nei/NEIHandlerFermenter.java @@ -1,15 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes.nei; +import java.awt.Point; +import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.FluidStack; + import codechicken.lib.gui.GuiDraw; import codechicken.nei.NEIServerUtils; import codechicken.nei.PositionedStack; @@ -24,15 +33,6 @@ import forestry.core.recipes.nei.NEIUtils; import forestry.core.recipes.nei.PositionedFluidTank; import forestry.core.recipes.nei.RecipeHandlerBase; import forestry.factory.gui.GuiFermenter; -import java.awt.Point; -import java.awt.Rectangle; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.FluidStack; public class NEIHandlerFermenter extends RecipeHandlerBase { @@ -54,12 +54,13 @@ public class NEIHandlerFermenter extends RecipeHandlerBase { if (recipe.getFluidResource() != null) { FluidStack input = recipe.getFluidResource().copy(); input.amount = recipe.getFermentationValue(); - this.tanks.add(new PositionedFluidTank( - input, - 10000, - new Rectangle(30, 4, 16, 58), - NEIHandlerFermenter.this.getGuiTexture(), - new Point(176, 0))); + this.tanks.add( + new PositionedFluidTank( + input, + 10000, + new Rectangle(30, 4, 16, 58), + NEIHandlerFermenter.this.getGuiTexture(), + new Point(176, 0))); } if (recipe.getOutput() != null) { int amount = Math.round(recipe.getFermentationValue() * recipe.getModifier()); @@ -67,12 +68,13 @@ public class NEIHandlerFermenter extends RecipeHandlerBase { amount *= ((IVariableFermentable) fermentable.getItem()).getFermentationModifier(fermentable); } FluidStack output = new FluidStack(recipe.getOutput(), amount); - this.tanks.add(new PositionedFluidTank( - output, - 10000, - new Rectangle(120, 4, 16, 58), - NEIHandlerFermenter.this.getGuiTexture(), - new Point(176, 0))); + this.tanks.add( + new PositionedFluidTank( + output, + 10000, + new Rectangle(120, 4, 16, 58), + NEIHandlerFermenter.this.getGuiTexture(), + new Point(176, 0))); } this.inputItems.add(new PositionedStack(fermentable, 80, 8)); diff --git a/src/main/java/forestry/factory/recipes/nei/NEIHandlerMoistener.java b/src/main/java/forestry/factory/recipes/nei/NEIHandlerMoistener.java index 106427a5c..a0f91010d 100644 --- a/src/main/java/forestry/factory/recipes/nei/NEIHandlerMoistener.java +++ b/src/main/java/forestry/factory/recipes/nei/NEIHandlerMoistener.java @@ -1,15 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes.nei; +import java.awt.Point; +import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + import codechicken.nei.NEIServerUtils; import codechicken.nei.PositionedStack; import forestry.api.fuels.FuelManager; @@ -19,15 +28,6 @@ import forestry.api.recipes.RecipeManagers; import forestry.core.recipes.nei.PositionedFluidTank; import forestry.core.recipes.nei.RecipeHandlerBase; import forestry.factory.gui.GuiMoistener; -import java.awt.Point; -import java.awt.Rectangle; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; public class NEIHandlerMoistener extends RecipeHandlerBase { diff --git a/src/main/java/forestry/factory/recipes/nei/NEIHandlerSqueezer.java b/src/main/java/forestry/factory/recipes/nei/NEIHandlerSqueezer.java index ee18b8c10..76245e6b2 100644 --- a/src/main/java/forestry/factory/recipes/nei/NEIHandlerSqueezer.java +++ b/src/main/java/forestry/factory/recipes/nei/NEIHandlerSqueezer.java @@ -1,15 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes.nei; +import java.awt.Point; +import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Random; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.FluidStack; + import codechicken.nei.NEIServerUtils; import codechicken.nei.PositionedStack; import forestry.api.recipes.ISqueezerRecipe; @@ -22,22 +33,11 @@ import forestry.core.recipes.nei.RecipeHandlerBase; import forestry.factory.gui.GuiSqueezer; import forestry.factory.recipes.ISqueezerContainerRecipe; import forestry.factory.recipes.SqueezerRecipeManager; -import java.awt.Point; -import java.awt.Rectangle; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.Random; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.FluidStack; public class NEIHandlerSqueezer extends RecipeHandlerBase { - private static final int[][] INPUTS = - new int[][] {{0, 0}, {1, 0}, {2, 0}, {0, 1}, {1, 1}, {2, 1}, {0, 2}, {1, 2}, {2, 2}}; + private static final int[][] INPUTS = new int[][] { { 0, 0 }, { 1, 0 }, { 2, 0 }, { 0, 1 }, { 1, 1 }, { 2, 1 }, + { 0, 2 }, { 1, 2 }, { 2, 2 } }; public class CachedSqueezerRecipe extends CachedBaseRecipe { @@ -55,8 +55,8 @@ public class NEIHandlerSqueezer extends RecipeHandlerBase { setTankFluid(recipe.getFluidOutput()); } if (recipe.getRemnants() != null) { - this.remnants = - new PositionedStackAdv(recipe.getRemnants(), 92, 49).setChance(recipe.getRemnantsChance()); + this.remnants = new PositionedStackAdv(recipe.getRemnants(), 92, 49) + .setChance(recipe.getRemnantsChance()); } this.processingTime = recipe.getProcessingTime(); @@ -75,7 +75,7 @@ public class NEIHandlerSqueezer extends RecipeHandlerBase { ItemStack emptyContainer = recipe.getEmptyContainer(); List ingredients = FluidHelper.getAllFilledContainers(emptyContainer); - setIngredients(new Object[] {ingredients}); + setIngredients(new Object[] { ingredients }); List fluids = new ArrayList<>(); for (ItemStack ingredient : ingredients) { FluidStack fluidStack = FluidHelper.getFluidStackInContainer(ingredient); @@ -84,8 +84,8 @@ public class NEIHandlerSqueezer extends RecipeHandlerBase { setTankFluid(fluids); if (recipe.getRemnants() != null) { - this.remnants = - new PositionedStackAdv(recipe.getRemnants(), 92, 49).setChance(recipe.getRemnantsChance()); + this.remnants = new PositionedStackAdv(recipe.getRemnants(), 92, 49) + .setChance(recipe.getRemnantsChance()); } this.processingTime = recipe.getProcessingTime(); @@ -242,7 +242,7 @@ public class NEIHandlerSqueezer extends RecipeHandlerBase { ISqueezerContainerRecipe containerRecipe = SqueezerRecipeManager.findMatchingContainerRecipe(ingred); if (containerRecipe != null) { CachedSqueezerRecipe crecipe = new CachedSqueezerRecipe(containerRecipe, true); - crecipe.setIngredients(new ItemStack[] {ingred}); + crecipe.setIngredients(new ItemStack[] { ingred }); FluidStack fluidStack = FluidHelper.getFluidStackInContainer(ingred); crecipe.setTankFluid(fluidStack); this.arecipes.add(crecipe); diff --git a/src/main/java/forestry/factory/recipes/nei/NEIHandlerStill.java b/src/main/java/forestry/factory/recipes/nei/NEIHandlerStill.java index 283cf1d0c..722b8c5c6 100644 --- a/src/main/java/forestry/factory/recipes/nei/NEIHandlerStill.java +++ b/src/main/java/forestry/factory/recipes/nei/NEIHandlerStill.java @@ -1,15 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.recipes.nei; +import java.awt.Point; +import java.awt.Rectangle; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.util.StatCollector; +import net.minecraftforge.fluids.FluidStack; + import codechicken.lib.gui.GuiDraw; import codechicken.nei.PositionedStack; import forestry.api.recipes.IStillRecipe; @@ -18,13 +25,6 @@ import forestry.core.recipes.nei.NEIUtils; import forestry.core.recipes.nei.PositionedFluidTank; import forestry.core.recipes.nei.RecipeHandlerBase; import forestry.factory.gui.GuiStill; -import java.awt.Point; -import java.awt.Rectangle; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.util.StatCollector; -import net.minecraftforge.fluids.FluidStack; public class NEIHandlerStill extends RecipeHandlerBase { @@ -34,20 +34,22 @@ public class NEIHandlerStill extends RecipeHandlerBase { public CachedStillRecipe(IStillRecipe recipe) { if (recipe.getInput() != null) { - this.tanks.add(new PositionedFluidTank( - recipe.getInput(), - 10000, - new Rectangle(30, 4, 16, 58), - NEIHandlerStill.this.getGuiTexture(), - new Point(176, 0))); + this.tanks.add( + new PositionedFluidTank( + recipe.getInput(), + 10000, + new Rectangle(30, 4, 16, 58), + NEIHandlerStill.this.getGuiTexture(), + new Point(176, 0))); } if (recipe.getOutput() != null) { - this.tanks.add(new PositionedFluidTank( - recipe.getOutput(), - 10000, - new Rectangle(120, 4, 16, 58), - NEIHandlerStill.this.getGuiTexture(), - new Point(176, 0))); + this.tanks.add( + new PositionedFluidTank( + recipe.getOutput(), + 10000, + new Rectangle(120, 4, 16, 58), + NEIHandlerStill.this.getGuiTexture(), + new Point(176, 0))); } } diff --git a/src/main/java/forestry/factory/tiles/ICrafterWorktable.java b/src/main/java/forestry/factory/tiles/ICrafterWorktable.java index 5422dbf7c..6ae5e3b44 100644 --- a/src/main/java/forestry/factory/tiles/ICrafterWorktable.java +++ b/src/main/java/forestry/factory/tiles/ICrafterWorktable.java @@ -4,6 +4,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; public interface ICrafterWorktable { + ItemStack getResult(); boolean canTakeStack(int slotIndex); diff --git a/src/main/java/forestry/factory/tiles/TileBottler.java b/src/main/java/forestry/factory/tiles/TileBottler.java index 842fbffcc..0d0410ff6 100644 --- a/src/main/java/forestry/factory/tiles/TileBottler.java +++ b/src/main/java/forestry/factory/tiles/TileBottler.java @@ -1,15 +1,28 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.tiles; +import java.io.IOException; +import java.util.Collection; +import java.util.LinkedList; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + import buildcraft.api.statements.ITriggerExternal; import cpw.mods.fml.common.Optional; import forestry.api.core.IErrorLogic; @@ -29,21 +42,9 @@ import forestry.factory.gui.GuiBottler; import forestry.factory.inventory.InventoryBottler; import forestry.factory.recipes.BottlerRecipe; import forestry.factory.triggers.FactoryTriggers; -import java.io.IOException; -import java.util.Collection; -import java.util.LinkedList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; public class TileBottler extends TilePowered implements ISidedInventory, ILiquidTankTile, IFluidHandler { + private static final int TICKS_PER_RECIPE_TIME = 5; private static final int ENERGY_PER_RECIPE_TIME = 1000; @@ -135,9 +136,7 @@ public class TileBottler extends TilePowered implements ISidedInventory, ILiquid } return ((float) inventory.getStackInSlot(InventoryBottler.SLOT_INPUT_EMPTY_CAN).stackSize - / (float) inventory - .getStackInSlot(InventoryBottler.SLOT_INPUT_EMPTY_CAN) - .getMaxStackSize()) + / (float) inventory.getStackInSlot(InventoryBottler.SLOT_INPUT_EMPTY_CAN).getMaxStackSize()) > percentage; } diff --git a/src/main/java/forestry/factory/tiles/TileCarpenter.java b/src/main/java/forestry/factory/tiles/TileCarpenter.java index 48f49941d..e42d12968 100644 --- a/src/main/java/forestry/factory/tiles/TileCarpenter.java +++ b/src/main/java/forestry/factory/tiles/TileCarpenter.java @@ -1,15 +1,29 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.tiles; +import java.io.IOException; + +import javax.annotation.Nullable; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.inventory.InventoryCraftResult; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + import forestry.api.core.IErrorLogic; import forestry.api.recipes.ICarpenterRecipe; import forestry.core.config.Constants; @@ -32,22 +46,10 @@ import forestry.factory.gui.GuiCarpenter; import forestry.factory.inventory.InventoryCarpenter; import forestry.factory.inventory.InventoryGhostCrafting; import forestry.factory.recipes.CarpenterRecipeManager; -import java.io.IOException; -import javax.annotation.Nullable; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.inventory.InventoryCraftResult; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; public class TileCarpenter extends TilePowered implements ISidedInventory, ILiquidTankTile, IFluidHandler, IItemStackDisplay { + private static final int TICKS_PER_RECIPE_TIME = 1; private static final int ENERGY_PER_WORK_CYCLE = 2040; private static final int ENERGY_PER_RECIPE_TIME = ENERGY_PER_WORK_CYCLE / 10; @@ -110,8 +112,8 @@ public class TileCarpenter extends TilePowered } if (!CarpenterRecipeManager.matches(currentRecipe, resourceTank.getFluid(), getBoxStack(), craftingInventory)) { - currentRecipe = CarpenterRecipeManager.findMatchingRecipe( - resourceTank.getFluid(), getBoxStack(), craftingInventory); + currentRecipe = CarpenterRecipeManager + .findMatchingRecipe(resourceTank.getFluid(), getBoxStack(), craftingInventory); if (currentRecipe != null) { int recipeTime = currentRecipe.getPackagingTime(); @@ -146,7 +148,11 @@ public class TileCarpenter extends TilePowered ItemStack pendingProduct = currentRecipe.getCraftingGridRecipe().getRecipeOutput(); InventoryUtil.tryAddStack( - this, pendingProduct, InventoryCarpenter.SLOT_PRODUCT, InventoryCarpenter.SLOT_PRODUCT_COUNT, true); + this, + pendingProduct, + InventoryCarpenter.SLOT_PRODUCT, + InventoryCarpenter.SLOT_PRODUCT_COUNT, + true); return true; } @@ -186,9 +192,13 @@ public class TileCarpenter extends TilePowered EntityPlayer player = PlayerUtil.getPlayer(worldObj, getAccessHandler().getOwner()); ItemStack[] craftingSets = InventoryUtil.getStacks( - craftingInventory, InventoryGhostCrafting.SLOT_CRAFTING_1, InventoryGhostCrafting.SLOT_CRAFTING_COUNT); + craftingInventory, + InventoryGhostCrafting.SLOT_CRAFTING_1, + InventoryGhostCrafting.SLOT_CRAFTING_COUNT); IInventory inventory = new InventoryMapper( - getInternalInventory(), InventoryCarpenter.SLOT_INVENTORY_1, InventoryCarpenter.SLOT_INVENTORY_COUNT); + getInternalInventory(), + InventoryCarpenter.SLOT_INVENTORY_1, + InventoryCarpenter.SLOT_INVENTORY_COUNT); return InventoryUtil.removeSets(inventory, 1, craftingSets, player, true, true, false, doRemove); } diff --git a/src/main/java/forestry/factory/tiles/TileCentrifuge.java b/src/main/java/forestry/factory/tiles/TileCentrifuge.java index 65f81840c..5d2a45ec3 100644 --- a/src/main/java/forestry/factory/tiles/TileCentrifuge.java +++ b/src/main/java/forestry/factory/tiles/TileCentrifuge.java @@ -1,15 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.tiles; +import java.io.IOException; +import java.util.Collection; +import java.util.LinkedList; +import java.util.Stack; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import buildcraft.api.statements.ITriggerExternal; import cpw.mods.fml.common.Optional; import forestry.api.circuits.ChipsetManager; @@ -32,19 +43,9 @@ import forestry.factory.gui.GuiCentrifuge; import forestry.factory.inventory.InventoryCentrifuge; import forestry.factory.recipes.CentrifugeRecipeManager; import forestry.factory.triggers.FactoryTriggers; -import java.io.IOException; -import java.util.Collection; -import java.util.LinkedList; -import java.util.Stack; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class TileCentrifuge extends TilePowered implements ISocketable, ISidedInventory { + private static final int TICKS_PER_RECIPE_TIME = 1; private static final int ENERGY_PER_WORK_CYCLE = 3200; private static final int ENERGY_PER_RECIPE_TIME = ENERGY_PER_WORK_CYCLE / 20; @@ -160,7 +161,11 @@ public class TileCentrifuge extends TilePowered implements ISocketable, ISidedIn ItemStack next = pendingProducts.peek(); boolean added = InventoryUtil.tryAddStack( - this, next, InventoryCentrifuge.SLOT_PRODUCT_1, InventoryCentrifuge.SLOT_PRODUCT_COUNT, true); + this, + next, + InventoryCentrifuge.SLOT_PRODUCT_1, + InventoryCentrifuge.SLOT_PRODUCT_COUNT, + true); if (added) { pendingProducts.pop(); @@ -178,10 +183,7 @@ public class TileCentrifuge extends TilePowered implements ISocketable, ISidedIn } return ((float) inventory.getStackInSlot(InventoryCentrifuge.SLOT_RESOURCE).stackSize - / (float) inventory - .getStackInSlot(InventoryCentrifuge.SLOT_RESOURCE) - .getMaxStackSize()) - > percentage; + / (float) inventory.getStackInSlot(InventoryCentrifuge.SLOT_RESOURCE).getMaxStackSize()) > percentage; } @Override diff --git a/src/main/java/forestry/factory/tiles/TileFabricator.java b/src/main/java/forestry/factory/tiles/TileFabricator.java index 500e15eb8..8b427f3b9 100644 --- a/src/main/java/forestry/factory/tiles/TileFabricator.java +++ b/src/main/java/forestry/factory/tiles/TileFabricator.java @@ -1,15 +1,29 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.tiles; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.IInventory; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + import forestry.api.core.IErrorLogic; import forestry.api.recipes.IFabricatorRecipe; import forestry.api.recipes.IFabricatorSmeltingRecipe; @@ -36,23 +50,10 @@ import forestry.factory.inventory.InventoryFabricator; import forestry.factory.inventory.InventoryGhostCrafting; import forestry.factory.recipes.FabricatorRecipeManager; import forestry.factory.recipes.FabricatorSmeltingRecipeManager; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.IInventory; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; public class TileFabricator extends TilePowered implements ISlotPickupWatcher, ILiquidTankTile, IFluidHandler, ISidedInventory { + private static final int MAX_HEAT = 5000; private final InventoryAdapterTile craftingInventory; @@ -92,9 +93,8 @@ public class TileFabricator extends TilePowered // FIXME 1.8: wont need this // move items from legacy crafting area to the new one IInventory inventory = getInternalInventory(); - for (int slot = InventoryFabricator.SLOT_CRAFTING_LEGACY_1; - slot < InventoryFabricator.SLOT_CRAFTING_LEGACY_1 + InventoryFabricator.SLOT_CRAFTING_LEGACY_COUNT; - slot++) { + for (int slot = InventoryFabricator.SLOT_CRAFTING_LEGACY_1; slot + < InventoryFabricator.SLOT_CRAFTING_LEGACY_1 + InventoryFabricator.SLOT_CRAFTING_LEGACY_COUNT; slot++) { ItemStack stack = inventory.getStackInSlot(slot); if (stack != null) { inventory.setInventorySlotContents(slot, null); @@ -221,7 +221,9 @@ public class TileFabricator extends TilePowered // Remove resources ItemStack[] crafting = InventoryUtil.getStacks( - craftingInventory, InventoryGhostCrafting.SLOT_CRAFTING_1, InventoryGhostCrafting.SLOT_CRAFTING_COUNT); + craftingInventory, + InventoryGhostCrafting.SLOT_CRAFTING_1, + InventoryGhostCrafting.SLOT_CRAFTING_COUNT); if (!removeFromInventory(crafting, null, false)) { return; } @@ -248,7 +250,9 @@ public class TileFabricator extends TilePowered private boolean removeFromInventory(ItemStack[] set, EntityPlayer player, boolean doRemove) { IInventory inventory = new InventoryMapper( - this, InventoryFabricator.SLOT_INVENTORY_1, InventoryFabricator.SLOT_INVENTORY_COUNT); + this, + InventoryFabricator.SLOT_INVENTORY_1, + InventoryFabricator.SLOT_INVENTORY_COUNT); return InventoryUtil.removeSets(inventory, 1, set, player, true, true, false, doRemove); } @@ -285,8 +289,8 @@ public class TileFabricator extends TilePowered private int getMeltingPoint() { if (this.getStackInSlot(InventoryFabricator.SLOT_METAL) != null) { - IFabricatorSmeltingRecipe smelt = FabricatorSmeltingRecipeManager.findMatchingSmelting( - this.getStackInSlot(InventoryFabricator.SLOT_METAL)); + IFabricatorSmeltingRecipe smelt = FabricatorSmeltingRecipeManager + .findMatchingSmelting(this.getStackInSlot(InventoryFabricator.SLOT_METAL)); if (smelt != null) { return smelt.getMeltingPoint(); } diff --git a/src/main/java/forestry/factory/tiles/TileFermenter.java b/src/main/java/forestry/factory/tiles/TileFermenter.java index 175a688c5..7add32b5a 100644 --- a/src/main/java/forestry/factory/tiles/TileFermenter.java +++ b/src/main/java/forestry/factory/tiles/TileFermenter.java @@ -1,15 +1,30 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.tiles; +import java.io.IOException; +import java.util.Collection; +import java.util.LinkedList; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + import buildcraft.api.statements.ITriggerExternal; import cpw.mods.fml.common.Optional; import forestry.api.core.IErrorLogic; @@ -33,23 +48,9 @@ import forestry.factory.gui.GuiFermenter; import forestry.factory.inventory.InventoryFermenter; import forestry.factory.recipes.FermenterRecipeManager; import forestry.factory.triggers.FactoryTriggers; -import java.io.IOException; -import java.util.Collection; -import java.util.LinkedList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; public class TileFermenter extends TilePowered implements ISidedInventory, ILiquidTankTile, IFluidHandler { + private final FilteredTank resourceTank; private final FilteredTank productTank; private final TankManager tankManager; diff --git a/src/main/java/forestry/factory/tiles/TileMillRainmaker.java b/src/main/java/forestry/factory/tiles/TileMillRainmaker.java index 27d6d8cfc..906b4928c 100644 --- a/src/main/java/forestry/factory/tiles/TileMillRainmaker.java +++ b/src/main/java/forestry/factory/tiles/TileMillRainmaker.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.tiles; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.nbt.NBTTagCompound; + import forestry.api.fuels.FuelManager; import forestry.api.fuels.RainSubstrate; import forestry.core.proxy.Proxies; import forestry.core.tiles.TileMill; import forestry.factory.inventory.InventoryRainmaker; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.nbt.NBTTagCompound; public class TileMillRainmaker extends TileMill { + private int duration; private boolean reverse; diff --git a/src/main/java/forestry/factory/tiles/TileMoistener.java b/src/main/java/forestry/factory/tiles/TileMoistener.java index 76f10d776..c9fb6bc6c 100644 --- a/src/main/java/forestry/factory/tiles/TileMoistener.java +++ b/src/main/java/forestry/factory/tiles/TileMoistener.java @@ -1,15 +1,29 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.tiles; +import java.io.IOException; +import java.util.ArrayList; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + import forestry.api.core.IErrorLogic; import forestry.api.fuels.FuelManager; import forestry.api.fuels.MoistenerFuel; @@ -32,23 +46,10 @@ import forestry.factory.gui.ContainerMoistener; import forestry.factory.gui.GuiMoistener; import forestry.factory.inventory.InventoryMoistener; import forestry.factory.recipes.MoistenerRecipeManager; -import java.io.IOException; -import java.util.ArrayList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; public class TileMoistener extends TileBase implements ISidedInventory, ILiquidTankTile, IFluidHandler, IRenderableTile { + private final FilteredTank resourceTank; private final TankManager tankManager; private IMoistenerRecipe currentRecipe; @@ -196,8 +197,8 @@ public class TileMoistener extends TileBase } if (FuelManager.moistenerResource.containsKey(getStackInSlot(InventoryMoistener.SLOT_WORKING))) { - MoistenerFuel res = - FuelManager.moistenerResource.get(getStackInSlot(InventoryMoistener.SLOT_WORKING)); + MoistenerFuel res = FuelManager.moistenerResource + .get(getStackInSlot(InventoryMoistener.SLOT_WORKING)); burnTime = totalTime = res.moistenerValue; } } else { @@ -224,8 +225,8 @@ public class TileMoistener extends TileBase } public void checkRecipe() { - IMoistenerRecipe sameRec = MoistenerRecipeManager.findMatchingRecipe( - getInternalInventory().getStackInSlot(InventoryMoistener.SLOT_RESOURCE)); + IMoistenerRecipe sameRec = MoistenerRecipeManager + .findMatchingRecipe(getInternalInventory().getStackInSlot(InventoryMoistener.SLOT_RESOURCE)); if (currentRecipe != sameRec) { currentRecipe = sameRec; resetRecipe(); @@ -361,9 +362,8 @@ public class TileMoistener extends TileBase private void rotateReservoir() { ArrayList slotsToShift = new ArrayList<>(); - for (int i = InventoryMoistener.SLOT_RESERVOIR_1; - i < InventoryMoistener.SLOT_RESERVOIR_1 + InventoryMoistener.SLOT_RESERVOIR_COUNT; - i++) { + for (int i = InventoryMoistener.SLOT_RESERVOIR_1; i + < InventoryMoistener.SLOT_RESERVOIR_1 + InventoryMoistener.SLOT_RESERVOIR_COUNT; i++) { if (getStackInSlot(i) == null) { continue; } @@ -445,10 +445,7 @@ public class TileMoistener extends TileBase } return ((float) inventory.getStackInSlot(InventoryMoistener.SLOT_RESOURCE).stackSize - / (float) inventory - .getStackInSlot(InventoryMoistener.SLOT_RESOURCE) - .getMaxStackSize()) - > percentage; + / (float) inventory.getStackInSlot(InventoryMoistener.SLOT_RESOURCE).getMaxStackSize()) > percentage; } public boolean isProducing() { diff --git a/src/main/java/forestry/factory/tiles/TileRaintank.java b/src/main/java/forestry/factory/tiles/TileRaintank.java index 57c8de931..879cca5c3 100644 --- a/src/main/java/forestry/factory/tiles/TileRaintank.java +++ b/src/main/java/forestry/factory/tiles/TileRaintank.java @@ -1,15 +1,29 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.tiles; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + import forestry.api.core.BiomeHelper; import forestry.api.core.IErrorLogic; import forestry.core.config.Constants; @@ -26,22 +40,9 @@ import forestry.core.utils.ItemStackUtil; import forestry.factory.gui.ContainerRaintank; import forestry.factory.gui.GuiRaintank; import forestry.factory.inventory.InventoryRaintank; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; public class TileRaintank extends TileBase implements ISidedInventory, ILiquidTankTile, IFluidHandler { + private static final FluidStack STACK_WATER = Fluids.WATER.getFluid(Constants.RAINTANK_AMOUNT_PER_UPDATE); private final FilteredTank resourceTank; diff --git a/src/main/java/forestry/factory/tiles/TileSqueezer.java b/src/main/java/forestry/factory/tiles/TileSqueezer.java index 6bda009d7..99e345a11 100644 --- a/src/main/java/forestry/factory/tiles/TileSqueezer.java +++ b/src/main/java/forestry/factory/tiles/TileSqueezer.java @@ -1,15 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.tiles; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + import forestry.api.circuits.ChipsetManager; import forestry.api.circuits.CircuitSocketType; import forestry.api.circuits.ICircuitBoard; @@ -34,19 +44,10 @@ import forestry.factory.gui.ContainerSqueezer; import forestry.factory.gui.GuiSqueezer; import forestry.factory.inventory.InventorySqueezer; import forestry.factory.recipes.SqueezerRecipeManager; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; public class TileSqueezer extends TilePowered implements ISocketable, ISidedInventory, ILiquidTankTile, IFluidHandler, ISpeedUpgradable { + private static final int TICKS_PER_RECIPE_TIME = 1; private static final int ENERGY_PER_WORK_CYCLE = 2000; private static final int ENERGY_PER_RECIPE_TIME = ENERGY_PER_WORK_CYCLE / 10; diff --git a/src/main/java/forestry/factory/tiles/TileStill.java b/src/main/java/forestry/factory/tiles/TileStill.java index 2cb2dd923..bf04aa039 100644 --- a/src/main/java/forestry/factory/tiles/TileStill.java +++ b/src/main/java/forestry/factory/tiles/TileStill.java @@ -1,15 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.tiles; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.ISidedInventory; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.util.ForgeDirection; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.fluids.FluidTankInfo; +import net.minecraftforge.fluids.IFluidHandler; + import forestry.api.core.IErrorLogic; import forestry.api.recipes.IStillRecipe; import forestry.core.config.Constants; @@ -27,17 +36,9 @@ import forestry.factory.gui.ContainerStill; import forestry.factory.gui.GuiStill; import forestry.factory.inventory.InventoryStill; import forestry.factory.recipes.StillRecipeManager; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.fluids.FluidTankInfo; -import net.minecraftforge.fluids.IFluidHandler; public class TileStill extends TilePowered implements ISidedInventory, ILiquidTankTile, IFluidHandler { + private static final int ENERGY_PER_RECIPE_TIME = 200; private final FilteredTank resourceTank; diff --git a/src/main/java/forestry/factory/tiles/TileWorktable.java b/src/main/java/forestry/factory/tiles/TileWorktable.java index d30aa8c28..a87134593 100644 --- a/src/main/java/forestry/factory/tiles/TileWorktable.java +++ b/src/main/java/forestry/factory/tiles/TileWorktable.java @@ -1,15 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.tiles; +import java.io.IOException; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; + import forestry.core.config.Config; import forestry.core.inventory.InventoryAdapterTile; import forestry.core.inventory.wrappers.InventoryMapper; @@ -26,16 +34,9 @@ import forestry.factory.inventory.InventoryGhostCrafting; import forestry.factory.inventory.InventoryWorktable; import forestry.factory.recipes.MemorizedRecipe; import forestry.factory.recipes.RecipeMemory; -import java.io.IOException; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; public class TileWorktable extends TileBase implements ICrafterWorktable { + private final RecipeMemory recipeMemory; private final InventoryAdapterTile craftingDisplay; private MemorizedRecipe currentRecipe; @@ -139,8 +140,8 @@ public class TileWorktable extends TileBase implements ICrafterWorktable { ItemStack[] recipeItems = InventoryUtil.getStacks(currentRecipe.getCraftMatrix()); ItemStack[] inventory = InventoryUtil.getStacks(this); - InventoryCraftingForestry crafting = - RecipeUtil.getCraftRecipe(recipeItems, inventory, worldObj, currentRecipe.getRecipeOutput()); + InventoryCraftingForestry crafting = RecipeUtil + .getCraftRecipe(recipeItems, inventory, worldObj, currentRecipe.getRecipeOutput()); return crafting != null; } @@ -153,8 +154,8 @@ public class TileWorktable extends TileBase implements ICrafterWorktable { ItemStack[] recipeItems = InventoryUtil.getStacks(currentRecipe.getCraftMatrix()); ItemStack[] inventory = InventoryUtil.getStacks(this); - InventoryCraftingForestry crafting = - RecipeUtil.getCraftRecipe(recipeItems, inventory, worldObj, currentRecipe.getRecipeOutput()); + InventoryCraftingForestry crafting = RecipeUtil + .getCraftRecipe(recipeItems, inventory, worldObj, currentRecipe.getRecipeOutput()); if (crafting == null) { return false; } @@ -195,8 +196,7 @@ public class TileWorktable extends TileBase implements ICrafterWorktable { continue; } - if (container != null - && container.isItemStackDamageable() + if (container != null && container.isItemStackDamageable() && container.getItemDamage() > container.getMaxDamage()) { MinecraftForge.EVENT_BUS.post(new PlayerDestroyItemEvent(player, container)); continue; @@ -247,7 +247,9 @@ public class TileWorktable extends TileBase implements ICrafterWorktable { public IInventory getCraftingDisplay() { return new InventoryMapper( - craftingDisplay, InventoryGhostCrafting.SLOT_CRAFTING_1, InventoryGhostCrafting.SLOT_CRAFTING_COUNT); + craftingDisplay, + InventoryGhostCrafting.SLOT_CRAFTING_1, + InventoryGhostCrafting.SLOT_CRAFTING_COUNT); } public void clearCraftMatrix() { diff --git a/src/main/java/forestry/factory/triggers/FactoryTriggers.java b/src/main/java/forestry/factory/triggers/FactoryTriggers.java index fb358869c..dcbab3261 100644 --- a/src/main/java/forestry/factory/triggers/FactoryTriggers.java +++ b/src/main/java/forestry/factory/triggers/FactoryTriggers.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.triggers; import forestry.core.triggers.Trigger; public class FactoryTriggers { + public static Trigger lowResource25; public static Trigger lowResource10; public static Trigger lowFuel25; diff --git a/src/main/java/forestry/factory/triggers/TriggerLowFuel.java b/src/main/java/forestry/factory/triggers/TriggerLowFuel.java index 20f35c97a..3ad135a7d 100644 --- a/src/main/java/forestry/factory/triggers/TriggerLowFuel.java +++ b/src/main/java/forestry/factory/triggers/TriggerLowFuel.java @@ -1,22 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.triggers; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.IStatementParameter; import forestry.core.tiles.TileEngine; import forestry.core.tiles.TilePowered; import forestry.core.triggers.Trigger; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class TriggerLowFuel extends Trigger { @@ -36,8 +35,8 @@ public class TriggerLowFuel extends Trigger { * Return true if the tile given in parameter activates the trigger, given the parameters. */ @Override - public boolean isTriggerActive( - TileEntity tile, ForgeDirection side, IStatementContainer source, IStatementParameter[] parameters) { + public boolean isTriggerActive(TileEntity tile, ForgeDirection side, IStatementContainer source, + IStatementParameter[] parameters) { if (tile instanceof TilePowered) { return !((TilePowered) tile).hasFuelMin(threshold); diff --git a/src/main/java/forestry/factory/triggers/TriggerLowResource.java b/src/main/java/forestry/factory/triggers/TriggerLowResource.java index 0c4a96620..45de481f3 100644 --- a/src/main/java/forestry/factory/triggers/TriggerLowResource.java +++ b/src/main/java/forestry/factory/triggers/TriggerLowResource.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.factory.triggers; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.IStatementParameter; import forestry.core.tiles.TilePowered; import forestry.core.triggers.Trigger; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class TriggerLowResource extends Trigger { @@ -35,8 +34,8 @@ public class TriggerLowResource extends Trigger { * Return true if the tile given in parameter activates the trigger, given the parameters. */ @Override - public boolean isTriggerActive( - TileEntity tile, ForgeDirection side, IStatementContainer source, IStatementParameter[] parameters) { + public boolean isTriggerActive(TileEntity tile, ForgeDirection side, IStatementContainer source, + IStatementParameter[] parameters) { if (!(tile instanceof TilePowered)) { return false; } diff --git a/src/main/java/forestry/farming/FarmHelper.java b/src/main/java/forestry/farming/FarmHelper.java index 194775be2..d0048fe44 100755 --- a/src/main/java/forestry/farming/FarmHelper.java +++ b/src/main/java/forestry/farming/FarmHelper.java @@ -1,30 +1,30 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming; -import com.google.common.collect.ImmutableSet; -import forestry.api.farming.FarmDirection; -import forestry.api.multiblock.IFarmComponent; -import forestry.core.utils.vect.MutableVect; -import forestry.core.utils.vect.Vect; -import forestry.core.utils.vect.VectUtil; import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; +import com.google.common.collect.ImmutableSet; + +import forestry.api.farming.FarmDirection; +import forestry.api.multiblock.IFarmComponent; +import forestry.core.utils.vect.MutableVect; +import forestry.core.utils.vect.Vect; +import forestry.core.utils.vect.VectUtil; + public class FarmHelper { - public static final ImmutableSet bricks = ImmutableSet.of( - Blocks.brick_block, Blocks.stonebrick, Blocks.sandstone, Blocks.nether_brick, Blocks.quartz_block); + public static final ImmutableSet bricks = ImmutableSet + .of(Blocks.brick_block, Blocks.stonebrick, Blocks.sandstone, Blocks.nether_brick, Blocks.quartz_block); private static FarmDirection getOpposite(FarmDirection farmDirection) { ForgeDirection forgeDirection = farmDirection.getForgeDirection(); @@ -32,8 +32,8 @@ public class FarmHelper { return FarmDirection.getFarmDirection(forgeDirectionOpposite); } - public static Vect getFarmMultiblockCorner( - World world, Vect start, FarmDirection farmSide, FarmDirection layoutDirection) { + public static Vect getFarmMultiblockCorner(World world, Vect start, FarmDirection farmSide, + FarmDirection layoutDirection) { Vect edge = getFarmMultiblockEdge(world, start, farmSide); return getFarmMultiblockEdge(world, edge, getOpposite(layoutDirection)); } diff --git a/src/main/java/forestry/farming/FarmTarget.java b/src/main/java/forestry/farming/FarmTarget.java index aeb83c1dd..1d1cd363c 100755 --- a/src/main/java/forestry/farming/FarmTarget.java +++ b/src/main/java/forestry/farming/FarmTarget.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming; +import net.minecraft.block.Block; +import net.minecraft.world.World; + import forestry.api.farming.FarmDirection; import forestry.core.utils.vect.MutableVect; import forestry.core.utils.vect.Vect; import forestry.core.utils.vect.VectUtil; -import net.minecraft.block.Block; -import net.minecraft.world.World; public class FarmTarget { diff --git a/src/main/java/forestry/farming/blocks/BlockFarm.java b/src/main/java/forestry/farming/blocks/BlockFarm.java index 6270399ed..3d6f8fbb9 100644 --- a/src/main/java/forestry/farming/blocks/BlockFarm.java +++ b/src/main/java/forestry/farming/blocks/BlockFarm.java @@ -1,30 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.blocks; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.core.blocks.BlockStructure; -import forestry.core.render.ParticleHelper; -import forestry.core.utils.ItemStackUtil; -import forestry.farming.render.EnumFarmBlockTexture; -import forestry.farming.tiles.TileFarm; -import forestry.farming.tiles.TileFarmControl; -import forestry.farming.tiles.TileFarmGearbox; -import forestry.farming.tiles.TileFarmHatch; -import forestry.farming.tiles.TileFarmPlain; -import forestry.farming.tiles.TileFarmValve; -import forestry.plugins.PluginFarming; import java.util.ArrayList; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.client.particle.EffectRenderer; @@ -41,6 +27,20 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.core.blocks.BlockStructure; +import forestry.core.render.ParticleHelper; +import forestry.core.utils.ItemStackUtil; +import forestry.farming.render.EnumFarmBlockTexture; +import forestry.farming.tiles.TileFarm; +import forestry.farming.tiles.TileFarmControl; +import forestry.farming.tiles.TileFarmGearbox; +import forestry.farming.tiles.TileFarmHatch; +import forestry.farming.tiles.TileFarmPlain; +import forestry.farming.tiles.TileFarmValve; +import forestry.plugins.PluginFarming; + public class BlockFarm extends BlockStructure { private final ParticleHelper.Callback particleCallback; @@ -53,7 +53,7 @@ public class BlockFarm extends BlockStructure { } @Override - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @SideOnly(Side.CLIENT) public void getSubBlocks(Item item, CreativeTabs tab, List list) { for (int i = 0; i < 6; i++) { diff --git a/src/main/java/forestry/farming/blocks/BlockFarmType.java b/src/main/java/forestry/farming/blocks/BlockFarmType.java index 5e0c0d049..f777ae857 100644 --- a/src/main/java/forestry/farming/blocks/BlockFarmType.java +++ b/src/main/java/forestry/farming/blocks/BlockFarmType.java @@ -1,16 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.blocks; public enum BlockFarmType { + BASIC, BAND, GEARBOX, diff --git a/src/main/java/forestry/farming/blocks/BlockMushroom.java b/src/main/java/forestry/farming/blocks/BlockMushroom.java index cb7972934..027807f79 100644 --- a/src/main/java/forestry/farming/blocks/BlockMushroom.java +++ b/src/main/java/forestry/farming/blocks/BlockMushroom.java @@ -1,22 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.blocks; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.core.blocks.IItemTyped; -import forestry.core.config.Constants; import java.util.ArrayList; import java.util.List; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.BlockSapling; import net.minecraft.client.renderer.texture.IIconRegister; @@ -29,6 +24,11 @@ import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenBigMushroom; import net.minecraft.world.gen.feature.WorldGenerator; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.core.blocks.IItemTyped; +import forestry.core.config.Constants; + public class BlockMushroom extends BlockSapling implements IItemTyped { public enum MushroomType { @@ -42,10 +42,9 @@ public class BlockMushroom extends BlockSapling implements IItemTyped { public BlockMushroom() { super(); setHardness(0.0f); - this.generators = new WorldGenerator[] { - new WorldGenBigMushroom(MushroomType.BROWN.ordinal()), new WorldGenBigMushroom(MushroomType.RED.ordinal()) - }; - this.drops = new ItemStack[] {new ItemStack(Blocks.brown_mushroom), new ItemStack(Blocks.red_mushroom)}; + this.generators = new WorldGenerator[] { new WorldGenBigMushroom(MushroomType.BROWN.ordinal()), + new WorldGenBigMushroom(MushroomType.RED.ordinal()) }; + this.drops = new ItemStack[] { new ItemStack(Blocks.brown_mushroom), new ItemStack(Blocks.red_mushroom) }; setCreativeTab(null); setTickRandomly(true); } @@ -121,7 +120,7 @@ public class BlockMushroom extends BlockSapling implements IItemTyped { } /* ICONS */ - @SuppressWarnings({"unchecked", "rawtypes"}) + @SuppressWarnings({ "unchecked", "rawtypes" }) @SideOnly(Side.CLIENT) @Override public void getSubBlocks(Item item, CreativeTabs tab, List list) { diff --git a/src/main/java/forestry/farming/blocks/BlockRegistryFarming.java b/src/main/java/forestry/farming/blocks/BlockRegistryFarming.java index 2fedacd09..a0b587556 100644 --- a/src/main/java/forestry/farming/blocks/BlockRegistryFarming.java +++ b/src/main/java/forestry/farming/blocks/BlockRegistryFarming.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.blocks; @@ -15,6 +13,7 @@ import forestry.core.items.ItemBlockTyped; import forestry.farming.items.ItemBlockFarm; public class BlockRegistryFarming extends BlockRegistry { + public final BlockMushroom mushroom; public final BlockFarm farm; diff --git a/src/main/java/forestry/farming/circuits/CircuitFarmLogic.java b/src/main/java/forestry/farming/circuits/CircuitFarmLogic.java index a4ec8b23d..542b71cce 100755 --- a/src/main/java/forestry/farming/circuits/CircuitFarmLogic.java +++ b/src/main/java/forestry/farming/circuits/CircuitFarmLogic.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.circuits; diff --git a/src/main/java/forestry/farming/gui/ContainerFarm.java b/src/main/java/forestry/farming/gui/ContainerFarm.java index f12275442..102468b3d 100755 --- a/src/main/java/forestry/farming/gui/ContainerFarm.java +++ b/src/main/java/forestry/farming/gui/ContainerFarm.java @@ -1,23 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.gui; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraftforge.fluids.IFluidTank; + import forestry.core.gui.ContainerSocketed; import forestry.core.gui.slots.SlotFiltered; import forestry.core.gui.slots.SlotOutput; import forestry.core.network.packets.PacketGuiUpdate; import forestry.farming.multiblock.InventoryFarm; import forestry.farming.tiles.TileFarm; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraftforge.fluids.IFluidTank; public class ContainerFarm extends ContainerSocketed { @@ -51,8 +50,12 @@ public class ContainerFarm extends ContainerSocketed { // Production 2 for (int i = 0; i < 2; i++) { for (int j = 0; j < 2; j++) { - addSlotToContainer(new SlotOutput( - tile, InventoryFarm.SLOT_PRODUCTION_1 + 4 + j + i * 2, 164 + j * 18, 86 + i * 18)); + addSlotToContainer( + new SlotOutput( + tile, + InventoryFarm.SLOT_PRODUCTION_1 + 4 + j + i * 2, + 164 + j * 18, + 86 + i * 18)); } } diff --git a/src/main/java/forestry/farming/gui/FarmLedger.java b/src/main/java/forestry/farming/gui/FarmLedger.java index c2c56d32c..085eb9d06 100644 --- a/src/main/java/forestry/farming/gui/FarmLedger.java +++ b/src/main/java/forestry/farming/gui/FarmLedger.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.gui; +import net.minecraft.init.Items; + import forestry.core.gui.ledgers.Ledger; import forestry.core.gui.ledgers.LedgerManager; import forestry.core.utils.StringUtil; -import net.minecraft.init.Items; public class FarmLedger extends Ledger { + private final IFarmLedgerDelegate delegate; public FarmLedger(LedgerManager ledgerManager, IFarmLedgerDelegate delegate) { @@ -61,7 +61,8 @@ public class FarmLedger extends Ledger { y += drawSubheader(StringUtil.localize("gui.hydr.rainfall") + ':', xBody, y); y += 3; y += drawText( - StringUtil.floatAsPercent(delegate.getHydrationRainfallModifier()) + " (" + delegate.getDrought() + StringUtil.floatAsPercent(delegate.getHydrationRainfallModifier()) + " (" + + delegate.getDrought() + " d)", xBody, y); diff --git a/src/main/java/forestry/farming/gui/GuiFarm.java b/src/main/java/forestry/farming/gui/GuiFarm.java index 3577e0573..158021f85 100755 --- a/src/main/java/forestry/farming/gui/GuiFarm.java +++ b/src/main/java/forestry/farming/gui/GuiFarm.java @@ -1,15 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.gui; +import net.minecraft.entity.player.EntityPlayer; + import forestry.api.farming.FarmDirection; import forestry.core.config.Constants; import forestry.core.gui.GuiForestryTitled; @@ -19,7 +19,6 @@ import forestry.core.gui.widgets.TankWidget; import forestry.farming.gui.widgets.FarmLogicSlot; import forestry.farming.multiblock.IFarmControllerInternal; import forestry.farming.tiles.TileFarm; -import net.minecraft.entity.player.EntityPlayer; public class GuiFarm extends GuiForestryTitled { diff --git a/src/main/java/forestry/farming/gui/IFarmLedgerDelegate.java b/src/main/java/forestry/farming/gui/IFarmLedgerDelegate.java index c22d960de..1e66eaa74 100644 --- a/src/main/java/forestry/farming/gui/IFarmLedgerDelegate.java +++ b/src/main/java/forestry/farming/gui/IFarmLedgerDelegate.java @@ -1,16 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.gui; public interface IFarmLedgerDelegate { + float getHydrationModifier(); float getHydrationTempModifier(); diff --git a/src/main/java/forestry/farming/gui/widgets/FarmLogicSlot.java b/src/main/java/forestry/farming/gui/widgets/FarmLogicSlot.java index 72c49044d..55459c3b8 100644 --- a/src/main/java/forestry/farming/gui/widgets/FarmLogicSlot.java +++ b/src/main/java/forestry/farming/gui/widgets/FarmLogicSlot.java @@ -1,15 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.gui.widgets; +import net.minecraft.util.IIcon; + import forestry.api.farming.FarmDirection; import forestry.api.farming.IFarmLogic; import forestry.core.gui.tooltips.ToolTip; @@ -17,18 +17,13 @@ import forestry.core.gui.widgets.Widget; import forestry.core.gui.widgets.WidgetManager; import forestry.core.proxy.Proxies; import forestry.farming.multiblock.IFarmControllerInternal; -import net.minecraft.util.IIcon; public class FarmLogicSlot extends Widget { private final IFarmControllerInternal farmController; private final FarmDirection farmDirection; - public FarmLogicSlot( - IFarmControllerInternal farmController, - WidgetManager manager, - int xPos, - int yPos, + public FarmLogicSlot(IFarmControllerInternal farmController, WidgetManager manager, int xPos, int yPos, FarmDirection farmDirection) { super(manager, xPos, yPos); this.farmController = farmController; @@ -64,6 +59,7 @@ public class FarmLogicSlot extends Widget { } protected final ToolTip toolTip = new ToolTip(250) { + @Override public void refresh() { toolTip.clear(); @@ -72,10 +68,9 @@ public class FarmLogicSlot extends Widget { } toolTip.add(getLogic().getName()); toolTip.add("Fertilizer: " + getLogic().getFertilizerConsumption()); - toolTip.add("Water: " - + getLogic() - .getWaterConsumption( - farmController.getFarmLedgerDelegate().getHydrationModifier())); + toolTip.add( + "Water: " + getLogic() + .getWaterConsumption(farmController.getFarmLedgerDelegate().getHydrationModifier())); } }; } diff --git a/src/main/java/forestry/farming/items/ItemBlockFarm.java b/src/main/java/forestry/farming/items/ItemBlockFarm.java index dfbe3670c..3de07c757 100644 --- a/src/main/java/forestry/farming/items/ItemBlockFarm.java +++ b/src/main/java/forestry/farming/items/ItemBlockFarm.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.items; -import forestry.farming.render.EnumFarmBlockTexture; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; +import forestry.farming.render.EnumFarmBlockTexture; + public class ItemBlockFarm extends ItemBlock { public ItemBlockFarm(Block block) { @@ -29,15 +29,14 @@ public class ItemBlockFarm extends ItemBlock { return i; } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void addInformation(ItemStack itemstack, EntityPlayer player, List info, boolean par4) { if (!itemstack.hasTagCompound()) { return; } - info.add( - EnumFarmBlockTexture.getFromCompound(itemstack.getTagCompound()).getName()); + info.add(EnumFarmBlockTexture.getFromCompound(itemstack.getTagCompound()).getName()); } @Override diff --git a/src/main/java/forestry/farming/logic/Crop.java b/src/main/java/forestry/farming/logic/Crop.java index cf27019bd..bf7d09314 100755 --- a/src/main/java/forestry/farming/logic/Crop.java +++ b/src/main/java/forestry/farming/logic/Crop.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import java.util.Collection; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + import forestry.api.farming.ICrop; import forestry.core.config.Constants; import forestry.core.utils.vect.Vect; -import java.util.Collection; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; public abstract class Crop implements ICrop { diff --git a/src/main/java/forestry/farming/logic/CropBasicAgriCraft.java b/src/main/java/forestry/farming/logic/CropBasicAgriCraft.java index 153bbccd9..058052195 100644 --- a/src/main/java/forestry/farming/logic/CropBasicAgriCraft.java +++ b/src/main/java/forestry/farming/logic/CropBasicAgriCraft.java @@ -1,26 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; -import forestry.core.config.Constants; -import forestry.core.proxy.Proxies; -import forestry.core.utils.vect.Vect; import java.util.ArrayList; import java.util.Collection; import java.util.Collections; + import net.minecraft.block.Block; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import forestry.core.config.Constants; +import forestry.core.proxy.Proxies; +import forestry.core.utils.vect.Vect; + public class CropBasicAgriCraft extends Crop { private final Block block; @@ -41,15 +41,15 @@ public class CropBasicAgriCraft extends Crop { protected Collection harvestBlock(Vect pos) { ArrayList harvest = block.getDrops(world, pos.x, pos.y, pos.z, meta, 0); if (harvest.size() > 1) { - harvest.remove( - 1); // AgriCraft returns cropsticks in 0, seeds in 1 in getDrops, removing since harvesting doesn't + harvest.remove(1); // AgriCraft returns cropsticks in 0, seeds in 1 in getDrops, removing since harvesting + // doesn't // return them. } harvest.remove(0); Proxies.common.addBlockDestroyEffects(world, pos.x, pos.y, pos.z, Blocks.melon_block, 0); world.setBlockMetadataWithNotify(pos.x, pos.y, pos.z, 0, Constants.FLAG_BLOCK_SYNCH); - harvest.removeAll( - Collections.singleton(null)); // sanatize nulls that get thru from Agricraft+Harvestcraft (sesameseed) + harvest.removeAll(Collections.singleton(null)); // sanatize nulls that get thru from Agricraft+Harvestcraft + // (sesameseed) return harvest; } @@ -57,6 +57,8 @@ public class CropBasicAgriCraft extends Crop { public String toString() { return String.format( "CropBasicAgriCraft [ position: [ %s ]; block: %s; meta: %s ]", - position.toString(), block.getUnlocalizedName(), meta); + position.toString(), + block.getUnlocalizedName(), + meta); } } diff --git a/src/main/java/forestry/farming/logic/CropBasicFruit.java b/src/main/java/forestry/farming/logic/CropBasicFruit.java index ec0b8dbf4..56f3ce0c0 100644 --- a/src/main/java/forestry/farming/logic/CropBasicFruit.java +++ b/src/main/java/forestry/farming/logic/CropBasicFruit.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import java.util.Collection; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + import forestry.core.config.Constants; import forestry.core.proxy.Proxies; import forestry.core.utils.vect.Vect; -import java.util.Collection; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; public class CropBasicFruit extends Crop { @@ -46,6 +46,8 @@ public class CropBasicFruit extends Crop { public String toString() { return String.format( "CropBasicFruit [ position: [ %s ]; block: %s; meta: %s ]", - position.toString(), block.getUnlocalizedName(), meta); + position.toString(), + block.getUnlocalizedName(), + meta); } } diff --git a/src/main/java/forestry/farming/logic/CropBasicGrowthCraft.java b/src/main/java/forestry/farming/logic/CropBasicGrowthCraft.java index 920c7d92d..c9081eea7 100644 --- a/src/main/java/forestry/farming/logic/CropBasicGrowthCraft.java +++ b/src/main/java/forestry/farming/logic/CropBasicGrowthCraft.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import java.util.ArrayList; +import java.util.Collection; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + import forestry.core.config.Constants; import forestry.core.proxy.Proxies; import forestry.core.utils.vect.Vect; -import java.util.ArrayList; -import java.util.Collection; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; public class CropBasicGrowthCraft extends Crop { @@ -64,6 +64,8 @@ public class CropBasicGrowthCraft extends Crop { public String toString() { return String.format( "CropBasicGrowthCraft [ position: [ %s ]; block: %s; meta: %s ]", - position.toString(), block.getUnlocalizedName(), meta); + position.toString(), + block.getUnlocalizedName(), + meta); } } diff --git a/src/main/java/forestry/farming/logic/CropBasicIC2Crop.java b/src/main/java/forestry/farming/logic/CropBasicIC2Crop.java index 845432c46..d0336eddf 100644 --- a/src/main/java/forestry/farming/logic/CropBasicIC2Crop.java +++ b/src/main/java/forestry/farming/logic/CropBasicIC2Crop.java @@ -1,13 +1,16 @@ package forestry.farming.logic; -import forestry.core.utils.vect.Vect; -import forestry.plugins.compat.PluginIC2; import java.util.Collection; + import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import forestry.core.utils.vect.Vect; +import forestry.plugins.compat.PluginIC2; + public class CropBasicIC2Crop extends Crop { + private final TileEntity tileEntity; public CropBasicIC2Crop(World world, TileEntity tileEntity, Vect position) { diff --git a/src/main/java/forestry/farming/logic/CropBlock.java b/src/main/java/forestry/farming/logic/CropBlock.java index d5d3fdd38..5d8938e78 100755 --- a/src/main/java/forestry/farming/logic/CropBlock.java +++ b/src/main/java/forestry/farming/logic/CropBlock.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; -import forestry.core.proxy.Proxies; -import forestry.core.utils.vect.Vect; import java.util.Collection; + import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import forestry.core.proxy.Proxies; +import forestry.core.utils.vect.Vect; + public class CropBlock extends Crop { protected final Block block; @@ -46,6 +46,8 @@ public class CropBlock extends Crop { public String toString() { return String.format( "CropBlock [ position: [ %s ]; block: %s; meta: %s ]", - position.toString(), block.getUnlocalizedName(), meta); + position.toString(), + block.getUnlocalizedName(), + meta); } } diff --git a/src/main/java/forestry/farming/logic/CropFruit.java b/src/main/java/forestry/farming/logic/CropFruit.java index b45ad660a..d18202441 100755 --- a/src/main/java/forestry/farming/logic/CropFruit.java +++ b/src/main/java/forestry/farming/logic/CropFruit.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import java.util.ArrayList; +import java.util.Collection; + +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + import forestry.api.genetics.IFruitBearer; import forestry.core.network.packets.PacketFXSignal; import forestry.core.proxy.Proxies; import forestry.core.utils.vect.Vect; -import java.util.ArrayList; -import java.util.Collection; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; public class CropFruit extends Crop { diff --git a/src/main/java/forestry/farming/logic/CropPeat.java b/src/main/java/forestry/farming/logic/CropPeat.java index e9b13640c..5dc4b502f 100755 --- a/src/main/java/forestry/farming/logic/CropPeat.java +++ b/src/main/java/forestry/farming/logic/CropPeat.java @@ -1,26 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + import forestry.core.blocks.BlockSoil; import forestry.core.proxy.Proxies; import forestry.core.utils.vect.Vect; import forestry.plugins.PluginCore; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; public class CropPeat extends Crop { diff --git a/src/main/java/forestry/farming/logic/CropRubber.java b/src/main/java/forestry/farming/logic/CropRubber.java index 3b7ea327e..89c94dad5 100755 --- a/src/main/java/forestry/farming/logic/CropRubber.java +++ b/src/main/java/forestry/farming/logic/CropRubber.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import java.util.ArrayList; +import java.util.Collection; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + import forestry.core.config.Constants; import forestry.core.proxy.Proxies; import forestry.core.utils.vect.Vect; import forestry.plugins.compat.PluginIC2; -import java.util.ArrayList; -import java.util.Collection; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; public class CropRubber extends CropBlock { diff --git a/src/main/java/forestry/farming/logic/FarmLogic.java b/src/main/java/forestry/farming/logic/FarmLogic.java index 7825dcd3b..3fbd06bf6 100755 --- a/src/main/java/forestry/farming/logic/FarmLogic.java +++ b/src/main/java/forestry/farming/logic/FarmLogic.java @@ -1,25 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; -import forestry.api.farming.FarmDirection; -import forestry.api.farming.IFarmHousing; -import forestry.api.farming.IFarmLogic; -import forestry.core.config.Constants; -import forestry.core.entities.EntitySelector; -import forestry.core.render.SpriteSheet; -import forestry.core.utils.EntityUtil; -import forestry.core.utils.vect.Vect; import java.util.ArrayList; import java.util.List; + import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.entity.item.EntityItem; @@ -29,7 +20,17 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; +import forestry.api.farming.FarmDirection; +import forestry.api.farming.IFarmHousing; +import forestry.api.farming.IFarmLogic; +import forestry.core.config.Constants; +import forestry.core.entities.EntitySelector; +import forestry.core.render.SpriteSheet; +import forestry.core.utils.EntityUtil; +import forestry.core.utils.vect.Vect; + public abstract class FarmLogic implements IFarmLogic { + private final EntitySelectorFarm entitySelectorFarm = new EntitySelectorFarm(this); protected final IFarmHousing housing; protected boolean isManual; @@ -90,8 +91,8 @@ public abstract class FarmLogic implements IFarmLogic { protected List collectEntityItems(boolean toWorldHeight) { AxisAlignedBB harvestBox = getHarvestBox(housing, toWorldHeight); - List entityItems = - EntityUtil.selectEntitiesWithinAABB(housing.getWorld(), entitySelectorFarm, harvestBox); + List entityItems = EntityUtil + .selectEntitiesWithinAABB(housing.getWorld(), entitySelectorFarm, harvestBox); List stacks = new ArrayList<>(); for (EntityItem entity : entityItems) { ItemStack contained = entity.getEntityItem(); @@ -102,6 +103,7 @@ public abstract class FarmLogic implements IFarmLogic { } private static class EntitySelectorFarm extends EntitySelector { + private final FarmLogic farmLogic; public EntitySelectorFarm(FarmLogic farmLogic) { diff --git a/src/main/java/forestry/farming/logic/FarmLogicArboreal.java b/src/main/java/forestry/farming/logic/FarmLogicArboreal.java index 767350fef..1a1c42b09 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicArboreal.java +++ b/src/main/java/forestry/farming/logic/FarmLogicArboreal.java @@ -1,15 +1,28 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Set; +import java.util.Stack; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.util.ResourceLocation; +import net.minecraft.world.World; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.farming.FarmDirection; @@ -22,25 +35,13 @@ import forestry.core.render.SpriteSheet; import forestry.core.utils.vect.Vect; import forestry.core.utils.vect.VectUtil; import forestry.plugins.PluginCore; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Set; -import java.util.Stack; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.util.ResourceLocation; -import net.minecraft.world.World; public class FarmLogicArboreal extends FarmLogicHomogeneous { + private static final int BRANCH_RANGE = 20; - public FarmLogicArboreal( - IFarmHousing housing, ItemStack resource, ItemStack ground, Iterable germlings) { + public FarmLogicArboreal(IFarmHousing housing, ItemStack resource, ItemStack ground, + Iterable germlings) { super(housing, resource, ground, germlings); } @@ -161,8 +162,8 @@ public class FarmLogicArboreal extends FarmLogicHomogeneous { return crops; } - private ArrayList processHarvestBlock( - IFarmable germling, Stack crops, Set seen, Vect start, Vect position) { + private ArrayList processHarvestBlock(IFarmable germling, Stack crops, Set seen, Vect start, + Vect position) { World world = getWorld(); diff --git a/src/main/java/forestry/farming/logic/FarmLogicCereal.java b/src/main/java/forestry/farming/logic/FarmLogicCereal.java index 038ffe9fe..a29ab16ac 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicCereal.java +++ b/src/main/java/forestry/farming/logic/FarmLogicCereal.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import net.minecraft.init.Items; +import net.minecraft.util.IIcon; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.farming.Farmables; import forestry.api.farming.IFarmHousing; -import net.minecraft.init.Items; -import net.minecraft.util.IIcon; public class FarmLogicCereal extends FarmLogicCrops { diff --git a/src/main/java/forestry/farming/logic/FarmLogicCocoa.java b/src/main/java/forestry/farming/logic/FarmLogicCocoa.java index 8ffe2100b..2cf7a7c32 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicCocoa.java +++ b/src/main/java/forestry/farming/logic/FarmLogicCocoa.java @@ -1,15 +1,28 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Set; +import java.util.Stack; + +import net.minecraft.block.Block; +import net.minecraft.block.BlockLog; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.farming.FarmDirection; @@ -19,19 +32,6 @@ import forestry.api.farming.IFarmable; import forestry.core.utils.vect.MutableVect; import forestry.core.utils.vect.Vect; import forestry.core.utils.vect.VectUtil; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Set; -import java.util.Stack; -import net.minecraft.block.Block; -import net.minecraft.block.BlockLog; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class FarmLogicCocoa extends FarmLogic { diff --git a/src/main/java/forestry/farming/logic/FarmLogicCrops.java b/src/main/java/forestry/farming/logic/FarmLogicCrops.java index b6fbbeeff..8b7ee5a17 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicCrops.java +++ b/src/main/java/forestry/farming/logic/FarmLogicCrops.java @@ -1,15 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import java.util.Collection; +import java.util.Stack; + +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.oredict.OreDictionary; + import forestry.api.farming.FarmDirection; import forestry.api.farming.ICrop; import forestry.api.farming.IFarmHousing; @@ -19,14 +25,9 @@ import forestry.core.utils.ItemStackUtil; import forestry.core.utils.vect.IVect; import forestry.core.utils.vect.Vect; import forestry.core.utils.vect.VectUtil; -import java.util.Collection; -import java.util.Stack; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.oredict.OreDictionary; public abstract class FarmLogicCrops extends FarmLogicWatered { + private static final ItemStack farmland = new ItemStack(Blocks.farmland, 1, OreDictionary.WILDCARD_VALUE); private final Iterable seeds; diff --git a/src/main/java/forestry/farming/logic/FarmLogicEnder.java b/src/main/java/forestry/farming/logic/FarmLogicEnder.java index e897a7694..6c7ff2707 100644 --- a/src/main/java/forestry/farming/logic/FarmLogicEnder.java +++ b/src/main/java/forestry/farming/logic/FarmLogicEnder.java @@ -1,15 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import java.util.Collection; +import java.util.Stack; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +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; import forestry.api.farming.FarmDirection; @@ -20,13 +27,6 @@ import forestry.api.farming.IFarmable; import forestry.core.utils.BlockUtil; import forestry.core.utils.vect.Vect; import forestry.core.utils.vect.VectUtil; -import java.util.Collection; -import java.util.Stack; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; public class FarmLogicEnder extends FarmLogicHomogeneous { diff --git a/src/main/java/forestry/farming/logic/FarmLogicGourd.java b/src/main/java/forestry/farming/logic/FarmLogicGourd.java index e2909dfd3..544a2737c 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicGourd.java +++ b/src/main/java/forestry/farming/logic/FarmLogicGourd.java @@ -1,15 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import java.util.Collection; +import java.util.Stack; + +import net.minecraft.init.Items; +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; import forestry.api.farming.FarmDirection; @@ -18,12 +24,6 @@ import forestry.api.farming.ICrop; import forestry.api.farming.IFarmHousing; import forestry.api.farming.IFarmable; import forestry.core.utils.vect.Vect; -import java.util.Collection; -import java.util.Stack; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; public class FarmLogicGourd extends FarmLogic { diff --git a/src/main/java/forestry/farming/logic/FarmLogicHomogeneous.java b/src/main/java/forestry/farming/logic/FarmLogicHomogeneous.java index aa6aafa4e..230361811 100644 --- a/src/main/java/forestry/farming/logic/FarmLogicHomogeneous.java +++ b/src/main/java/forestry/farming/logic/FarmLogicHomogeneous.java @@ -1,15 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + import forestry.api.farming.FarmDirection; import forestry.api.farming.IFarmHousing; import forestry.api.farming.IFarmable; @@ -18,11 +23,6 @@ import forestry.core.utils.ItemStackUtil; import forestry.core.utils.vect.Vect; import forestry.core.utils.vect.VectUtil; import forestry.farming.FarmHelper; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; public abstract class FarmLogicHomogeneous extends FarmLogic { @@ -32,8 +32,8 @@ public abstract class FarmLogicHomogeneous extends FarmLogic { List produce = new ArrayList<>(); - protected FarmLogicHomogeneous( - IFarmHousing housing, ItemStack resource, ItemStack soilBlock, Iterable germlings) { + protected FarmLogicHomogeneous(IFarmHousing housing, ItemStack resource, ItemStack soilBlock, + Iterable germlings) { super(housing); this.resource = resource; this.soilBlock = soilBlock; @@ -83,7 +83,7 @@ public abstract class FarmLogicHomogeneous extends FarmLogic { } private boolean maintainSoil(int x, int yGround, int z, FarmDirection direction, int extent) { - ItemStack[] resources = new ItemStack[] {resource}; + ItemStack[] resources = new ItemStack[] { resource }; if (!housing.getFarmInventory().hasResources(resources)) { return false; } diff --git a/src/main/java/forestry/farming/logic/FarmLogicIC2Crops.java b/src/main/java/forestry/farming/logic/FarmLogicIC2Crops.java index 1be7cd2ac..7fd7e3397 100644 --- a/src/main/java/forestry/farming/logic/FarmLogicIC2Crops.java +++ b/src/main/java/forestry/farming/logic/FarmLogicIC2Crops.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; @@ -15,6 +13,7 @@ import forestry.api.farming.IFarmHousing; // TODO: Make special Logic for Crops, maybe a virtual map of references to iterate faster? public class FarmLogicIC2Crops extends FarmLogicOrchard { + public FarmLogicIC2Crops(IFarmHousing housing) { super(housing); this.setFarmables(Farmables.farmables.get(FarmableReference.IC2Crops.get())); diff --git a/src/main/java/forestry/farming/logic/FarmLogicInfernal.java b/src/main/java/forestry/farming/logic/FarmLogicInfernal.java index dd31bef44..5286be2f0 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicInfernal.java +++ b/src/main/java/forestry/farming/logic/FarmLogicInfernal.java @@ -1,15 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import java.util.Collection; +import java.util.Stack; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +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; import forestry.api.farming.FarmDirection; @@ -20,13 +27,6 @@ import forestry.api.farming.IFarmable; import forestry.core.utils.BlockUtil; import forestry.core.utils.vect.Vect; import forestry.core.utils.vect.VectUtil; -import java.util.Collection; -import java.util.Stack; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; public class FarmLogicInfernal extends FarmLogicHomogeneous { diff --git a/src/main/java/forestry/farming/logic/FarmLogicOrchard.java b/src/main/java/forestry/farming/logic/FarmLogicOrchard.java index 55d2ec453..56bd284db 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicOrchard.java +++ b/src/main/java/forestry/farming/logic/FarmLogicOrchard.java @@ -1,16 +1,30 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Set; +import java.util.Stack; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + import com.google.common.collect.ImmutableList; + import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -20,19 +34,6 @@ import forestry.core.utils.vect.Vect; import forestry.core.utils.vect.VectUtil; import forestry.plugins.PluginCore; import forestry.plugins.PluginManager; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Set; -import java.util.Stack; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; public class FarmLogicOrchard extends FarmLogic { @@ -144,8 +145,7 @@ public class FarmLogicOrchard extends FarmLogic { World world = getWorld(); // Determine what type we want to harvest. - if (!VectUtil.isWoodBlock(world, position) - && !isBlockTraversable(world, position, traversalBlocks) + if (!VectUtil.isWoodBlock(world, position) && !isBlockTraversable(world, position, traversalBlocks) && !isFruitBearer(world, position)) { return crops; } diff --git a/src/main/java/forestry/farming/logic/FarmLogicPeat.java b/src/main/java/forestry/farming/logic/FarmLogicPeat.java index 946ef0d4d..00bc95b6f 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicPeat.java +++ b/src/main/java/forestry/farming/logic/FarmLogicPeat.java @@ -1,15 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import java.util.Collection; +import java.util.Stack; + +import net.minecraft.block.Block; +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; import forestry.api.farming.FarmDirection; @@ -19,14 +25,9 @@ import forestry.core.blocks.BlockSoil; import forestry.core.utils.vect.Vect; import forestry.core.utils.vect.VectUtil; import forestry.plugins.PluginCore; -import java.util.Collection; -import java.util.Stack; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; public class FarmLogicPeat extends FarmLogicWatered { + private static final ItemStack bogEarth = PluginCore.blocks.soil.get(BlockSoil.SoilType.BOG_EARTH, 1); public FarmLogicPeat(IFarmHousing housing) { diff --git a/src/main/java/forestry/farming/logic/FarmLogicReeds.java b/src/main/java/forestry/farming/logic/FarmLogicReeds.java index 1b46f7a8d..60c374f7d 100644 --- a/src/main/java/forestry/farming/logic/FarmLogicReeds.java +++ b/src/main/java/forestry/farming/logic/FarmLogicReeds.java @@ -1,15 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import java.util.Collection; +import java.util.Stack; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +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; import forestry.api.farming.FarmDirection; @@ -19,13 +26,6 @@ import forestry.api.farming.IFarmHousing; import forestry.api.farming.IFarmable; import forestry.core.utils.ItemStackUtil; import forestry.core.utils.vect.Vect; -import java.util.Collection; -import java.util.Stack; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; public class FarmLogicReeds extends FarmLogic { diff --git a/src/main/java/forestry/farming/logic/FarmLogicRubber.java b/src/main/java/forestry/farming/logic/FarmLogicRubber.java index bac3991d2..58398b2b0 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicRubber.java +++ b/src/main/java/forestry/farming/logic/FarmLogicRubber.java @@ -1,15 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Set; +import java.util.Stack; + +import net.minecraft.block.Block; +import net.minecraft.init.Items; +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; import forestry.api.farming.FarmDirection; @@ -20,17 +31,6 @@ import forestry.core.utils.Log; import forestry.core.utils.vect.Vect; import forestry.core.utils.vect.VectUtil; import forestry.plugins.compat.PluginIC2; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Set; -import java.util.Stack; -import net.minecraft.block.Block; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; public class FarmLogicRubber extends FarmLogic { @@ -39,9 +39,7 @@ public class FarmLogicRubber extends FarmLogic { public FarmLogicRubber(IFarmHousing housing) { super(housing); if (PluginIC2.rubberwood == null || PluginIC2.resin == null) { - Log.warning( - "Failed to init a farm logic %s since IC2 was not found", - getClass().getName()); + Log.warning("Failed to init a farm logic %s since IC2 was not found", getClass().getName()); inActive = true; } } diff --git a/src/main/java/forestry/farming/logic/FarmLogicShroom.java b/src/main/java/forestry/farming/logic/FarmLogicShroom.java index ad5eb4d91..b4d89225f 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicShroom.java +++ b/src/main/java/forestry/farming/logic/FarmLogicShroom.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import java.util.ArrayList; +import java.util.Collection; + +import net.minecraft.init.Blocks; +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.farming.Farmables; import forestry.api.farming.IFarmHousing; -import java.util.ArrayList; -import java.util.Collection; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; public class FarmLogicShroom extends FarmLogicArboreal { diff --git a/src/main/java/forestry/farming/logic/FarmLogicSucculent.java b/src/main/java/forestry/farming/logic/FarmLogicSucculent.java index 18a1d0e4a..11c7887eb 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicSucculent.java +++ b/src/main/java/forestry/farming/logic/FarmLogicSucculent.java @@ -1,15 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import java.util.Collection; +import java.util.Stack; + +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +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; import forestry.api.farming.FarmDirection; @@ -19,13 +26,6 @@ import forestry.api.farming.IFarmHousing; import forestry.api.farming.IFarmable; import forestry.core.utils.ItemStackUtil; import forestry.core.utils.vect.Vect; -import java.util.Collection; -import java.util.Stack; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; public class FarmLogicSucculent extends FarmLogic { diff --git a/src/main/java/forestry/farming/logic/FarmLogicVegetable.java b/src/main/java/forestry/farming/logic/FarmLogicVegetable.java index 91fc1b45b..1b866aa69 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicVegetable.java +++ b/src/main/java/forestry/farming/logic/FarmLogicVegetable.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import net.minecraft.init.Items; +import net.minecraft.util.IIcon; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.farming.Farmables; import forestry.api.farming.IFarmHousing; -import net.minecraft.init.Items; -import net.minecraft.util.IIcon; public class FarmLogicVegetable extends FarmLogicCrops { diff --git a/src/main/java/forestry/farming/logic/FarmLogicWatered.java b/src/main/java/forestry/farming/logic/FarmLogicWatered.java index b02581409..2616b1352 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicWatered.java +++ b/src/main/java/forestry/farming/logic/FarmLogicWatered.java @@ -1,15 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; + import forestry.api.farming.FarmDirection; import forestry.api.farming.IFarmHousing; import forestry.core.fluids.Fluids; @@ -18,14 +26,6 @@ import forestry.core.utils.ItemStackUtil; import forestry.core.utils.vect.Vect; import forestry.core.utils.vect.VectUtil; import forestry.farming.FarmHelper; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.fluids.FluidStack; public abstract class FarmLogicWatered extends FarmLogic { @@ -89,7 +89,7 @@ public abstract class FarmLogicWatered extends FarmLogic { private boolean maintainSoil(int x, int y, int z, FarmDirection direction, int extent) { World world = getWorld(); - ItemStack[] resources = new ItemStack[] {resource}; + ItemStack[] resources = new ItemStack[] { resource }; for (int i = 0; i < extent; i++) { Vect position = translateWithOffset(x, y, z, direction, i); @@ -151,7 +151,7 @@ public abstract class FarmLogicWatered extends FarmLogic { } private boolean trySetSoil(Vect position) { - ItemStack[] resources = new ItemStack[] {resource}; + ItemStack[] resources = new ItemStack[] { resource }; if (!housing.getFarmInventory().hasResources(resources)) { return false; } diff --git a/src/main/java/forestry/farming/logic/FarmableBasicAgricraft.java b/src/main/java/forestry/farming/logic/FarmableBasicAgricraft.java index 898717b98..9b5606151 100644 --- a/src/main/java/forestry/farming/logic/FarmableBasicAgricraft.java +++ b/src/main/java/forestry/farming/logic/FarmableBasicAgricraft.java @@ -1,24 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + import forestry.api.farming.ICrop; import forestry.api.farming.IFarmableBasic; import forestry.core.config.Constants; import forestry.core.utils.ItemStackUtil; import forestry.core.utils.vect.Vect; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; public class FarmableBasicAgricraft implements IFarmableBasic { diff --git a/src/main/java/forestry/farming/logic/FarmableBasicFruit.java b/src/main/java/forestry/farming/logic/FarmableBasicFruit.java index 3c7a6c0fe..1e0a02ebb 100644 --- a/src/main/java/forestry/farming/logic/FarmableBasicFruit.java +++ b/src/main/java/forestry/farming/logic/FarmableBasicFruit.java @@ -1,24 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + import forestry.api.farming.ICrop; import forestry.api.farming.IFarmableBasic; import forestry.core.config.Constants; import forestry.core.utils.ItemStackUtil; import forestry.core.utils.vect.Vect; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; public class FarmableBasicFruit implements IFarmableBasic { diff --git a/src/main/java/forestry/farming/logic/FarmableBasicGrowthCraft.java b/src/main/java/forestry/farming/logic/FarmableBasicGrowthCraft.java index 18aec0351..8f20402d8 100644 --- a/src/main/java/forestry/farming/logic/FarmableBasicGrowthCraft.java +++ b/src/main/java/forestry/farming/logic/FarmableBasicGrowthCraft.java @@ -1,24 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + import forestry.api.farming.ICrop; import forestry.api.farming.IFarmableBasic; import forestry.core.config.Constants; import forestry.core.utils.ItemStackUtil; import forestry.core.utils.vect.Vect; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; public class FarmableBasicGrowthCraft implements IFarmableBasic { diff --git a/src/main/java/forestry/farming/logic/FarmableBasicIC2Crop.java b/src/main/java/forestry/farming/logic/FarmableBasicIC2Crop.java index c7888227a..b02b932f1 100644 --- a/src/main/java/forestry/farming/logic/FarmableBasicIC2Crop.java +++ b/src/main/java/forestry/farming/logic/FarmableBasicIC2Crop.java @@ -1,15 +1,17 @@ package forestry.farming.logic; -import forestry.api.farming.ICrop; -import forestry.api.farming.IFarmable; -import forestry.core.utils.vect.Vect; -import forestry.plugins.compat.PluginIC2; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import forestry.api.farming.ICrop; +import forestry.api.farming.IFarmable; +import forestry.core.utils.vect.Vect; +import forestry.plugins.compat.PluginIC2; + public class FarmableBasicIC2Crop implements IFarmable { + @Override public boolean isSaplingAt(World world, int x, int y, int z) { TileEntity crop = world.getTileEntity(x, y, z); diff --git a/src/main/java/forestry/farming/logic/FarmableCocoa.java b/src/main/java/forestry/farming/logic/FarmableCocoa.java index 159c66560..84e6e6a15 100755 --- a/src/main/java/forestry/farming/logic/FarmableCocoa.java +++ b/src/main/java/forestry/farming/logic/FarmableCocoa.java @@ -1,19 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; -import forestry.api.farming.ICrop; -import forestry.api.farming.IFarmableBasic; -import forestry.core.utils.BlockUtil; -import forestry.core.utils.vect.Vect; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; @@ -22,6 +16,11 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import forestry.api.farming.ICrop; +import forestry.api.farming.IFarmableBasic; +import forestry.core.utils.BlockUtil; +import forestry.core.utils.vect.Vect; + public class FarmableCocoa implements IFarmableBasic { private static final Block COCOA_PLANT = Blocks.cocoa; diff --git a/src/main/java/forestry/farming/logic/FarmableGE.java b/src/main/java/forestry/farming/logic/FarmableGE.java index 0627bf368..263963666 100755 --- a/src/main/java/forestry/farming/logic/FarmableGE.java +++ b/src/main/java/forestry/farming/logic/FarmableGE.java @@ -1,27 +1,27 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + import forestry.api.arboriculture.IAlleleTreeSpecies; import forestry.api.farming.ICrop; import forestry.api.farming.IFarmableBasic; import forestry.arboriculture.genetics.TreeGenome; import forestry.core.utils.vect.Vect; import forestry.plugins.PluginArboriculture; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; public class FarmableGE implements IFarmableBasic { + @Override public boolean isSapling(Block block, int meta) { return PluginArboriculture.blocks.saplingGE == block; diff --git a/src/main/java/forestry/farming/logic/FarmableGenericCrop.java b/src/main/java/forestry/farming/logic/FarmableGenericCrop.java index fdf7cc794..834f7113e 100755 --- a/src/main/java/forestry/farming/logic/FarmableGenericCrop.java +++ b/src/main/java/forestry/farming/logic/FarmableGenericCrop.java @@ -1,23 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; -import forestry.api.farming.ICrop; -import forestry.api.farming.IFarmableBasic; -import forestry.core.utils.vect.Vect; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; +import forestry.api.farming.ICrop; +import forestry.api.farming.IFarmableBasic; +import forestry.core.utils.vect.Vect; + public class FarmableGenericCrop implements IFarmableBasic { private final ItemStack seed; diff --git a/src/main/java/forestry/farming/logic/FarmableGenericSapling.java b/src/main/java/forestry/farming/logic/FarmableGenericSapling.java index 931eff5e7..a009e97a8 100755 --- a/src/main/java/forestry/farming/logic/FarmableGenericSapling.java +++ b/src/main/java/forestry/farming/logic/FarmableGenericSapling.java @@ -1,23 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + import forestry.api.farming.ICrop; import forestry.api.farming.IFarmableBasic; import forestry.core.utils.ItemStackUtil; import forestry.core.utils.vect.Vect; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; public class FarmableGenericSapling implements IFarmableBasic { diff --git a/src/main/java/forestry/farming/logic/FarmableGourd.java b/src/main/java/forestry/farming/logic/FarmableGourd.java index 533f2ca4f..b86df169e 100755 --- a/src/main/java/forestry/farming/logic/FarmableGourd.java +++ b/src/main/java/forestry/farming/logic/FarmableGourd.java @@ -1,24 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + import forestry.api.farming.ICrop; import forestry.api.farming.IFarmableBasic; import forestry.core.config.Constants; import forestry.core.utils.ItemStackUtil; import forestry.core.utils.vect.Vect; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; public class FarmableGourd implements IFarmableBasic { diff --git a/src/main/java/forestry/farming/logic/FarmableReference.java b/src/main/java/forestry/farming/logic/FarmableReference.java index 9c64c8848..0acd2d6cd 100644 --- a/src/main/java/forestry/farming/logic/FarmableReference.java +++ b/src/main/java/forestry/farming/logic/FarmableReference.java @@ -1,16 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; public enum FarmableReference { + Arboreal, Wheat, Cocoa, @@ -23,8 +22,7 @@ public enum FarmableReference { Rubber, Shroom, Succulentes, - Vegetables, - ; + Vegetables,; private final String VALUE; diff --git a/src/main/java/forestry/farming/logic/FarmableStacked.java b/src/main/java/forestry/farming/logic/FarmableStacked.java index cc172edfa..a9bdc90c0 100755 --- a/src/main/java/forestry/farming/logic/FarmableStacked.java +++ b/src/main/java/forestry/farming/logic/FarmableStacked.java @@ -1,24 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + import forestry.api.farming.ICrop; import forestry.api.farming.IFarmableBasic; import forestry.core.config.Constants; import forestry.core.utils.ItemStackUtil; import forestry.core.utils.vect.Vect; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; public class FarmableStacked implements IFarmableBasic { diff --git a/src/main/java/forestry/farming/logic/FarmableVanillaMushroom.java b/src/main/java/forestry/farming/logic/FarmableVanillaMushroom.java index 3e47083a6..5a3baef0c 100644 --- a/src/main/java/forestry/farming/logic/FarmableVanillaMushroom.java +++ b/src/main/java/forestry/farming/logic/FarmableVanillaMushroom.java @@ -1,26 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import net.minecraft.block.Block; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + import forestry.api.farming.ICrop; import forestry.core.config.Constants; import forestry.core.proxy.Proxies; import forestry.core.utils.ItemStackUtil; import forestry.core.utils.vect.Vect; import forestry.plugins.PluginFarming; -import net.minecraft.block.Block; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; public class FarmableVanillaMushroom extends FarmableGenericSapling { diff --git a/src/main/java/forestry/farming/logic/FarmableVanillaSapling.java b/src/main/java/forestry/farming/logic/FarmableVanillaSapling.java index a1112f088..bace8df7a 100755 --- a/src/main/java/forestry/farming/logic/FarmableVanillaSapling.java +++ b/src/main/java/forestry/farming/logic/FarmableVanillaSapling.java @@ -1,25 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.logic; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; + import forestry.api.arboriculture.ITree; import forestry.api.arboriculture.TreeManager; import forestry.api.genetics.IIndividual; import forestry.core.utils.GeneticsUtil; import forestry.plugins.PluginManager; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; public class FarmableVanillaSapling extends FarmableGenericSapling { diff --git a/src/main/java/forestry/farming/multiblock/FakeFarmController.java b/src/main/java/forestry/farming/multiblock/FakeFarmController.java index 026ac9d69..79d92e617 100644 --- a/src/main/java/forestry/farming/multiblock/FakeFarmController.java +++ b/src/main/java/forestry/farming/multiblock/FakeFarmController.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.multiblock; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.fluids.FluidStack; + import forestry.api.circuits.CircuitSocketType; import forestry.api.circuits.ICircuitSocketType; import forestry.api.farming.FarmDirection; @@ -23,12 +26,9 @@ import forestry.core.inventory.IInventoryAdapter; import forestry.core.multiblock.FakeMultiblockController; import forestry.farming.gui.IFarmLedgerDelegate; import io.netty.util.internal.EmptyArrays; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.fluids.FluidStack; public class FakeFarmController extends FakeMultiblockController implements IFarmControllerInternal { + public static final FakeFarmController instance = new FakeFarmController(); private FakeFarmController() {} @@ -121,6 +121,7 @@ public class FakeFarmController extends FakeMultiblockController implements IFar } private static class FakeFarmInventory implements IFarmInventory { + public static final FakeFarmInventory instance = new FakeFarmInventory(); private FakeFarmInventory() {} @@ -170,6 +171,7 @@ public class FakeFarmController extends FakeMultiblockController implements IFar } private static class FakeFarmLedgerDelegate implements IFarmLedgerDelegate { + public static final FakeFarmLedgerDelegate instance = new FakeFarmLedgerDelegate(); private FakeFarmLedgerDelegate() {} diff --git a/src/main/java/forestry/farming/multiblock/FarmController.java b/src/main/java/forestry/farming/multiblock/FarmController.java index f2e013cff..036a24ac4 100644 --- a/src/main/java/forestry/farming/multiblock/FarmController.java +++ b/src/main/java/forestry/farming/multiblock/FarmController.java @@ -1,15 +1,37 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.multiblock; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.EnumMap; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.Stack; + +import net.minecraft.block.Block; +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.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + import forestry.api.circuits.ChipsetManager; import forestry.api.circuits.CircuitSocketType; import forestry.api.circuits.ICircuitBoard; @@ -52,33 +74,12 @@ import forestry.farming.gui.IFarmLedgerDelegate; import forestry.farming.logic.FarmLogicArboreal; import forestry.farming.tiles.TileFarmGearbox; import forestry.farming.tiles.TileFarmPlain; -import java.io.IOException; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.EnumMap; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.Stack; -import net.minecraft.block.Block; -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.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; public class FarmController extends RectangularMultiblockControllerBase implements IFarmControllerInternal, ILiquidTankTile { private enum Stage { + CULTIVATE, HARVEST; @@ -414,7 +415,7 @@ public class FarmController extends RectangularMultiblockControllerBase public int[] getCoords() { if (coords == null) { ChunkCoordinates centerCoord = getCenterCoord(); - coords = new int[] {centerCoord.posX, centerCoord.posY, centerCoord.posZ}; + coords = new int[] { centerCoord.posX, centerCoord.posY, centerCoord.posZ }; } return coords; } @@ -422,7 +423,7 @@ public class FarmController extends RectangularMultiblockControllerBase @Override public int[] getOffset() { if (offset == null) { - offset = new int[] {-getArea()[0] / 2, -2, -getArea()[2] / 2}; + offset = new int[] { -getArea()[0] / 2, -2, -getArea()[2] / 2 }; } return offset; } @@ -430,7 +431,7 @@ public class FarmController extends RectangularMultiblockControllerBase @Override public int[] getArea() { if (area == null) { - area = new int[] {7 + (allowedExtent * 2), 13, 7 + (allowedExtent * 2)}; + area = new int[] { 7 + (allowedExtent * 2), 13, 7 + (allowedExtent * 2) }; } return area; } @@ -536,13 +537,8 @@ public class FarmController extends RectangularMultiblockControllerBase setExtents(worldObj, targets); } - private static void createTargets( - World world, - Map> targets, - Vect targetStart, - final int allowedExtent, - final int farmSizeNorthSouth, - final int farmSizeEastWest) { + private static void createTargets(World world, Map> targets, Vect targetStart, + final int allowedExtent, final int farmSizeNorthSouth, final int farmSizeEastWest) { for (FarmDirection farmSide : FarmDirection.values()) { @@ -600,8 +596,8 @@ public class FarmController extends RectangularMultiblockControllerBase return null; } - private static boolean isCycleCanceledByListeners( - IFarmLogic logic, FarmDirection direction, Iterable farmListeners) { + private static boolean isCycleCanceledByListeners(IFarmLogic logic, FarmDirection direction, + Iterable farmListeners) { for (IFarmListener listener : farmListeners) { if (listener.cancelTask(logic, direction)) { return true; @@ -613,8 +609,7 @@ public class FarmController extends RectangularMultiblockControllerBase private static void setExtents(World worldObj, Map> targets) { for (List targetsList : targets.values()) { if (!targetsList.isEmpty()) { - Vect groundPosition = - getGroundPosition(worldObj, targetsList.get(0).getStart()); + Vect groundPosition = getGroundPosition(worldObj, targetsList.get(0).getStart()); for (FarmTarget target : targetsList) { target.setExtentAndYOffset(worldObj, groundPosition); @@ -624,14 +619,15 @@ public class FarmController extends RectangularMultiblockControllerBase } private static class FarmWorkStatus { + public boolean didWork = false; public boolean hasFarmland = false; public boolean hasFertilizer = false; public boolean hasLiquid = false; } - private FarmWorkStatus cultivateTargets( - FarmWorkStatus farmWorkStatus, List farmTargets, IFarmLogic logic) { + private FarmWorkStatus cultivateTargets(FarmWorkStatus farmWorkStatus, List farmTargets, + IFarmLogic logic) { float hydrationModifier = hydrationManager.getHydrationModifier(); final int fertilizerConsumption = logic.getFertilizerConsumption(); @@ -674,7 +670,11 @@ public class FarmController extends RectangularMultiblockControllerBase private static boolean cultivateTarget(FarmTarget target, IFarmLogic logic, Iterable farmListeners) { Vect targetPosition = target.getStart().add(0, target.getYOffset(), 0); if (logic.cultivate( - targetPosition.x, targetPosition.y, targetPosition.z, target.getDirection(), target.getExtent())) { + targetPosition.x, + targetPosition.y, + targetPosition.z, + target.getDirection(), + target.getExtent())) { for (IFarmListener listener : farmListeners) { listener.hasCultivated( logic, @@ -690,8 +690,8 @@ public class FarmController extends RectangularMultiblockControllerBase return false; } - private static Collection harvestTargets( - List farmTargets, IFarmLogic logic, Iterable farmListeners) { + private static Collection harvestTargets(List farmTargets, IFarmLogic logic, + Iterable farmListeners) { if (farmTargets != null) { for (FarmTarget target : farmTargets) { Collection harvested = harvestTarget(target, logic, farmListeners); @@ -704,8 +704,8 @@ public class FarmController extends RectangularMultiblockControllerBase return Collections.emptyList(); } - private static Collection harvestTarget( - FarmTarget target, IFarmLogic logic, Iterable farmListeners) { + private static Collection harvestTarget(FarmTarget target, IFarmLogic logic, + Iterable farmListeners) { Collection harvested = logic.harvest( target.getStart().x, target.getStart().y + target.getYOffset(), diff --git a/src/main/java/forestry/farming/multiblock/FarmFertilizerManager.java b/src/main/java/forestry/farming/multiblock/FarmFertilizerManager.java index 94fe00aa0..337aab7af 100644 --- a/src/main/java/forestry/farming/multiblock/FarmFertilizerManager.java +++ b/src/main/java/forestry/farming/multiblock/FarmFertilizerManager.java @@ -1,24 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.multiblock; +import java.io.IOException; + +import net.minecraft.nbt.NBTTagCompound; + import forestry.api.core.ForestryAPI; import forestry.api.core.INBTTagable; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IStreamable; -import java.io.IOException; -import net.minecraft.nbt.NBTTagCompound; public class FarmFertilizerManager implements INBTTagable, IStreamable { + private static final int BUFFER_FERTILIZER = 200; private final int fertilizerValue; diff --git a/src/main/java/forestry/farming/multiblock/FarmHydrationManager.java b/src/main/java/forestry/farming/multiblock/FarmHydrationManager.java index 7084e28ee..8d3ccd539 100644 --- a/src/main/java/forestry/farming/multiblock/FarmHydrationManager.java +++ b/src/main/java/forestry/farming/multiblock/FarmHydrationManager.java @@ -1,15 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.multiblock; +import java.io.IOException; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; + import forestry.api.core.BiomeHelper; import forestry.api.core.INBTTagable; import forestry.core.network.DataInputStreamForestry; @@ -17,12 +21,9 @@ import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IStreamable; import forestry.core.tiles.IClimatised; import forestry.farming.gui.IFarmLedgerDelegate; -import java.io.IOException; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; public class FarmHydrationManager implements IFarmLedgerDelegate, INBTTagable, IStreamable { + private static final int DELAY_HYDRATION = 100; private static final float RAINFALL_MODIFIER_MAX = 15f; private static final float RAINFALL_MODIFIER_MIN = 0.5f; diff --git a/src/main/java/forestry/farming/multiblock/FarmMultiblockSizeLimits.java b/src/main/java/forestry/farming/multiblock/FarmMultiblockSizeLimits.java index f3d66dd7a..ac58a670f 100644 --- a/src/main/java/forestry/farming/multiblock/FarmMultiblockSizeLimits.java +++ b/src/main/java/forestry/farming/multiblock/FarmMultiblockSizeLimits.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.multiblock; import forestry.core.multiblock.IMultiblockSizeLimits; class FarmMultiblockSizeLimits implements IMultiblockSizeLimits { + public static final FarmMultiblockSizeLimits instance = new FarmMultiblockSizeLimits(); private FarmMultiblockSizeLimits() {} diff --git a/src/main/java/forestry/farming/multiblock/IFarmControllerInternal.java b/src/main/java/forestry/farming/multiblock/IFarmControllerInternal.java index dda2a607e..6ac0edf82 100644 --- a/src/main/java/forestry/farming/multiblock/IFarmControllerInternal.java +++ b/src/main/java/forestry/farming/multiblock/IFarmControllerInternal.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.multiblock; @@ -20,13 +18,9 @@ import forestry.core.network.IStreamableGui; import forestry.core.tiles.IClimatised; import forestry.farming.gui.IFarmLedgerDelegate; -public interface IFarmControllerInternal - extends IFarmController, - IMultiblockControllerInternal, - ISocketable, - IClimatised, - IRestrictedAccess, - IStreamableGui { +public interface IFarmControllerInternal extends IFarmController, IMultiblockControllerInternal, ISocketable, + IClimatised, IRestrictedAccess, IStreamableGui { + IFarmLedgerDelegate getFarmLedgerDelegate(); IInventoryAdapter getInternalInventory(); diff --git a/src/main/java/forestry/farming/multiblock/InventoryFarm.java b/src/main/java/forestry/farming/multiblock/InventoryFarm.java index 5edcc8a24..5a1ed3e99 100644 --- a/src/main/java/forestry/farming/multiblock/InventoryFarm.java +++ b/src/main/java/forestry/farming/multiblock/InventoryFarm.java @@ -1,15 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.multiblock; +import java.util.Stack; + +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.fluids.Fluid; + import forestry.api.farming.FarmDirection; import forestry.api.farming.IFarmInventory; import forestry.api.farming.IFarmLogic; @@ -24,15 +31,9 @@ import forestry.core.utils.SlotUtil; import forestry.plugins.PluginCore; import forestry.plugins.PluginManager; import ic2.api.item.IC2Items; -import java.util.Stack; -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.fluids.Fluid; public class InventoryFarm extends InventoryAdapterRestricted implements IFarmInventory { + public static final int SLOT_RESOURCES_1 = 0; public static final int SLOT_RESOURCES_COUNT = 6; public static final int SLOT_GERMLINGS_1 = 6; @@ -45,8 +46,7 @@ public class InventoryFarm extends InventoryAdapterRestricted implements IFarmIn public static final int SLOT_CAN = 21; public static final int SLOT_CAN_COUNT = 1; - public static final int SLOT_COUNT = SLOT_RESOURCES_COUNT - + SLOT_GERMLINGS_COUNT + public static final int SLOT_COUNT = SLOT_RESOURCES_COUNT + SLOT_GERMLINGS_COUNT + SLOT_PRODUCTION_COUNT + SLOT_FERTILIZER_COUNT + SLOT_CAN_COUNT; @@ -95,8 +95,8 @@ public class InventoryFarm extends InventoryAdapterRestricted implements IFarmIn @Override public void removeResources(ItemStack[] resources) { - EntityPlayer player = PlayerUtil.getPlayer( - farmController.getWorld(), farmController.getAccessHandler().getOwner()); + EntityPlayer player = PlayerUtil + .getPlayer(farmController.getWorld(), farmController.getAccessHandler().getOwner()); InventoryUtil.removeSets(resourcesInventory, 1, resources, player, false, true, false, true); } diff --git a/src/main/java/forestry/farming/multiblock/MultiblockLogicFarm.java b/src/main/java/forestry/farming/multiblock/MultiblockLogicFarm.java index 81b864b25..330a6584d 100644 --- a/src/main/java/forestry/farming/multiblock/MultiblockLogicFarm.java +++ b/src/main/java/forestry/farming/multiblock/MultiblockLogicFarm.java @@ -1,20 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.multiblock; -import forestry.api.multiblock.IMultiblockLogicFarm; -import forestry.core.multiblock.MultiblockLogic; import net.minecraft.world.World; +import forestry.api.multiblock.IMultiblockLogicFarm; +import forestry.core.multiblock.MultiblockLogic; + public class MultiblockLogicFarm extends MultiblockLogic implements IMultiblockLogicFarm { + public MultiblockLogicFarm() { super(IFarmControllerInternal.class); } diff --git a/src/main/java/forestry/farming/proxy/ProxyFarming.java b/src/main/java/forestry/farming/proxy/ProxyFarming.java index e55db4057..e97f0438c 100755 --- a/src/main/java/forestry/farming/proxy/ProxyFarming.java +++ b/src/main/java/forestry/farming/proxy/ProxyFarming.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.proxy; diff --git a/src/main/java/forestry/farming/proxy/ProxyFarmingClient.java b/src/main/java/forestry/farming/proxy/ProxyFarmingClient.java index fc33c4b73..c751f1cb4 100644 --- a/src/main/java/forestry/farming/proxy/ProxyFarmingClient.java +++ b/src/main/java/forestry/farming/proxy/ProxyFarmingClient.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.proxy; +import net.minecraft.item.Item; +import net.minecraftforge.client.MinecraftForgeClient; + import cpw.mods.fml.client.registry.RenderingRegistry; import forestry.farming.render.RenderFarmBlock; import forestry.farming.render.RenderFarmItem; import forestry.plugins.PluginFarming; -import net.minecraft.item.Item; -import net.minecraftforge.client.MinecraftForgeClient; public class ProxyFarmingClient extends ProxyFarming { @@ -24,7 +23,7 @@ public class ProxyFarmingClient extends ProxyFarming { PluginFarming.modelIdFarmBlock = RenderingRegistry.getNextAvailableRenderId(); RenderingRegistry.registerBlockHandler(new RenderFarmBlock()); - MinecraftForgeClient.registerItemRenderer( - Item.getItemFromBlock(PluginFarming.blocks.farm), new RenderFarmItem()); + MinecraftForgeClient + .registerItemRenderer(Item.getItemFromBlock(PluginFarming.blocks.farm), new RenderFarmItem()); } } diff --git a/src/main/java/forestry/farming/render/EnumFarmBlockTexture.java b/src/main/java/forestry/farming/render/EnumFarmBlockTexture.java index 8305bfc5b..9685919a6 100644 --- a/src/main/java/forestry/farming/render/EnumFarmBlockTexture.java +++ b/src/main/java/forestry/farming/render/EnumFarmBlockTexture.java @@ -1,28 +1,29 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.render; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.core.render.TextureManager; -import forestry.farming.blocks.BlockFarmType; import java.util.Arrays; import java.util.List; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.IIcon; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.core.render.TextureManager; +import forestry.farming.blocks.BlockFarmType; + public enum EnumFarmBlockTexture { + BRICK_STONE(new ItemStack(Blocks.stonebrick, 1, 0)), BRICK_MOSSY(new ItemStack(Blocks.stonebrick, 1, 1)), BRICK_CRACKED(new ItemStack(Blocks.stonebrick, 1, 2)), diff --git a/src/main/java/forestry/farming/render/RenderFarmBlock.java b/src/main/java/forestry/farming/render/RenderFarmBlock.java index 182d37f70..55e876577 100644 --- a/src/main/java/forestry/farming/render/RenderFarmBlock.java +++ b/src/main/java/forestry/farming/render/RenderFarmBlock.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.render; +import net.minecraft.block.Block; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.world.IBlockAccess; + import forestry.core.render.RenderOverlayBlock; import forestry.farming.blocks.BlockFarm; import forestry.plugins.PluginFarming; -import net.minecraft.block.Block; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.world.IBlockAccess; public class RenderFarmBlock extends RenderOverlayBlock { @@ -23,8 +22,8 @@ public class RenderFarmBlock extends RenderOverlayBlock { public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {} @Override - public boolean renderWorldBlock( - IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) { + public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, + RenderBlocks renderer) { // Render the plain block. renderer.renderStandardBlock(block, x, y, z); @@ -33,8 +32,8 @@ public class RenderFarmBlock extends RenderOverlayBlock { return true; } - private static void renderFarmOverlay( - IBlockAccess world, BlockFarm block, int x, int y, int z, RenderBlocks renderer) { + private static void renderFarmOverlay(IBlockAccess world, BlockFarm block, int x, int y, int z, + RenderBlocks renderer) { int mixedBrightness = block.getMixedBrightnessForBlock(world, x, y, z); int metadata = world.getBlockMetadata(x, y, z); diff --git a/src/main/java/forestry/farming/render/RenderFarmItem.java b/src/main/java/forestry/farming/render/RenderFarmItem.java index 00ea42f5e..f4ab86a52 100644 --- a/src/main/java/forestry/farming/render/RenderFarmItem.java +++ b/src/main/java/forestry/farming/render/RenderFarmItem.java @@ -1,27 +1,27 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.render; -import forestry.core.utils.ItemStackUtil; -import forestry.farming.blocks.BlockFarm; import net.minecraft.client.renderer.RenderBlocks; import net.minecraft.client.renderer.Tessellator; import net.minecraft.item.ItemStack; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.opengl.GL11; +import forestry.core.utils.ItemStackUtil; +import forestry.farming.blocks.BlockFarm; + public class RenderFarmItem implements IItemRenderer { - private static void renderFarmBlock( - RenderBlocks render, ItemStack item, float translateX, float translateY, float translateZ) { + private static void renderFarmBlock(RenderBlocks render, ItemStack item, float translateX, float translateY, + float translateZ) { Tessellator tessellator = Tessellator.instance; BlockFarm block = (BlockFarm) ItemStackUtil.getBlock(item); if (block == null) { diff --git a/src/main/java/forestry/farming/tiles/TileFarm.java b/src/main/java/forestry/farming/tiles/TileFarm.java index ae8006168..fe6b0c0ad 100644 --- a/src/main/java/forestry/farming/tiles/TileFarm.java +++ b/src/main/java/forestry/farming/tiles/TileFarm.java @@ -1,15 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.farming.tiles; +import java.io.IOException; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChunkCoordinates; + import forestry.api.circuits.ICircuitSocketType; import forestry.api.core.IErrorLogic; import forestry.api.core.IErrorLogicSource; @@ -31,21 +37,9 @@ import forestry.farming.gui.ContainerFarm; import forestry.farming.gui.GuiFarm; import forestry.farming.multiblock.MultiblockLogicFarm; import forestry.farming.render.EnumFarmBlockTexture; -import java.io.IOException; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.ChunkCoordinates; -public abstract class TileFarm extends MultiblockTileEntityForestry - implements IFarmComponent, - IHintSource, - ISocketable, - IStreamableGui, - IErrorLogicSource, - IRestrictedAccess, - ITitled { +public abstract class TileFarm extends MultiblockTileEntityForestry implements IFarmComponent, + IHintSource, ISocketable, IStreamableGui, IErrorLogicSource, IRestrictedAccess, ITitled { private EnumFarmBlockTexture farmBlockTexture = EnumFarmBlockTexture.BRICK_STONE; @@ -54,8 +48,8 @@ public abstract class TileFarm extends MultiblockTileEntityForestry 0) { parameter = parameters[0]; @@ -78,7 +76,7 @@ public class TriggerLowSoil extends Trigger { } else { ItemStack filter = parameter.getItemStack().copy(); filter.stackSize = threshold; - return !InventoryUtil.contains(resourcesInventory, new ItemStack[] {filter}); + return !InventoryUtil.contains(resourcesInventory, new ItemStack[] { filter }); } } } diff --git a/src/main/java/forestry/food/BeverageEffect.java b/src/main/java/forestry/food/BeverageEffect.java index b5473fcb8..ba1b550d2 100755 --- a/src/main/java/forestry/food/BeverageEffect.java +++ b/src/main/java/forestry/food/BeverageEffect.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.food; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; + import forestry.api.food.BeverageManager; import forestry.api.food.IBeverageEffect; import forestry.core.utils.StringUtil; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; public abstract class BeverageEffect implements IBeverageEffect { @@ -33,8 +33,12 @@ public abstract class BeverageEffect implements IBeverageEffect { this.id = id; if (BeverageManager.effectList[id] != null) { - throw new RuntimeException("Beverage effect slot " + id + " was already occupied by " - + BeverageManager.effectList[id].toString() + " when trying to add " + this.toString()); + throw new RuntimeException( + "Beverage effect slot " + id + + " was already occupied by " + + BeverageManager.effectList[id].toString() + + " when trying to add " + + this.toString()); } else { BeverageManager.effectList[id] = this; } diff --git a/src/main/java/forestry/food/BeverageEffectAntidote.java b/src/main/java/forestry/food/BeverageEffectAntidote.java index ab9272f4b..96eb21dd1 100755 --- a/src/main/java/forestry/food/BeverageEffectAntidote.java +++ b/src/main/java/forestry/food/BeverageEffectAntidote.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.food; diff --git a/src/main/java/forestry/food/BeverageEffectDrunk.java b/src/main/java/forestry/food/BeverageEffectDrunk.java index de63fd17d..89e8442a7 100755 --- a/src/main/java/forestry/food/BeverageEffectDrunk.java +++ b/src/main/java/forestry/food/BeverageEffectDrunk.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.food; diff --git a/src/main/java/forestry/food/InfuserIngredient.java b/src/main/java/forestry/food/InfuserIngredient.java index 33c58a039..b2740fc1a 100644 --- a/src/main/java/forestry/food/InfuserIngredient.java +++ b/src/main/java/forestry/food/InfuserIngredient.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.food; import net.minecraft.item.ItemStack; public class InfuserIngredient { + private final ItemStack ingredient; private final String description; diff --git a/src/main/java/forestry/food/InfuserIngredientManager.java b/src/main/java/forestry/food/InfuserIngredientManager.java index ccf184c83..64a2a16d1 100644 --- a/src/main/java/forestry/food/InfuserIngredientManager.java +++ b/src/main/java/forestry/food/InfuserIngredientManager.java @@ -1,21 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.food; -import forestry.api.food.IIngredientManager; import java.util.ArrayList; import java.util.List; + import net.minecraft.item.ItemStack; +import forestry.api.food.IIngredientManager; + public class InfuserIngredientManager implements IIngredientManager { + private final List ingredients = new ArrayList<>(); @Override @@ -35,8 +36,8 @@ public class InfuserIngredientManager implements IIngredientManager { return ingredient.getDescription(); } else if (ingredient.getIngredient().getItemDamage() >= 0 && ingredient.getIngredient().isItemEqual(itemstack)) { - return ingredient.getDescription(); - } + return ingredient.getDescription(); + } } return null; diff --git a/src/main/java/forestry/food/InfuserMixture.java b/src/main/java/forestry/food/InfuserMixture.java index fea6164c6..b42e2b382 100644 --- a/src/main/java/forestry/food/InfuserMixture.java +++ b/src/main/java/forestry/food/InfuserMixture.java @@ -1,28 +1,28 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.food; -import forestry.api.food.IBeverageEffect; import net.minecraft.item.ItemStack; +import forestry.api.food.IBeverageEffect; + /** * describes the itemstacks required to achieve a certain effect. */ public class InfuserMixture { + private final int meta; private final ItemStack[] ingredients; private final IBeverageEffect effect; public InfuserMixture(int meta, ItemStack ingredient, IBeverageEffect effect) { - this(meta, new ItemStack[] {ingredient}, effect); + this(meta, new ItemStack[] { ingredient }, effect); } public InfuserMixture(int meta, ItemStack ingredients[], IBeverageEffect effect) { diff --git a/src/main/java/forestry/food/InfuserMixtureManager.java b/src/main/java/forestry/food/InfuserMixtureManager.java index d164b28ec..8ca5e7aaf 100644 --- a/src/main/java/forestry/food/InfuserMixtureManager.java +++ b/src/main/java/forestry/food/InfuserMixtureManager.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.food; -import forestry.api.food.IBeverageEffect; -import forestry.api.food.IInfuserManager; import java.util.ArrayList; import java.util.Arrays; import java.util.List; + import net.minecraft.item.ItemStack; +import forestry.api.food.IBeverageEffect; +import forestry.api.food.IInfuserManager; + /** * contains the available mixtures. */ diff --git a/src/main/java/forestry/food/gui/ContainerInfuser.java b/src/main/java/forestry/food/gui/ContainerInfuser.java index f46d50b49..9ec72eb72 100755 --- a/src/main/java/forestry/food/gui/ContainerInfuser.java +++ b/src/main/java/forestry/food/gui/ContainerInfuser.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.food.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.core.gui.ContainerItemInventory; import forestry.core.gui.slots.SlotFiltered; import forestry.core.gui.slots.SlotOutput; import forestry.food.inventory.ItemInventoryInfuser; -import net.minecraft.entity.player.InventoryPlayer; public class ContainerInfuser extends ContainerItemInventory { diff --git a/src/main/java/forestry/food/gui/GuiInfuser.java b/src/main/java/forestry/food/gui/GuiInfuser.java index 1b226b24a..b820b8651 100755 --- a/src/main/java/forestry/food/gui/GuiInfuser.java +++ b/src/main/java/forestry/food/gui/GuiInfuser.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.food.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.api.food.BeverageManager; import forestry.core.config.Constants; import forestry.core.gui.GuiForestry; import forestry.food.inventory.ItemInventoryInfuser; -import net.minecraft.entity.player.InventoryPlayer; public class GuiInfuser extends GuiForestry { diff --git a/src/main/java/forestry/food/inventory/ItemInventoryInfuser.java b/src/main/java/forestry/food/inventory/ItemInventoryInfuser.java index c8d166c5e..9f4a5a282 100644 --- a/src/main/java/forestry/food/inventory/ItemInventoryInfuser.java +++ b/src/main/java/forestry/food/inventory/ItemInventoryInfuser.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.food.inventory; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import forestry.api.food.BeverageManager; import forestry.core.inventory.ItemInventory; import forestry.plugins.PluginFood; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class ItemInventoryInfuser extends ItemInventory { + private static final short inputSlot = 0; private static final short outputSlot = 1; private static final short ingredientSlot1 = 2; diff --git a/src/main/java/forestry/food/items/EnumBeverage.java b/src/main/java/forestry/food/items/EnumBeverage.java index dc87a4572..7cf1549b9 100644 --- a/src/main/java/forestry/food/items/EnumBeverage.java +++ b/src/main/java/forestry/food/items/EnumBeverage.java @@ -1,26 +1,28 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.food.items; +import java.awt.Color; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.util.IIcon; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.core.render.TextureManager; -import java.awt.Color; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.util.IIcon; public enum EnumBeverage implements ItemBeverage.IBeverageInfo { + MEAD_SHORT("meadShort", "glass", new Color(0xec9a19), new Color(0xffffff), 1, 0.2f, true), MEAD_CURATIVE("meadCurative", "glass", new Color(0xc5feff), new Color(0xffffff), 1, 0.2f, true), MEAD("mead", "glass", new Color(0xcc6600), new Color(0xffffff), 10, 0.1f, true); + public static final EnumBeverage[] VALUES = values(); private final String name; @@ -38,13 +40,7 @@ public enum EnumBeverage implements ItemBeverage.IBeverageInfo { private final float saturation; private final boolean isAlwaysEdible; - EnumBeverage( - String name, - String iconType, - Color primaryColor, - Color secondaryColor, - int heal, - float saturation, + EnumBeverage(String name, String iconType, Color primaryColor, Color secondaryColor, int heal, float saturation, boolean isAlwaysEdible) { this.name = name; this.iconType = iconType; diff --git a/src/main/java/forestry/food/items/ItemAmbrosia.java b/src/main/java/forestry/food/items/ItemAmbrosia.java index 55dbc8ac2..f4f720822 100755 --- a/src/main/java/forestry/food/items/ItemAmbrosia.java +++ b/src/main/java/forestry/food/items/ItemAmbrosia.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.food.items; -import forestry.core.config.Constants; -import forestry.core.items.ItemForestryFood; import net.minecraft.item.ItemStack; import net.minecraft.potion.Potion; +import forestry.core.config.Constants; +import forestry.core.items.ItemForestryFood; + public class ItemAmbrosia extends ItemForestryFood { public ItemAmbrosia() { diff --git a/src/main/java/forestry/food/items/ItemBeverage.java b/src/main/java/forestry/food/items/ItemBeverage.java index 662c87aac..cb026173a 100755 --- a/src/main/java/forestry/food/items/ItemBeverage.java +++ b/src/main/java/forestry/food/items/ItemBeverage.java @@ -1,23 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.food.items; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.food.IBeverageEffect; -import forestry.core.config.Config; -import forestry.core.items.ItemForestryFood; -import forestry.core.items.ItemOverlay; -import forestry.food.BeverageEffect; import java.util.List; + import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; @@ -28,8 +20,18 @@ 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; +import forestry.api.food.IBeverageEffect; +import forestry.core.config.Config; +import forestry.core.items.ItemForestryFood; +import forestry.core.items.ItemOverlay; +import forestry.food.BeverageEffect; + public class ItemBeverage extends ItemForestryFood { + public interface IBeverageInfo extends ItemOverlay.IOverlayInfo { + int getHeal(); float getSaturation(); @@ -121,7 +123,7 @@ public class ItemBeverage extends ItemForestryFood { return itemstack; } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { for (int i = 0; i < beverages.length; i++) { @@ -131,7 +133,7 @@ public class ItemBeverage extends ItemForestryFood { } } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean flag) { List effects = BeverageEffect.loadEffects(itemstack); diff --git a/src/main/java/forestry/food/items/ItemInfuser.java b/src/main/java/forestry/food/items/ItemInfuser.java index 45e1dd879..6ef7e3617 100644 --- a/src/main/java/forestry/food/items/ItemInfuser.java +++ b/src/main/java/forestry/food/items/ItemInfuser.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.food.items; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import forestry.core.items.ItemWithGui; import forestry.food.gui.ContainerInfuser; import forestry.food.gui.GuiInfuser; import forestry.food.inventory.ItemInventoryInfuser; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class ItemInfuser extends ItemWithGui { + @Override public Object getGui(EntityPlayer player, ItemStack heldItem, int data) { return new GuiInfuser(player.inventory, new ItemInventoryInfuser(player, heldItem)); diff --git a/src/main/java/forestry/food/items/ItemRegistryFood.java b/src/main/java/forestry/food/items/ItemRegistryFood.java index 590d52b58..ae7d8cf93 100644 --- a/src/main/java/forestry/food/items/ItemRegistryFood.java +++ b/src/main/java/forestry/food/items/ItemRegistryFood.java @@ -1,22 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.food.items; +import java.util.Collections; + +import net.minecraft.item.ItemStack; + import forestry.core.items.ItemForestryFood; import forestry.core.items.ItemRegistry; import forestry.food.BeverageEffect; -import java.util.Collections; -import net.minecraft.item.ItemStack; public class ItemRegistryFood extends ItemRegistry { + public final ItemForestryFood honeyedSlice; public final ItemBeverage beverage; public final ItemForestryFood ambrosia; diff --git a/src/main/java/forestry/lepidopterology/ButterflySpawner.java b/src/main/java/forestry/lepidopterology/ButterflySpawner.java index 140c7761a..d50e56797 100755 --- a/src/main/java/forestry/lepidopterology/ButterflySpawner.java +++ b/src/main/java/forestry/lepidopterology/ButterflySpawner.java @@ -1,15 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology; +import net.minecraft.world.World; + import forestry.api.arboriculture.ILeafTickHandler; import forestry.api.arboriculture.ITree; import forestry.api.lepidopterology.ButterflyManager; @@ -17,22 +17,18 @@ import forestry.api.lepidopterology.IButterfly; import forestry.core.utils.Log; import forestry.lepidopterology.entities.EntityButterfly; import forestry.plugins.PluginLepidopterology; -import net.minecraft.world.World; public class ButterflySpawner implements ILeafTickHandler { @Override public boolean onRandomLeafTick(ITree tree, World world, int x, int y, int z, boolean isDestroyed) { - if (world.rand.nextFloat() - >= tree.getGenome().getSappiness() * tree.getGenome().getYield()) { + if (world.rand.nextFloat() >= tree.getGenome().getSappiness() * tree.getGenome().getYield()) { return false; } - IButterfly spawn = ButterflyManager.butterflyRoot - .getIndividualTemplates() - .get(world.rand.nextInt( - ButterflyManager.butterflyRoot.getIndividualTemplates().size())); + IButterfly spawn = ButterflyManager.butterflyRoot.getIndividualTemplates() + .get(world.rand.nextInt(ButterflyManager.butterflyRoot.getIndividualTemplates().size())); if (world.rand.nextFloat() >= spawn.getGenome().getPrimary().getRarity() * 0.5f) { return false; } diff --git a/src/main/java/forestry/lepidopterology/blocks/BlockLepidopterology.java b/src/main/java/forestry/lepidopterology/blocks/BlockLepidopterology.java index 1bf84aec7..194d7cf67 100644 --- a/src/main/java/forestry/lepidopterology/blocks/BlockLepidopterology.java +++ b/src/main/java/forestry/lepidopterology/blocks/BlockLepidopterology.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.blocks; @@ -14,6 +12,7 @@ import forestry.api.core.Tabs; import forestry.core.blocks.BlockBase; public class BlockLepidopterology extends BlockBase { + public BlockLepidopterology() { super(true); setCreativeTab(Tabs.tabLepidopterology); diff --git a/src/main/java/forestry/lepidopterology/blocks/BlockLepidopterologyType.java b/src/main/java/forestry/lepidopterology/blocks/BlockLepidopterologyType.java index c2659ff95..1cbdfb41b 100644 --- a/src/main/java/forestry/lepidopterology/blocks/BlockLepidopterologyType.java +++ b/src/main/java/forestry/lepidopterology/blocks/BlockLepidopterologyType.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.blocks; @@ -17,7 +15,9 @@ import forestry.core.tiles.TileForestry; import forestry.lepidopterology.tiles.TileLepidopteristChest; public enum BlockLepidopterologyType implements IMachinePropertiesTESR { + LEPICHEST(TileLepidopteristChest.class, "LepiChest") { + @Override public IBlockRenderer getRenderer() { return Proxies.render.getRenderChest("lepichest"); diff --git a/src/main/java/forestry/lepidopterology/blocks/BlockRegistryLepidopterology.java b/src/main/java/forestry/lepidopterology/blocks/BlockRegistryLepidopterology.java index e99493e3d..5a9cdc50a 100644 --- a/src/main/java/forestry/lepidopterology/blocks/BlockRegistryLepidopterology.java +++ b/src/main/java/forestry/lepidopterology/blocks/BlockRegistryLepidopterology.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.blocks; @@ -14,6 +12,7 @@ import forestry.core.blocks.BlockRegistry; import forestry.core.items.ItemBlockForestry; public class BlockRegistryLepidopterology extends BlockRegistry { + public final BlockLepidopterology lepidopterology; public BlockRegistryLepidopterology() { diff --git a/src/main/java/forestry/lepidopterology/commands/CommandButterfly.java b/src/main/java/forestry/lepidopterology/commands/CommandButterfly.java index 5766e89c0..5354226e4 100644 --- a/src/main/java/forestry/lepidopterology/commands/CommandButterfly.java +++ b/src/main/java/forestry/lepidopterology/commands/CommandButterfly.java @@ -1,20 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.commands; +import net.minecraft.command.ICommandSender; +import net.minecraft.world.World; + import forestry.core.commands.CommandHelpers; import forestry.core.commands.SubCommand; import forestry.lepidopterology.entities.EntityButterfly; -import net.minecraft.command.ICommandSender; -import net.minecraft.world.World; /** * @author CovertJaguar diff --git a/src/main/java/forestry/lepidopterology/entities/AIButterflyBase.java b/src/main/java/forestry/lepidopterology/entities/AIButterflyBase.java index eb408d90a..93f0fb04f 100755 --- a/src/main/java/forestry/lepidopterology/entities/AIButterflyBase.java +++ b/src/main/java/forestry/lepidopterology/entities/AIButterflyBase.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.entities; @@ -29,7 +27,10 @@ public abstract class AIButterflyBase extends EntityAIBase { } Vec3 randomTarget = RandomPositionGenerator.findRandomTargetBlockAwayFrom( - entity, 16, 7, Vec3.createVectorHelper(entity.posX, entity.posY, entity.posZ)); + entity, + 16, + 7, + Vec3.createVectorHelper(entity.posX, entity.posY, entity.posZ)); if (randomTarget == null) { return null; @@ -43,8 +44,8 @@ public abstract class AIButterflyBase extends EntityAIBase { } protected Vec3 getRandomDestinationUpwards() { - Vec3 destination = Vec3.createVectorHelper( - entity.posX, entity.posY + entity.getRNG().nextInt(10) + 2, entity.posZ); + Vec3 destination = Vec3 + .createVectorHelper(entity.posX, entity.posY + entity.getRNG().nextInt(10) + 2, entity.posZ); if (validateDestination(destination, true)) { return destination; } else { diff --git a/src/main/java/forestry/lepidopterology/entities/AIButterflyFlee.java b/src/main/java/forestry/lepidopterology/entities/AIButterflyFlee.java index 4adfaf53b..f9da9be3a 100755 --- a/src/main/java/forestry/lepidopterology/entities/AIButterflyFlee.java +++ b/src/main/java/forestry/lepidopterology/entities/AIButterflyFlee.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.entities; @@ -22,8 +20,8 @@ public class AIButterflyFlee extends AIButterflyMovement { @Override public boolean shouldExecute() { - EntityPlayer player = entity.worldObj.getClosestPlayerToEntity( - entity, entity.getButterfly().getGenome().getPrimary().getFlightDistance()); + EntityPlayer player = entity.worldObj + .getClosestPlayerToEntity(entity, entity.getButterfly().getGenome().getPrimary().getFlightDistance()); if (player == null || player.isSneaking()) { return false; diff --git a/src/main/java/forestry/lepidopterology/entities/AIButterflyInteract.java b/src/main/java/forestry/lepidopterology/entities/AIButterflyInteract.java index cf6f132cb..248a0d236 100755 --- a/src/main/java/forestry/lepidopterology/entities/AIButterflyInteract.java +++ b/src/main/java/forestry/lepidopterology/entities/AIButterflyInteract.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.entities; diff --git a/src/main/java/forestry/lepidopterology/entities/AIButterflyMate.java b/src/main/java/forestry/lepidopterology/entities/AIButterflyMate.java index 3e900b84d..bc6b25c3f 100644 --- a/src/main/java/forestry/lepidopterology/entities/AIButterflyMate.java +++ b/src/main/java/forestry/lepidopterology/entities/AIButterflyMate.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.entities; @@ -44,16 +42,15 @@ public class AIButterflyMate extends AIButterflyInteract { @Override public void updateTask() { if (continueExecuting()) { - IPollinatable tile = - GeneticsUtil.getOrCreatePollinatable(null, entity.worldObj, rest.posX, rest.posY, rest.posZ); + IPollinatable tile = GeneticsUtil + .getOrCreatePollinatable(null, entity.worldObj, rest.posX, rest.posY, rest.posZ); if (tile instanceof IButterflyNursery) { IButterflyNursery nursery = (IButterflyNursery) tile; if (nursery.canNurse(entity.getButterfly())) { nursery.setCaterpillar(entity.getButterfly().spawnCaterpillar(nursery)); - // Log.finest("A butterfly '%s' laid an egg at %s/%s/%s.", entity.getButterfly().getIdent(), + // Log.finest("A butterfly '%s' laid an egg at %s/%s/%s.", entity.getButterfly().getIdent(), // rest.posX, rest.posY, rest.posZ); - if (entity.getRNG().nextFloat() - < 1.0f / entity.getButterfly().getGenome().getFertility()) { + if (entity.getRNG().nextFloat() < 1.0f / entity.getButterfly().getGenome().getFertility()) { entity.setHealth(0); } } diff --git a/src/main/java/forestry/lepidopterology/entities/AIButterflyMovement.java b/src/main/java/forestry/lepidopterology/entities/AIButterflyMovement.java index b964c358e..765adb4d1 100644 --- a/src/main/java/forestry/lepidopterology/entities/AIButterflyMovement.java +++ b/src/main/java/forestry/lepidopterology/entities/AIButterflyMovement.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.entities; diff --git a/src/main/java/forestry/lepidopterology/entities/AIButterflyPollinate.java b/src/main/java/forestry/lepidopterology/entities/AIButterflyPollinate.java index d764da36c..5755fbd34 100644 --- a/src/main/java/forestry/lepidopterology/entities/AIButterflyPollinate.java +++ b/src/main/java/forestry/lepidopterology/entities/AIButterflyPollinate.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.entities; @@ -31,15 +29,13 @@ public class AIButterflyPollinate extends AIButterflyInteract { return false; } - ICheckPollinatable checkPollinatable = - GeneticsUtil.getCheckPollinatable(entity.worldObj, rest.posX, rest.posY, rest.posZ); + ICheckPollinatable checkPollinatable = GeneticsUtil + .getCheckPollinatable(entity.worldObj, rest.posX, rest.posY, rest.posZ); if (checkPollinatable == null) { return false; } - if (!entity.getButterfly() - .getGenome() - .getFlowerProvider() + if (!entity.getButterfly().getGenome().getFlowerProvider() .isAcceptedPollinatable(entity.worldObj, new FakePollinatable(checkPollinatable))) { return false; } @@ -50,20 +46,20 @@ public class AIButterflyPollinate extends AIButterflyInteract { @Override public void updateTask() { if (continueExecuting()) { - ICheckPollinatable checkPollinatable = - GeneticsUtil.getCheckPollinatable(entity.worldObj, rest.posX, rest.posY, rest.posZ); + ICheckPollinatable checkPollinatable = GeneticsUtil + .getCheckPollinatable(entity.worldObj, rest.posX, rest.posY, rest.posZ); if (checkPollinatable != null) { if (entity.getPollen() == null) { entity.setPollen(checkPollinatable.getPollen()); - // Log.finest("A butterfly '%s' grabbed a pollen '%s' at %s/%s/%s.", + // Log.finest("A butterfly '%s' grabbed a pollen '%s' at %s/%s/%s.", // entity.getButterfly().getIdent(), entity.getPollen().getIdent(), rest.posX, rest.posY, // rest.posZ); } else if (checkPollinatable.canMateWith(entity.getPollen())) { - IPollinatable realPollinatable = GeneticsUtil.getOrCreatePollinatable( - null, entity.worldObj, rest.posX, rest.posY, rest.posZ); + IPollinatable realPollinatable = GeneticsUtil + .getOrCreatePollinatable(null, entity.worldObj, rest.posX, rest.posY, rest.posZ); if (realPollinatable != null) { realPollinatable.mateWith(entity.getPollen()); - // Log.finest("A butterfly '%s' unloaded pollen '%s' at %s/%s/%s.", + // Log.finest("A butterfly '%s' unloaded pollen '%s' at %s/%s/%s.", // entity.getButterfly().getIdent(), entity.getPollen().getIdent(), rest.posX, rest.posY, // rest.posZ); entity.setPollen(null); diff --git a/src/main/java/forestry/lepidopterology/entities/AIButterflyRest.java b/src/main/java/forestry/lepidopterology/entities/AIButterflyRest.java index ca7898884..11f4d3e56 100755 --- a/src/main/java/forestry/lepidopterology/entities/AIButterflyRest.java +++ b/src/main/java/forestry/lepidopterology/entities/AIButterflyRest.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.entities; diff --git a/src/main/java/forestry/lepidopterology/entities/AIButterflyRise.java b/src/main/java/forestry/lepidopterology/entities/AIButterflyRise.java index 8dc7bd5d6..3bb6c2fae 100644 --- a/src/main/java/forestry/lepidopterology/entities/AIButterflyRise.java +++ b/src/main/java/forestry/lepidopterology/entities/AIButterflyRise.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.entities; diff --git a/src/main/java/forestry/lepidopterology/entities/AIButterflyWander.java b/src/main/java/forestry/lepidopterology/entities/AIButterflyWander.java index b19e28b6a..e69936f68 100755 --- a/src/main/java/forestry/lepidopterology/entities/AIButterflyWander.java +++ b/src/main/java/forestry/lepidopterology/entities/AIButterflyWander.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.entities; diff --git a/src/main/java/forestry/lepidopterology/entities/EntityButterfly.java b/src/main/java/forestry/lepidopterology/entities/EntityButterfly.java index bebe25c00..9595321f9 100755 --- a/src/main/java/forestry/lepidopterology/entities/EntityButterfly.java +++ b/src/main/java/forestry/lepidopterology/entities/EntityButterfly.java @@ -1,34 +1,13 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.entities; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.arboriculture.EnumGermlingType; -import forestry.api.arboriculture.TreeManager; -import forestry.api.core.IToolScoop; -import forestry.api.genetics.AlleleManager; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IIndividual; -import forestry.api.genetics.ISpeciesRoot; -import forestry.api.lepidopterology.ButterflyManager; -import forestry.api.lepidopterology.EnumFlutterType; -import forestry.api.lepidopterology.IAlleleButterflySpecies; -import forestry.api.lepidopterology.IButterfly; -import forestry.api.lepidopterology.IButterflyGenome; -import forestry.api.lepidopterology.IButterflyRoot; -import forestry.api.lepidopterology.IEntityButterfly; -import forestry.api.lepidopterology.ILepidopteristTracker; -import forestry.core.utils.ItemStackUtil; -import forestry.lepidopterology.genetics.Butterfly; import net.minecraft.block.Block; import net.minecraft.block.BlockFence; import net.minecraft.block.BlockFlower; @@ -52,6 +31,26 @@ import net.minecraft.world.World; import net.minecraft.world.chunk.Chunk; import net.minecraftforge.common.IPlantable; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.arboriculture.EnumGermlingType; +import forestry.api.arboriculture.TreeManager; +import forestry.api.core.IToolScoop; +import forestry.api.genetics.AlleleManager; +import forestry.api.genetics.IAllele; +import forestry.api.genetics.IIndividual; +import forestry.api.genetics.ISpeciesRoot; +import forestry.api.lepidopterology.ButterflyManager; +import forestry.api.lepidopterology.EnumFlutterType; +import forestry.api.lepidopterology.IAlleleButterflySpecies; +import forestry.api.lepidopterology.IButterfly; +import forestry.api.lepidopterology.IButterflyGenome; +import forestry.api.lepidopterology.IButterflyRoot; +import forestry.api.lepidopterology.IEntityButterfly; +import forestry.api.lepidopterology.ILepidopteristTracker; +import forestry.core.utils.ItemStackUtil; +import forestry.lepidopterology.genetics.Butterfly; + public class EntityButterfly extends EntityCreature implements IEntityButterfly { /* CONSTANTS */ @@ -208,8 +207,8 @@ public class EntityButterfly extends EntityCreature implements IEntityButterfly } if (!worldObj.getEntitiesWithinAABB( - EntityButterfly.class, AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1)) - .isEmpty()) { + EntityButterfly.class, + AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1)).isEmpty()) { weight -= 1.0f; } @@ -296,8 +295,8 @@ public class EntityButterfly extends EntityCreature implements IEntityButterfly public void setIndividual(IButterfly butterfly) { if (butterfly == null) { - butterfly = ButterflyManager.butterflyRoot.templateAsIndividual( - ButterflyManager.butterflyRoot.getDefaultTemplate()); + butterfly = ButterflyManager.butterflyRoot + .templateAsIndividual(ButterflyManager.butterflyRoot.getDefaultTemplate()); } contained = butterfly; diff --git a/src/main/java/forestry/lepidopterology/entities/EnumButterflyState.java b/src/main/java/forestry/lepidopterology/entities/EnumButterflyState.java index 4765e94c3..db7e81205 100644 --- a/src/main/java/forestry/lepidopterology/entities/EnumButterflyState.java +++ b/src/main/java/forestry/lepidopterology/entities/EnumButterflyState.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.entities; import forestry.lepidopterology.render.RenderButterflyItem; public enum EnumButterflyState { + FLYING(true), GLIDING(true), RISING(true), diff --git a/src/main/java/forestry/lepidopterology/genetics/AlleleButterflyEffect.java b/src/main/java/forestry/lepidopterology/genetics/AlleleButterflyEffect.java index 18a78a651..5420481a7 100644 --- a/src/main/java/forestry/lepidopterology/genetics/AlleleButterflyEffect.java +++ b/src/main/java/forestry/lepidopterology/genetics/AlleleButterflyEffect.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.genetics; diff --git a/src/main/java/forestry/lepidopterology/genetics/AlleleButterflyEffectNone.java b/src/main/java/forestry/lepidopterology/genetics/AlleleButterflyEffectNone.java index 881412a39..d64579c1f 100644 --- a/src/main/java/forestry/lepidopterology/genetics/AlleleButterflyEffectNone.java +++ b/src/main/java/forestry/lepidopterology/genetics/AlleleButterflyEffectNone.java @@ -1,16 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.genetics; public class AlleleButterflyEffectNone extends AlleleButterflyEffect { + public AlleleButterflyEffectNone() { super("none", false); } diff --git a/src/main/java/forestry/lepidopterology/genetics/AlleleButterflySpecies.java b/src/main/java/forestry/lepidopterology/genetics/AlleleButterflySpecies.java index 76d308e8e..1f3ffc9a2 100755 --- a/src/main/java/forestry/lepidopterology/genetics/AlleleButterflySpecies.java +++ b/src/main/java/forestry/lepidopterology/genetics/AlleleButterflySpecies.java @@ -1,16 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.genetics; +import java.awt.Color; +import java.util.EnumSet; +import java.util.HashMap; +import java.util.Map; + +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.world.World; +import net.minecraftforge.common.BiomeDictionary; + import com.mojang.authlib.GameProfile; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.core.IIconProvider; @@ -21,16 +30,9 @@ import forestry.api.lepidopterology.EnumFlutterType; import forestry.api.lepidopterology.IAlleleButterflySpeciesCustom; import forestry.api.lepidopterology.IButterflyRoot; import forestry.core.genetics.alleles.AlleleSpecies; -import java.awt.Color; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.Map; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.common.BiomeDictionary; public class AlleleButterflySpecies extends AlleleSpecies implements IAlleleButterflySpeciesCustom { + private final String texture; private final Color serumColour; private float rarity = 0.1f; @@ -42,16 +44,8 @@ public class AlleleButterflySpecies extends AlleleSpecies implements IAlleleButt private final Map butterflyLoot = new HashMap<>(); private final Map caterpillarLoot = new HashMap<>(); - public AlleleButterflySpecies( - String uid, - String unlocalizedName, - String authority, - String unlocalizedDescription, - String texturePath, - boolean isDominant, - IClassification branch, - String binomial, - Color serumColour) { + public AlleleButterflySpecies(String uid, String unlocalizedName, String authority, String unlocalizedDescription, + String texturePath, boolean isDominant, IClassification branch, String binomial, Color serumColour) { super(uid, unlocalizedName, authority, unlocalizedDescription, isDominant, branch, binomial); this.serumColour = serumColour; this.texture = texturePath; @@ -140,7 +134,7 @@ public class AlleleButterflySpecies extends AlleleSpecies implements IAlleleButt @Override public ItemStack[] getResearchBounty(World world, GameProfile researcher, IIndividual individual, int bountyLevel) { - return new ItemStack[] {getRoot().getMemberStack(individual.copy(), EnumFlutterType.SERUM.ordinal())}; + return new ItemStack[] { getRoot().getMemberStack(individual.copy(), EnumFlutterType.SERUM.ordinal()) }; } /* OTHER */ diff --git a/src/main/java/forestry/lepidopterology/genetics/BranchButterflies.java b/src/main/java/forestry/lepidopterology/genetics/BranchButterflies.java index 891ab1708..0c3ec0124 100644 --- a/src/main/java/forestry/lepidopterology/genetics/BranchButterflies.java +++ b/src/main/java/forestry/lepidopterology/genetics/BranchButterflies.java @@ -1,19 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.genetics; -import forestry.core.genetics.Branch; import java.util.Locale; +import forestry.core.genetics.Branch; + public class BranchButterflies extends Branch { + public BranchButterflies(String scientific) { super("moth." + scientific.toLowerCase(Locale.ENGLISH), scientific); } diff --git a/src/main/java/forestry/lepidopterology/genetics/Butterfly.java b/src/main/java/forestry/lepidopterology/genetics/Butterfly.java index d5e9f9071..9b41c616b 100755 --- a/src/main/java/forestry/lepidopterology/genetics/Butterfly.java +++ b/src/main/java/forestry/lepidopterology/genetics/Butterfly.java @@ -1,15 +1,27 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.genetics; +import java.util.ArrayList; +import java.util.List; +import java.util.Locale; +import java.util.Map; +import java.util.Random; + +import net.minecraft.entity.EntityCreature; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraftforge.common.BiomeDictionary; + import forestry.api.core.EnumHumidity; import forestry.api.core.EnumTemperature; import forestry.api.genetics.AlleleManager; @@ -30,18 +42,6 @@ import forestry.core.genetics.Chromosome; import forestry.core.genetics.GenericRatings; import forestry.core.genetics.IndividualLiving; import forestry.core.utils.StringUtil; -import java.util.ArrayList; -import java.util.List; -import java.util.Locale; -import java.util.Map; -import java.util.Random; -import net.minecraft.entity.EntityCreature; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary; public class Butterfly extends IndividualLiving implements IButterfly { @@ -65,39 +65,39 @@ public class Butterfly extends IndividualLiving implements IButterfly { IAlleleButterflySpecies primary = genome.getPrimary(); IAlleleButterflySpecies secondary = genome.getSecondary(); if (!isPureBred(EnumButterflyChromosome.SPECIES)) { - list.add(EnumChatFormatting.BLUE - + StringUtil.localize("butterflies.hybrid") - .replaceAll("%PRIMARY", primary.getName()) - .replaceAll("%SECONDARY", secondary.getName())); + list.add( + EnumChatFormatting.BLUE + StringUtil.localize("butterflies.hybrid") + .replaceAll("%PRIMARY", primary.getName()).replaceAll("%SECONDARY", secondary.getName())); } if (getMate() != null) { - list.add(EnumChatFormatting.RED - + StringUtil.localize("gui.fecundated").toUpperCase(Locale.ENGLISH)); + list.add(EnumChatFormatting.RED + StringUtil.localize("gui.fecundated").toUpperCase(Locale.ENGLISH)); } - list.add(EnumChatFormatting.YELLOW - + genome.getActiveAllele(EnumButterflyChromosome.SIZE).getName()); - list.add(EnumChatFormatting.DARK_GREEN - + genome.getActiveAllele(EnumButterflyChromosome.SPEED).getName()); - list.add(genome.getActiveAllele(EnumButterflyChromosome.LIFESPAN).getName() - + ' ' - + StringUtil.localize("gui.life")); + list.add(EnumChatFormatting.YELLOW + genome.getActiveAllele(EnumButterflyChromosome.SIZE).getName()); + list.add(EnumChatFormatting.DARK_GREEN + genome.getActiveAllele(EnumButterflyChromosome.SPEED).getName()); + list.add( + genome.getActiveAllele(EnumButterflyChromosome.LIFESPAN).getName() + ' ' + + StringUtil.localize("gui.life")); - IAlleleTolerance tempTolerance = - (IAlleleTolerance) getGenome().getActiveAllele(EnumButterflyChromosome.TEMPERATURE_TOLERANCE); - list.add(EnumChatFormatting.GREEN + "T: " - + AlleleManager.climateHelper.toDisplay(genome.getPrimary().getTemperature()) + " / " - + tempTolerance.getName()); + IAlleleTolerance tempTolerance = (IAlleleTolerance) getGenome() + .getActiveAllele(EnumButterflyChromosome.TEMPERATURE_TOLERANCE); + list.add( + EnumChatFormatting.GREEN + "T: " + + AlleleManager.climateHelper.toDisplay(genome.getPrimary().getTemperature()) + + " / " + + tempTolerance.getName()); - IAlleleTolerance humidTolerance = - (IAlleleTolerance) getGenome().getActiveAllele(EnumButterflyChromosome.TEMPERATURE_TOLERANCE); - list.add(EnumChatFormatting.GREEN + "H: " - + AlleleManager.climateHelper.toDisplay(genome.getPrimary().getHumidity()) + " / " - + humidTolerance.getName()); + IAlleleTolerance humidTolerance = (IAlleleTolerance) getGenome() + .getActiveAllele(EnumButterflyChromosome.TEMPERATURE_TOLERANCE); + list.add( + EnumChatFormatting.GREEN + "H: " + + AlleleManager.climateHelper.toDisplay(genome.getPrimary().getHumidity()) + + " / " + + humidTolerance.getName()); - list.add(EnumChatFormatting.RED - + GenericRatings.rateActivityTime( - genome.getNocturnal(), genome.getPrimary().isNocturnal())); + list.add( + EnumChatFormatting.RED + + GenericRatings.rateActivityTime(genome.getNocturnal(), genome.getPrimary().isNocturnal())); if (genome.getTolerantFlyer()) { list.add(EnumChatFormatting.WHITE + StringUtil.localize("gui.flyer.tooltip")); @@ -109,8 +109,8 @@ public class Butterfly extends IndividualLiving implements IButterfly { public void readFromNBT(NBTTagCompound nbttagcompound) { if (nbttagcompound == null) { - this.genome = ButterflyManager.butterflyRoot.templateAsGenome( - ButterflyManager.butterflyRoot.getDefaultTemplate()); + this.genome = ButterflyManager.butterflyRoot + .templateAsGenome(ButterflyManager.butterflyRoot.getDefaultTemplate()); return; } @@ -119,8 +119,8 @@ public class Butterfly extends IndividualLiving implements IButterfly { if (nbttagcompound.hasKey("Genome")) { genome = new ButterflyGenome(nbttagcompound.getCompoundTag("Genome")); } else { - genome = ButterflyManager.butterflyRoot.templateAsGenome( - ButterflyManager.butterflyRoot.getDefaultTemplate()); + genome = ButterflyManager.butterflyRoot + .templateAsGenome(ButterflyManager.butterflyRoot.getDefaultTemplate()); } if (nbttagcompound.hasKey("Mate")) { mate = new ButterflyGenome(nbttagcompound.getCompoundTag("Mate")); @@ -156,8 +156,7 @@ public class Butterfly extends IndividualLiving implements IButterfly { if (getGenome().getPrimary().strictSpawnMatch()) { BiomeDictionary.Type[] types = BiomeDictionary.getTypesForBiome(biome); - if (types.length == 1 - && getGenome().getPrimary().getSpawnBiomes().contains(types[0])) { + if (types.length == 1 && getGenome().getPrimary().getSpawnBiomes().contains(types[0])) { noneMatched = false; } } else { @@ -304,8 +303,7 @@ public class Butterfly extends IndividualLiving implements IButterfly { EntityCreature creature = entity.getEntity(); float metabolism = (float) getGenome().getMetabolism() / 10; - for (Map.Entry entry : - getGenome().getPrimary().getButterflyLoot().entrySet()) { + for (Map.Entry entry : getGenome().getPrimary().getButterflyLoot().entrySet()) { if (creature.worldObj.rand.nextFloat() < entry.getValue() * metabolism) { drop.add(entry.getKey().copy()); } @@ -319,8 +317,7 @@ public class Butterfly extends IndividualLiving implements IButterfly { ArrayList drop = new ArrayList<>(); float metabolism = (float) getGenome().getMetabolism() / 10; - for (Map.Entry entry : - getGenome().getPrimary().getCaterpillarLoot().entrySet()) { + for (Map.Entry entry : getGenome().getPrimary().getCaterpillarLoot().entrySet()) { if (rand.nextFloat() < entry.getValue() * metabolism) { drop.add(entry.getKey().copy()); } diff --git a/src/main/java/forestry/lepidopterology/genetics/ButterflyBranchDefinition.java b/src/main/java/forestry/lepidopterology/genetics/ButterflyBranchDefinition.java index 6d1db82bf..a6344b0a9 100644 --- a/src/main/java/forestry/lepidopterology/genetics/ButterflyBranchDefinition.java +++ b/src/main/java/forestry/lepidopterology/genetics/ButterflyBranchDefinition.java @@ -1,15 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.genetics; +import java.util.Arrays; + import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IAllele; import forestry.api.genetics.IAlleleRegistry; @@ -18,9 +18,9 @@ import forestry.api.lepidopterology.EnumButterflyChromosome; import forestry.core.genetics.IBranchDefinition; import forestry.core.genetics.alleles.AlleleHelper; import forestry.core.genetics.alleles.EnumAllele; -import java.util.Arrays; public enum ButterflyBranchDefinition implements IBranchDefinition { + Anthocharis, Attacus, Bassarona, @@ -64,17 +64,17 @@ public enum ButterflyBranchDefinition implements IBranchDefinition { AlleleHelper.instance.set(defaultTemplate, EnumButterflyChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTER); AlleleHelper.instance.set(defaultTemplate, EnumButterflyChromosome.METABOLISM, 3); AlleleHelper.instance.set(defaultTemplate, EnumButterflyChromosome.FERTILITY, 3); - AlleleHelper.instance.set( - defaultTemplate, EnumButterflyChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.NONE); - AlleleHelper.instance.set( - defaultTemplate, EnumButterflyChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.NONE); + AlleleHelper.instance + .set(defaultTemplate, EnumButterflyChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.NONE); + AlleleHelper.instance + .set(defaultTemplate, EnumButterflyChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.NONE); AlleleHelper.instance.set(defaultTemplate, EnumButterflyChromosome.NOCTURNAL, false); AlleleHelper.instance.set(defaultTemplate, EnumButterflyChromosome.TOLERANT_FLYER, false); AlleleHelper.instance.set(defaultTemplate, EnumButterflyChromosome.FIRE_RESIST, false); - AlleleHelper.instance.set( - defaultTemplate, EnumButterflyChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.VANILLA); - AlleleHelper.instance.set( - defaultTemplate, EnumButterflyChromosome.EFFECT, AlleleButterflyEffect.butterflyNone); + AlleleHelper.instance + .set(defaultTemplate, EnumButterflyChromosome.FLOWER_PROVIDER, EnumAllele.Flowers.VANILLA); + AlleleHelper.instance + .set(defaultTemplate, EnumButterflyChromosome.EFFECT, AlleleButterflyEffect.butterflyNone); } return Arrays.copyOf(defaultTemplate, defaultTemplate.length); } @@ -87,9 +87,8 @@ public enum ButterflyBranchDefinition implements IBranchDefinition { public static void createAlleles() { IAlleleRegistry alleleRegistry = AlleleManager.alleleRegistry; - alleleRegistry - .getClassification("class.insecta") - .addMemberGroup(alleleRegistry.createAndRegisterClassification( + alleleRegistry.getClassification("class.insecta").addMemberGroup( + alleleRegistry.createAndRegisterClassification( IClassification.EnumClassLevel.ORDER, "lepidoptera", "Lepidoptera", @@ -132,7 +131,9 @@ public enum ButterflyBranchDefinition implements IBranchDefinition { Cethosia.getBranch(), Speyeria.getBranch()), alleleRegistry.createAndRegisterClassification( - IClassification.EnumClassLevel.FAMILY, "lycaenidae", "Lycaenidae"), + IClassification.EnumClassLevel.FAMILY, + "lycaenidae", + "Lycaenidae"), alleleRegistry.createAndRegisterClassification( IClassification.EnumClassLevel.FAMILY, "papilionidae", @@ -140,6 +141,8 @@ public enum ButterflyBranchDefinition implements IBranchDefinition { Papilio.getBranch(), Protographium.getBranch()), alleleRegistry.createAndRegisterClassification( - IClassification.EnumClassLevel.FAMILY, "notchidae", "Notchidae"))); + IClassification.EnumClassLevel.FAMILY, + "notchidae", + "Notchidae"))); } } diff --git a/src/main/java/forestry/lepidopterology/genetics/ButterflyDefinition.java b/src/main/java/forestry/lepidopterology/genetics/ButterflyDefinition.java index 64d2ff90e..d94114253 100644 --- a/src/main/java/forestry/lepidopterology/genetics/ButterflyDefinition.java +++ b/src/main/java/forestry/lepidopterology/genetics/ButterflyDefinition.java @@ -1,15 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.genetics; +import java.awt.Color; +import java.util.Arrays; +import java.util.Locale; + +import net.minecraft.item.ItemStack; + import forestry.api.core.EnumHumidity; import forestry.api.core.EnumTemperature; import forestry.api.genetics.IAllele; @@ -23,13 +27,11 @@ import forestry.api.lepidopterology.IButterflyGenome; import forestry.core.config.Constants; import forestry.core.genetics.alleles.AlleleHelper; import forestry.core.genetics.alleles.EnumAllele; -import java.awt.Color; -import java.util.Arrays; -import java.util.Locale; -import net.minecraft.item.ItemStack; public enum ButterflyDefinition implements IButterflyDefinition { + CabbageWhite(ButterflyBranchDefinition.Pieris, "cabbageWhite", "rapae", new Color(0xccffee), true, 1.0f) { + @Override protected void setAlleles(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumButterflyChromosome.SIZE, EnumAllele.Size.AVERAGE); @@ -37,30 +39,35 @@ public enum ButterflyDefinition implements IButterflyDefinition { }, Brimstone(ButterflyBranchDefinition.Gonepteryx, "brimstone", "rhamni", new Color(0xf0ee38), true, 1.0f), Aurora(ButterflyBranchDefinition.Anthocharis, "orangeTip", "cardamines", new Color(0xe34f05), true, 0.5f) { + @Override protected void setAlleles(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumButterflyChromosome.SIZE, EnumAllele.Size.SMALLER); } }, Postillion(ButterflyBranchDefinition.Colias, "postillion", "croceus", new Color(0xd77e04), true, 0.5f) { + @Override protected void setAlleles(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumButterflyChromosome.SPEED, EnumAllele.Speed.SLOW); } }, PalaenoSulphur(ButterflyBranchDefinition.Colias, "palaenoSulphur", "palaeno", new Color(0xf8fba3), true, 0.4f) { + @Override protected void setAlleles(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumButterflyChromosome.SPEED, EnumAllele.Speed.SLOWER); } }, Reseda(ButterflyBranchDefinition.Pontia, "reseda", "edusa", new Color(0x747d48), true, 0.3f) { + @Override protected void setAlleles(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumButterflyChromosome.SPEED, EnumAllele.Speed.SLOWER); } }, SpringAzure(ButterflyBranchDefinition.Celastrina, "springAzure", "argiolus", new Color(0xb8cae2), true, 0.3f) { + @Override protected void setAlleles(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumButterflyChromosome.SIZE, EnumAllele.Size.SMALLER); @@ -68,6 +75,7 @@ public enum ButterflyDefinition implements IButterflyDefinition { } }, GozoraAzure(ButterflyBranchDefinition.Celastrina, "gozoraAzure", "gozora", new Color(0x6870e7), true, 0.2f) { + @Override protected void setAlleles(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumButterflyChromosome.SIZE, EnumAllele.Size.SMALLER); @@ -75,6 +83,7 @@ public enum ButterflyDefinition implements IButterflyDefinition { } }, CitrusSwallow(ButterflyBranchDefinition.Papilio, "swallowtailC", "demodocus", new Color(0xeae389), false, 1.0f) { + @Override protected void setSpeciesProperties(IAlleleButterflySpeciesCustom species) { species.setTemperature(EnumTemperature.WARM).setHumidity(EnumHumidity.DAMP); @@ -87,12 +96,13 @@ public enum ButterflyDefinition implements IButterflyDefinition { AlleleHelper.instance.set(alleles, EnumButterflyChromosome.FERTILITY, 10); AlleleHelper.instance.set(alleles, EnumButterflyChromosome.METABOLISM, 8); AlleleHelper.instance.set(alleles, EnumButterflyChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTER); - AlleleHelper.instance.set( - alleles, EnumButterflyChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.DOWN_1); + AlleleHelper.instance + .set(alleles, EnumButterflyChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.DOWN_1); AlleleHelper.instance.set(alleles, EnumButterflyChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.DOWN_1); } }, EmeraldPeacock(ButterflyBranchDefinition.Papilio, "emeraldPeacock", "palinurus", new Color(0x7cfe80), true, 0.1f) { + @Override protected void setSpeciesProperties(IAlleleButterflySpeciesCustom species) { species.setTemperature(EnumTemperature.WARM).setHumidity(EnumHumidity.DAMP); @@ -103,12 +113,13 @@ public enum ButterflyDefinition implements IButterflyDefinition { AlleleHelper.instance.set(alleles, EnumButterflyChromosome.SIZE, EnumAllele.Size.LARGE); AlleleHelper.instance.set(alleles, EnumButterflyChromosome.LIFESPAN, EnumAllele.Lifespan.NORMAL); AlleleHelper.instance.set(alleles, EnumButterflyChromosome.FERTILITY, 5); - AlleleHelper.instance.set( - alleles, EnumButterflyChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.DOWN_1); + AlleleHelper.instance + .set(alleles, EnumButterflyChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.DOWN_1); AlleleHelper.instance.set(alleles, EnumButterflyChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.DOWN_1); } }, ThoasSwallow(ButterflyBranchDefinition.Papilio, "swallowtailT", "thoas", new Color(0xeac783), false, 0.2f) { + @Override protected void setSpeciesProperties(IAlleleButterflySpeciesCustom species) { species.setTemperature(EnumTemperature.WARM).setHumidity(EnumHumidity.DAMP); @@ -122,24 +133,27 @@ public enum ButterflyDefinition implements IButterflyDefinition { } }, Spicebush(ButterflyBranchDefinition.Papilio, "swallowtailS", "troilus", new Color(0xeefeff), true, 0.5f) { + @Override protected void setAlleles(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumButterflyChromosome.SIZE, EnumAllele.Size.AVERAGE); } }, BlackSwallow(ButterflyBranchDefinition.Papilio, "swallowtailB", "polyxenes", new Color(0xeac783), true, 1.0f) { + @Override protected void setAlleles(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumButterflyChromosome.SPEED, EnumAllele.Speed.SLOW); AlleleHelper.instance.set(alleles, EnumButterflyChromosome.SIZE, EnumAllele.Size.LARGE); AlleleHelper.instance.set(alleles, EnumButterflyChromosome.LIFESPAN, EnumAllele.Lifespan.SHORTER); - AlleleHelper.instance.set( - alleles, EnumButterflyChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.DOWN_1); + AlleleHelper.instance + .set(alleles, EnumButterflyChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.DOWN_1); AlleleHelper.instance.set(alleles, EnumButterflyChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.DOWN_1); } }, - ZebraSwallow( - ButterflyBranchDefinition.Protographium, "swallowtailZ", "marcellus", new Color(0xeafeff), true, 0.5f) { + ZebraSwallow(ButterflyBranchDefinition.Protographium, "swallowtailZ", "marcellus", new Color(0xeafeff), true, + 0.5f) { + @Override protected void setAlleles(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumButterflyChromosome.SPEED, EnumAllele.Speed.SLOWER); @@ -147,6 +161,7 @@ public enum ButterflyDefinition implements IButterflyDefinition { } }, Glasswing(ButterflyBranchDefinition.Greta, "glasswing", "oto", new Color(0x583732), true, 0.1f) { + @Override protected void setSpeciesProperties(IAlleleButterflySpeciesCustom species) { species.setTemperature(EnumTemperature.WARM); @@ -157,29 +172,33 @@ public enum ButterflyDefinition implements IButterflyDefinition { AlleleHelper.instance.set(alleles, EnumButterflyChromosome.SIZE, EnumAllele.Size.SMALLER); AlleleHelper.instance.set(alleles, EnumButterflyChromosome.LIFESPAN, EnumAllele.Lifespan.SHORT); AlleleHelper.instance.set(alleles, EnumButterflyChromosome.FERTILITY, 5); - AlleleHelper.instance.set( - alleles, EnumButterflyChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.DOWN_1); + AlleleHelper.instance + .set(alleles, EnumButterflyChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.DOWN_1); } }, SpeckledWood(ButterflyBranchDefinition.Pararge, "speckledWood", "aegeria", new Color(0x947245), true, 1.0f) { + @Override protected void setAlleles(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumButterflyChromosome.FERTILITY, 2); } }, MSpeckledWood(ButterflyBranchDefinition.Pararge, "speckledWoodM", "xiphia", new Color(0x402919), true, 0.5f) { + @Override protected void setAlleles(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumButterflyChromosome.FERTILITY, 2); } }, CSpeckledWood(ButterflyBranchDefinition.Pararge, "speckledWoodC", "xiphioides", new Color(0x51372a), true, 0.5f) { + @Override protected void setAlleles(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumButterflyChromosome.FERTILITY, 2); } }, MBlueMorpho(ButterflyBranchDefinition.Morpho, "blueMorphoM", "menelaus", new Color(0x72e1fd), true, 0.5f) { + @Override protected void setSpeciesProperties(IAlleleButterflySpeciesCustom species) { species.setTemperature(EnumTemperature.WARM).setHumidity(EnumHumidity.DAMP); @@ -193,6 +212,7 @@ public enum ButterflyDefinition implements IButterflyDefinition { } }, PBlueMorpho(ButterflyBranchDefinition.Morpho, "blueMorphoP", "peleides", new Color(0x6ecce8), true, 0.25f) { + @Override protected void setSpeciesProperties(IAlleleButterflySpeciesCustom species) { species.setTemperature(EnumTemperature.WARM).setHumidity(EnumHumidity.DAMP); @@ -206,6 +226,7 @@ public enum ButterflyDefinition implements IButterflyDefinition { } }, RBlueMorpho(ButterflyBranchDefinition.Morpho, "blueMorphoR", "rhetenor", new Color(0x00bef8), true, 0.1f) { + @Override protected void setSpeciesProperties(IAlleleButterflySpeciesCustom species) { species.setTemperature(EnumTemperature.WARM).setHumidity(EnumHumidity.DAMP); @@ -219,12 +240,14 @@ public enum ButterflyDefinition implements IButterflyDefinition { } }, Comma(ButterflyBranchDefinition.Polygonia, "comma", "c-album", new Color(0xf89505), true, 0.3f) { + @Override protected void setAlleles(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumButterflyChromosome.SPEED, EnumAllele.Speed.SLOWER); } }, Batesia(ButterflyBranchDefinition.Batesia, "paintedBeauty", "hypochlora", new Color(0xfe7763), true, 0.3f) { + @Override protected void setSpeciesProperties(IAlleleButterflySpeciesCustom species) { species.setTemperature(EnumTemperature.WARM).setHumidity(EnumHumidity.DAMP); @@ -236,6 +259,7 @@ public enum ButterflyDefinition implements IButterflyDefinition { } }, BlueWing(ButterflyBranchDefinition.Myscelia, "blueWing", "ethusa", new Color(0x3a93cc), true, 0.3f) { + @Override protected void setAlleles(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumButterflyChromosome.SIZE, EnumAllele.Size.AVERAGE); @@ -243,12 +267,14 @@ public enum ButterflyDefinition implements IButterflyDefinition { } }, Monarch(ButterflyBranchDefinition.Danaus, "monarch", "plexippus", new Color(0xffa722), true, 0.2f) { + @Override protected void setAlleles(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumButterflyChromosome.SIZE, EnumAllele.Size.AVERAGE); } }, BlueDuke(ButterflyBranchDefinition.Bassarona, "blueDuke", "durga", new Color(0x304240), true, 0.5f) { + @Override protected void setSpeciesProperties(IAlleleButterflySpeciesCustom species) { species.setTemperature(EnumTemperature.COLD); @@ -256,11 +282,12 @@ public enum ButterflyDefinition implements IButterflyDefinition { @Override protected void setAlleles(IAllele[] alleles) { - AlleleHelper.instance.set( - alleles, EnumButterflyChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.BOTH_1); + AlleleHelper.instance + .set(alleles, EnumButterflyChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.BOTH_1); } }, GlassyTiger(ButterflyBranchDefinition.Parantica, "glassyTiger", "aglea", new Color(0x5b3935), true, 0.3f) { + @Override protected void setAlleles(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumButterflyChromosome.SIZE, EnumAllele.Size.AVERAGE); @@ -268,6 +295,7 @@ public enum ButterflyDefinition implements IButterflyDefinition { }, Postman(ButterflyBranchDefinition.Heliconius, "postman", "melpomene", new Color(0xf7302d), true, 0.3f), Malachite(ButterflyBranchDefinition.Siproeta, "malachite", "stelenes", new Color(0xbdff53), true, 0.5f) { + @Override protected void setSpeciesProperties(IAlleleButterflySpeciesCustom species) { species.setTemperature(EnumTemperature.WARM).setHumidity(EnumHumidity.DAMP); @@ -276,20 +304,22 @@ public enum ButterflyDefinition implements IButterflyDefinition { @Override protected void setAlleles(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumButterflyChromosome.SIZE, EnumAllele.Size.AVERAGE); - AlleleHelper.instance.set( - alleles, EnumButterflyChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.DOWN_1); + AlleleHelper.instance + .set(alleles, EnumButterflyChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.DOWN_1); AlleleHelper.instance.set(alleles, EnumButterflyChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.DOWN_1); } }, LLacewing(ButterflyBranchDefinition.Cethosia, "leopardLacewing", "cyane", new Color(0xfb8a06), true, 0.7f) { + @Override protected void setAlleles(IAllele[] alleles) { - AlleleHelper.instance.set( - alleles, EnumButterflyChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.UP_1); + AlleleHelper.instance + .set(alleles, EnumButterflyChromosome.TEMPERATURE_TOLERANCE, EnumAllele.Tolerance.UP_1); AlleleHelper.instance.set(alleles, EnumButterflyChromosome.HUMIDITY_TOLERANCE, EnumAllele.Tolerance.UP_1); } }, DianaFrit(ButterflyBranchDefinition.Speyeria, "dianaFritillary", "diana", new Color(0xffac05), true, 0.6f) { + @Override protected void setAlleles(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumButterflyChromosome.SPEED, EnumAllele.Speed.SLOWER); @@ -302,19 +332,15 @@ public enum ButterflyDefinition implements IButterflyDefinition { private IAllele[] template; private IButterflyGenome genome; - ButterflyDefinition( - ButterflyBranchDefinition branchDefinition, - String speciesName, - String binomial, - Color serumColor, - boolean dominant, - float rarity) { + ButterflyDefinition(ButterflyBranchDefinition branchDefinition, String speciesName, String binomial, + Color serumColor, boolean dominant, float rarity) { this.branch = branchDefinition; String uid = "lepi" + name(); IClassification parent = branch.getBranch().getParent(); String unlocalizedName = "for.butterflies.species." - + parent.getUID().substring((parent.getLevel().name().toLowerCase(Locale.ENGLISH)).length() + 1) + '.' + + parent.getUID().substring((parent.getLevel().name().toLowerCase(Locale.ENGLISH)).length() + 1) + + '.' + speciesName; String unlocalizedDescription = "for.description." + uid; diff --git a/src/main/java/forestry/lepidopterology/genetics/ButterflyFactory.java b/src/main/java/forestry/lepidopterology/genetics/ButterflyFactory.java index db70c424b..e0e305436 100644 --- a/src/main/java/forestry/lepidopterology/genetics/ButterflyFactory.java +++ b/src/main/java/forestry/lepidopterology/genetics/ButterflyFactory.java @@ -1,34 +1,27 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.genetics; +import java.awt.Color; + import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IClassification; import forestry.api.lepidopterology.EnumButterflyChromosome; import forestry.api.lepidopterology.IAlleleButterflySpeciesCustom; import forestry.api.lepidopterology.IButterflyFactory; -import java.awt.Color; public class ButterflyFactory implements IButterflyFactory { + @Override - public IAlleleButterflySpeciesCustom createSpecies( - String uid, - String unlocalizedName, - String authority, - String unlocalizedDescription, - String texturePath, - boolean isDominant, - IClassification branch, - String binomial, - Color serumColour) { + public IAlleleButterflySpeciesCustom createSpecies(String uid, String unlocalizedName, String authority, + String unlocalizedDescription, String texturePath, boolean isDominant, IClassification branch, + String binomial, Color serumColour) { IAlleleButterflySpeciesCustom species = new AlleleButterflySpecies( uid, unlocalizedName, diff --git a/src/main/java/forestry/lepidopterology/genetics/ButterflyGenome.java b/src/main/java/forestry/lepidopterology/genetics/ButterflyGenome.java index 3547e897b..38c78f395 100755 --- a/src/main/java/forestry/lepidopterology/genetics/ButterflyGenome.java +++ b/src/main/java/forestry/lepidopterology/genetics/ButterflyGenome.java @@ -1,15 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.genetics; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import forestry.api.genetics.EnumTolerance; import forestry.api.genetics.IAlleleFloat; import forestry.api.genetics.IAlleleFlowers; @@ -26,8 +27,6 @@ import forestry.api.lepidopterology.IButterflyGenome; import forestry.core.genetics.Genome; import forestry.core.genetics.alleles.AlleleBoolean; import forestry.core.genetics.alleles.AlleleTolerance; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; public class ButterflyGenome extends Genome implements IButterflyGenome { @@ -51,8 +50,10 @@ public class ButterflyGenome extends Genome implements IButterflyGenome { return (IAlleleButterflySpecies) species; } - return (IAlleleButterflySpecies) - getActiveAllele(itemStack, EnumButterflyChromosome.SPECIES, ButterflyManager.butterflyRoot); + return (IAlleleButterflySpecies) getActiveAllele( + itemStack, + EnumButterflyChromosome.SPECIES, + ButterflyManager.butterflyRoot); } /* SPECIES */ diff --git a/src/main/java/forestry/lepidopterology/genetics/ButterflyHelper.java b/src/main/java/forestry/lepidopterology/genetics/ButterflyHelper.java index f00af4dab..6dee75c79 100755 --- a/src/main/java/forestry/lepidopterology/genetics/ButterflyHelper.java +++ b/src/main/java/forestry/lepidopterology/genetics/ButterflyHelper.java @@ -1,16 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.genetics; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.Map.Entry; + +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + import com.mojang.authlib.GameProfile; + import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IAllele; import forestry.api.genetics.IChromosomeType; @@ -29,14 +38,6 @@ import forestry.core.genetics.SpeciesRoot; import forestry.core.utils.EntityUtil; import forestry.lepidopterology.entities.EntityButterfly; import forestry.plugins.PluginLepidopterology; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.Map.Entry; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; public class ButterflyHelper extends SpeciesRoot implements IButterflyRoot { @@ -57,8 +58,7 @@ public class ButterflyHelper extends SpeciesRoot implements IButterflyRoot { public int getSpeciesCount() { if (butterflySpeciesCount < 0) { butterflySpeciesCount = 0; - for (Entry entry : - AlleleManager.alleleRegistry.getRegisteredAlleles().entrySet()) { + for (Entry entry : AlleleManager.alleleRegistry.getRegisteredAlleles().entrySet()) { if (entry.getValue() instanceof IAlleleButterflySpecies) { if (((IAlleleButterflySpecies) entry.getValue()).isCounted()) { butterflySpeciesCount++; diff --git a/src/main/java/forestry/lepidopterology/genetics/IButterflyDefinition.java b/src/main/java/forestry/lepidopterology/genetics/IButterflyDefinition.java index 6a5e0c563..db7eb0721 100644 --- a/src/main/java/forestry/lepidopterology/genetics/IButterflyDefinition.java +++ b/src/main/java/forestry/lepidopterology/genetics/IButterflyDefinition.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.genetics; +import net.minecraft.item.ItemStack; + import forestry.api.lepidopterology.EnumFlutterType; import forestry.api.lepidopterology.IButterfly; import forestry.api.lepidopterology.IButterflyGenome; import forestry.core.genetics.IGeneticDefinition; -import net.minecraft.item.ItemStack; public interface IButterflyDefinition extends IGeneticDefinition { + @Override IButterflyGenome getGenome(); diff --git a/src/main/java/forestry/lepidopterology/genetics/LepidopteristTracker.java b/src/main/java/forestry/lepidopterology/genetics/LepidopteristTracker.java index 477d85d1b..469abcab2 100755 --- a/src/main/java/forestry/lepidopterology/genetics/LepidopteristTracker.java +++ b/src/main/java/forestry/lepidopterology/genetics/LepidopteristTracker.java @@ -1,22 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.genetics; +import net.minecraft.entity.player.EntityPlayer; + import forestry.api.genetics.IBreedingTracker; import forestry.api.genetics.IIndividual; import forestry.api.lepidopterology.ButterflyManager; import forestry.api.lepidopterology.IButterfly; import forestry.api.lepidopterology.ILepidopteristTracker; import forestry.core.genetics.BreedingTracker; -import net.minecraft.entity.player.EntityPlayer; public class LepidopteristTracker extends BreedingTracker implements ILepidopteristTracker { diff --git a/src/main/java/forestry/lepidopterology/genetics/MothDefinition.java b/src/main/java/forestry/lepidopterology/genetics/MothDefinition.java index 4d90b8d23..612de3858 100644 --- a/src/main/java/forestry/lepidopterology/genetics/MothDefinition.java +++ b/src/main/java/forestry/lepidopterology/genetics/MothDefinition.java @@ -1,15 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.genetics; +import java.awt.Color; +import java.util.Arrays; +import java.util.Locale; + +import net.minecraft.item.ItemStack; + import forestry.api.genetics.IAllele; import forestry.api.genetics.IClassification; import forestry.api.lepidopterology.ButterflyManager; @@ -21,20 +25,19 @@ import forestry.api.lepidopterology.IButterflyGenome; import forestry.core.config.Constants; import forestry.core.genetics.alleles.AlleleHelper; import forestry.core.genetics.alleles.EnumAllele; -import java.awt.Color; -import java.util.Arrays; -import java.util.Locale; -import net.minecraft.item.ItemStack; public enum MothDefinition implements IButterflyDefinition { + Brimstone(ButterflyBranchDefinition.Opisthograptis, "brimstone", "luteolata", new Color(0xffea40), true, 1.0f), LatticedHeath(ButterflyBranchDefinition.Chiasmia, "latticeHeath", "clathrata", new Color(0xf2f0be), true, 0.5f) { + @Override protected void setAlleles(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumButterflyChromosome.SIZE, EnumAllele.Size.SMALLEST); } }, Atlas(ButterflyBranchDefinition.Attacus, "atlas", "atlas", new Color(0xd96e3d), false, 0.1f) { + @Override protected void setAlleles(IAllele[] alleles) { AlleleHelper.instance.set(alleles, EnumButterflyChromosome.SIZE, EnumAllele.Size.LARGEST); @@ -46,19 +49,15 @@ public enum MothDefinition implements IButterflyDefinition { private IAllele[] template; private IButterflyGenome genome; - MothDefinition( - ButterflyBranchDefinition branchDefinition, - String speciesName, - String binomial, - Color serumColor, - boolean dominant, - float rarity) { + MothDefinition(ButterflyBranchDefinition branchDefinition, String speciesName, String binomial, Color serumColor, + boolean dominant, float rarity) { branch = branchDefinition; String uid = "moth" + name(); IClassification parent = branch.getBranch().getParent(); String unlocalizedName = "for.butterflies.species." - + parent.getUID().substring((parent.getLevel().name().toLowerCase(Locale.ENGLISH)).length() + 1) + '.' + + parent.getUID().substring((parent.getLevel().name().toLowerCase(Locale.ENGLISH)).length() + 1) + + '.' + speciesName; String unlocalizedDescription = "for.description." + uid; diff --git a/src/main/java/forestry/lepidopterology/gui/GuiFlutterlyzer.java b/src/main/java/forestry/lepidopterology/gui/GuiFlutterlyzer.java index 474645f5d..ac80bb3d3 100755 --- a/src/main/java/forestry/lepidopterology/gui/GuiFlutterlyzer.java +++ b/src/main/java/forestry/lepidopterology/gui/GuiFlutterlyzer.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.gui; +import java.util.ArrayList; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IAlleleFlowers; import forestry.api.genetics.IAlleleInteger; @@ -26,9 +29,6 @@ import forestry.core.utils.StringUtil; import forestry.lepidopterology.genetics.ButterflyGenome; import forestry.lepidopterology.inventory.ItemInventoryFlutterlyzer; import forestry.plugins.PluginLepidopterology; -import java.util.ArrayList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class GuiFlutterlyzer extends GuiAlyzer { @@ -108,42 +108,24 @@ public class GuiFlutterlyzer extends GuiAlyzer { drawRow( StringUtil.localize("gui.size"), - butterfly - .getGenome() - .getActiveAllele(EnumButterflyChromosome.SIZE) - .getName(), - butterfly - .getGenome() - .getInactiveAllele(EnumButterflyChromosome.SIZE) - .getName(), + butterfly.getGenome().getActiveAllele(EnumButterflyChromosome.SIZE).getName(), + butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.SIZE).getName(), butterfly, EnumButterflyChromosome.SPEED); textLayout.newLine(); drawRow( StringUtil.localize("gui.lifespan"), - butterfly - .getGenome() - .getActiveAllele(EnumButterflyChromosome.LIFESPAN) - .getName(), - butterfly - .getGenome() - .getInactiveAllele(EnumButterflyChromosome.LIFESPAN) - .getName(), + butterfly.getGenome().getActiveAllele(EnumButterflyChromosome.LIFESPAN).getName(), + butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.LIFESPAN).getName(), butterfly, EnumButterflyChromosome.LIFESPAN); textLayout.newLine(); drawRow( StringUtil.localize("gui.speed"), - butterfly - .getGenome() - .getActiveAllele(EnumButterflyChromosome.SPEED) - .getName(), - butterfly - .getGenome() - .getInactiveAllele(EnumButterflyChromosome.SPEED) - .getName(), + butterfly.getGenome().getActiveAllele(EnumButterflyChromosome.SPEED).getName(), + butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.SPEED).getName(), butterfly, EnumButterflyChromosome.SPEED); textLayout.newLine(); @@ -162,19 +144,13 @@ public class GuiFlutterlyzer extends GuiAlyzer { drawFertilityInfo( butterfly.getGenome().getFertility(), COLUMN_1, - getColorCoding(butterfly - .getGenome() - .getActiveAllele(EnumButterflyChromosome.FERTILITY) - .isDominant()), + getColorCoding(butterfly.getGenome().getActiveAllele(EnumButterflyChromosome.FERTILITY).isDominant()), 8); drawFertilityInfo( ((IAlleleInteger) butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.FERTILITY)) .getValue(), COLUMN_2, - getColorCoding(butterfly - .getGenome() - .getInactiveAllele(EnumButterflyChromosome.FERTILITY) - .isDominant()), + getColorCoding(butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.FERTILITY).isDominant()), 8); textLayout.newLine(); @@ -183,8 +159,7 @@ public class GuiFlutterlyzer extends GuiAlyzer { StringUtil.localize("gui.flowers"), butterfly.getGenome().getFlowerProvider().getDescription(), ((IAlleleFlowers) butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.FLOWER_PROVIDER)) - .getProvider() - .getDescription(), + .getProvider().getDescription(), butterfly, EnumButterflyChromosome.FLOWER_PROVIDER); textLayout.newLine(); @@ -192,10 +167,7 @@ public class GuiFlutterlyzer extends GuiAlyzer { drawRow( StringUtil.localize("gui.effect"), butterfly.getGenome().getEffect().getName(), - butterfly - .getGenome() - .getInactiveAllele(EnumButterflyChromosome.EFFECT) - .getName(), + butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.EFFECT).getName(), butterfly, EnumButterflyChromosome.EFFECT); @@ -215,18 +187,16 @@ public class GuiFlutterlyzer extends GuiAlyzer { drawRow( StringUtil.localize("gui.climate"), - AlleleManager.climateHelper.toDisplay( - butterfly.getGenome().getPrimary().getTemperature()), - AlleleManager.climateHelper.toDisplay( - butterfly.getGenome().getPrimary().getTemperature()), + AlleleManager.climateHelper.toDisplay(butterfly.getGenome().getPrimary().getTemperature()), + AlleleManager.climateHelper.toDisplay(butterfly.getGenome().getPrimary().getTemperature()), butterfly, EnumButterflyChromosome.SPECIES); textLayout.newLine(); - IAlleleTolerance tempToleranceActive = - (IAlleleTolerance) butterfly.getGenome().getActiveAllele(EnumButterflyChromosome.TEMPERATURE_TOLERANCE); - IAlleleTolerance tempToleranceInactive = (IAlleleTolerance) - butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.TEMPERATURE_TOLERANCE); + IAlleleTolerance tempToleranceActive = (IAlleleTolerance) butterfly.getGenome() + .getActiveAllele(EnumButterflyChromosome.TEMPERATURE_TOLERANCE); + IAlleleTolerance tempToleranceInactive = (IAlleleTolerance) butterfly.getGenome() + .getInactiveAllele(EnumButterflyChromosome.TEMPERATURE_TOLERANCE); textLayout.drawLine(" " + StringUtil.localize("gui.tolerance"), COLUMN_0); drawToleranceInfo(tempToleranceActive, COLUMN_1); drawToleranceInfo(tempToleranceInactive, COLUMN_2); @@ -235,18 +205,16 @@ public class GuiFlutterlyzer extends GuiAlyzer { drawRow( StringUtil.localize("gui.humidity"), - AlleleManager.climateHelper.toDisplay( - butterfly.getGenome().getPrimary().getHumidity()), - AlleleManager.climateHelper.toDisplay( - butterfly.getGenome().getPrimary().getHumidity()), + AlleleManager.climateHelper.toDisplay(butterfly.getGenome().getPrimary().getHumidity()), + AlleleManager.climateHelper.toDisplay(butterfly.getGenome().getPrimary().getHumidity()), butterfly, EnumButterflyChromosome.SPECIES); textLayout.newLine(); - IAlleleTolerance humidToleranceActive = - (IAlleleTolerance) butterfly.getGenome().getActiveAllele(EnumButterflyChromosome.HUMIDITY_TOLERANCE); - IAlleleTolerance humidToleranceInactive = - (IAlleleTolerance) butterfly.getGenome().getInactiveAllele(EnumButterflyChromosome.HUMIDITY_TOLERANCE); + IAlleleTolerance humidToleranceActive = (IAlleleTolerance) butterfly.getGenome() + .getActiveAllele(EnumButterflyChromosome.HUMIDITY_TOLERANCE); + IAlleleTolerance humidToleranceInactive = (IAlleleTolerance) butterfly.getGenome() + .getInactiveAllele(EnumButterflyChromosome.HUMIDITY_TOLERANCE); textLayout.drawLine(" " + StringUtil.localize("gui.tolerance"), COLUMN_0); drawToleranceInfo(humidToleranceActive, COLUMN_1); drawToleranceInfo(humidToleranceInactive, COLUMN_2); @@ -321,10 +289,13 @@ public class GuiFlutterlyzer extends GuiAlyzer { textLayout.newLine(); int x = COLUMN_0; - for (ItemStack stack : - butterfly.getGenome().getPrimary().getButterflyLoot().keySet()) { + for (ItemStack stack : butterfly.getGenome().getPrimary().getButterflyLoot().keySet()) { itemRender.renderItemIntoGUI( - fontRendererObj, mc.renderEngine, stack, guiLeft + x, guiTop + textLayout.getLineY()); + fontRendererObj, + mc.renderEngine, + stack, + guiLeft + x, + guiTop + textLayout.getLineY()); x += 18; if (x > 148) { x = COLUMN_0; @@ -339,10 +310,13 @@ public class GuiFlutterlyzer extends GuiAlyzer { textLayout.newLine(); x = COLUMN_0; - for (ItemStack stack : - butterfly.getGenome().getPrimary().getCaterpillarLoot().keySet()) { + for (ItemStack stack : butterfly.getGenome().getPrimary().getCaterpillarLoot().keySet()) { itemRender.renderItemIntoGUI( - fontRendererObj, mc.renderEngine, stack, guiLeft + x, guiTop + textLayout.getLineY()); + fontRendererObj, + mc.renderEngine, + stack, + guiLeft + x, + guiTop + textLayout.getLineY()); x += 18; if (x > 148) { x = COLUMN_0; diff --git a/src/main/java/forestry/lepidopterology/inventory/ItemInventoryFlutterlyzer.java b/src/main/java/forestry/lepidopterology/inventory/ItemInventoryFlutterlyzer.java index d5a461e7e..135eedb4a 100644 --- a/src/main/java/forestry/lepidopterology/inventory/ItemInventoryFlutterlyzer.java +++ b/src/main/java/forestry/lepidopterology/inventory/ItemInventoryFlutterlyzer.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.inventory; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import forestry.api.lepidopterology.ButterflyManager; import forestry.core.config.Config; import forestry.core.gui.IHintSource; import forestry.core.inventory.ItemInventoryAlyzer; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class ItemInventoryFlutterlyzer extends ItemInventoryAlyzer implements IHintSource { diff --git a/src/main/java/forestry/lepidopterology/items/ItemButterflyGE.java b/src/main/java/forestry/lepidopterology/items/ItemButterflyGE.java index 3952314ed..2ddbc2591 100755 --- a/src/main/java/forestry/lepidopterology/items/ItemButterflyGE.java +++ b/src/main/java/forestry/lepidopterology/items/ItemButterflyGE.java @@ -1,15 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.items; +import java.util.List; +import java.util.Random; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.creativetab.CreativeTabs; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.core.Tabs; @@ -29,17 +40,6 @@ import forestry.core.utils.EntityUtil; import forestry.lepidopterology.entities.EntityButterfly; import forestry.lepidopterology.genetics.ButterflyGenome; import forestry.plugins.PluginLepidopterology; -import java.util.List; -import java.util.Random; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; public class ItemButterflyGE extends ItemGE { @@ -87,7 +87,7 @@ public class ItemButterflyGE extends ItemGE { return butterfly.getDisplayName(); } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void getSubItems(Item item, CreativeTabs par2CreativeTabs, List itemList) { addCreativeItems(itemList, true); @@ -131,14 +131,16 @@ public class ItemButterflyGE extends ItemGE { } if (EntityUtil.spawnEntity( + entityItem.worldObj, + new EntityButterfly( entityItem.worldObj, - new EntityButterfly( - entityItem.worldObj, butterfly, (int) entityItem.posX, (int) entityItem.posY, (int) - entityItem.posZ), - entityItem.posX, - entityItem.posY, - entityItem.posZ) - != null) { + butterfly, + (int) entityItem.posX, + (int) entityItem.posY, + (int) entityItem.posZ), + entityItem.posX, + entityItem.posY, + entityItem.posZ) != null) { if (entityItem.getEntityItem().stackSize > 1) { entityItem.getEntityItem().stackSize--; } else { @@ -158,10 +160,7 @@ public class ItemButterflyGE extends ItemGE { } return getColourFromSpecies( - AlleleManager.alleleRegistry - .getIndividual(itemstack) - .getGenome() - .getPrimary(), + AlleleManager.alleleRegistry.getIndividual(itemstack).getGenome().getPrimary(), renderPass); } @@ -214,17 +213,8 @@ public class ItemButterflyGE extends ItemGE { } @Override - public boolean onItemUse( - ItemStack itemstack, - EntityPlayer player, - World world, - int x, - int y, - int z, - int par7, - float facingX, - float facingY, - float facingZ) { + public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int par7, + float facingX, float facingY, float facingZ) { if (world.isRemote) { return false; diff --git a/src/main/java/forestry/lepidopterology/items/ItemFlutterlyzer.java b/src/main/java/forestry/lepidopterology/items/ItemFlutterlyzer.java index 4a21a92f4..44a5e0a83 100644 --- a/src/main/java/forestry/lepidopterology/items/ItemFlutterlyzer.java +++ b/src/main/java/forestry/lepidopterology/items/ItemFlutterlyzer.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.items; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import forestry.api.core.Tabs; import forestry.core.gui.ContainerAlyzer; import forestry.core.items.ItemWithGui; import forestry.lepidopterology.gui.GuiFlutterlyzer; import forestry.lepidopterology.inventory.ItemInventoryFlutterlyzer; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class ItemFlutterlyzer extends ItemWithGui { + public ItemFlutterlyzer() { setCreativeTab(Tabs.tabLepidopterology); } diff --git a/src/main/java/forestry/lepidopterology/items/ItemRegistryLepidopterology.java b/src/main/java/forestry/lepidopterology/items/ItemRegistryLepidopterology.java index 541b6a268..1f380b184 100644 --- a/src/main/java/forestry/lepidopterology/items/ItemRegistryLepidopterology.java +++ b/src/main/java/forestry/lepidopterology/items/ItemRegistryLepidopterology.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.items; @@ -14,6 +12,7 @@ import forestry.api.lepidopterology.EnumFlutterType; import forestry.core.items.ItemRegistry; public class ItemRegistryLepidopterology extends ItemRegistry { + public final ItemFlutterlyzer flutterlyzer; public final ItemButterflyGE butterflyGE; public final ItemButterflyGE serumGE; diff --git a/src/main/java/forestry/lepidopterology/proxy/ProxyLepidopterology.java b/src/main/java/forestry/lepidopterology/proxy/ProxyLepidopterology.java index e799dfea6..b2f2475fc 100755 --- a/src/main/java/forestry/lepidopterology/proxy/ProxyLepidopterology.java +++ b/src/main/java/forestry/lepidopterology/proxy/ProxyLepidopterology.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.proxy; diff --git a/src/main/java/forestry/lepidopterology/proxy/ProxyLepidopterologyClient.java b/src/main/java/forestry/lepidopterology/proxy/ProxyLepidopterologyClient.java index 679e1ff0e..bddfd7fbb 100644 --- a/src/main/java/forestry/lepidopterology/proxy/ProxyLepidopterologyClient.java +++ b/src/main/java/forestry/lepidopterology/proxy/ProxyLepidopterologyClient.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.proxy; +import net.minecraftforge.client.MinecraftForgeClient; + import cpw.mods.fml.client.registry.RenderingRegistry; import forestry.lepidopterology.entities.EntityButterfly; import forestry.lepidopterology.render.RenderButterflyEntity; import forestry.lepidopterology.render.RenderButterflyItem; import forestry.plugins.PluginLepidopterology; -import net.minecraftforge.client.MinecraftForgeClient; public class ProxyLepidopterologyClient extends ProxyLepidopterology { diff --git a/src/main/java/forestry/lepidopterology/recipes/MatingRecipe.java b/src/main/java/forestry/lepidopterology/recipes/MatingRecipe.java index 27c20fab0..2fd6163ec 100644 --- a/src/main/java/forestry/lepidopterology/recipes/MatingRecipe.java +++ b/src/main/java/forestry/lepidopterology/recipes/MatingRecipe.java @@ -1,23 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.recipes; -import forestry.api.lepidopterology.ButterflyManager; -import forestry.api.lepidopterology.EnumFlutterType; -import forestry.api.lepidopterology.IButterfly; import net.minecraft.inventory.InventoryCrafting; import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.world.World; +import forestry.api.lepidopterology.ButterflyManager; +import forestry.api.lepidopterology.EnumFlutterType; +import forestry.api.lepidopterology.IButterfly; + public class MatingRecipe implements IRecipe { private final ItemStack unknown; @@ -25,7 +24,8 @@ public class MatingRecipe implements IRecipe { public MatingRecipe() { unknown = ButterflyManager.butterflyRoot.getMemberStack( - ButterflyManager.butterflyRoot.getIndividualTemplates().get(0), EnumFlutterType.BUTTERFLY.ordinal()); + ButterflyManager.butterflyRoot.getIndividualTemplates().get(0), + EnumFlutterType.BUTTERFLY.ordinal()); } @Override @@ -36,15 +36,15 @@ public class MatingRecipe implements IRecipe { int sera = 0; for (int i = 0; i < crafting.getSizeInventory(); i++) { - if (ButterflyManager.butterflyRoot.isMember( - crafting.getStackInSlot(i), EnumFlutterType.BUTTERFLY.ordinal())) { + if (ButterflyManager.butterflyRoot + .isMember(crafting.getStackInSlot(i), EnumFlutterType.BUTTERFLY.ordinal())) { butterflies++; mated = ButterflyManager.butterflyRoot.isMated(crafting.getStackInSlot(i)); cached = crafting.getStackInSlot(i); - } else if (ButterflyManager.butterflyRoot.isMember( - crafting.getStackInSlot(i), EnumFlutterType.SERUM.ordinal())) { - sera++; - } + } else if (ButterflyManager.butterflyRoot + .isMember(crafting.getStackInSlot(i), EnumFlutterType.SERUM.ordinal())) { + sera++; + } } return !mated && butterflies == 1 && sera == 1; @@ -64,13 +64,13 @@ public class MatingRecipe implements IRecipe { IButterfly butterfly = null; IButterfly serum = null; for (int i = 0; i < crafting.getSizeInventory(); i++) { - if (ButterflyManager.butterflyRoot.isMember( - crafting.getStackInSlot(i), EnumFlutterType.BUTTERFLY.ordinal())) { + if (ButterflyManager.butterflyRoot + .isMember(crafting.getStackInSlot(i), EnumFlutterType.BUTTERFLY.ordinal())) { butterfly = ButterflyManager.butterflyRoot.getMember(crafting.getStackInSlot(i)); - } else if (ButterflyManager.butterflyRoot.isMember( - crafting.getStackInSlot(i), EnumFlutterType.SERUM.ordinal())) { - serum = ButterflyManager.butterflyRoot.getMember(crafting.getStackInSlot(i)); - } + } else if (ButterflyManager.butterflyRoot + .isMember(crafting.getStackInSlot(i), EnumFlutterType.SERUM.ordinal())) { + serum = ButterflyManager.butterflyRoot.getMember(crafting.getStackInSlot(i)); + } } if (butterfly == null || serum == null) { return null; diff --git a/src/main/java/forestry/lepidopterology/render/ModelButterfly.java b/src/main/java/forestry/lepidopterology/render/ModelButterfly.java index e344c8fc7..c78c4f5e5 100755 --- a/src/main/java/forestry/lepidopterology/render/ModelButterfly.java +++ b/src/main/java/forestry/lepidopterology/render/ModelButterfly.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.render; @@ -14,6 +12,7 @@ import net.minecraft.client.model.ModelBase; import net.minecraft.client.model.ModelRenderer; import net.minecraft.entity.Entity; import net.minecraft.util.MathHelper; + import org.lwjgl.opengl.GL11; public class ModelButterfly extends ModelBase { diff --git a/src/main/java/forestry/lepidopterology/render/RenderButterflyEntity.java b/src/main/java/forestry/lepidopterology/render/RenderButterflyEntity.java index 8f261b512..4fbe6ffcf 100644 --- a/src/main/java/forestry/lepidopterology/render/RenderButterflyEntity.java +++ b/src/main/java/forestry/lepidopterology/render/RenderButterflyEntity.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.render; -import forestry.lepidopterology.entities.EntityButterfly; import net.minecraft.client.renderer.entity.RenderLiving; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityLivingBase; import net.minecraft.util.ResourceLocation; +import forestry.lepidopterology.entities.EntityButterfly; + public class RenderButterflyEntity extends RenderLiving { private final ModelButterfly butterflyModel; @@ -25,8 +24,8 @@ public class RenderButterflyEntity extends RenderLiving { butterflyModel = (ModelButterfly) mainModel; } - private void renderButterfly( - EntityButterfly entity, double x, double y, double z, float light, float partialTickTime) { + private void renderButterfly(EntityButterfly entity, double x, double y, double z, float light, + float partialTickTime) { if (!entity.isRenderable()) { return; } diff --git a/src/main/java/forestry/lepidopterology/render/RenderButterflyItem.java b/src/main/java/forestry/lepidopterology/render/RenderButterflyItem.java index 89040a21f..b933cdb5b 100644 --- a/src/main/java/forestry/lepidopterology/render/RenderButterflyItem.java +++ b/src/main/java/forestry/lepidopterology/render/RenderButterflyItem.java @@ -1,28 +1,28 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.render; -import forestry.api.lepidopterology.ButterflyManager; -import forestry.api.lepidopterology.IButterfly; -import forestry.core.proxy.Proxies; -import forestry.lepidopterology.entities.EntityButterfly; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.item.ItemStack; import net.minecraftforge.client.IItemRenderer; + import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GL12; +import forestry.api.lepidopterology.ButterflyManager; +import forestry.api.lepidopterology.IButterfly; +import forestry.core.proxy.Proxies; +import forestry.lepidopterology.entities.EntityButterfly; + public class RenderButterflyItem implements IItemRenderer { private final ModelButterfly model; @@ -73,8 +73,8 @@ public class RenderButterflyItem implements IItemRenderer { private IButterfly initButterfly(ItemStack item) { IButterfly butterfly = ButterflyManager.butterflyRoot.getMember(item); if (butterfly == null) { - butterfly = ButterflyManager.butterflyRoot.templateAsIndividual( - ButterflyManager.butterflyRoot.getDefaultTemplate()); + butterfly = ButterflyManager.butterflyRoot + .templateAsIndividual(ButterflyManager.butterflyRoot.getDefaultTemplate()); } if (entity == null) { diff --git a/src/main/java/forestry/lepidopterology/tiles/TileLepidopteristChest.java b/src/main/java/forestry/lepidopterology/tiles/TileLepidopteristChest.java index b31116a45..51604374c 100644 --- a/src/main/java/forestry/lepidopterology/tiles/TileLepidopteristChest.java +++ b/src/main/java/forestry/lepidopterology/tiles/TileLepidopteristChest.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.lepidopterology.tiles; @@ -14,6 +12,7 @@ import forestry.api.lepidopterology.ButterflyManager; import forestry.core.tiles.TileNaturalistChest; public class TileLepidopteristChest extends TileNaturalistChest { + public TileLepidopteristChest() { super(ButterflyManager.butterflyRoot); } diff --git a/src/main/java/forestry/mail/EnumDeliveryState.java b/src/main/java/forestry/mail/EnumDeliveryState.java index 3a84f3f9c..20abe8c65 100755 --- a/src/main/java/forestry/mail/EnumDeliveryState.java +++ b/src/main/java/forestry/mail/EnumDeliveryState.java @@ -1,19 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail; -import forestry.api.mail.IPostalState; import java.util.Locale; +import forestry.api.mail.IPostalState; + public enum EnumDeliveryState implements IPostalState { + OK, NO_MAILBOX, NOT_MAILABLE, diff --git a/src/main/java/forestry/mail/EnumStationState.java b/src/main/java/forestry/mail/EnumStationState.java index 3ea45aa11..f2d4e8e3c 100755 --- a/src/main/java/forestry/mail/EnumStationState.java +++ b/src/main/java/forestry/mail/EnumStationState.java @@ -1,19 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail; -import forestry.api.mail.IPostalState; import java.util.Locale; +import forestry.api.mail.IPostalState; + public enum EnumStationState implements IPostalState { + OK, INSUFFICIENT_OFFER, INSUFFICIENT_TRADE_GOOD, diff --git a/src/main/java/forestry/mail/EventHandlerMailAlert.java b/src/main/java/forestry/mail/EventHandlerMailAlert.java index b2eb85b69..08a67f5d9 100644 --- a/src/main/java/forestry/mail/EventHandlerMailAlert.java +++ b/src/main/java/forestry/mail/EventHandlerMailAlert.java @@ -1,15 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; + import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.gameevent.PlayerEvent; import cpw.mods.fml.common.gameevent.TickEvent; @@ -17,10 +18,9 @@ import cpw.mods.fml.common.gameevent.TickEvent.Phase; import forestry.core.proxy.Proxies; import forestry.mail.gui.GuiMailboxInfo; import forestry.mail.network.packets.PacketPOBoxInfoUpdate; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayer; public class EventHandlerMailAlert { + @SubscribeEvent public void onRenderTick(TickEvent.RenderTickEvent event) { if (event.phase != Phase.END) { diff --git a/src/main/java/forestry/mail/Letter.java b/src/main/java/forestry/mail/Letter.java index e49e03a8d..84c8ac135 100755 --- a/src/main/java/forestry/mail/Letter.java +++ b/src/main/java/forestry/mail/Letter.java @@ -1,28 +1,30 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + +import org.apache.commons.lang3.StringUtils; + import forestry.api.mail.ILetter; import forestry.api.mail.IMailAddress; import forestry.api.mail.IStamps; import forestry.core.inventory.InventoryAdapter; import forestry.core.utils.InventoryUtil; import forestry.core.utils.StringUtil; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import org.apache.commons.lang3.StringUtils; public class Letter implements ILetter { + public static final short SLOT_ATTACHMENT_1 = 0; public static final short SLOT_ATTACHMENT_COUNT = 18; public static final short SLOT_POSTAGE_1 = 18; @@ -38,7 +40,7 @@ public class Letter implements ILetter { public Letter(IMailAddress sender, IMailAddress recipient) { this.sender = sender; - this.recipient = new IMailAddress[] {recipient}; + this.recipient = new IMailAddress[] { recipient }; } public Letter(NBTTagCompound nbttagcompound) { @@ -209,7 +211,7 @@ public class Letter implements ILetter { if (address == null) { this.recipient = new IMailAddress[] {}; } else { - this.recipient = new IMailAddress[] {address}; + this.recipient = new IMailAddress[] { address }; } } diff --git a/src/main/java/forestry/mail/LetterProperties.java b/src/main/java/forestry/mail/LetterProperties.java index fbe2cd200..f46bba68b 100644 --- a/src/main/java/forestry/mail/LetterProperties.java +++ b/src/main/java/forestry/mail/LetterProperties.java @@ -1,28 +1,29 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.mail.ILetter; -import forestry.core.render.TextureManager; -import forestry.plugins.PluginMail; import java.util.List; + 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 cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; +import forestry.api.mail.ILetter; +import forestry.core.render.TextureManager; +import forestry.plugins.PluginMail; + public class LetterProperties { + private enum State { FRESH, STAMPED, diff --git a/src/main/java/forestry/mail/MailAddress.java b/src/main/java/forestry/mail/MailAddress.java index 6cc8709fb..d60b57a41 100644 --- a/src/main/java/forestry/mail/MailAddress.java +++ b/src/main/java/forestry/mail/MailAddress.java @@ -1,24 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail; +import java.util.Locale; +import java.util.UUID; + +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; + import com.mojang.authlib.GameProfile; + import forestry.api.core.INBTTagable; import forestry.api.mail.EnumAddressee; import forestry.api.mail.IMailAddress; import forestry.core.utils.PlayerUtil; -import java.util.Locale; -import java.util.UUID; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTUtil; public class MailAddress implements INBTTagable, IMailAddress { diff --git a/src/main/java/forestry/mail/POBox.java b/src/main/java/forestry/mail/POBox.java index 6c6a41c47..2277c5c3e 100755 --- a/src/main/java/forestry/mail/POBox.java +++ b/src/main/java/forestry/mail/POBox.java @@ -1,25 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.WorldSavedData; + import forestry.api.mail.ILetter; import forestry.api.mail.IMailAddress; import forestry.api.mail.PostManager; import forestry.core.inventory.InventoryAdapter; import forestry.core.utils.InventoryUtil; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.WorldSavedData; public class POBox extends WorldSavedData implements IInventory { diff --git a/src/main/java/forestry/mail/POBoxInfo.java b/src/main/java/forestry/mail/POBoxInfo.java index de94071d9..2673b36d1 100755 --- a/src/main/java/forestry/mail/POBoxInfo.java +++ b/src/main/java/forestry/mail/POBoxInfo.java @@ -1,16 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail; public class POBoxInfo { + public final int playerLetters; public final int tradeLetters; diff --git a/src/main/java/forestry/mail/PostOffice.java b/src/main/java/forestry/mail/PostOffice.java index 72fa46572..b37441f4b 100755 --- a/src/main/java/forestry/mail/PostOffice.java +++ b/src/main/java/forestry/mail/PostOffice.java @@ -1,15 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail; +import java.io.File; +import java.util.LinkedHashMap; + +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; +import net.minecraft.world.WorldSavedData; + import forestry.api.mail.EnumPostage; import forestry.api.mail.ILetter; import forestry.api.mail.IMailAddress; @@ -21,12 +27,6 @@ import forestry.api.mail.ITradeStation; import forestry.api.mail.PostManager; import forestry.mail.items.EnumStampDefinition; import forestry.plugins.PluginMail; -import java.io.File; -import java.util.LinkedHashMap; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; -import net.minecraft.world.WorldSavedData; public class PostOffice extends WorldSavedData implements IPostOffice { @@ -93,8 +93,7 @@ public class PostOffice extends WorldSavedData implements IPostOffice { continue; } - MailAddress address = - new MailAddress(str.replace(TradeStation.SAVE_NAME, "").replace(".dat", "")); + MailAddress address = new MailAddress(str.replace(TradeStation.SAVE_NAME, "").replace(".dat", "")); ITradeStation trade = PostManager.postRegistry.getTradeStation(world, address); if (trade == null) { continue; @@ -124,7 +123,7 @@ public class PostOffice extends WorldSavedData implements IPostOffice { @Override public ItemStack getAnyStamp(EnumPostage postage, int max) { - return getAnyStamp(new EnumPostage[] {postage}, max); + return getAnyStamp(new EnumPostage[] { postage }, max); } @Override diff --git a/src/main/java/forestry/mail/PostRegistry.java b/src/main/java/forestry/mail/PostRegistry.java index e2eb9b9f3..61d834268 100755 --- a/src/main/java/forestry/mail/PostRegistry.java +++ b/src/main/java/forestry/mail/PostRegistry.java @@ -1,16 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail; +import java.io.File; +import java.util.EnumMap; +import java.util.HashMap; +import java.util.Map; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.world.World; + import com.mojang.authlib.GameProfile; + import forestry.api.mail.EnumAddressee; import forestry.api.mail.ILetter; import forestry.api.mail.IMailAddress; @@ -23,14 +32,6 @@ import forestry.core.proxy.Proxies; import forestry.core.utils.PlayerUtil; import forestry.mail.network.packets.PacketPOBoxInfoUpdate; import forestry.plugins.PluginMail; -import java.io.File; -import java.util.EnumMap; -import java.util.HashMap; -import java.util.Map; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.world.World; public class PostRegistry implements IPostRegistry { diff --git a/src/main/java/forestry/mail/PostalCarrier.java b/src/main/java/forestry/mail/PostalCarrier.java index 90be14e22..cd7a04afd 100755 --- a/src/main/java/forestry/mail/PostalCarrier.java +++ b/src/main/java/forestry/mail/PostalCarrier.java @@ -1,15 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +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; import forestry.api.mail.EnumAddressee; @@ -24,11 +28,6 @@ import forestry.core.render.TextureManager; import forestry.core.utils.PlayerUtil; import forestry.core.utils.StringUtil; import forestry.mail.network.packets.PacketPOBoxInfoUpdate; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; public class PostalCarrier implements IPostalCarrier { @@ -57,8 +56,8 @@ public class PostalCarrier implements IPostalCarrier { } @Override - public IPostalState deliverLetter( - World world, IPostOffice office, IMailAddress recipient, ItemStack letterStack, boolean doDeliver) { + public IPostalState deliverLetter(World world, IPostOffice office, IMailAddress recipient, ItemStack letterStack, + boolean doDeliver) { if (type == EnumAddressee.TRADER) { return handleTradeLetter(world, recipient, letterStack, doDeliver); } else { @@ -66,8 +65,8 @@ public class PostalCarrier implements IPostalCarrier { } } - private static IPostalState handleTradeLetter( - World world, IMailAddress recipient, ItemStack letterStack, boolean doLodge) { + private static IPostalState handleTradeLetter(World world, IMailAddress recipient, ItemStack letterStack, + boolean doLodge) { ITradeStation trade = PostManager.postRegistry.getTradeStation(world, recipient); if (trade == null) { return EnumDeliveryState.NO_MAILBOX; diff --git a/src/main/java/forestry/mail/SaveEventHandlerMail.java b/src/main/java/forestry/mail/SaveEventHandlerMail.java index e3b3719e4..d92c6347a 100755 --- a/src/main/java/forestry/mail/SaveEventHandlerMail.java +++ b/src/main/java/forestry/mail/SaveEventHandlerMail.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail; -import forestry.core.ISaveEventHandler; import net.minecraft.world.World; +import forestry.core.ISaveEventHandler; + public class SaveEventHandlerMail implements ISaveEventHandler { @Override diff --git a/src/main/java/forestry/mail/TradeStation.java b/src/main/java/forestry/mail/TradeStation.java index ef75f4ef9..e5ad02c2e 100755 --- a/src/main/java/forestry/mail/TradeStation.java +++ b/src/main/java/forestry/mail/TradeStation.java @@ -1,16 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail; +import java.util.ArrayList; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTUtil; +import net.minecraft.world.World; +import net.minecraft.world.WorldSavedData; + import com.mojang.authlib.GameProfile; + import forestry.api.mail.EnumPostage; import forestry.api.mail.ILetter; import forestry.api.mail.IMailAddress; @@ -27,16 +36,9 @@ import forestry.core.utils.StringUtil; import forestry.mail.inventory.InventoryTradeStation; import forestry.mail.items.EnumStampDefinition; import forestry.plugins.PluginMail; -import java.util.ArrayList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTUtil; -import net.minecraft.world.World; -import net.minecraft.world.WorldSavedData; public class TradeStation extends WorldSavedData implements ITradeStation, IInventoryAdapter { + public static final String SAVE_NAME = "TradePO_"; public static final short SLOT_TRADEGOOD = 0; public static final short SLOT_TRADEGOOD_COUNT = 1; @@ -50,8 +52,7 @@ public class TradeStation extends WorldSavedData implements ITradeStation, IInve public static final short SLOT_RECEIVE_BUFFER_COUNT = 15; public static final short SLOT_SEND_BUFFER = 30; public static final short SLOT_SEND_BUFFER_COUNT = 10; - public static final int SLOT_SIZE = SLOT_TRADEGOOD_COUNT - + SLOT_EXCHANGE_COUNT + public static final int SLOT_SIZE = SLOT_TRADEGOOD_COUNT + SLOT_EXCHANGE_COUNT + SLOT_LETTERS_COUNT + SLOT_STAMPS_COUNT + SLOT_RECEIVE_BUFFER_COUNT @@ -142,8 +143,8 @@ public class TradeStation extends WorldSavedData implements ITradeStation, IInve @Override public TradeStationInfo getTradeInfo() { - ItemStack[] condensedRequired = - ItemStackUtil.condenseStacks(InventoryUtil.getStacks(inventory, SLOT_EXCHANGE_1, SLOT_EXCHANGE_COUNT)); + ItemStack[] condensedRequired = ItemStackUtil + .condenseStacks(InventoryUtil.getStacks(inventory, SLOT_EXCHANGE_1, SLOT_EXCHANGE_COUNT)); // Set current state EnumStationState state = EnumStationState.OK; @@ -205,7 +206,8 @@ public class TradeStation extends WorldSavedData implements ITradeStation, IInve // Check for sufficient output buffer int storable = countStorablePayment( - ordersToFillCount, InventoryUtil.getStacks(inventory, SLOT_EXCHANGE_1, SLOT_EXCHANGE_COUNT)); + ordersToFillCount, + InventoryUtil.getStacks(inventory, SLOT_EXCHANGE_1, SLOT_EXCHANGE_COUNT)); if (storable <= 0) { return EnumStationState.INSUFFICIENT_BUFFER; @@ -250,8 +252,8 @@ public class TradeStation extends WorldSavedData implements ITradeStation, IInve ItemStack mailstack = LetterProperties.createStampedLetterStack(mail); mailstack.setTagCompound(nbttagcompound); - IPostalState responseState = - PostManager.postRegistry.getPostOffice(world).lodgeLetter(world, mailstack, doLodge); + IPostalState responseState = PostManager.postRegistry.getPostOffice(world) + .lodgeLetter(world, mailstack, doLodge); if (!responseState.isOk()) { return EnumDeliveryState.RESPONSE_NOT_MAILABLE; @@ -264,8 +266,8 @@ public class TradeStation extends WorldSavedData implements ITradeStation, IInve continue; } - InventoryUtil.tryAddStack( - inventory, stack.copy(), SLOT_RECEIVE_BUFFER, SLOT_RECEIVE_BUFFER_COUNT, false); + InventoryUtil + .tryAddStack(inventory, stack.copy(), SLOT_RECEIVE_BUFFER, SLOT_RECEIVE_BUFFER_COUNT, false); } } @@ -288,8 +290,7 @@ public class TradeStation extends WorldSavedData implements ITradeStation, IInve orderFilledMessage = orderFilledMessage.replace("%COUNT", Integer.toString(ordersToFillCount)); } - orderFilledMessage = - orderFilledMessage.replace("%SENDER", letter.getSender().getName()); + orderFilledMessage = orderFilledMessage.replace("%SENDER", letter.getSender().getName()); confirm.setText(orderFilledMessage); confirm.addStamps(PluginMail.items.stamps.get(EnumStampDefinition.P_1, 1)); @@ -301,7 +302,7 @@ public class TradeStation extends WorldSavedData implements ITradeStation, IInve PostManager.postRegistry.getPostOffice(world).lodgeLetter(world, confirmstack, doLodge); removePaper(); - removeStamps(new int[] {0, 1}); + removeStamps(new int[] { 0, 1 }); } markDirty(); diff --git a/src/main/java/forestry/mail/blocks/BlockMail.java b/src/main/java/forestry/mail/blocks/BlockMail.java index 4093ecd2a..52d312d37 100644 --- a/src/main/java/forestry/mail/blocks/BlockMail.java +++ b/src/main/java/forestry/mail/blocks/BlockMail.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.blocks; import forestry.core.blocks.BlockBase; public class BlockMail extends BlockBase { + public BlockMail() { super(); } diff --git a/src/main/java/forestry/mail/blocks/BlockMailType.java b/src/main/java/forestry/mail/blocks/BlockMailType.java index 3bc3d3352..ad99efbec 100644 --- a/src/main/java/forestry/mail/blocks/BlockMailType.java +++ b/src/main/java/forestry/mail/blocks/BlockMailType.java @@ -1,24 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.blocks; +import java.util.Locale; + +import org.apache.commons.lang3.text.WordUtils; + import forestry.core.blocks.IMachineProperties; import forestry.core.tiles.TileForestry; import forestry.mail.tiles.TileMailbox; import forestry.mail.tiles.TileStampCollector; import forestry.mail.tiles.TileTrader; -import java.util.Locale; -import org.apache.commons.lang3.text.WordUtils; public enum BlockMailType implements IMachineProperties { + MAILBOX(TileMailbox.class), TRADESTATION(TileTrader.class), PHILATELIST(TileStampCollector.class); diff --git a/src/main/java/forestry/mail/blocks/BlockRegistryMail.java b/src/main/java/forestry/mail/blocks/BlockRegistryMail.java index a1c605e2a..f6675fb4f 100644 --- a/src/main/java/forestry/mail/blocks/BlockRegistryMail.java +++ b/src/main/java/forestry/mail/blocks/BlockRegistryMail.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.blocks; @@ -14,6 +12,7 @@ import forestry.core.blocks.BlockRegistry; import forestry.core.items.ItemBlockForestry; public class BlockRegistryMail extends BlockRegistry { + public final BlockMail mail; public BlockRegistryMail() { diff --git a/src/main/java/forestry/mail/commands/CommandMail.java b/src/main/java/forestry/mail/commands/CommandMail.java index 0521ba31b..30595d004 100644 --- a/src/main/java/forestry/mail/commands/CommandMail.java +++ b/src/main/java/forestry/mail/commands/CommandMail.java @@ -1,17 +1,18 @@ /* - ******************************************************************************* - * 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 - ******************************************************************************* + ******************************************************************************* 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.mail.commands; +import net.minecraft.command.ICommandSender; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatStyle; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.world.World; + import forestry.api.mail.ITradeStation; import forestry.api.mail.PostManager; import forestry.api.mail.TradeStationInfo; @@ -19,12 +20,6 @@ import forestry.core.commands.CommandHelpers; import forestry.core.commands.SubCommand; import forestry.core.utils.StringUtil; import forestry.mail.MailAddress; -import net.minecraft.command.ICommandSender; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.ChatStyle; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.world.World; /** * @author CovertJaguar @@ -50,10 +45,8 @@ public class CommandMail extends SubCommand { if (!(sender instanceof EntityPlayer)) { return; } - for (ITradeStation trade : PostManager.postRegistry - .getPostOffice(((EntityPlayer) sender).worldObj) - .getActiveTradeStations(((EntityPlayer) sender).worldObj) - .values()) { + for (ITradeStation trade : PostManager.postRegistry.getPostOffice(((EntityPlayer) sender).worldObj) + .getActiveTradeStations(((EntityPlayer) sender).worldObj).values()) { CommandHelpers.sendChatMessage(sender, makeTradeListEntry(trade.getTradeInfo())); } } @@ -98,7 +91,10 @@ public class CommandMail extends SubCommand { ChatStyle red = new ChatStyle(); red.setColor(EnumChatFormatting.RED); CommandHelpers.sendLocalizedChatMessage( - sender, red, "for.chat.command.forestry.mail.virtualize.no_tradestation", args[0]); + sender, + red, + "for.chat.command.forestry.mail.virtualize.no_tradestation", + args[0]); return; } diff --git a/src/main/java/forestry/mail/gui/ContainerCatalogue.java b/src/main/java/forestry/mail/gui/ContainerCatalogue.java index bbe20f670..7d2d26b64 100755 --- a/src/main/java/forestry/mail/gui/ContainerCatalogue.java +++ b/src/main/java/forestry/mail/gui/ContainerCatalogue.java @@ -1,15 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.gui; +import java.util.ArrayList; +import java.util.Collections; +import java.util.EnumSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.inventory.Container; +import net.minecraft.inventory.ICrafting; + import forestry.api.mail.EnumAddressee; import forestry.api.mail.IMailAddress; import forestry.api.mail.IPostOffice; @@ -22,16 +32,6 @@ import forestry.core.network.packets.PacketGuiSelectRequest; import forestry.core.proxy.Proxies; import forestry.mail.EnumStationState; import forestry.mail.network.packets.PacketLetterInfoResponse; -import java.util.ArrayList; -import java.util.Collections; -import java.util.EnumSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ICrafting; public class ContainerCatalogue extends Container implements IGuiSelectable, ILetterInfoReceiver { @@ -48,7 +48,7 @@ public class ContainerCatalogue extends Container implements IGuiSelectable, ILe private boolean needsSynch = true; private int currentFilter = 1; - private static final String[] FILTER_NAMES = new String[] {"all", "online", "offline"}; + private static final String[] FILTER_NAMES = new String[] { "all", "online", "offline" }; private static final List> FILTERS = new ArrayList<>(); static { diff --git a/src/main/java/forestry/mail/gui/ContainerLetter.java b/src/main/java/forestry/mail/gui/ContainerLetter.java index c6e1048e9..575f787e9 100755 --- a/src/main/java/forestry/mail/gui/ContainerLetter.java +++ b/src/main/java/forestry/mail/gui/ContainerLetter.java @@ -1,16 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.gui; +import java.util.Iterator; +import java.util.UUID; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.server.MinecraftServer; +import net.minecraft.world.World; + import com.mojang.authlib.GameProfile; + import forestry.api.mail.EnumAddressee; import forestry.api.mail.ILetter; import forestry.api.mail.IMailAddress; @@ -26,11 +32,6 @@ import forestry.mail.Letter; import forestry.mail.inventory.ItemInventoryLetter; import forestry.mail.network.packets.PacketLetterInfoResponse; import forestry.mail.network.packets.PacketLetterTextSet; -import java.util.Iterator; -import java.util.UUID; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.server.MinecraftServer; -import net.minecraft.world.World; public class ContainerLetter extends ContainerItemInventory implements ILetterInfoReceiver { @@ -102,8 +103,7 @@ public class ContainerLetter extends ContainerItemInventory } public void advanceCarrierType() { - Iterator it = - PostManager.postRegistry.getRegisteredCarriers().values().iterator(); + Iterator it = PostManager.postRegistry.getRegisteredCarriers().values().iterator(); while (it.hasNext()) { if (it.next().getType().equals(carrierType)) { break; @@ -114,11 +114,7 @@ public class ContainerLetter extends ContainerItemInventory if (it.hasNext()) { postal = it.next(); } else { - postal = PostManager.postRegistry - .getRegisteredCarriers() - .values() - .iterator() - .next(); + postal = PostManager.postRegistry.getRegisteredCarriers().values().iterator().next(); } setCarrierType(postal.getType()); @@ -141,8 +137,7 @@ public class ContainerLetter extends ContainerItemInventory private static IMailAddress getRecipient(String recipientName, EnumAddressee type) { switch (type) { case PLAYER: { - GameProfile gameProfile = - MinecraftServer.getServer().func_152358_ax().func_152655_a(recipientName); + GameProfile gameProfile = MinecraftServer.getServer().func_152358_ax().func_152655_a(recipientName); if (gameProfile == null) { gameProfile = new GameProfile(new UUID(0, 0), recipientName); } diff --git a/src/main/java/forestry/mail/gui/ContainerMailbox.java b/src/main/java/forestry/mail/gui/ContainerMailbox.java index 2d1200fc6..4c60c9885 100755 --- a/src/main/java/forestry/mail/gui/ContainerMailbox.java +++ b/src/main/java/forestry/mail/gui/ContainerMailbox.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.gui; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + import forestry.core.gui.ContainerTile; import forestry.core.gui.slots.SlotOutput; import forestry.core.proxy.Proxies; @@ -18,10 +21,6 @@ import forestry.mail.POBox; import forestry.mail.POBoxInfo; import forestry.mail.network.packets.PacketPOBoxInfoUpdate; import forestry.mail.tiles.TileMailbox; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; public class ContainerMailbox extends ContainerTile { @@ -32,8 +31,8 @@ public class ContainerMailbox extends ContainerTile { public ContainerMailbox(InventoryPlayer playerInventory, TileMailbox tile) { super(tile, playerInventory, 35, 145); - IInventory inventory = - tile.getOrCreateMailInventory(playerInventory.player.worldObj, playerInventory.player.getGameProfile()); + IInventory inventory = tile + .getOrCreateMailInventory(playerInventory.player.worldObj, playerInventory.player.getGameProfile()); if (inventory instanceof POBox) { this.mailInventory = (POBox) inventory; diff --git a/src/main/java/forestry/mail/gui/ContainerStampCollector.java b/src/main/java/forestry/mail/gui/ContainerStampCollector.java index 0184a13ce..fe186cd7f 100644 --- a/src/main/java/forestry/mail/gui/ContainerStampCollector.java +++ b/src/main/java/forestry/mail/gui/ContainerStampCollector.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.core.gui.ContainerTile; import forestry.core.gui.slots.SlotFiltered; import forestry.core.gui.slots.SlotOutput; import forestry.mail.inventory.InventoryStampCollector; import forestry.mail.tiles.TileStampCollector; -import net.minecraft.entity.player.InventoryPlayer; public class ContainerStampCollector extends ContainerTile { @@ -28,8 +27,12 @@ public class ContainerStampCollector extends ContainerTile { // Collected Stamps for (int i = 0; i < 3; i++) { for (int j = 0; j < 9; j++) { - addSlotToContainer(new SlotOutput( - tile, j + i * 9 + InventoryStampCollector.SLOT_BUFFER_1, 8 + j * 18, 46 + i * 18)); + addSlotToContainer( + new SlotOutput( + tile, + j + i * 9 + InventoryStampCollector.SLOT_BUFFER_1, + 8 + j * 18, + 46 + i * 18)); } } } diff --git a/src/main/java/forestry/mail/gui/ContainerTradeName.java b/src/main/java/forestry/mail/gui/ContainerTradeName.java index 7ee8bed43..aedf05ac9 100755 --- a/src/main/java/forestry/mail/gui/ContainerTradeName.java +++ b/src/main/java/forestry/mail/gui/ContainerTradeName.java @@ -1,19 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.gui; +import net.minecraft.entity.player.EntityPlayer; + import forestry.api.mail.IMailAddress; import forestry.core.gui.ContainerTile; import forestry.mail.tiles.TileTrader; -import net.minecraft.entity.player.EntityPlayer; public class ContainerTradeName extends ContainerTile { diff --git a/src/main/java/forestry/mail/gui/ContainerTrader.java b/src/main/java/forestry/mail/gui/ContainerTrader.java index 7c1aa33a0..500ce55bd 100755 --- a/src/main/java/forestry/mail/gui/ContainerTrader.java +++ b/src/main/java/forestry/mail/gui/ContainerTrader.java @@ -1,15 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.api.mail.IMailAddress; import forestry.core.gui.ContainerTile; import forestry.core.gui.slots.SlotFiltered; @@ -17,7 +17,6 @@ import forestry.core.gui.slots.SlotForestry; import forestry.core.gui.slots.SlotOutput; import forestry.mail.TradeStation; import forestry.mail.tiles.TileTrader; -import net.minecraft.entity.player.InventoryPlayer; public class ContainerTrader extends ContainerTile { @@ -30,25 +29,36 @@ public class ContainerTrader extends ContainerTile { // Exchange for (int row = 0; row < 2; row++) { for (int col = 0; col < 2; col++) { - addSlotToContainer(new SlotForestry( - this.tile, TradeStation.SLOT_EXCHANGE_1 + col + row * 2, 69 + col * 18, 55 + row * 18) - .blockShift()); + addSlotToContainer( + new SlotForestry( + this.tile, + TradeStation.SLOT_EXCHANGE_1 + col + row * 2, + 69 + col * 18, + 55 + row * 18).blockShift()); } } // Stamps for (int row = 0; row < 2; row++) { for (int col = 0; col < 2; col++) { - addSlotToContainer(new SlotFiltered( - this.tile, TradeStation.SLOT_STAMPS_1 + col + row * 2, 15 + col * 18, 37 + row * 18)); + addSlotToContainer( + new SlotFiltered( + this.tile, + TradeStation.SLOT_STAMPS_1 + col + row * 2, + 15 + col * 18, + 37 + row * 18)); } } // Letters for (int row = 0; row < 3; row++) { for (int col = 0; col < 2; col++) { - addSlotToContainer(new SlotFiltered( - this.tile, TradeStation.SLOT_LETTERS_1 + col + row * 2, 15 + col * 18, 73 + row * 18)); + addSlotToContainer( + new SlotFiltered( + this.tile, + TradeStation.SLOT_LETTERS_1 + col + row * 2, + 15 + col * 18, + 73 + row * 18)); } } @@ -56,21 +66,23 @@ public class ContainerTrader extends ContainerTile { final int bufCols = 5; for (int row = 0; row < 3; row++) { for (int col = 0; col < bufCols; col++) { - addSlotToContainer(new SlotOutput( - this.tile, - TradeStation.SLOT_RECEIVE_BUFFER + col + row * bufCols, - 123 + col * 18, - 19 + row * 18)); + addSlotToContainer( + new SlotOutput( + this.tile, + TradeStation.SLOT_RECEIVE_BUFFER + col + row * bufCols, + 123 + col * 18, + 19 + row * 18)); } } for (int row = 0; row < 2; row++) { for (int col = 0; col < bufCols; col++) { - addSlotToContainer(new SlotFiltered( - this.tile, - TradeStation.SLOT_SEND_BUFFER + col + row * bufCols, - 123 + col * 18, - (19 + (18 * 4)) + row * 18)); + addSlotToContainer( + new SlotFiltered( + this.tile, + TradeStation.SLOT_SEND_BUFFER + col + row * bufCols, + 123 + col * 18, + (19 + (18 * 4)) + row * 18)); } } } diff --git a/src/main/java/forestry/mail/gui/GuiCatalogue.java b/src/main/java/forestry/mail/gui/GuiCatalogue.java index 683768aa2..272d75a22 100755 --- a/src/main/java/forestry/mail/gui/GuiCatalogue.java +++ b/src/main/java/forestry/mail/gui/GuiCatalogue.java @@ -1,15 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.gui; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.client.gui.GuiButton; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.input.Keyboard; + import forestry.api.mail.EnumAddressee; import forestry.api.mail.TradeStationInfo; import forestry.core.config.SessionVars; @@ -17,15 +27,6 @@ import forestry.core.gui.GuiForestry; import forestry.core.gui.widgets.ItemStackWidget; import forestry.core.gui.widgets.Widget; import forestry.core.utils.StringUtil; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.client.gui.GuiButton; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.util.EnumChatFormatting; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.input.Keyboard; public class GuiCatalogue extends GuiForestry { @@ -53,8 +54,13 @@ public class GuiCatalogue extends GuiForestry { buttonList.add(new GuiButton(2, width / 2 + 44, guiTop + 150, 12, 20, ">")); buttonList.add(new GuiButton(3, width / 2 - 58, guiTop + 150, 12, 20, "<")); - buttonFilter = - new GuiButton(4, (width / 2) - 44, guiTop + 150, 42, 20, StringUtil.localize("gui.mail.filter.all")); + buttonFilter = new GuiButton( + 4, + (width / 2) - 44, + guiTop + 150, + 42, + 20, + StringUtil.localize("gui.mail.filter.all")); buttonList.add(buttonFilter); buttonUse = new GuiButton(5, width / 2, guiTop + 150, 42, 20, StringUtil.localize("gui.mail.address.copy")); @@ -93,8 +99,8 @@ public class GuiCatalogue extends GuiForestry { } private void drawNoTrade(int x, int y) { - fontRendererObj.drawSplitString( - StringUtil.localize("gui.mail.notrades"), x, y + 18, 119, fontColor.get("gui.book")); + fontRendererObj + .drawSplitString(StringUtil.localize("gui.mail.notrades"), x, y + 18, 119, fontColor.get("gui.book")); } private void drawTradePreview(TradeStationInfo tradeInfo, int x, int y) { diff --git a/src/main/java/forestry/mail/gui/GuiLetter.java b/src/main/java/forestry/mail/gui/GuiLetter.java index 920168477..29f40272d 100755 --- a/src/main/java/forestry/mail/gui/GuiLetter.java +++ b/src/main/java/forestry/mail/gui/GuiLetter.java @@ -1,15 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.gui; +import java.util.ArrayList; + +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.entity.player.EntityPlayer; + +import org.apache.commons.lang3.StringUtils; +import org.lwjgl.input.Keyboard; + import forestry.api.mail.EnumAddressee; import forestry.api.mail.IMailAddress; import forestry.core.config.Constants; @@ -23,11 +29,6 @@ import forestry.core.utils.StringUtil; import forestry.mail.gui.widgets.AddresseeSlot; import forestry.mail.inventory.ItemInventoryLetter; import forestry.mail.network.packets.PacketLetterInfoRequest; -import java.util.ArrayList; -import net.minecraft.client.gui.GuiTextField; -import net.minecraft.entity.player.EntityPlayer; -import org.apache.commons.lang3.StringUtils; -import org.lwjgl.input.Keyboard; public class GuiLetter extends GuiForestry { @@ -140,10 +141,14 @@ public class GuiLetter extends GuiForestry super.drawGuiContainerBackgroundLayer(var1, mouseX, mouseY); if (this.isProcessedLetter) { - fontRendererObj.drawString( - address.getText(), guiLeft + 49, guiTop + 16, fontColor.get("gui.mail.lettertext")); + fontRendererObj + .drawString(address.getText(), guiLeft + 49, guiTop + 16, fontColor.get("gui.mail.lettertext")); fontRendererObj.drawSplitString( - text.getText(), guiLeft + 20, guiTop + 34, 119, fontColor.get("gui.mail.lettertext")); + text.getText(), + guiLeft + 20, + guiTop + 34, + 119, + fontColor.get("gui.mail.lettertext")); } else { clearTradeInfoWidgets(); address.drawTextBox(); diff --git a/src/main/java/forestry/mail/gui/GuiMailbox.java b/src/main/java/forestry/mail/gui/GuiMailbox.java index 85aa0e3bf..abbac6279 100755 --- a/src/main/java/forestry/mail/gui/GuiMailbox.java +++ b/src/main/java/forestry/mail/gui/GuiMailbox.java @@ -1,19 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.core.config.Constants; import forestry.core.gui.GuiForestry; import forestry.mail.tiles.TileMailbox; -import net.minecraft.entity.player.InventoryPlayer; public class GuiMailbox extends GuiForestry { diff --git a/src/main/java/forestry/mail/gui/GuiMailboxInfo.java b/src/main/java/forestry/mail/gui/GuiMailboxInfo.java index 8b1d22322..f960c9a11 100755 --- a/src/main/java/forestry/mail/gui/GuiMailboxInfo.java +++ b/src/main/java/forestry/mail/gui/GuiMailboxInfo.java @@ -1,26 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.gui; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.util.ResourceLocation; + +import org.lwjgl.opengl.GL11; + import forestry.core.config.Config; import forestry.core.config.Constants; import forestry.core.proxy.Proxies; import forestry.core.render.ForestryResource; import forestry.mail.POBoxInfo; -import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.FontRenderer; -import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.ScaledResolution; -import net.minecraft.util.ResourceLocation; -import org.lwjgl.opengl.GL11; public class GuiMailboxInfo extends Gui { @@ -55,8 +55,10 @@ public class GuiMailboxInfo extends Gui { int y = 0; Minecraft minecraft = Minecraft.getMinecraft(); - ScaledResolution scaledresolution = - new ScaledResolution(minecraft, minecraft.displayWidth, minecraft.displayHeight); + ScaledResolution scaledresolution = new ScaledResolution( + minecraft, + minecraft.displayWidth, + minecraft.displayHeight); if (Config.mailAlertXPosition == XPosition.RIGHT) { x = scaledresolution.getScaledWidth() - WIDTH; } @@ -95,15 +97,14 @@ public class GuiMailboxInfo extends Gui { if (info.hasMail()) { if (this.poInfo == null) { playJingle = true; - } else if (this.poInfo.playerLetters != info.playerLetters - || this.poInfo.tradeLetters != info.tradeLetters) { - playJingle = true; - } + } else + if (this.poInfo.playerLetters != info.playerLetters || this.poInfo.tradeLetters != info.tradeLetters) { + playJingle = true; + } } if (playJingle) { - Proxies.common - .getRenderWorld() + Proxies.common.getRenderWorld() .playSoundAtEntity(Proxies.common.getClientInstance().thePlayer, "random.levelup", 1.0f, 1.0f); } diff --git a/src/main/java/forestry/mail/gui/GuiStampCollector.java b/src/main/java/forestry/mail/gui/GuiStampCollector.java index 1ccb62a6f..2de5ffdfc 100644 --- a/src/main/java/forestry/mail/gui/GuiStampCollector.java +++ b/src/main/java/forestry/mail/gui/GuiStampCollector.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.gui; +import net.minecraft.entity.player.InventoryPlayer; + import forestry.core.config.Constants; import forestry.core.gui.GuiForestry; import forestry.mail.tiles.TileStampCollector; -import net.minecraft.entity.player.InventoryPlayer; public class GuiStampCollector extends GuiForestry { + public GuiStampCollector(InventoryPlayer player, TileStampCollector tile) { super(Constants.TEXTURE_PATH_GUI + "/philatelist.png", new ContainerStampCollector(player, tile), tile); this.xSize = 176; diff --git a/src/main/java/forestry/mail/gui/GuiTradeName.java b/src/main/java/forestry/mail/gui/GuiTradeName.java index 6f324c1cc..6be8421ce 100755 --- a/src/main/java/forestry/mail/gui/GuiTradeName.java +++ b/src/main/java/forestry/mail/gui/GuiTradeName.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.gui; +import net.minecraft.client.gui.GuiTextField; + +import org.apache.commons.lang3.StringUtils; +import org.lwjgl.input.Keyboard; + import forestry.core.config.Constants; import forestry.core.gui.GuiForestry; import forestry.core.proxy.Proxies; import forestry.core.utils.StringUtil; import forestry.mail.network.packets.PacketTraderAddressRequest; import forestry.mail.tiles.TileTrader; -import net.minecraft.client.gui.GuiTextField; -import org.apache.commons.lang3.StringUtils; -import org.lwjgl.input.Keyboard; public class GuiTradeName extends GuiForestry { diff --git a/src/main/java/forestry/mail/gui/GuiTrader.java b/src/main/java/forestry/mail/gui/GuiTrader.java index 3af5e751e..e423c623a 100755 --- a/src/main/java/forestry/mail/gui/GuiTrader.java +++ b/src/main/java/forestry/mail/gui/GuiTrader.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.gui; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.StatCollector; + import forestry.core.config.Constants; import forestry.core.gui.GuiForestry; import forestry.core.utils.StringUtil; import forestry.mail.tiles.TileTrader; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.util.StatCollector; public class GuiTrader extends GuiForestry { @@ -32,11 +31,14 @@ public class GuiTrader extends GuiForestry { String receive = StringUtil.localize("gui.mail.receive"); this.fontRendererObj.drawString( - receive, textLayout.getCenteredOffset(receive, 70) + 51, 45, fontColor.get("gui.mail.text")); + receive, + textLayout.getCenteredOffset(receive, 70) + 51, + 45, + fontColor.get("gui.mail.text")); String send = StringUtil.localize("gui.mail.send"); - this.fontRendererObj.drawString( - send, textLayout.getCenteredOffset(send, 70) + 51, 99, fontColor.get("gui.mail.text")); + this.fontRendererObj + .drawString(send, textLayout.getCenteredOffset(send, 70) + 51, 99, fontColor.get("gui.mail.text")); super.drawGuiContainerForegroundLayer(mouseX, mouseY); } @@ -46,6 +48,9 @@ public class GuiTrader extends GuiForestry { super.drawGuiContainerBackgroundLayer(var1, mouseX, mouseY); fontRendererObj.drawString( - container.getAddress().getName(), guiLeft + 19, guiTop + 22, fontColor.get("gui.mail.text")); + container.getAddress().getName(), + guiLeft + 19, + guiTop + 22, + fontColor.get("gui.mail.text")); } } diff --git a/src/main/java/forestry/mail/gui/ILetterInfoReceiver.java b/src/main/java/forestry/mail/gui/ILetterInfoReceiver.java index 401c42c85..ba46e984f 100644 --- a/src/main/java/forestry/mail/gui/ILetterInfoReceiver.java +++ b/src/main/java/forestry/mail/gui/ILetterInfoReceiver.java @@ -1,17 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.gui; import forestry.mail.network.packets.PacketLetterInfoResponse; public interface ILetterInfoReceiver { + void handleLetterInfoUpdate(PacketLetterInfoResponse packet); } diff --git a/src/main/java/forestry/mail/gui/widgets/AddresseeSlot.java b/src/main/java/forestry/mail/gui/widgets/AddresseeSlot.java index ff56bd893..1b8230350 100644 --- a/src/main/java/forestry/mail/gui/widgets/AddresseeSlot.java +++ b/src/main/java/forestry/mail/gui/widgets/AddresseeSlot.java @@ -1,15 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.gui.widgets; +import net.minecraft.entity.player.EntityPlayer; + +import org.lwjgl.opengl.GL11; + import forestry.api.mail.IPostalCarrier; import forestry.api.mail.PostManager; import forestry.core.gui.widgets.Widget; @@ -18,8 +20,6 @@ import forestry.core.proxy.Proxies; import forestry.core.render.SpriteSheet; import forestry.core.utils.StringUtil; import forestry.mail.gui.ContainerLetter; -import net.minecraft.entity.player.EntityPlayer; -import org.lwjgl.opengl.GL11; public class AddresseeSlot extends Widget { @@ -44,8 +44,7 @@ public class AddresseeSlot extends Widget { @Override protected String getLegacyTooltip(EntityPlayer player) { - return StringUtil.localize( - "gui.addressee." + containerLetter.getCarrierType().toString()); + return StringUtil.localize("gui.addressee." + containerLetter.getCarrierType().toString()); } @Override diff --git a/src/main/java/forestry/mail/inventory/InventoryStampCollector.java b/src/main/java/forestry/mail/inventory/InventoryStampCollector.java index 4353dec53..31382632f 100644 --- a/src/main/java/forestry/mail/inventory/InventoryStampCollector.java +++ b/src/main/java/forestry/mail/inventory/InventoryStampCollector.java @@ -1,21 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.inventory; +import net.minecraft.item.ItemStack; + import forestry.api.mail.IStamps; import forestry.core.inventory.InventoryAdapterTile; import forestry.mail.tiles.TileStampCollector; -import net.minecraft.item.ItemStack; public class InventoryStampCollector extends InventoryAdapterTile { + public static final short SLOT_FILTER = 0; public static final short SLOT_BUFFER_1 = 1; public static final short SLOT_BUFFER_COUNT = 27; diff --git a/src/main/java/forestry/mail/inventory/InventoryTradeStation.java b/src/main/java/forestry/mail/inventory/InventoryTradeStation.java index 93fdb8fb4..7f3dd0393 100644 --- a/src/main/java/forestry/mail/inventory/InventoryTradeStation.java +++ b/src/main/java/forestry/mail/inventory/InventoryTradeStation.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.inventory; +import java.util.ArrayList; + +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + import forestry.api.mail.IStamps; import forestry.core.inventory.InventoryAdapter; import forestry.core.utils.ItemStackUtil; import forestry.core.utils.SlotUtil; import forestry.mail.TradeStation; -import java.util.ArrayList; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; public class InventoryTradeStation extends InventoryAdapter { @@ -31,22 +31,19 @@ public class InventoryTradeStation extends InventoryAdapter { ArrayList slots = new ArrayList<>(); - for (int i = TradeStation.SLOT_LETTERS_1; - i < TradeStation.SLOT_LETTERS_1 + TradeStation.SLOT_LETTERS_COUNT; - i++) { + for (int i = TradeStation.SLOT_LETTERS_1; i + < TradeStation.SLOT_LETTERS_1 + TradeStation.SLOT_LETTERS_COUNT; i++) { slots.add(i); } for (int i = TradeStation.SLOT_STAMPS_1; i < TradeStation.SLOT_STAMPS_1 + TradeStation.SLOT_STAMPS_COUNT; i++) { slots.add(i); } - for (int i = TradeStation.SLOT_RECEIVE_BUFFER; - i < TradeStation.SLOT_RECEIVE_BUFFER + TradeStation.SLOT_RECEIVE_BUFFER_COUNT; - i++) { + for (int i = TradeStation.SLOT_RECEIVE_BUFFER; i + < TradeStation.SLOT_RECEIVE_BUFFER + TradeStation.SLOT_RECEIVE_BUFFER_COUNT; i++) { slots.add(i); } - for (int i = TradeStation.SLOT_SEND_BUFFER; - i < TradeStation.SLOT_SEND_BUFFER + TradeStation.SLOT_SEND_BUFFER_COUNT; - i++) { + for (int i = TradeStation.SLOT_SEND_BUFFER; i + < TradeStation.SLOT_SEND_BUFFER + TradeStation.SLOT_SEND_BUFFER_COUNT; i++) { slots.add(i); } diff --git a/src/main/java/forestry/mail/inventory/ItemInventoryLetter.java b/src/main/java/forestry/mail/inventory/ItemInventoryLetter.java index a297428ff..a8175314a 100644 --- a/src/main/java/forestry/mail/inventory/ItemInventoryLetter.java +++ b/src/main/java/forestry/mail/inventory/ItemInventoryLetter.java @@ -1,16 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.inventory; +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 com.google.common.collect.ImmutableSet; + import forestry.api.core.IErrorSource; import forestry.api.core.IErrorState; import forestry.api.mail.ILetter; @@ -23,13 +29,9 @@ import forestry.core.utils.SlotUtil; import forestry.mail.Letter; import forestry.mail.LetterProperties; import forestry.mail.items.ItemStamps; -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; public class ItemInventoryLetter extends ItemInventory implements IErrorSource, IHintSource { + private ILetter letter; public ItemInventoryLetter(EntityPlayer player, ItemStack itemstack) { diff --git a/src/main/java/forestry/mail/items/EnumStampDefinition.java b/src/main/java/forestry/mail/items/EnumStampDefinition.java index cfd47b411..d72f51282 100644 --- a/src/main/java/forestry/mail/items/EnumStampDefinition.java +++ b/src/main/java/forestry/mail/items/EnumStampDefinition.java @@ -1,23 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.items; -import forestry.api.mail.EnumPostage; -import forestry.core.items.ItemOverlay; import java.awt.Color; import java.util.EnumMap; import java.util.Map; + import net.minecraft.init.Items; +import forestry.api.mail.EnumPostage; +import forestry.core.items.ItemOverlay; + public enum EnumStampDefinition implements ItemOverlay.IOverlayInfo { + P_1("1n", EnumPostage.P_1, "gemApatite", new Color(0x4a8ca7), new Color(0xffffff)), P_2("2n", EnumPostage.P_2, "ingotCopper", new Color(0xe8c814), new Color(0xffffff)), P_5("5n", EnumPostage.P_5, "ingotTin", new Color(0x9c0707), new Color(0xffffff)), @@ -25,8 +26,8 @@ public enum EnumStampDefinition implements ItemOverlay.IOverlayInfo { P_20("20n", EnumPostage.P_20, "gemDiamond", new Color(0xff9031), new Color(0xfff7dd)), P_50("50n", EnumPostage.P_50, "gemEmerald", new Color(0x6431d7), new Color(0xfff7dd)), P_100("100n", EnumPostage.P_100, Items.nether_star, new Color(0xd731ba), new Color(0xfff7dd)), -// P_200("200n", EnumPostage.P_200, Items.nether_star, new Color(0xcd9831), new Color(0xfff7dd)), -; + // P_200("200n", EnumPostage.P_200, Items.nether_star, new Color(0xcd9831), new Color(0xfff7dd)), + ; public static final EnumStampDefinition[] VALUES = values(); private static final Map postageMap = new EnumMap<>(EnumPostage.class); diff --git a/src/main/java/forestry/mail/items/ItemCatalogue.java b/src/main/java/forestry/mail/items/ItemCatalogue.java index 022887814..08468bfee 100644 --- a/src/main/java/forestry/mail/items/ItemCatalogue.java +++ b/src/main/java/forestry/mail/items/ItemCatalogue.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.items; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import forestry.core.items.ItemWithGui; import forestry.mail.gui.ContainerCatalogue; import forestry.mail.gui.GuiCatalogue; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class ItemCatalogue extends ItemWithGui { + @Override public Object getGui(EntityPlayer player, ItemStack heldItem, int data) { return new GuiCatalogue(player); diff --git a/src/main/java/forestry/mail/items/ItemLetter.java b/src/main/java/forestry/mail/items/ItemLetter.java index 538def7ec..d2b35d192 100755 --- a/src/main/java/forestry/mail/items/ItemLetter.java +++ b/src/main/java/forestry/mail/items/ItemLetter.java @@ -1,15 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.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.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; + import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import forestry.api.mail.ILetter; @@ -20,18 +30,9 @@ import forestry.mail.LetterProperties; import forestry.mail.gui.ContainerLetter; import forestry.mail.gui.GuiLetter; import forestry.mail.inventory.ItemInventoryLetter; -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.ChatComponentTranslation; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; public class ItemLetter extends ItemWithGui { + public ItemLetter() { setMaxStackSize(64); } @@ -67,7 +68,7 @@ public class ItemLetter extends ItemWithGui { return LetterProperties.getIconFromDamage(damage); } - @SuppressWarnings({"unchecked", "rawtypes"}) + @SuppressWarnings({ "unchecked", "rawtypes" }) @Override public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean flag) { NBTTagCompound nbttagcompound = itemstack.getTagCompound(); diff --git a/src/main/java/forestry/mail/items/ItemRegistryMail.java b/src/main/java/forestry/mail/items/ItemRegistryMail.java index c8aadf1bd..bd63873b3 100644 --- a/src/main/java/forestry/mail/items/ItemRegistryMail.java +++ b/src/main/java/forestry/mail/items/ItemRegistryMail.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.items; import forestry.core.items.ItemRegistry; public class ItemRegistryMail extends ItemRegistry { + public final ItemStamps stamps; public final ItemLetter letters; public final ItemCatalogue catalogue; diff --git a/src/main/java/forestry/mail/items/ItemStamps.java b/src/main/java/forestry/mail/items/ItemStamps.java index e5065d685..e217962bf 100755 --- a/src/main/java/forestry/mail/items/ItemStamps.java +++ b/src/main/java/forestry/mail/items/ItemStamps.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.items; +import net.minecraft.item.ItemStack; + import forestry.api.mail.EnumPostage; import forestry.api.mail.IStamps; import forestry.core.CreativeTabForestry; import forestry.core.items.ItemOverlay; -import net.minecraft.item.ItemStack; public class ItemStamps extends ItemOverlay implements IStamps { + public ItemStamps() { super(CreativeTabForestry.tabForestry, EnumStampDefinition.VALUES); } diff --git a/src/main/java/forestry/mail/network/PacketRegistryMail.java b/src/main/java/forestry/mail/network/PacketRegistryMail.java index 6e22c7a83..e1a24892d 100644 --- a/src/main/java/forestry/mail/network/PacketRegistryMail.java +++ b/src/main/java/forestry/mail/network/PacketRegistryMail.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.network; @@ -19,6 +17,7 @@ import forestry.mail.network.packets.PacketTraderAddressRequest; import forestry.mail.network.packets.PacketTraderAddressResponse; public class PacketRegistryMail extends PacketRegistry { + @Override public void registerPackets() { registerServerPacket(new PacketLetterInfoRequest()); diff --git a/src/main/java/forestry/mail/network/packets/PacketLetterInfoRequest.java b/src/main/java/forestry/mail/network/packets/PacketLetterInfoRequest.java index f7a42ef12..ef906bc3d 100644 --- a/src/main/java/forestry/mail/network/packets/PacketLetterInfoRequest.java +++ b/src/main/java/forestry/mail/network/packets/PacketLetterInfoRequest.java @@ -1,15 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayerMP; + import forestry.api.mail.EnumAddressee; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; @@ -17,8 +19,6 @@ import forestry.core.network.ForestryPacket; import forestry.core.network.IForestryPacketServer; import forestry.core.network.PacketIdServer; import forestry.mail.gui.ContainerLetter; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayerMP; public class PacketLetterInfoRequest extends ForestryPacket implements IForestryPacketServer { diff --git a/src/main/java/forestry/mail/network/packets/PacketLetterInfoResponse.java b/src/main/java/forestry/mail/network/packets/PacketLetterInfoResponse.java index 5e3d5c554..ec74db8ed 100644 --- a/src/main/java/forestry/mail/network/packets/PacketLetterInfoResponse.java +++ b/src/main/java/forestry/mail/network/packets/PacketLetterInfoResponse.java @@ -1,16 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.network.packets; +import java.io.IOException; +import java.util.UUID; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.item.ItemStack; + import com.mojang.authlib.GameProfile; + import forestry.api.mail.EnumAddressee; import forestry.api.mail.IMailAddress; import forestry.api.mail.PostManager; @@ -22,11 +28,6 @@ import forestry.core.network.IForestryPacketClient; import forestry.core.network.PacketIdClient; import forestry.mail.EnumStationState; import forestry.mail.gui.ILetterInfoReceiver; -import java.io.IOException; -import java.util.UUID; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.Container; -import net.minecraft.item.ItemStack; public class PacketLetterInfoResponse extends ForestryPacket implements IForestryPacketClient { @@ -126,7 +127,11 @@ public class PacketLetterInfoResponse extends ForestryPacket implements IForestr required = data.readItemStacks(); this.tradeInfo = new TradeStationInfo( - address, owner, tradegood, required, EnumStationState.values()[data.readShort()]); + address, + owner, + tradegood, + required, + EnumStationState.values()[data.readShort()]); } } diff --git a/src/main/java/forestry/mail/network/packets/PacketLetterTextSet.java b/src/main/java/forestry/mail/network/packets/PacketLetterTextSet.java index d070feb1b..1ab4a9d9e 100644 --- a/src/main/java/forestry/mail/network/packets/PacketLetterTextSet.java +++ b/src/main/java/forestry/mail/network/packets/PacketLetterTextSet.java @@ -1,22 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayerMP; + import forestry.core.network.DataInputStreamForestry; import forestry.core.network.IForestryPacketServer; import forestry.core.network.PacketIdServer; import forestry.core.network.packets.PacketString; import forestry.mail.gui.ContainerLetter; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayerMP; public class PacketLetterTextSet extends PacketString implements IForestryPacketServer { diff --git a/src/main/java/forestry/mail/network/packets/PacketPOBoxInfoUpdate.java b/src/main/java/forestry/mail/network/packets/PacketPOBoxInfoUpdate.java index 626607d69..b45df9c93 100644 --- a/src/main/java/forestry/mail/network/packets/PacketPOBoxInfoUpdate.java +++ b/src/main/java/forestry/mail/network/packets/PacketPOBoxInfoUpdate.java @@ -1,15 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; + import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.ForestryPacket; @@ -17,8 +19,6 @@ import forestry.core.network.IForestryPacketClient; import forestry.core.network.PacketIdClient; import forestry.mail.POBoxInfo; import forestry.mail.gui.GuiMailboxInfo; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; public class PacketPOBoxInfoUpdate extends ForestryPacket implements IForestryPacketClient { diff --git a/src/main/java/forestry/mail/network/packets/PacketTraderAddressRequest.java b/src/main/java/forestry/mail/network/packets/PacketTraderAddressRequest.java index 184557d53..90a7bfced 100644 --- a/src/main/java/forestry/mail/network/packets/PacketTraderAddressRequest.java +++ b/src/main/java/forestry/mail/network/packets/PacketTraderAddressRequest.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.tileentity.TileEntity; + import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IForestryPacketServer; import forestry.core.network.PacketIdServer; import forestry.core.network.packets.PacketCoordinates; import forestry.mail.tiles.TileTrader; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.tileentity.TileEntity; public class PacketTraderAddressRequest extends PacketCoordinates implements IForestryPacketServer { diff --git a/src/main/java/forestry/mail/network/packets/PacketTraderAddressResponse.java b/src/main/java/forestry/mail/network/packets/PacketTraderAddressResponse.java index f4cee718f..62bf15160 100644 --- a/src/main/java/forestry/mail/network/packets/PacketTraderAddressResponse.java +++ b/src/main/java/forestry/mail/network/packets/PacketTraderAddressResponse.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.network.packets; +import java.io.IOException; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; + import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IForestryPacketClient; import forestry.core.network.PacketIdClient; import forestry.core.network.packets.PacketCoordinates; import forestry.mail.tiles.TileTrader; -import java.io.IOException; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.tileentity.TileEntity; public class PacketTraderAddressResponse extends PacketCoordinates implements IForestryPacketClient { diff --git a/src/main/java/forestry/mail/tiles/IMailContainer.java b/src/main/java/forestry/mail/tiles/IMailContainer.java index 0d98a3d65..e1cce1ff6 100644 --- a/src/main/java/forestry/mail/tiles/IMailContainer.java +++ b/src/main/java/forestry/mail/tiles/IMailContainer.java @@ -1,15 +1,14 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.tiles; public interface IMailContainer { + boolean hasMail(); } diff --git a/src/main/java/forestry/mail/tiles/TileMailbox.java b/src/main/java/forestry/mail/tiles/TileMailbox.java index f4bf4033f..966e10521 100644 --- a/src/main/java/forestry/mail/tiles/TileMailbox.java +++ b/src/main/java/forestry/mail/tiles/TileMailbox.java @@ -1,17 +1,28 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.tiles; +import java.util.Collection; +import java.util.LinkedList; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.world.World; +import net.minecraftforge.common.util.ForgeDirection; + import buildcraft.api.statements.ITriggerExternal; + import com.mojang.authlib.GameProfile; + import cpw.mods.fml.common.Optional; import forestry.api.mail.ILetter; import forestry.api.mail.IMailAddress; @@ -25,15 +36,6 @@ import forestry.mail.PostRegistry; import forestry.mail.gui.ContainerMailbox; import forestry.mail.gui.GuiMailbox; import forestry.mail.triggers.MailTriggers; -import java.util.Collection; -import java.util.LinkedList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.ChatComponentTranslation; -import net.minecraft.world.World; -import net.minecraftforge.common.util.ForgeDirection; public class TileMailbox extends TileBase implements IMailContainer { @@ -102,8 +104,7 @@ public class TileMailbox extends TileBase implements IMailContainer { @Override public boolean hasMail() { - IInventory mailInventory = - getOrCreateMailInventory(worldObj, getAccessHandler().getOwner()); + IInventory mailInventory = getOrCreateMailInventory(worldObj, getAccessHandler().getOwner()); for (int i = 0; i < mailInventory.getSizeInventory(); i++) { if (mailInventory.getStackInSlot(i) != null) { return true; diff --git a/src/main/java/forestry/mail/tiles/TileStampCollector.java b/src/main/java/forestry/mail/tiles/TileStampCollector.java index 72e372c3e..1cbb67313 100644 --- a/src/main/java/forestry/mail/tiles/TileStampCollector.java +++ b/src/main/java/forestry/mail/tiles/TileStampCollector.java @@ -1,15 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.tiles; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; + import forestry.api.mail.IStamps; import forestry.api.mail.PostManager; import forestry.core.inventory.IInventoryAdapter; @@ -18,11 +20,9 @@ import forestry.core.utils.InventoryUtil; import forestry.mail.gui.ContainerStampCollector; import forestry.mail.gui.GuiStampCollector; import forestry.mail.inventory.InventoryStampCollector; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; public class TileStampCollector extends TileBase implements IInventory { + public TileStampCollector() { super("philatelist"); setInternalInventory(new InventoryStampCollector(this)); @@ -42,8 +42,7 @@ public class TileStampCollector extends TileBase implements IInventory { } else { ItemStack filter = inventory.getStackInSlot(InventoryStampCollector.SLOT_FILTER); if (filter.getItem() instanceof IStamps) { - stamp = PostManager.postRegistry - .getPostOffice(worldObj) + stamp = PostManager.postRegistry.getPostOffice(worldObj) .getAnyStamp(((IStamps) filter.getItem()).getPostage(filter), 1); } } diff --git a/src/main/java/forestry/mail/tiles/TileTrader.java b/src/main/java/forestry/mail/tiles/TileTrader.java index 13fc7c6ae..00fec7747 100644 --- a/src/main/java/forestry/mail/tiles/TileTrader.java +++ b/src/main/java/forestry/mail/tiles/TileTrader.java @@ -1,15 +1,25 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.tiles; +import java.io.IOException; +import java.util.Collection; +import java.util.LinkedList; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.init.Items; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import buildcraft.api.statements.ITriggerExternal; import cpw.mods.fml.common.Optional; import forestry.api.core.IErrorLogic; @@ -33,16 +43,6 @@ import forestry.mail.gui.GuiTrader; import forestry.mail.inventory.InventoryTradeStation; import forestry.mail.network.packets.PacketTraderAddressResponse; import forestry.mail.triggers.MailTriggers; -import java.io.IOException; -import java.util.Collection; -import java.util.LinkedList; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Items; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class TileTrader extends TileBase { @@ -115,8 +115,8 @@ public class TileTrader extends TileBase { /* UPDATING */ /** - * The trade station should show errors for missing stamps and paper first. - * Once it is able to send letters, it should display other error states. + * The trade station should show errors for missing stamps and paper first. Once it is able to send letters, it + * should display other error states. */ @Override public void updateServerSide() { @@ -139,7 +139,10 @@ public class TileTrader extends TileBase { if (tradeGood != null) { boolean hasSupplies = hasItemCount( - TradeStation.SLOT_SEND_BUFFER, TradeStation.SLOT_SEND_BUFFER_COUNT, tradeGood, tradeGood.stackSize); + TradeStation.SLOT_SEND_BUFFER, + TradeStation.SLOT_SEND_BUFFER_COUNT, + tradeGood, + tradeGood.stackSize); errorLogic.setCondition(!hasSupplies, EnumErrorCode.NO_SUPPLIES); } @@ -161,8 +164,8 @@ public class TileTrader extends TileBase { } /** - * Returns true if there are 'itemCount' of 'item' in the inventory - * wildcard when item == null, counts all types of items + * Returns true if there are 'itemCount' of 'item' in the inventory wildcard when item == null, counts all types of + * items */ private boolean hasItemCount(int startSlot, int countSlots, ItemStack item, int itemCount) { int count = 0; @@ -185,8 +188,8 @@ public class TileTrader extends TileBase { } /** - * Returns the percentage of the inventory that is occupied by 'item' - * if item == null, returns the percentage occupied by all kinds of items + * Returns the percentage of the inventory that is occupied by 'item' if item == null, returns the percentage + * occupied by all kinds of items */ private float percentOccupied(int startSlot, int countSlots, ItemStack item) { int count = 0; @@ -210,7 +213,10 @@ public class TileTrader extends TileBase { public boolean hasPaperMin(int count) { return hasItemCount( - TradeStation.SLOT_LETTERS_1, TradeStation.SLOT_LETTERS_COUNT, new ItemStack(Items.paper), count); + TradeStation.SLOT_LETTERS_1, + TradeStation.SLOT_LETTERS_COUNT, + new ItemStack(Items.paper), + count); } public boolean hasInputBufMin(float percentage) { @@ -295,8 +301,7 @@ public class TileTrader extends TileBase { if (hasValidTradeAddress & hasUniqueTradeAddress) { this.address = address; - PostManager.postRegistry.getOrCreateTradeStation( - worldObj, getAccessHandler().getOwner(), address); + PostManager.postRegistry.getOrCreateTradeStation(worldObj, getAccessHandler().getOwner(), address); } } else { this.address = address; @@ -310,8 +315,8 @@ public class TileTrader extends TileBase { return super.getInternalInventory(); } - return (TradeStation) PostManager.postRegistry.getOrCreateTradeStation( - worldObj, getAccessHandler().getOwner(), address); + return (TradeStation) PostManager.postRegistry + .getOrCreateTradeStation(worldObj, getAccessHandler().getOwner(), address); } /* ITRIGGERPROVIDER */ diff --git a/src/main/java/forestry/mail/triggers/MailTriggers.java b/src/main/java/forestry/mail/triggers/MailTriggers.java index ec7226de0..f3939354a 100644 --- a/src/main/java/forestry/mail/triggers/MailTriggers.java +++ b/src/main/java/forestry/mail/triggers/MailTriggers.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.triggers; import forestry.core.triggers.Trigger; public class MailTriggers { + public static Trigger triggerHasMail; public static Trigger lowPaper64; public static Trigger lowPaper32; diff --git a/src/main/java/forestry/mail/triggers/TriggerBuffer.java b/src/main/java/forestry/mail/triggers/TriggerBuffer.java index b37c559e6..2e203240c 100755 --- a/src/main/java/forestry/mail/triggers/TriggerBuffer.java +++ b/src/main/java/forestry/mail/triggers/TriggerBuffer.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.triggers; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.IStatementParameter; import forestry.core.triggers.Trigger; import forestry.mail.tiles.TileTrader; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class TriggerBuffer extends Trigger { @@ -32,8 +31,8 @@ public class TriggerBuffer extends Trigger { } @Override - public boolean isTriggerActive( - TileEntity tile, ForgeDirection side, IStatementContainer source, IStatementParameter[] parameters) { + public boolean isTriggerActive(TileEntity tile, ForgeDirection side, IStatementContainer source, + IStatementParameter[] parameters) { if (!(tile instanceof TileTrader)) { return false; diff --git a/src/main/java/forestry/mail/triggers/TriggerHasMail.java b/src/main/java/forestry/mail/triggers/TriggerHasMail.java index c454318d5..c319c7a1e 100755 --- a/src/main/java/forestry/mail/triggers/TriggerHasMail.java +++ b/src/main/java/forestry/mail/triggers/TriggerHasMail.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.triggers; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.IStatementParameter; import forestry.core.triggers.Trigger; import forestry.mail.tiles.IMailContainer; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class TriggerHasMail extends Trigger { @@ -24,8 +23,8 @@ public class TriggerHasMail extends Trigger { } @Override - public boolean isTriggerActive( - TileEntity tile, ForgeDirection side, IStatementContainer source, IStatementParameter[] parameters) { + public boolean isTriggerActive(TileEntity tile, ForgeDirection side, IStatementContainer source, + IStatementParameter[] parameters) { if (!(tile instanceof IMailContainer)) { return false; diff --git a/src/main/java/forestry/mail/triggers/TriggerLowInput.java b/src/main/java/forestry/mail/triggers/TriggerLowInput.java index 0083f19a7..7eb2941f6 100755 --- a/src/main/java/forestry/mail/triggers/TriggerLowInput.java +++ b/src/main/java/forestry/mail/triggers/TriggerLowInput.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.triggers; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.IStatementParameter; import forestry.core.triggers.Trigger; import forestry.mail.tiles.TileTrader; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class TriggerLowInput extends Trigger { @@ -32,8 +31,8 @@ public class TriggerLowInput extends Trigger { } @Override - public boolean isTriggerActive( - TileEntity tile, ForgeDirection side, IStatementContainer source, IStatementParameter[] parameters) { + public boolean isTriggerActive(TileEntity tile, ForgeDirection side, IStatementContainer source, + IStatementParameter[] parameters) { if (!(tile instanceof TileTrader)) { return false; diff --git a/src/main/java/forestry/mail/triggers/TriggerLowPaper.java b/src/main/java/forestry/mail/triggers/TriggerLowPaper.java index abd7b37ec..997be7b61 100755 --- a/src/main/java/forestry/mail/triggers/TriggerLowPaper.java +++ b/src/main/java/forestry/mail/triggers/TriggerLowPaper.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.triggers; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.IStatementParameter; import forestry.core.triggers.Trigger; import forestry.mail.tiles.TileTrader; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class TriggerLowPaper extends Trigger { @@ -32,8 +31,8 @@ public class TriggerLowPaper extends Trigger { } @Override - public boolean isTriggerActive( - TileEntity tile, ForgeDirection side, IStatementContainer source, IStatementParameter[] parameters) { + public boolean isTriggerActive(TileEntity tile, ForgeDirection side, IStatementContainer source, + IStatementParameter[] parameters) { if (!(tile instanceof TileTrader)) { return false; diff --git a/src/main/java/forestry/mail/triggers/TriggerLowStamps.java b/src/main/java/forestry/mail/triggers/TriggerLowStamps.java index 94bc3d3e3..9af7d782c 100755 --- a/src/main/java/forestry/mail/triggers/TriggerLowStamps.java +++ b/src/main/java/forestry/mail/triggers/TriggerLowStamps.java @@ -1,21 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.mail.triggers; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.IStatementParameter; import forestry.core.triggers.Trigger; import forestry.mail.tiles.TileTrader; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; public class TriggerLowStamps extends Trigger { @@ -32,8 +31,8 @@ public class TriggerLowStamps extends Trigger { } @Override - public boolean isTriggerActive( - TileEntity tile, ForgeDirection side, IStatementContainer source, IStatementParameter[] parameters) { + public boolean isTriggerActive(TileEntity tile, ForgeDirection side, IStatementContainer source, + IStatementParameter[] parameters) { if (!(tile instanceof TileTrader)) { return false; diff --git a/src/main/java/forestry/plugins/ForestryPlugin.java b/src/main/java/forestry/plugins/ForestryPlugin.java index 6784bf7f2..3c5870368 100755 --- a/src/main/java/forestry/plugins/ForestryPlugin.java +++ b/src/main/java/forestry/plugins/ForestryPlugin.java @@ -1,15 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins; +import java.util.EnumSet; +import java.util.Random; + +import net.minecraft.command.ICommand; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; + import cpw.mods.fml.common.IFuelHandler; import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage; import forestry.core.IPickupHandler; @@ -18,11 +23,6 @@ import forestry.core.ISaveEventHandler; import forestry.core.network.IPacketRegistry; import forestry.core.network.PacketRegistryDummy; import forestry.core.utils.Log; -import java.util.EnumSet; -import java.util.Random; -import net.minecraft.command.ICommand; -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; public abstract class ForestryPlugin { @@ -76,7 +76,9 @@ public abstract class ForestryPlugin { return String.format( "Received an invalid '%s' request '%s' from mod '%s'. Please contact the author and report this issue.", - message.key, messageValue, message.getSender()); + message.key, + messageValue, + message.getSender()); } protected static void logInvalidIMCMessage(IMCMessage message) { @@ -88,12 +90,7 @@ public abstract class ForestryPlugin { return null; } - public void populateChunk( - IChunkProvider chunkProvider, - World world, - Random rand, - int chunkX, - int chunkZ, + public void populateChunk(IChunkProvider chunkProvider, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGeneratedZ) {} public void populateChunkRetroGen(World world, Random rand, int chunkX, int chunkZ) {} diff --git a/src/main/java/forestry/plugins/Plugin.java b/src/main/java/forestry/plugins/Plugin.java index 93b49f81c..0b2d7070c 100644 --- a/src/main/java/forestry/plugins/Plugin.java +++ b/src/main/java/forestry/plugins/Plugin.java @@ -9,7 +9,8 @@ import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; /** - * Optional annotation to provide additional information on IPlugins. This information will be available via the "/forestry plugin info $pluginID" command ingame. + * Optional annotation to provide additional information on IPlugins. This information will be available via the + * "/forestry plugin info $pluginID" command ingame. * * @author SirSengir */ diff --git a/src/main/java/forestry/plugins/PluginApiculture.java b/src/main/java/forestry/plugins/PluginApiculture.java index f4da492d4..d9c2640c4 100644 --- a/src/main/java/forestry/plugins/PluginApiculture.java +++ b/src/main/java/forestry/plugins/PluginApiculture.java @@ -1,16 +1,40 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins; +import java.io.File; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Random; +import java.util.Set; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.IIcon; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraftforge.client.event.TextureStitchEvent; +import net.minecraftforge.common.ChestGenHooks; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.config.Property; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; + import com.google.common.collect.ImmutableMap; + import cpw.mods.fml.common.FMLCommonHandler; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage; @@ -93,29 +117,6 @@ import forestry.core.utils.Log; import forestry.core.utils.Stack; import forestry.core.utils.StringUtil; import forestry.food.items.ItemRegistryFood; -import java.io.File; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Objects; -import java.util.Random; -import java.util.Set; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.IIcon; -import net.minecraft.util.WeightedRandomChestContent; -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; -import net.minecraftforge.client.event.TextureStitchEvent; -import net.minecraftforge.common.ChestGenHooks; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.config.Property; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; @Plugin( pluginID = "Apiculture", @@ -145,7 +146,7 @@ public class PluginApiculture extends ForestryPlugin { private final Map defaultPlantableFlowers = new HashMap<>(); @Override - @SuppressWarnings({"unchecked"}) + @SuppressWarnings({ "unchecked" }) protected void setupAPI() { super.setupAPI(); @@ -154,7 +155,7 @@ public class PluginApiculture extends ForestryPlugin { FlowerManager.flowerRegistry = new FlowerRegistry(); - BeeManager.villageBees = new ArrayList[] {new ArrayList<>(), new ArrayList<>()}; + BeeManager.villageBees = new ArrayList[] { new ArrayList<>(), new ArrayList<>() }; BeeManager.beeFactory = new BeeFactory(); BeeManager.beeMutationFactory = new BeeMutationFactory(); @@ -191,11 +192,11 @@ public class PluginApiculture extends ForestryPlugin { new MachineDefinition(BlockApicultureType.BEEHOUSE).setFaces(0, 1, 2, 2, 4, 4, 0, 7)); MachineDefinition definitionChest = new MachineDefinition( - 0, - "forestry.ApiaristChestNew", - TileApiaristChest.class, - Proxies.render.getRenderChest("apiaristchest")) - .setBoundingBox(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); + 0, + "forestry.ApiaristChestNew", + TileApiaristChest.class, + Proxies.render.getRenderChest("apiaristchest")) + .setBoundingBox(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); blocks.apicultureChest.addDefinition(definitionChest); // Add triggers @@ -237,8 +238,8 @@ public class PluginApiculture extends ForestryPlugin { beekeepingMode = config.getStringLocalized("beekeeping", "mode", "NORMAL", validBeekeepingModeNames); Log.finer("Beekeeping mode read from config: " + beekeepingMode); - secondPrincessChance = - config.getFloatLocalized("beekeeping", "second.princess", secondPrincessChance, 0.0f, 100.0f); + secondPrincessChance = config + .getFloatLocalized("beekeeping", "second.princess", secondPrincessChance, 0.0f, 100.0f); String acceptedFlowerMessage = StringUtil.localize("config.beekeeping.flowers.accepted.comment"); String plantableFlowerMessage = StringUtil.localize("config.beekeeping.flowers.plantable.comment"); @@ -278,7 +279,8 @@ public class PluginApiculture extends ForestryPlugin { BeeDefinition.initBees(); AlleleManager.alleleRegistry.registerDeprecatedAlleleReplacement( - "forestry.speciesArgrarian", BeeDefinition.AGRARIAN.getGenome().getPrimary()); + "forestry.speciesArgrarian", + BeeDefinition.AGRARIAN.getGenome().getPrimary()); // Hives createHives(); @@ -347,22 +349,42 @@ public class PluginApiculture extends ForestryPlugin { flowerRegistry.registerAcceptableFlower(Blocks.cactus, FlowerManager.FlowerTypeCacti); flowerRegistry.registerAcceptableFlower( - Blocks.double_plant, 0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); + Blocks.double_plant, + 0, + FlowerManager.FlowerTypeVanilla, + FlowerManager.FlowerTypeSnow); flowerRegistry.registerAcceptableFlower( - Blocks.double_plant, 1, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); + Blocks.double_plant, + 1, + FlowerManager.FlowerTypeVanilla, + FlowerManager.FlowerTypeSnow); flowerRegistry.registerAcceptableFlower( - Blocks.double_plant, 4, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); + Blocks.double_plant, + 4, + FlowerManager.FlowerTypeVanilla, + FlowerManager.FlowerTypeSnow); flowerRegistry.registerAcceptableFlower( - Blocks.double_plant, 5, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); + Blocks.double_plant, + 5, + FlowerManager.FlowerTypeVanilla, + FlowerManager.FlowerTypeSnow); // Register plantable plants for (int meta = 0; meta <= 8; meta++) { flowerRegistry.registerPlantableFlower( - Blocks.red_flower, meta, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); + Blocks.red_flower, + meta, + 1.0, + FlowerManager.FlowerTypeVanilla, + FlowerManager.FlowerTypeSnow); } flowerRegistry.registerPlantableFlower( - Blocks.yellow_flower, 0, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); + Blocks.yellow_flower, + 0, + 1.0, + FlowerManager.FlowerTypeVanilla, + FlowerManager.FlowerTypeSnow); flowerRegistry.registerPlantableFlower(Blocks.brown_mushroom, 0, 1.0, FlowerManager.FlowerTypeMushrooms); flowerRegistry.registerPlantableFlower(Blocks.red_mushroom, 0, 1.0, FlowerManager.FlowerTypeMushrooms); flowerRegistry.registerPlantableFlower(Blocks.cactus, 0, 1.0, FlowerManager.FlowerTypeCacti); @@ -410,8 +432,8 @@ public class PluginApiculture extends ForestryPlugin { ICrateRegistry crateRegistry = StorageManager.crateRegistry; crateRegistry.registerCrate(PluginCore.items.beeswax.getItemStack(), "cratedBeeswax"); crateRegistry.registerCrate(items.pollenCluster.get(EnumPollenCluster.NORMAL, 1), "cratedPollen"); - crateRegistry.registerCrate( - items.pollenCluster.get(EnumPollenCluster.CRYSTALLINE, 1), "cratedCrystallinePollen"); + crateRegistry + .registerCrate(items.pollenCluster.get(EnumPollenCluster.CRYSTALLINE, 1), "cratedCrystallinePollen"); crateRegistry.registerCrate(items.propolis.getItemStack(), "cratedPropolis"); crateRegistry.registerCrate(items.honeydew.getItemStack(), "cratedHoneydew"); crateRegistry.registerCrate(items.royalJelly.getItemStack(), "cratedRoyalJelly"); @@ -470,7 +492,14 @@ public class PluginApiculture extends ForestryPlugin { Items.melon); RecipeUtil.addRecipe(items.frameUntreated, "###", "#S#", "###", '#', "stickWood", 'S', Items.string); RecipeUtil.addRecipe( - items.frameImpregnated, "###", "#S#", "###", '#', PluginCore.items.stickImpregnated, 'S', Items.string); + items.frameImpregnated, + "###", + "#S#", + "###", + '#', + PluginCore.items.stickImpregnated, + 'S', + Items.string); RecipeUtil.addRecipe( items.minecartBeehouse.getBeeHouseMinecart(), "B", @@ -526,7 +555,10 @@ public class PluginApiculture extends ForestryPlugin { // / CAPSULES RecipeUtil.addRecipe( - ForestryAPI.activeMode.getStackSetting("recipe.output.capsule"), "###", '#', PluginCore.items.beeswax); + ForestryAPI.activeMode.getStackSetting("recipe.output.capsule"), + "###", + '#', + PluginCore.items.beeswax); RecipeUtil.addRecipe( ForestryAPI.activeMode.getStackSetting("recipe.output.refractory"), "###", @@ -548,7 +580,14 @@ public class PluginApiculture extends ForestryPlugin { // / TORCHES RecipeUtil.addRecipe( - new ItemStack(Blocks.torch, 3), " # ", " # ", " Y ", '#', PluginCore.items.beeswax, 'Y', "stickWood"); + new ItemStack(Blocks.torch, 3), + " # ", + " # ", + " Y ", + '#', + PluginCore.items.beeswax, + 'Y', + "stickWood"); RecipeUtil.addRecipe( PluginCore.items.craftingMaterial.getPulsatingMesh(), "# #", @@ -648,20 +687,26 @@ public class PluginApiculture extends ForestryPlugin { FluidStack honeyDropFluid = Fluids.HONEY.getFluid(Constants.FLUID_PER_HONEY_DROP); RecipeManagers.squeezerManager.addRecipe( 10, - new ItemStack[] {items.honeyDrop.getItemStack()}, + new ItemStack[] { items.honeyDrop.getItemStack() }, honeyDropFluid, items.propolis.getItemStack(), 5); - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {items.honeydew.getItemStack()}, honeyDropFluid); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { items.honeydew.getItemStack() }, honeyDropFluid); ItemStack phosphor = PluginCore.items.phosphor.getItemStack(2); RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {phosphor, new ItemStack(Blocks.sand)}, Fluids.LAVA.getFluid(2000)); + 10, + new ItemStack[] { phosphor, new ItemStack(Blocks.sand) }, + Fluids.LAVA.getFluid(2000)); RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {phosphor, new ItemStack(Blocks.sand, 1, 1)}, Fluids.LAVA.getFluid(2000)); + 10, + new ItemStack[] { phosphor, new ItemStack(Blocks.sand, 1, 1) }, + Fluids.LAVA.getFluid(2000)); RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {phosphor, new ItemStack(Blocks.dirt)}, Fluids.LAVA.getFluid(1600)); + 10, + new ItemStack[] { phosphor, new ItemStack(Blocks.dirt) }, + Fluids.LAVA.getFluid(1600)); // / CARPENTER RecipeManagers.carpenterManager.addRecipe( @@ -727,40 +772,37 @@ public class PluginApiculture extends ForestryPlugin { RecipeManagers.centrifugeManager.addRecipe( 20, items.beeComb.get(EnumHoneyComb.HONEY, 1), - ImmutableMap.of( - PluginCore.items.beeswax.getItemStack(), 1.0f, - items.honeyDrop.getItemStack(), 0.9f)); + ImmutableMap + .of(PluginCore.items.beeswax.getItemStack(), 1.0f, items.honeyDrop.getItemStack(), 0.9f)); // Cocoa combs RecipeManagers.centrifugeManager.addRecipe( 20, items.beeComb.get(EnumHoneyComb.COCOA, 1), - ImmutableMap.of( - PluginCore.items.beeswax.getItemStack(), 1.0f, new ItemStack(Items.dye, 1, 3), 0.5f)); + ImmutableMap + .of(PluginCore.items.beeswax.getItemStack(), 1.0f, new ItemStack(Items.dye, 1, 3), 0.5f)); // Simmering combs RecipeManagers.centrifugeManager.addRecipe( 20, items.beeComb.get(EnumHoneyComb.SIMMERING, 1), ImmutableMap.of( - PluginCore.items.refractoryWax.getItemStack(), 1.0f, - PluginCore.items.phosphor.getItemStack(2), 0.7f)); + PluginCore.items.refractoryWax.getItemStack(), + 1.0f, + PluginCore.items.phosphor.getItemStack(2), + 0.7f)); // Stringy combs RecipeManagers.centrifugeManager.addRecipe( 20, items.beeComb.get(EnumHoneyComb.STRINGY, 1), - ImmutableMap.of( - items.propolis.getItemStack(), 1.0f, - items.honeyDrop.getItemStack(), 0.4f)); + ImmutableMap.of(items.propolis.getItemStack(), 1.0f, items.honeyDrop.getItemStack(), 0.4f)); // Dripping combs RecipeManagers.centrifugeManager.addRecipe( 20, items.beeComb.get(EnumHoneyComb.DRIPPING, 1), - ImmutableMap.of( - items.honeydew.getItemStack(), 1.0f, - items.honeyDrop.getItemStack(), 0.4f)); + ImmutableMap.of(items.honeydew.getItemStack(), 1.0f, items.honeyDrop.getItemStack(), 0.4f)); // Frozen combs RecipeManagers.centrifugeManager.addRecipe( @@ -780,29 +822,29 @@ public class PluginApiculture extends ForestryPlugin { RecipeManagers.centrifugeManager.addRecipe( 20, items.beeComb.get(EnumHoneyComb.SILKY, 1), - ImmutableMap.of( - items.honeyDrop.getItemStack(), 1.0f, - items.propolis.get(EnumPropolis.SILKY, 1), 0.8f)); + ImmutableMap + .of(items.honeyDrop.getItemStack(), 1.0f, items.propolis.get(EnumPropolis.SILKY, 1), 0.8f)); // Parched combs RecipeManagers.centrifugeManager.addRecipe( 20, items.beeComb.get(EnumHoneyComb.PARCHED, 1), - ImmutableMap.of( - PluginCore.items.beeswax.getItemStack(), 1.0f, - items.honeyDrop.getItemStack(), 0.9f)); + ImmutableMap + .of(PluginCore.items.beeswax.getItemStack(), 1.0f, items.honeyDrop.getItemStack(), 0.9f)); // Mysterious combs RecipeManagers.centrifugeManager.addRecipe( 20, items.beeComb.get(EnumHoneyComb.MYSTERIOUS, 1), ImmutableMap.of( - items.propolis.get(EnumPropolis.PULSATING, 1), 1.0f, - items.honeyDrop.getItemStack(), 0.4f)); + items.propolis.get(EnumPropolis.PULSATING, 1), + 1.0f, + items.honeyDrop.getItemStack(), + 0.4f)); // Irradiated combs - RecipeManagers.centrifugeManager.addRecipe( - 20, items.beeComb.get(EnumHoneyComb.IRRADIATED, 1), ImmutableMap.of()); + RecipeManagers.centrifugeManager + .addRecipe(20, items.beeComb.get(EnumHoneyComb.IRRADIATED, 1), ImmutableMap.of()); // Powdery combs RecipeManagers.centrifugeManager.addRecipe( @@ -832,9 +874,8 @@ public class PluginApiculture extends ForestryPlugin { RecipeManagers.centrifugeManager.addRecipe( 20, items.beeComb.get(EnumHoneyComb.MOSSY, 1), - ImmutableMap.of( - PluginCore.items.beeswax.getItemStack(), 1.0f, - items.honeyDrop.getItemStack(), 0.9f)); + ImmutableMap + .of(PluginCore.items.beeswax.getItemStack(), 1.0f, items.honeyDrop.getItemStack(), 0.9f)); // Mellow Combs RecipeManagers.centrifugeManager.addRecipe( @@ -853,15 +894,23 @@ public class PluginApiculture extends ForestryPlugin { 5, items.propolis.get(EnumPropolis.SILKY, 1), ImmutableMap.of( - PluginCore.items.craftingMaterial.getSilkWisp(), 0.6f, - items.propolis.getItemStack(), 0.1f)); + PluginCore.items.craftingMaterial.getSilkWisp(), + 0.6f, + items.propolis.getItemStack(), + 0.1f)); // / FERMENTER RecipeManagers.fermenterManager.addRecipe( - items.honeydew.getItemStack(), 500, 1.0f, Fluids.SHORT_MEAD.getFluid(1), Fluids.HONEY.getFluid(1)); + items.honeydew.getItemStack(), + 500, + 1.0f, + Fluids.SHORT_MEAD.getFluid(1), + Fluids.HONEY.getFluid(1)); // / STILL RecipeManagers.stillManager.addRecipe( - Constants.STILL_DESTILLATION_DURATION, Fluids.SHORT_MEAD.getFluid(10), Fluids.MEAD.getFluid(5)); + Constants.STILL_DESTILLATION_DURATION, + Fluids.SHORT_MEAD.getFluid(10), + Fluids.MEAD.getFluid(5)); } // ANALYZER @@ -966,15 +1015,18 @@ public class PluginApiculture extends ForestryPlugin { ChestGenHooks.addItem( ChestGenHooks.DUNGEON_CHEST, new WeightedRandomChestContent( - BeeDefinition.STEADFAST.getMemberStack(EnumBeeType.DRONE), 1, 1, rarity)); + BeeDefinition.STEADFAST.getMemberStack(EnumBeeType.DRONE), + 1, + 1, + rarity)); ItemStack stack = blocks.candle.getUnlitCandle(1); NBTTagCompound tag = new NBTTagCompound(); tag.setInteger(BlockCandle.colourTagName, 0xffffff); stack.setTagCompound(tag); - ChestGenHooks.addItem( - Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(stack, 7, 12, 12)); + ChestGenHooks + .addItem(Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(stack, 7, 12, 12)); ChestGenHooks.addItem( Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(items.scoop.getItemStack(), 1, 1, 8)); @@ -994,7 +1046,10 @@ public class PluginApiculture extends ForestryPlugin { ChestGenHooks.addItem( Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent( - BeeDefinition.FOREST.getRainResist().getMemberStack(EnumBeeType.PRINCESS), 1, 1, 5)); + BeeDefinition.FOREST.getRainResist().getMemberStack(EnumBeeType.PRINCESS), + 1, + 1, + 5)); ChestGenHooks.addItem( Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(BeeDefinition.COMMON.getMemberStack(EnumBeeType.DRONE), 1, 2, 8)); @@ -1015,12 +1070,12 @@ public class PluginApiculture extends ForestryPlugin { private static void createAlleles() { - IClassification hymnoptera = AlleleManager.alleleRegistry.createAndRegisterClassification( - EnumClassLevel.ORDER, "hymnoptera", "Hymnoptera"); + IClassification hymnoptera = AlleleManager.alleleRegistry + .createAndRegisterClassification(EnumClassLevel.ORDER, "hymnoptera", "Hymnoptera"); AlleleManager.alleleRegistry.getClassification("class.insecta").addMemberGroup(hymnoptera); - IClassification apidae = - AlleleManager.alleleRegistry.createAndRegisterClassification(EnumClassLevel.FAMILY, "apidae", "Apidae"); + IClassification apidae = AlleleManager.alleleRegistry + .createAndRegisterClassification(EnumClassLevel.FAMILY, "apidae", "Apidae"); hymnoptera.addMemberGroup(apidae); for (BeeBranchDefinition beeBranch : BeeBranchDefinition.values()) { @@ -1082,12 +1137,7 @@ public class PluginApiculture extends ForestryPlugin { } @Override - public void populateChunk( - IChunkProvider chunkProvider, - World world, - Random rand, - int chunkX, - int chunkZ, + public void populateChunk(IChunkProvider chunkProvider, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated) { if (Config.getBeehivesAmount() > 0.0) { HiveDecorator.decorateHives(chunkProvider, world, rand, chunkX, chunkZ, hasVillageGenerated); @@ -1114,7 +1164,8 @@ public class PluginApiculture extends ForestryPlugin { } else if (message.key.equals("add-alveary-slab") && message.isStringMessage()) { String messageString = String.format( "Received a '%s' request from mod '%s'. This IMC message has been replaced with the oreDictionary for 'slabWood'. Please contact the author and report this issue.", - message.key, message.getSender()); + message.key, + message.getSender()); Log.warning(messageString); return true; } diff --git a/src/main/java/forestry/plugins/PluginArboriculture.java b/src/main/java/forestry/plugins/PluginArboriculture.java index 890bbb772..e29ef95e6 100644 --- a/src/main/java/forestry/plugins/PluginArboriculture.java +++ b/src/main/java/forestry/plugins/PluginArboriculture.java @@ -1,15 +1,27 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.util.WeightedRandomChestContent; +import net.minecraftforge.common.ChestGenHooks; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.FuelBurnTimeEvent; +import net.minecraftforge.oredict.OreDictionary; + import cpw.mods.fml.common.IFuelHandler; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage; @@ -60,18 +72,6 @@ import forestry.core.proxy.Proxies; import forestry.core.recipes.RecipeUtil; import forestry.core.tiles.MachineDefinition; import forestry.factory.recipes.FabricatorRecipe; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.WeightedRandomChestContent; -import net.minecraftforge.common.ChestGenHooks; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.FuelBurnTimeEvent; -import net.minecraftforge.oredict.OreDictionary; @Plugin( pluginID = "Arboriculture", @@ -146,11 +146,11 @@ public class PluginArboriculture extends ForestryPlugin { } MachineDefinition definitionChest = new MachineDefinition( - BlockArboricultureType.ARBCHEST.ordinal(), - "forestry.ArbChest", - TileArboristChest.class, - Proxies.render.getRenderChest("arbchest")) - .setBoundingBox(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); + BlockArboricultureType.ARBCHEST.ordinal(), + "forestry.ArbChest", + TileArboristChest.class, + Proxies.render.getRenderChest("arbchest")) + .setBoundingBox(0.0625F, 0.0F, 0.0625F, 0.9375F, 0.875F, 0.9375F); blocks.arboriculture.addDefinition(definitionChest); // Init rendering @@ -213,7 +213,9 @@ public class PluginArboriculture extends ForestryPlugin { protected void registerRecipes() { RecipeUtil.addSmelting( - new ItemStack(blocks.logs, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(Items.coal, 1, 1), 0.15F); + new ItemStack(blocks.logs, 1, OreDictionary.WILDCARD_VALUE), + new ItemStack(Items.coal, 1, 1), + 0.15F); for (EnumWoodType woodType : EnumWoodType.VALUES) { ItemStack planks = TreeManager.woodItemAccess.getPlanks(woodType, false); @@ -265,16 +267,22 @@ public class PluginArboriculture extends ForestryPlugin { logs.stackSize = 1; fireproofLogs.stackSize = 1; RecipeManagers.fabricatorManager.addRecipe( - new FabricatorRecipe(null, Fluids.GLASS.getFluid(500), fireproofLogs.copy(), new Object[] { - " # ", "#X#", " # ", '#', PluginCore.items.refractoryWax, 'X', logs.copy() - })); + new FabricatorRecipe( + null, + Fluids.GLASS.getFluid(500), + fireproofLogs.copy(), + new Object[] { " # ", "#X#", " # ", '#', PluginCore.items.refractoryWax, 'X', + logs.copy() })); planks.stackSize = 1; fireproofPlanks.stackSize = 5; RecipeManagers.fabricatorManager.addRecipe( - new FabricatorRecipe(null, Fluids.GLASS.getFluid(500), fireproofPlanks.copy(), new Object[] { - "X#X", "#X#", "X#X", '#', PluginCore.items.refractoryWax, 'X', planks.copy() - })); + new FabricatorRecipe( + null, + Fluids.GLASS.getFluid(500), + fireproofPlanks.copy(), + new Object[] { "X#X", "#X#", "X#X", '#', PluginCore.items.refractoryWax, 'X', + planks.copy() })); } } @@ -304,43 +312,43 @@ public class PluginArboriculture extends ForestryPlugin { ItemStack mulch = new ItemStack(PluginCore.items.mulch); RecipeManagers.squeezerManager.addRecipe( 20, - new ItemStack[] {EnumFruit.CHERRY.getStack()}, + new ItemStack[] { EnumFruit.CHERRY.getStack() }, Fluids.SEEDOIL.getFluid(5 * seedOilMultiplier), mulch, 5); RecipeManagers.squeezerManager.addRecipe( 60, - new ItemStack[] {EnumFruit.WALNUT.getStack()}, + new ItemStack[] { EnumFruit.WALNUT.getStack() }, Fluids.SEEDOIL.getFluid(18 * seedOilMultiplier), mulch, 5); RecipeManagers.squeezerManager.addRecipe( 70, - new ItemStack[] {EnumFruit.CHESTNUT.getStack()}, + new ItemStack[] { EnumFruit.CHESTNUT.getStack() }, Fluids.SEEDOIL.getFluid(22 * seedOilMultiplier), mulch, 2); RecipeManagers.squeezerManager.addRecipe( 10, - new ItemStack[] {EnumFruit.LEMON.getStack()}, + new ItemStack[] { EnumFruit.LEMON.getStack() }, Fluids.JUICE.getFluid(juiceMultiplier * 2), mulch, (int) Math.floor(mulchMultiplier * 0.5f)); RecipeManagers.squeezerManager.addRecipe( 10, - new ItemStack[] {EnumFruit.PLUM.getStack()}, + new ItemStack[] { EnumFruit.PLUM.getStack() }, Fluids.JUICE.getFluid((int) Math.floor(juiceMultiplier * 0.5f)), mulch, mulchMultiplier * 3); RecipeManagers.squeezerManager.addRecipe( 10, - new ItemStack[] {EnumFruit.PAPAYA.getStack()}, + new ItemStack[] { EnumFruit.PAPAYA.getStack() }, Fluids.JUICE.getFluid(juiceMultiplier * 3), mulch, (int) Math.floor(mulchMultiplier * 0.5f)); RecipeManagers.squeezerManager.addRecipe( 10, - new ItemStack[] {EnumFruit.DATES.getStack()}, + new ItemStack[] { EnumFruit.DATES.getStack() }, Fluids.JUICE.getFluid((int) Math.floor(juiceMultiplier * 0.25)), mulch, mulchMultiplier); @@ -395,16 +403,16 @@ public class PluginArboriculture extends ForestryPlugin { AlleleManager.ersatzSpecimen.put(new ItemStack(Blocks.leaves, 1, 1), TreeDefinition.Spruce.getIndividual()); AlleleManager.ersatzSpecimen.put(new ItemStack(Blocks.leaves, 1, 2), TreeDefinition.Birch.getIndividual()); AlleleManager.ersatzSpecimen.put(new ItemStack(Blocks.leaves, 1, 3), TreeDefinition.Jungle.getIndividual()); - AlleleManager.ersatzSpecimen.put( - new ItemStack(Blocks.leaves2, 1, 0), TreeDefinition.AcaciaVanilla.getIndividual()); + AlleleManager.ersatzSpecimen + .put(new ItemStack(Blocks.leaves2, 1, 0), TreeDefinition.AcaciaVanilla.getIndividual()); AlleleManager.ersatzSpecimen.put(new ItemStack(Blocks.leaves2, 1, 1), TreeDefinition.DarkOak.getIndividual()); AlleleManager.ersatzSaplings.put(new ItemStack(Blocks.sapling, 1, 0), TreeDefinition.Oak.getIndividual()); AlleleManager.ersatzSaplings.put(new ItemStack(Blocks.sapling, 1, 1), TreeDefinition.Spruce.getIndividual()); AlleleManager.ersatzSaplings.put(new ItemStack(Blocks.sapling, 1, 2), TreeDefinition.Birch.getIndividual()); AlleleManager.ersatzSaplings.put(new ItemStack(Blocks.sapling, 1, 3), TreeDefinition.Jungle.getIndividual()); - AlleleManager.ersatzSaplings.put( - new ItemStack(Blocks.sapling, 1, 4), TreeDefinition.AcaciaVanilla.getIndividual()); + AlleleManager.ersatzSaplings + .put(new ItemStack(Blocks.sapling, 1, 4), TreeDefinition.AcaciaVanilla.getIndividual()); AlleleManager.ersatzSaplings.put(new ItemStack(Blocks.sapling, 1, 5), TreeDefinition.DarkOak.getIndividual()); } @@ -444,7 +452,10 @@ public class PluginArboriculture extends ForestryPlugin { ChestGenHooks.addItem( Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent( - TreeDefinition.Spruce.getMemberStack(EnumGermlingType.SAPLING), 2, 3, 6)); + TreeDefinition.Spruce.getMemberStack(EnumGermlingType.SAPLING), + 2, + 3, + 6)); ChestGenHooks.addItem( Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent(TreeDefinition.Birch.getMemberStack(EnumGermlingType.SAPLING), 2, 3, 6)); @@ -459,27 +470,43 @@ public class PluginArboriculture extends ForestryPlugin { ChestGenHooks.addItem( Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent( - TreeDefinition.Oak.getMemberStack(EnumGermlingType.POLLEN), 2, 3, 4)); + TreeDefinition.Oak.getMemberStack(EnumGermlingType.POLLEN), + 2, + 3, + 4)); ChestGenHooks.addItem( Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent( - TreeDefinition.Spruce.getMemberStack(EnumGermlingType.POLLEN), 2, 3, 4)); + TreeDefinition.Spruce.getMemberStack(EnumGermlingType.POLLEN), + 2, + 3, + 4)); ChestGenHooks.addItem( Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent( - TreeDefinition.Birch.getMemberStack(EnumGermlingType.POLLEN), 2, 3, 4)); + TreeDefinition.Birch.getMemberStack(EnumGermlingType.POLLEN), + 2, + 3, + 4)); ChestGenHooks.addItem( Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent( - TreeDefinition.Larch.getMemberStack(EnumGermlingType.POLLEN), 1, 2, 3)); + TreeDefinition.Larch.getMemberStack(EnumGermlingType.POLLEN), + 1, + 2, + 3)); ChestGenHooks.addItem( Constants.CHEST_GEN_HOOK_NATURALIST_CHEST, new WeightedRandomChestContent( - TreeDefinition.Lime.getMemberStack(EnumGermlingType.POLLEN), 1, 2, 3)); + TreeDefinition.Lime.getMemberStack(EnumGermlingType.POLLEN), + 1, + 2, + 3)); } } private static class FuelHandler implements IFuelHandler { + @Override public int getBurnTime(ItemStack fuel) { Item item = fuel.getItem(); diff --git a/src/main/java/forestry/plugins/PluginCore.java b/src/main/java/forestry/plugins/PluginCore.java index 4cb6d17f4..091855492 100644 --- a/src/main/java/forestry/plugins/PluginCore.java +++ b/src/main/java/forestry/plugins/PluginCore.java @@ -1,15 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins; +import java.util.ArrayList; + +import net.minecraft.command.ICommand; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + import cpw.mods.fml.common.IFuelHandler; import forestry.api.circuits.ChipsetManager; import forestry.api.core.ForestryAPI; @@ -47,12 +53,6 @@ import forestry.core.recipes.RecipeUtil; import forestry.core.tiles.MachineDefinition; import forestry.core.utils.ClimateUtil; import forestry.core.utils.ForestryModEnvWarningCallable; -import java.util.ArrayList; -import net.minecraft.command.ICommand; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; @Plugin( pluginID = "Core", @@ -61,6 +61,7 @@ import net.minecraftforge.oredict.OreDictionary; url = Constants.URL, unlocalizedDescription = "for.plugin.core.description") public class PluginCore extends ForestryPlugin { + public static final RootCommand rootCommand = new RootCommand(); public static ItemRegistryCore items; public static BlockRegistryCore blocks; @@ -98,7 +99,8 @@ public class PluginCore extends ForestryPlugin { rootCommand.addChildCommand(new CommandPlugins()); blocks.core.addDefinitions( - new MachineDefinition(BlockCoreType.ESCRITOIRE), new MachineDefinition(BlockCoreType.ANALYZER)); + new MachineDefinition(BlockCoreType.ESCRITOIRE), + new MachineDefinition(BlockCoreType.ANALYZER)); } @Override @@ -201,15 +203,19 @@ public class PluginCore extends ForestryPlugin { /* BRONZE INGOTS */ if (Config.isCraftingBronzeEnabled()) { RecipeUtil.addShapelessRecipe( - new ItemStack(items.ingotBronze, 4), "ingotTin", "ingotCopper", "ingotCopper", "ingotCopper"); + new ItemStack(items.ingotBronze, 4), + "ingotTin", + "ingotCopper", + "ingotCopper", + "ingotCopper"); } /* STURDY MACHINE */ RecipeUtil.addRecipe(items.sturdyCasing, "###", "# #", "###", '#', "ingotBronze"); // / EMPTY CANS - RecipeUtil.addRecipe( - ForestryAPI.activeMode.getStackSetting("recipe.output.can"), " # ", "# #", '#', "ingotTin"); + RecipeUtil + .addRecipe(ForestryAPI.activeMode.getStackSetting("recipe.output.can"), " # ", "# #", '#', "ingotTin"); // / GEARS ArrayList stoneGear = OreDictionary.getOres("gearStone"); @@ -321,14 +327,10 @@ public class PluginCore extends ForestryPlugin { } if (ForestryAPI.activeMode.getStackSetting("recipe.output.bogearth.can").stackSize > 0) { - ItemStack canWater = PluginFluids.items - .getContainer(EnumContainerType.CAN, Fluids.WATER) + ItemStack canWater = PluginFluids.items.getContainer(EnumContainerType.CAN, Fluids.WATER).getItemStack(); + ItemStack waxCapsuleWater = PluginFluids.items.getContainer(EnumContainerType.CAPSULE, Fluids.WATER) .getItemStack(); - ItemStack waxCapsuleWater = PluginFluids.items - .getContainer(EnumContainerType.CAPSULE, Fluids.WATER) - .getItemStack(); - ItemStack refractoryWater = PluginFluids.items - .getContainer(EnumContainerType.REFRACTORY, Fluids.WATER) + ItemStack refractoryWater = PluginFluids.items.getContainer(EnumContainerType.REFRACTORY, Fluids.WATER) .getItemStack(); RecipeUtil.addRecipe( ForestryAPI.activeMode.getStackSetting("recipe.output.bogearth.can"), @@ -429,7 +431,7 @@ public class PluginCore extends ForestryPlugin { @Override public ICommand[] getConsoleCommands() { - return new ICommand[] {rootCommand}; + return new ICommand[] { rootCommand }; } @Override diff --git a/src/main/java/forestry/plugins/PluginEnergy.java b/src/main/java/forestry/plugins/PluginEnergy.java index 9a1921de6..f805237ef 100755 --- a/src/main/java/forestry/plugins/PluginEnergy.java +++ b/src/main/java/forestry/plugins/PluginEnergy.java @@ -1,15 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; + import cpw.mods.fml.common.SidedProxy; import forestry.api.core.ForestryAPI; import forestry.core.config.Constants; @@ -18,8 +19,6 @@ import forestry.energy.blocks.BlockEngineType; import forestry.energy.blocks.BlockRegistryEnergy; import forestry.energy.proxy.ProxyEnergy; import forestry.energy.tiles.EngineDefinition; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; @Plugin( pluginID = "Energy", @@ -44,7 +43,8 @@ public class PluginEnergy extends ForestryPlugin { @Override public void preInit() { blocks.engine.addDefinitions( - new EngineDefinition(BlockEngineType.PEAT), new EngineDefinition(BlockEngineType.BIOGAS)); + new EngineDefinition(BlockEngineType.PEAT), + new EngineDefinition(BlockEngineType.BIOGAS)); if (ForestryAPI.activeMode.getBooleanSetting("energy.engine.clockwork")) { blocks.engine.addDefinition(new EngineDefinition(BlockEngineType.CLOCKWORK)); diff --git a/src/main/java/forestry/plugins/PluginFactory.java b/src/main/java/forestry/plugins/PluginFactory.java index 64d4228db..cb5d4b52e 100644 --- a/src/main/java/forestry/plugins/PluginFactory.java +++ b/src/main/java/forestry/plugins/PluginFactory.java @@ -1,16 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + import com.google.common.collect.ImmutableList; + import forestry.api.circuits.ChipsetManager; import forestry.api.circuits.CircuitSocketType; import forestry.api.circuits.ICircuitLayout; @@ -58,11 +63,6 @@ import forestry.factory.recipes.MoistenerRecipeManager; import forestry.factory.recipes.SqueezerRecipeManager; import forestry.factory.recipes.StillRecipeManager; import forestry.factory.triggers.FactoryTriggers; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; @Plugin( pluginID = "Factory", @@ -71,6 +71,7 @@ import net.minecraftforge.fluids.FluidStack; url = Constants.URL, unlocalizedDescription = "for.plugin.factory.description") public class PluginFactory extends ForestryPlugin { + public static BlockRegistryFactory blocks; @Override @@ -161,7 +162,9 @@ public class PluginFactory extends ForestryPlugin { FuelManager.copperEngineFuel.put( peat, new EngineCopperFuel( - peat, Constants.ENGINE_COPPER_FUEL_VALUE_PEAT, Constants.ENGINE_COPPER_CYCLE_DURATION_PEAT)); + peat, + Constants.ENGINE_COPPER_FUEL_VALUE_PEAT, + Constants.ENGINE_COPPER_CYCLE_DURATION_PEAT)); ItemStack bituminousPeat = coreItems.bituminousPeat.getItemStack(); FuelManager.copperEngineFuel.put( @@ -218,8 +221,8 @@ public class PluginFactory extends ForestryPlugin { // Set rain substrates ItemStack iodineCharge = coreItems.iodineCharge.getItemStack(); ItemStack dissipationCharge = coreItems.craftingMaterial.getDissipationCharge(); - FuelManager.rainSubstrate.put( - iodineCharge, new RainSubstrate(iodineCharge, Constants.RAINMAKER_RAIN_DURATION_IODINE, 0.01f)); + FuelManager.rainSubstrate + .put(iodineCharge, new RainSubstrate(iodineCharge, Constants.RAINMAKER_RAIN_DURATION_IODINE, 0.01f)); FuelManager.rainSubstrate.put(dissipationCharge, new RainSubstrate(dissipationCharge, 0.075f)); for (BlockFactoryTesrType type : BlockFactoryTesrType.VALUES) { @@ -282,34 +285,15 @@ public class PluginFactory extends ForestryPlugin { EnumElectronTube.APATITE.registerTubeRecipe("gemApatite"); EnumElectronTube.LAPIS.registerTubeRecipe("gemLapis"); RecipeManagers.fabricatorManager.addRecipe( - null, Fluids.GLASS.getFluid(500), electronTube.get(EnumElectronTube.ENDER, 4), new Object[] { - " X ", - "#X#", - "XXX", - '#', - new ItemStack(Items.ender_eye, 1, 0), - 'X', - new ItemStack(Blocks.end_stone, 1, 0) - }); + null, + Fluids.GLASS.getFluid(500), + electronTube.get(EnumElectronTube.ENDER, 4), + new Object[] { " X ", "#X#", "XXX", '#', new ItemStack(Items.ender_eye, 1, 0), 'X', + new ItemStack(Blocks.end_stone, 1, 0) }); - String[] dyes = { - "dyeBlack", - "dyeRed", - "dyeGreen", - "dyeBrown", - "dyeBlue", - "dyePurple", - "dyeCyan", - "dyeLightGray", - "dyeGray", - "dyePink", - "dyeLime", - "dyeYellow", - "dyeLightBlue", - "dyeMagenta", - "dyeOrange", - "dyeWhite" - }; + String[] dyes = { "dyeBlack", "dyeRed", "dyeGreen", "dyeBrown", "dyeBlue", "dyePurple", "dyeCyan", + "dyeLightGray", "dyeGray", "dyePink", "dyeLime", "dyeYellow", "dyeLightBlue", "dyeMagenta", "dyeOrange", + "dyeWhite" }; if (PluginManager.Module.APICULTURE.isEnabled()) { ItemRegistryApiculture beeItems = PluginApiculture.items; @@ -319,12 +303,13 @@ public class PluginFactory extends ForestryPlugin { beeItems.waxCast.getWildcard(), liquidGlassX4, new ItemStack(Blocks.stained_glass, 4, 15 - i), - new Object[] {"#", "X", '#', dyes[i], 'X', beeItems.propolis.getWildcard()}); + new Object[] { "#", "X", '#', dyes[i], 'X', beeItems.propolis.getWildcard() }); } RecipeManagers.fabricatorManager.addRecipe( - beeItems.waxCast.getWildcard(), liquidGlassX4, new ItemStack(Blocks.glass, 4, 0), new Object[] { - "#", "X", 'X', beeItems.propolis.getWildcard() - }); + beeItems.waxCast.getWildcard(), + liquidGlassX4, + new ItemStack(Blocks.glass, 4, 0), + new Object[] { "#", "X", 'X', beeItems.propolis.getWildcard() }); } // / SQUEEZER @@ -332,25 +317,25 @@ public class PluginFactory extends ForestryPlugin { int appleJuiceAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.apple"); RecipeManagers.squeezerManager.addRecipe( 10, - new ItemStack[] {new ItemStack(Items.apple)}, + new ItemStack[] { new ItemStack(Items.apple) }, Fluids.JUICE.getFluid(appleJuiceAmount), PluginCore.items.mulch.getItemStack(), appleMulchAmount); int seedOilAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.seed"); FluidStack seedOil = Fluids.SEEDOIL.getFluid(seedOilAmount); - RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[] {new ItemStack(Items.wheat_seeds)}, seedOil); - RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[] {new ItemStack(Items.pumpkin_seeds)}, seedOil); - RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[] {new ItemStack(Items.melon_seeds)}, seedOil); + RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[] { new ItemStack(Items.wheat_seeds) }, seedOil); + RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[] { new ItemStack(Items.pumpkin_seeds) }, seedOil); + RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[] { new ItemStack(Items.melon_seeds) }, seedOil); RecipeManagers.squeezerManager.addRecipe( 10, - new ItemStack[] {PluginCore.items.phosphor.getItemStack(2), new ItemStack(Blocks.cobblestone)}, + new ItemStack[] { PluginCore.items.phosphor.getItemStack(2), new ItemStack(Blocks.cobblestone) }, Fluids.LAVA.getFluid(1600)); - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {new ItemStack(Blocks.cactus)}, Fluids.WATER.getFluid(500)); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { new ItemStack(Blocks.cactus) }, Fluids.WATER.getFluid(500)); RecipeManagers.squeezerManager.addRecipe( 10, - new ItemStack[] {new ItemStack(Items.snowball), PluginCore.items.craftingMaterial.getIceShard(4)}, + new ItemStack[] { new ItemStack(Items.snowball), PluginCore.items.craftingMaterial.getIceShard(4) }, Fluids.ICE.getFluid(4000)); // STILL @@ -365,12 +350,12 @@ public class PluginFactory extends ForestryPlugin { } // MOISTENER - RecipeManagers.moistenerManager.addRecipe( - new ItemStack(Items.wheat_seeds), new ItemStack(Blocks.mycelium), 5000); - RecipeManagers.moistenerManager.addRecipe( - new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.mossy_cobblestone), 20000); - RecipeManagers.moistenerManager.addRecipe( - new ItemStack(Blocks.stonebrick), new ItemStack(Blocks.stonebrick, 1, 1), 20000); + RecipeManagers.moistenerManager + .addRecipe(new ItemStack(Items.wheat_seeds), new ItemStack(Blocks.mycelium), 5000); + RecipeManagers.moistenerManager + .addRecipe(new ItemStack(Blocks.cobblestone), new ItemStack(Blocks.mossy_cobblestone), 20000); + RecipeManagers.moistenerManager + .addRecipe(new ItemStack(Blocks.stonebrick), new ItemStack(Blocks.stonebrick, 1, 1), 20000); // FERMENTER for (int i = 0; i < 6; i++) { @@ -407,20 +392,20 @@ public class PluginFactory extends ForestryPlugin { // FABRICATOR - RecipeManagers.fabricatorSmeltingManager.addSmelting( - new ItemStack(Blocks.glass), Fluids.GLASS.getFluid(1000), 1000); - RecipeManagers.fabricatorSmeltingManager.addSmelting( - new ItemStack(Blocks.glass_pane), Fluids.GLASS.getFluid(375), 1000); - RecipeManagers.fabricatorSmeltingManager.addSmelting( - new ItemStack(Blocks.sand), Fluids.GLASS.getFluid(1000), 3000); - RecipeManagers.fabricatorSmeltingManager.addSmelting( - new ItemStack(Blocks.sand, 1, 1), Fluids.GLASS.getFluid(1000), 3000); - RecipeManagers.fabricatorSmeltingManager.addSmelting( - new ItemStack(Blocks.sandstone), Fluids.GLASS.getFluid(4000), 4800); - RecipeManagers.fabricatorSmeltingManager.addSmelting( - new ItemStack(Blocks.sandstone, 1, 1), Fluids.GLASS.getFluid(4000), 4800); - RecipeManagers.fabricatorSmeltingManager.addSmelting( - new ItemStack(Blocks.sandstone, 1, 2), Fluids.GLASS.getFluid(4000), 4800); + RecipeManagers.fabricatorSmeltingManager + .addSmelting(new ItemStack(Blocks.glass), Fluids.GLASS.getFluid(1000), 1000); + RecipeManagers.fabricatorSmeltingManager + .addSmelting(new ItemStack(Blocks.glass_pane), Fluids.GLASS.getFluid(375), 1000); + RecipeManagers.fabricatorSmeltingManager + .addSmelting(new ItemStack(Blocks.sand), Fluids.GLASS.getFluid(1000), 3000); + RecipeManagers.fabricatorSmeltingManager + .addSmelting(new ItemStack(Blocks.sand, 1, 1), Fluids.GLASS.getFluid(1000), 3000); + RecipeManagers.fabricatorSmeltingManager + .addSmelting(new ItemStack(Blocks.sandstone), Fluids.GLASS.getFluid(4000), 4800); + RecipeManagers.fabricatorSmeltingManager + .addSmelting(new ItemStack(Blocks.sandstone, 1, 1), Fluids.GLASS.getFluid(4000), 4800); + RecipeManagers.fabricatorSmeltingManager + .addSmelting(new ItemStack(Blocks.sandstone, 1, 2), Fluids.GLASS.getFluid(4000), 4800); // / CARPENTER RecipeManagers.carpenterManager.addRecipe( @@ -455,9 +440,22 @@ public class PluginFactory extends ForestryPlugin { '#', "logWood"); RecipeManagers.carpenterManager.addRecipe( - 5, Fluids.WATER.getFluid(250), null, PluginCore.items.woodPulp.getItemStack(4), "#", '#', "logWood"); + 5, + Fluids.WATER.getFluid(250), + null, + PluginCore.items.woodPulp.getItemStack(4), + "#", + '#', + "logWood"); RecipeManagers.carpenterManager.addRecipe( - 5, Fluids.WATER.getFluid(250), null, new ItemStack(Items.paper, 1), "#", "#", '#', "pulpWood"); + 5, + Fluids.WATER.getFluid(250), + null, + new ItemStack(Items.paper, 1), + "#", + "#", + '#', + "pulpWood"); RecipeManagers.carpenterManager.addRecipe( 5, Fluids.WATER.getFluid(1000), @@ -637,20 +635,28 @@ public class PluginFactory extends ForestryPlugin { null, PluginCore.items.carton.getItemStack(), PluginCore.items.kitPickaxe.getItemStack(), - new Object[] {"###", " X ", " X ", '#', "ingotBronze", 'X', "stickWood"}); + new Object[] { "###", " X ", " X ", '#', "ingotBronze", 'X', "stickWood" }); RecipeManagers.carpenterManager.addRecipe( 20, null, PluginCore.items.carton.getItemStack(), PluginCore.items.kitShovel.getItemStack(), - new Object[] {" # ", " X ", " X ", '#', "ingotBronze", 'X', "stickWood"}); + new Object[] { " # ", " X ", " X ", '#', "ingotBronze", 'X', "stickWood" }); // Reclamation RecipeManagers.carpenterManager.addRecipe( - null, PluginCore.items.ingotBronze.getItemStack(2), "#", '#', PluginCore.items.brokenBronzePickaxe); + null, + PluginCore.items.ingotBronze.getItemStack(2), + "#", + '#', + PluginCore.items.brokenBronzePickaxe); RecipeManagers.carpenterManager.addRecipe( - null, PluginCore.items.ingotBronze.getItemStack(), "#", '#', PluginCore.items.brokenBronzeShovel); + null, + PluginCore.items.ingotBronze.getItemStack(), + "#", + '#', + PluginCore.items.brokenBronzeShovel); // Crating and uncrating if (PluginManager.Module.STORAGE.isEnabled()) { @@ -660,11 +666,15 @@ public class PluginFactory extends ForestryPlugin { // / Solder Manager ChipsetManager.solderManager.addRecipe( - layout, PluginCore.items.tubes.get(EnumElectronTube.EMERALD, 1), Circuit.machineSpeedUpgrade1); + layout, + PluginCore.items.tubes.get(EnumElectronTube.EMERALD, 1), + Circuit.machineSpeedUpgrade1); + ChipsetManager.solderManager + .addRecipe(layout, PluginCore.items.tubes.get(EnumElectronTube.BLAZE, 1), Circuit.machineSpeedUpgrade2); ChipsetManager.solderManager.addRecipe( - layout, PluginCore.items.tubes.get(EnumElectronTube.BLAZE, 1), Circuit.machineSpeedUpgrade2); - ChipsetManager.solderManager.addRecipe( - layout, PluginCore.items.tubes.get(EnumElectronTube.GOLD, 1), Circuit.machineEfficiencyUpgrade1); + layout, + PluginCore.items.tubes.get(EnumElectronTube.GOLD, 1), + Circuit.machineEfficiencyUpgrade1); RecipeUtil.addRecipe( blocks.factoryTESR.get(BlockFactoryTesrType.BOTTLER), diff --git a/src/main/java/forestry/plugins/PluginFarming.java b/src/main/java/forestry/plugins/PluginFarming.java index 84b1ce40a..0e3c06b61 100644 --- a/src/main/java/forestry/plugins/PluginFarming.java +++ b/src/main/java/forestry/plugins/PluginFarming.java @@ -1,15 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins; +import java.util.ArrayList; +import java.util.Collection; +import java.util.regex.MatchResult; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; + import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage; import cpw.mods.fml.common.registry.GameData; @@ -37,17 +48,6 @@ import forestry.farming.tiles.TileFarmHatch; import forestry.farming.tiles.TileFarmPlain; import forestry.farming.tiles.TileFarmValve; import forestry.farming.triggers.FarmingTriggers; -import java.util.ArrayList; -import java.util.Collection; -import java.util.regex.MatchResult; -import java.util.regex.Matcher; -import java.util.regex.Pattern; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; @Plugin( pluginID = "Farming", @@ -86,35 +86,29 @@ public class PluginFarming extends ForestryPlugin { Farmables.farmables.get(FarmableReference.Orchard.get()).add(new FarmableBasicFruit(Blocks.carrots, 7)); Farmables.farmables.put(FarmableReference.Shroom.get(), new ArrayList<>()); - Farmables.farmables - .get(FarmableReference.Shroom.get()) + Farmables.farmables.get(FarmableReference.Shroom.get()) .add(new FarmableVanillaMushroom(Blocks.brown_mushroom, 0)); - Farmables.farmables - .get(FarmableReference.Shroom.get()) + Farmables.farmables.get(FarmableReference.Shroom.get()) .add(new FarmableVanillaMushroom(Blocks.red_mushroom, 0)); Farmables.farmables.put(FarmableReference.Wheat.get(), new ArrayList<>()); - Farmables.farmables - .get(FarmableReference.Wheat.get()) + Farmables.farmables.get(FarmableReference.Wheat.get()) .add(new FarmableGenericCrop(new ItemStack(Items.wheat_seeds), Blocks.wheat, 7)); Farmables.farmables.put(FarmableReference.Gourd.get(), new ArrayList<>()); - Farmables.farmables - .get(FarmableReference.Gourd.get()) - .add(new FarmableGourd( + Farmables.farmables.get(FarmableReference.Gourd.get()).add( + new FarmableGourd( new ItemStack(Items.pumpkin_seeds), new ItemStack(Blocks.pumpkin_stem), new ItemStack(Blocks.pumpkin))); - Farmables.farmables - .get(FarmableReference.Gourd.get()) - .add(new FarmableGourd( + Farmables.farmables.get(FarmableReference.Gourd.get()).add( + new FarmableGourd( new ItemStack(Items.melon_seeds), new ItemStack(Blocks.melon_stem), new ItemStack(Blocks.melon_block))); Farmables.farmables.put(FarmableReference.Infernal.get(), new ArrayList<>()); - Farmables.farmables - .get(FarmableReference.Infernal.get()) + Farmables.farmables.get(FarmableReference.Infernal.get()) .add(new FarmableGenericCrop(new ItemStack(Items.nether_wart), Blocks.nether_wart, 3)); Farmables.farmables.put(FarmableReference.Poales.get(), new ArrayList<>()); @@ -124,11 +118,9 @@ public class PluginFarming extends ForestryPlugin { Farmables.farmables.get(FarmableReference.Succulentes.get()).add(new FarmableStacked(Blocks.cactus, 3, 0)); Farmables.farmables.put(FarmableReference.Vegetables.get(), new ArrayList<>()); - Farmables.farmables - .get(FarmableReference.Vegetables.get()) + Farmables.farmables.get(FarmableReference.Vegetables.get()) .add(new FarmableGenericCrop(new ItemStack(Items.potato), Blocks.potatoes, 7)); - Farmables.farmables - .get(FarmableReference.Vegetables.get()) + Farmables.farmables.get(FarmableReference.Vegetables.get()) .add(new FarmableGenericCrop(new ItemStack(Items.carrot), Blocks.carrots, 7)); proxy.initializeRendering(); @@ -264,10 +256,11 @@ public class PluginFarming extends ForestryPlugin { throw new RuntimeException("can't find block for " + items[2]); } - Farmables.farmables - .get(tokens[0]) - .add(new FarmableGenericCrop( - new ItemStack(seed, 1, Integer.parseInt(items[1])), crop, Integer.parseInt(items[3]))); + Farmables.farmables.get(tokens[0]).add( + new FarmableGenericCrop( + new ItemStack(seed, 1, Integer.parseInt(items[1])), + crop, + Integer.parseInt(items[3]))); } catch (Exception ex) { Log.warning("%s for farm '%s': %s", errormsg, tokens[0], ex.getMessage()); } @@ -333,35 +326,61 @@ public class PluginFarming extends ForestryPlugin { ICircuitLayout layoutManual = ChipsetManager.circuitRegistry.getLayout("forestry.farms.manual"); ChipsetManager.solderManager.addRecipe( - layoutManaged, PluginCore.items.tubes.get(EnumElectronTube.COPPER, 1), Circuit.farmArborealManaged); + layoutManaged, + PluginCore.items.tubes.get(EnumElectronTube.COPPER, 1), + Circuit.farmArborealManaged); + ChipsetManager.solderManager + .addRecipe(layoutManaged, PluginCore.items.tubes.get(EnumElectronTube.TIN, 1), Circuit.farmPeatManaged); ChipsetManager.solderManager.addRecipe( - layoutManaged, PluginCore.items.tubes.get(EnumElectronTube.TIN, 1), Circuit.farmPeatManaged); + layoutManaged, + PluginCore.items.tubes.get(EnumElectronTube.BRONZE, 1), + Circuit.farmCerealManaged); ChipsetManager.solderManager.addRecipe( - layoutManaged, PluginCore.items.tubes.get(EnumElectronTube.BRONZE, 1), Circuit.farmCerealManaged); + layoutManaged, + PluginCore.items.tubes.get(EnumElectronTube.IRON, 1), + Circuit.farmVegetableManaged); ChipsetManager.solderManager.addRecipe( - layoutManaged, PluginCore.items.tubes.get(EnumElectronTube.IRON, 1), Circuit.farmVegetableManaged); + layoutManaged, + PluginCore.items.tubes.get(EnumElectronTube.BLAZE, 1), + Circuit.farmInfernalManaged); ChipsetManager.solderManager.addRecipe( - layoutManaged, PluginCore.items.tubes.get(EnumElectronTube.BLAZE, 1), Circuit.farmInfernalManaged); - ChipsetManager.solderManager.addRecipe( - layoutManaged, PluginCore.items.tubes.get(EnumElectronTube.APATITE, 1), Circuit.farmShroomManaged); + layoutManaged, + PluginCore.items.tubes.get(EnumElectronTube.APATITE, 1), + Circuit.farmShroomManaged); ChipsetManager.solderManager.addRecipe( - layoutManual, PluginCore.items.tubes.get(EnumElectronTube.COPPER, 1), Circuit.farmOrchardManual); + layoutManual, + PluginCore.items.tubes.get(EnumElectronTube.COPPER, 1), + Circuit.farmOrchardManual); + ChipsetManager.solderManager + .addRecipe(layoutManual, PluginCore.items.tubes.get(EnumElectronTube.TIN, 1), Circuit.farmPeatManual); ChipsetManager.solderManager.addRecipe( - layoutManual, PluginCore.items.tubes.get(EnumElectronTube.TIN, 1), Circuit.farmPeatManual); + layoutManual, + PluginCore.items.tubes.get(EnumElectronTube.BRONZE, 1), + Circuit.farmCerealManual); ChipsetManager.solderManager.addRecipe( - layoutManual, PluginCore.items.tubes.get(EnumElectronTube.BRONZE, 1), Circuit.farmCerealManual); + layoutManual, + PluginCore.items.tubes.get(EnumElectronTube.IRON, 1), + Circuit.farmVegetableManual); ChipsetManager.solderManager.addRecipe( - layoutManual, PluginCore.items.tubes.get(EnumElectronTube.IRON, 1), Circuit.farmVegetableManual); + layoutManual, + PluginCore.items.tubes.get(EnumElectronTube.GOLD, 1), + Circuit.farmSucculentManual); ChipsetManager.solderManager.addRecipe( - layoutManual, PluginCore.items.tubes.get(EnumElectronTube.GOLD, 1), Circuit.farmSucculentManual); + layoutManual, + PluginCore.items.tubes.get(EnumElectronTube.DIAMOND, 1), + Circuit.farmPoalesManual); ChipsetManager.solderManager.addRecipe( - layoutManual, PluginCore.items.tubes.get(EnumElectronTube.DIAMOND, 1), Circuit.farmPoalesManual); + layoutManual, + PluginCore.items.tubes.get(EnumElectronTube.OBSIDIAN, 1), + Circuit.farmGourdManual); ChipsetManager.solderManager.addRecipe( - layoutManual, PluginCore.items.tubes.get(EnumElectronTube.OBSIDIAN, 1), Circuit.farmGourdManual); + layoutManual, + PluginCore.items.tubes.get(EnumElectronTube.APATITE, 1), + Circuit.farmShroomManual); ChipsetManager.solderManager.addRecipe( - layoutManual, PluginCore.items.tubes.get(EnumElectronTube.APATITE, 1), Circuit.farmShroomManual); - ChipsetManager.solderManager.addRecipe( - layoutManual, PluginCore.items.tubes.get(EnumElectronTube.LAPIS, 1), Circuit.farmCocoaManual); + layoutManual, + PluginCore.items.tubes.get(EnumElectronTube.LAPIS, 1), + Circuit.farmCocoaManual); } } diff --git a/src/main/java/forestry/plugins/PluginFluids.java b/src/main/java/forestry/plugins/PluginFluids.java index 74f38125d..6aceaf5b1 100644 --- a/src/main/java/forestry/plugins/PluginFluids.java +++ b/src/main/java/forestry/plugins/PluginFluids.java @@ -1,15 +1,29 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemBlock; +import net.minecraft.item.ItemStack; +import net.minecraft.util.MovingObjectPosition; +import net.minecraftforge.client.event.TextureStitchEvent; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.event.entity.player.FillBucketEvent; +import net.minecraftforge.fluids.Fluid; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + import cpw.mods.fml.common.eventhandler.Event; import cpw.mods.fml.common.eventhandler.SubscribeEvent; import cpw.mods.fml.common.registry.GameRegistry; @@ -29,20 +43,6 @@ import forestry.core.items.ItemLiquidContainer; import forestry.core.items.ItemRegistryFluids; import forestry.core.utils.Log; import forestry.core.utils.StringUtil; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.MovingObjectPosition; -import net.minecraftforge.client.event.TextureStitchEvent; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.event.entity.player.FillBucketEvent; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; @Plugin( pluginID = "Fluids", @@ -60,10 +60,8 @@ public class PluginFluids extends ForestryPlugin { if (forestryFluid.getFluid() == null && Config.isFluidEnabled(forestryFluid)) { String fluidName = forestryFluid.getTag(); if (!FluidRegistry.isFluidRegistered(fluidName)) { - Fluid fluid = new Fluid(fluidName) - .setDensity(forestryFluid.getDensity()) - .setViscosity(forestryFluid.getViscosity()) - .setTemperature(forestryFluid.getTemperature()); + Fluid fluid = new Fluid(fluidName).setDensity(forestryFluid.getDensity()) + .setViscosity(forestryFluid.getViscosity()).setTemperature(forestryFluid.getTemperature()); FluidRegistry.registerFluid(fluid); createBlock(forestryFluid); } @@ -88,7 +86,9 @@ public class PluginFluids extends ForestryPlugin { "Pre-existing {0} fluid block detected, deferring to {1}:{2}, " + "this may cause issues if the server/client have different mod load orders, " + "recommended that you disable all but one instance of {0} fluid blocks via your configs.", - fluid.getName(), blockID.modId, blockID.name); + fluid.getName(), + blockID.modId, + blockID.name); } } } @@ -131,25 +131,39 @@ public class PluginFluids extends ForestryPlugin { if (RecipeManagers.squeezerManager != null) { RecipeManagers.squeezerManager.addContainerRecipe( - 10, items.canEmpty.getItemStack(), PluginCore.items.ingotTin.getItemStack(), 0.05f); + 10, + items.canEmpty.getItemStack(), + PluginCore.items.ingotTin.getItemStack(), + 0.05f); RecipeManagers.squeezerManager.addContainerRecipe( - 10, items.waxCapsuleEmpty.getItemStack(), PluginCore.items.beeswax.getItemStack(), 0.10f); + 10, + items.waxCapsuleEmpty.getItemStack(), + PluginCore.items.beeswax.getItemStack(), + 0.10f); RecipeManagers.squeezerManager.addContainerRecipe( - 10, items.refractoryEmpty.getItemStack(), PluginCore.items.refractoryWax.getItemStack(), 0.10f); + 10, + items.refractoryEmpty.getItemStack(), + PluginCore.items.refractoryWax.getItemStack(), + 0.10f); } FluidStack ethanol = Fluids.ETHANOL.getFluid(1); GeneratorFuel ethanolFuel = new GeneratorFuel( - ethanol, (int) (32 * ForestryAPI.activeMode.getFloatSetting("fuel.ethanol.generator")), 4); + ethanol, + (int) (32 * ForestryAPI.activeMode.getFloatSetting("fuel.ethanol.generator")), + 4); FuelManager.generatorFuel.put(ethanol.getFluid(), ethanolFuel); FluidStack biomass = Fluids.BIOMASS.getFluid(1); GeneratorFuel biomassFuel = new GeneratorFuel( - biomass, (int) (8 * ForestryAPI.activeMode.getFloatSetting("fuel.biomass.generator")), 1); + biomass, + (int) (8 * ForestryAPI.activeMode.getFloatSetting("fuel.biomass.generator")), + 1); FuelManager.generatorFuel.put(biomass.getFluid(), biomassFuel); } public static class MissingFluidException extends RuntimeException { + public MissingFluidException(String tag) { super("Fluid '" + tag + "' was not found. Please check your configs."); } @@ -165,6 +179,7 @@ public class PluginFluids extends ForestryPlugin { } public static class TextureHook { + @SubscribeEvent @SideOnly(Side.CLIENT) public void textureHook(TextureStitchEvent.Post event) { @@ -185,6 +200,7 @@ public class PluginFluids extends ForestryPlugin { } public static class FillBucketHook { + @SubscribeEvent public void fillBucket(FillBucketEvent event) { ItemStack bucket = event.current; diff --git a/src/main/java/forestry/plugins/PluginFood.java b/src/main/java/forestry/plugins/PluginFood.java index 6c167897d..561ce3213 100755 --- a/src/main/java/forestry/plugins/PluginFood.java +++ b/src/main/java/forestry/plugins/PluginFood.java @@ -1,15 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + import forestry.api.food.BeverageManager; import forestry.apiculture.items.EnumPollenCluster; import forestry.apiculture.items.ItemRegistryApiculture; @@ -22,8 +23,6 @@ import forestry.food.InfuserIngredientManager; import forestry.food.InfuserMixtureManager; import forestry.food.items.EnumBeverage; import forestry.food.items.ItemRegistryFood; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; @Plugin( pluginID = "Food", diff --git a/src/main/java/forestry/plugins/PluginLepidopterology.java b/src/main/java/forestry/plugins/PluginLepidopterology.java index 1248ff105..081a9fac7 100755 --- a/src/main/java/forestry/plugins/PluginLepidopterology.java +++ b/src/main/java/forestry/plugins/PluginLepidopterology.java @@ -1,15 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins; +import java.io.File; +import java.util.EnumSet; + +import net.minecraft.item.ItemStack; +import net.minecraft.item.crafting.CraftingManager; +import net.minecraftforge.oredict.OreDictionary; +import net.minecraftforge.oredict.RecipeSorter; + import cpw.mods.fml.common.SidedProxy; import forestry.Forestry; import forestry.api.arboriculture.TreeManager; @@ -36,12 +42,6 @@ import forestry.lepidopterology.genetics.MothDefinition; import forestry.lepidopterology.items.ItemRegistryLepidopterology; import forestry.lepidopterology.proxy.ProxyLepidopterology; import forestry.lepidopterology.recipes.MatingRecipe; -import java.io.File; -import java.util.EnumSet; -import net.minecraft.item.ItemStack; -import net.minecraft.item.crafting.CraftingManager; -import net.minecraftforge.oredict.OreDictionary; -import net.minecraftforge.oredict.RecipeSorter; @Plugin( pluginID = "Lepidopterology", diff --git a/src/main/java/forestry/plugins/PluginMail.java b/src/main/java/forestry/plugins/PluginMail.java index 2a39935a6..bb6863378 100755 --- a/src/main/java/forestry/plugins/PluginMail.java +++ b/src/main/java/forestry/plugins/PluginMail.java @@ -1,15 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins; +import net.minecraft.init.Items; +import net.minecraft.item.ItemStack; + import cpw.mods.fml.common.FMLCommonHandler; import forestry.api.mail.EnumAddressee; import forestry.api.mail.PostManager; @@ -35,8 +36,6 @@ import forestry.mail.items.EnumStampDefinition; import forestry.mail.items.ItemRegistryMail; import forestry.mail.network.PacketRegistryMail; import forestry.mail.triggers.MailTriggers; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; @Plugin( pluginID = "Mail", @@ -45,6 +44,7 @@ import net.minecraft.item.ItemStack; url = Constants.URL, unlocalizedDescription = "for.plugin.mail.description") public class PluginMail extends ForestryPlugin { + public static ItemRegistryMail items; public static BlockRegistryMail blocks; @@ -160,7 +160,9 @@ public class PluginMail extends ForestryPlugin { PluginCore.items.woodPulp); RecipeUtil.addShapelessRecipe( - items.catalogue.getItemStack(), items.stamps.getWildcard(), new ItemStack(Items.book)); + items.catalogue.getItemStack(), + items.stamps.getWildcard(), + new ItemStack(Items.book)); RecipeUtil.addRecipe( blocks.mail.get(BlockMailType.MAILBOX), diff --git a/src/main/java/forestry/plugins/PluginManager.java b/src/main/java/forestry/plugins/PluginManager.java index 558423130..dc963f590 100644 --- a/src/main/java/forestry/plugins/PluginManager.java +++ b/src/main/java/forestry/plugins/PluginManager.java @@ -1,17 +1,34 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins; +import java.io.File; +import java.util.ArrayList; +import java.util.EnumSet; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Locale; +import java.util.Random; +import java.util.Set; + +import net.minecraft.command.CommandHandler; +import net.minecraft.command.ICommand; +import net.minecraft.server.MinecraftServer; +import net.minecraft.util.StatCollector; +import net.minecraft.world.World; +import net.minecraft.world.chunk.IChunkProvider; +import net.minecraftforge.common.config.Configuration; +import net.minecraftforge.common.config.Property; + import com.google.common.collect.ImmutableList; import com.google.common.collect.Lists; + import cpw.mods.fml.common.IFuelHandler; import cpw.mods.fml.common.event.FMLInterModComms; import cpw.mods.fml.common.registry.GameRegistry; @@ -41,22 +58,6 @@ import forestry.plugins.compat.PluginNatura; import forestry.plugins.compat.PluginPlantMegaPack; import forestry.plugins.compat.PluginRotaryCraft; import forestry.plugins.compat.PluginWitchery; -import java.io.File; -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.HashSet; -import java.util.Iterator; -import java.util.Locale; -import java.util.Random; -import java.util.Set; -import net.minecraft.command.CommandHandler; -import net.minecraft.command.ICommand; -import net.minecraft.server.MinecraftServer; -import net.minecraft.util.StatCollector; -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; -import net.minecraftforge.common.config.Configuration; -import net.minecraftforge.common.config.Property; public class PluginManager { @@ -83,6 +84,7 @@ public class PluginManager { } public enum Module { + CORE(new PluginCore(), false), FLUIDS(new PluginFluids(), false), @@ -191,8 +193,8 @@ public class PluginManager { Locale locale = Locale.getDefault(); Locale.setDefault(Locale.ENGLISH); - Configuration config = - new Configuration(new File(Forestry.instance.getConfigFolder(), MODULE_CONFIG_FILE_NAME)); + Configuration config = new Configuration( + new File(Forestry.instance.getConfigFolder(), MODULE_CONFIG_FILE_NAME)); config.load(); config.addCustomCategoryComment( @@ -338,12 +340,7 @@ public class PluginManager { } } - public static void populateChunk( - IChunkProvider chunkProvider, - World world, - Random rand, - int chunkX, - int chunkZ, + public static void populateChunk(IChunkProvider chunkProvider, World world, Random rand, int chunkX, int chunkZ, boolean hasVillageGenerated) { for (Module m : loadedModules) { ForestryPlugin plugin = m.instance; diff --git a/src/main/java/forestry/plugins/PluginStorage.java b/src/main/java/forestry/plugins/PluginStorage.java index a52c1ad42..148e87f84 100755 --- a/src/main/java/forestry/plugins/PluginStorage.java +++ b/src/main/java/forestry/plugins/PluginStorage.java @@ -1,15 +1,49 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins; +import java.awt.Color; +import java.io.File; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.List; +import java.util.regex.Pattern; + +import net.minecraft.block.BlockBasePressurePlate; +import net.minecraft.block.BlockButton; +import net.minecraft.block.BlockChest; +import net.minecraft.block.BlockDoor; +import net.minecraft.block.BlockFence; +import net.minecraft.block.BlockFenceGate; +import net.minecraft.block.BlockFurnace; +import net.minecraft.block.BlockLadder; +import net.minecraft.block.BlockLever; +import net.minecraft.block.BlockRedstoneDiode; +import net.minecraft.block.BlockSlab; +import net.minecraft.block.BlockStairs; +import net.minecraft.block.BlockTorch; +import net.minecraft.block.BlockTrapDoor; +import net.minecraft.block.BlockWall; +import net.minecraft.block.BlockWorkbench; +import net.minecraft.block.IGrowable; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemDoor; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.IPlantable; +import net.minecraftforge.common.IShearable; +import net.minecraftforge.common.config.Property; +import net.minecraftforge.fluids.FluidStack; +import net.minecraftforge.oredict.OreDictionary; + import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInterModComms.IMCMessage; import forestry.Forestry; @@ -39,40 +73,6 @@ import forestry.storage.PickupHandlerStorage; import forestry.storage.ResupplyHandler; import forestry.storage.items.ItemRegistryStorage; import forestry.storage.proxy.ProxyStorage; -import java.awt.Color; -import java.io.File; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.List; -import java.util.regex.Pattern; -import net.minecraft.block.BlockBasePressurePlate; -import net.minecraft.block.BlockButton; -import net.minecraft.block.BlockChest; -import net.minecraft.block.BlockDoor; -import net.minecraft.block.BlockFence; -import net.minecraft.block.BlockFenceGate; -import net.minecraft.block.BlockFurnace; -import net.minecraft.block.BlockLadder; -import net.minecraft.block.BlockLever; -import net.minecraft.block.BlockRedstoneDiode; -import net.minecraft.block.BlockSlab; -import net.minecraft.block.BlockStairs; -import net.minecraft.block.BlockTorch; -import net.minecraft.block.BlockTrapDoor; -import net.minecraft.block.BlockWall; -import net.minecraft.block.BlockWorkbench; -import net.minecraft.block.IGrowable; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemDoor; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.IPlantable; -import net.minecraftforge.common.IShearable; -import net.minecraftforge.common.config.Property; -import net.minecraftforge.fluids.FluidStack; -import net.minecraftforge.oredict.OreDictionary; @Plugin( pluginID = "Storage", @@ -100,7 +100,7 @@ public class PluginStorage extends ForestryPlugin { public static ItemRegistryStorage items; @Override - @SuppressWarnings({"unchecked", "rawtypes"}) + @SuppressWarnings({ "unchecked", "rawtypes" }) protected void setupAPI() { super.setupAPI(); @@ -149,7 +149,7 @@ public class PluginStorage extends ForestryPlugin { } @Override - @SuppressWarnings({"unchecked", "rawtypes"}) + @SuppressWarnings({ "unchecked", "rawtypes" }) protected void disabledSetupAPI() { BackpackManager.backpackItems = new ArrayList[6]; BackpackManager.backpackItems[0] = minerItems; @@ -190,23 +190,24 @@ public class PluginStorage extends ForestryPlugin { forester.addValidItemClasses(Arrays.asList(IPlantable.class, IGrowable.class)); BackpackDefinition builder = (BackpackDefinition) BackpackManager.definitions.get("builder"); - builder.addValidBlockClasses(Arrays.asList( - BlockStairs.class, - BlockFence.class, - BlockFenceGate.class, - BlockWall.class, - BlockBasePressurePlate.class, - BlockLever.class, - BlockButton.class, - BlockTorch.class, - BlockRedstoneDiode.class, - BlockChest.class, - BlockWorkbench.class, - BlockFurnace.class, - BlockLadder.class, - BlockTrapDoor.class, - BlockDoor.class, - BlockSlab.class)); + builder.addValidBlockClasses( + Arrays.asList( + BlockStairs.class, + BlockFence.class, + BlockFenceGate.class, + BlockWall.class, + BlockBasePressurePlate.class, + BlockLever.class, + BlockButton.class, + BlockTorch.class, + BlockRedstoneDiode.class, + BlockChest.class, + BlockWorkbench.class, + BlockFurnace.class, + BlockLadder.class, + BlockTrapDoor.class, + BlockDoor.class, + BlockSlab.class)); builder.addValidItemClass(ItemDoor.class); } @@ -226,19 +227,27 @@ public class PluginStorage extends ForestryPlugin { adventurer.addValidItems(adventurerItems); builder.addValidItems(builderItems); - final Pattern minerOreDictPattern = - Pattern.compile("(ore|dust|gem|ingot|nugget|crushed|cluster|denseore)[A-Z].*"); + final Pattern minerOreDictPattern = Pattern + .compile("(ore|dust|gem|ingot|nugget|crushed|cluster|denseore)[A-Z].*"); final Pattern diggerOreDictPattern = Pattern.compile("(stone)[A-Z].*"); final Pattern foresterOreDictPattern = Pattern.compile("(crop|seed|tree)[A-Z].*"); - final Pattern builderOreDictPattern = - Pattern.compile("(block|paneGlass|slabWood|stainedClay|stainedGlass)[A-Z].*"); + final Pattern builderOreDictPattern = Pattern + .compile("(block|paneGlass|slabWood|stainedClay|stainedGlass)[A-Z].*"); final List minerOreDictNames = new ArrayList<>(); final List diggerOreDictNames = new ArrayList<>(Arrays.asList("cobblestone", "stone", "sand")); - final List foresterOreDictNames = - new ArrayList<>(Arrays.asList("logWood", "stickWood", "woodStick", "saplingTree")); - final List builderOreDictNames = new ArrayList<>(Arrays.asList( - "stone", "plankWood", "stairWood", "slabWood", "fenceWood", "glass", "blockGlass", "paneGlass")); + final List foresterOreDictNames = new ArrayList<>( + Arrays.asList("logWood", "stickWood", "woodStick", "saplingTree")); + final List builderOreDictNames = new ArrayList<>( + Arrays.asList( + "stone", + "plankWood", + "stairWood", + "slabWood", + "fenceWood", + "glass", + "blockGlass", + "paneGlass")); for (String name : OreDictionary.getOreNames()) { if (minerOreDictPattern.matcher(name).matches()) { @@ -259,106 +268,111 @@ public class PluginStorage extends ForestryPlugin { } miner.addValidOreDictNames(minerOreDictNames); - miner.addValidItems(Arrays.asList( - new ItemStack(Blocks.obsidian), - new ItemStack(Blocks.coal_ore), - new ItemStack(Items.coal), - PluginCore.items.bronzePickaxe.getItemStack(), - PluginCore.items.kitPickaxe.getItemStack(), - PluginCore.items.brokenBronzePickaxe.getItemStack())); + miner.addValidItems( + Arrays.asList( + new ItemStack(Blocks.obsidian), + new ItemStack(Blocks.coal_ore), + new ItemStack(Items.coal), + PluginCore.items.bronzePickaxe.getItemStack(), + PluginCore.items.kitPickaxe.getItemStack(), + PluginCore.items.brokenBronzePickaxe.getItemStack())); digger.addValidOreDictNames(diggerOreDictNames); - digger.addValidItems(Arrays.asList( - new ItemStack(Blocks.dirt, 1, OreDictionary.WILDCARD_VALUE), - new ItemStack(Blocks.gravel), - new ItemStack(Items.flint), - new ItemStack(Blocks.netherrack), - new ItemStack(Blocks.sandstone, 1, 0), - new ItemStack(Items.clay_ball), - new ItemStack(Blocks.soul_sand), - PluginCore.items.bronzeShovel.getItemStack(), - PluginCore.items.kitShovel.getItemStack(), - PluginCore.items.brokenBronzeShovel.getItemStack())); + digger.addValidItems( + Arrays.asList( + new ItemStack(Blocks.dirt, 1, OreDictionary.WILDCARD_VALUE), + new ItemStack(Blocks.gravel), + new ItemStack(Items.flint), + new ItemStack(Blocks.netherrack), + new ItemStack(Blocks.sandstone, 1, 0), + new ItemStack(Items.clay_ball), + new ItemStack(Blocks.soul_sand), + PluginCore.items.bronzeShovel.getItemStack(), + PluginCore.items.kitShovel.getItemStack(), + PluginCore.items.brokenBronzeShovel.getItemStack())); forester.addValidOreDictNames(foresterOreDictNames); - forester.addValidItems(Arrays.asList( - new ItemStack(Blocks.red_mushroom), - new ItemStack(Blocks.brown_mushroom), - new ItemStack(Blocks.red_flower), - new ItemStack(Blocks.yellow_flower), - new ItemStack(Blocks.cactus), - new ItemStack(Blocks.tallgrass, 1, OreDictionary.WILDCARD_VALUE), - new ItemStack(Blocks.vine), - new ItemStack(Blocks.pumpkin), - new ItemStack(Blocks.melon_block), - new ItemStack(Items.golden_apple), - new ItemStack(Items.nether_wart), - new ItemStack(Items.pumpkin_seeds), - new ItemStack(Items.melon_seeds))); + forester.addValidItems( + Arrays.asList( + new ItemStack(Blocks.red_mushroom), + new ItemStack(Blocks.brown_mushroom), + new ItemStack(Blocks.red_flower), + new ItemStack(Blocks.yellow_flower), + new ItemStack(Blocks.cactus), + new ItemStack(Blocks.tallgrass, 1, OreDictionary.WILDCARD_VALUE), + new ItemStack(Blocks.vine), + new ItemStack(Blocks.pumpkin), + new ItemStack(Blocks.melon_block), + new ItemStack(Items.golden_apple), + new ItemStack(Items.nether_wart), + new ItemStack(Items.pumpkin_seeds), + new ItemStack(Items.melon_seeds))); - hunter.addValidItems(Arrays.asList( - new ItemStack(Items.feather), - new ItemStack(Items.gunpowder), - new ItemStack(Items.blaze_powder), - new ItemStack(Items.blaze_rod), - new ItemStack(Items.bone), - new ItemStack(Items.string), - new ItemStack(Items.rotten_flesh), - new ItemStack(Items.ghast_tear), - new ItemStack(Items.gold_nugget), - new ItemStack(Items.arrow), - new ItemStack(Items.porkchop), - new ItemStack(Items.cooked_porkchop), - new ItemStack(Items.beef), - new ItemStack(Items.cooked_beef), - new ItemStack(Items.chicken), - new ItemStack(Items.cooked_chicken), - new ItemStack(Items.leather), - new ItemStack(Items.egg), - new ItemStack(Items.ender_pearl), - new ItemStack(Items.spider_eye), - new ItemStack(Items.fermented_spider_eye), - new ItemStack(Items.slime_ball), - new ItemStack(Items.dye, 1, 0), - new ItemStack(Blocks.hay_block), - new ItemStack(Blocks.wool, 1, OreDictionary.WILDCARD_VALUE), - new ItemStack(Items.ender_eye), - new ItemStack(Items.magma_cream), - new ItemStack(Items.speckled_melon), - new ItemStack(Items.fish), - new ItemStack(Items.cooked_fished), - new ItemStack(Items.lead), - new ItemStack(Items.fishing_rod), - new ItemStack(Items.name_tag), - new ItemStack(Items.saddle), - new ItemStack(Items.diamond_horse_armor), - new ItemStack(Items.golden_horse_armor), - new ItemStack(Items.iron_horse_armor))); + hunter.addValidItems( + Arrays.asList( + new ItemStack(Items.feather), + new ItemStack(Items.gunpowder), + new ItemStack(Items.blaze_powder), + new ItemStack(Items.blaze_rod), + new ItemStack(Items.bone), + new ItemStack(Items.string), + new ItemStack(Items.rotten_flesh), + new ItemStack(Items.ghast_tear), + new ItemStack(Items.gold_nugget), + new ItemStack(Items.arrow), + new ItemStack(Items.porkchop), + new ItemStack(Items.cooked_porkchop), + new ItemStack(Items.beef), + new ItemStack(Items.cooked_beef), + new ItemStack(Items.chicken), + new ItemStack(Items.cooked_chicken), + new ItemStack(Items.leather), + new ItemStack(Items.egg), + new ItemStack(Items.ender_pearl), + new ItemStack(Items.spider_eye), + new ItemStack(Items.fermented_spider_eye), + new ItemStack(Items.slime_ball), + new ItemStack(Items.dye, 1, 0), + new ItemStack(Blocks.hay_block), + new ItemStack(Blocks.wool, 1, OreDictionary.WILDCARD_VALUE), + new ItemStack(Items.ender_eye), + new ItemStack(Items.magma_cream), + new ItemStack(Items.speckled_melon), + new ItemStack(Items.fish), + new ItemStack(Items.cooked_fished), + new ItemStack(Items.lead), + new ItemStack(Items.fishing_rod), + new ItemStack(Items.name_tag), + new ItemStack(Items.saddle), + new ItemStack(Items.diamond_horse_armor), + new ItemStack(Items.golden_horse_armor), + new ItemStack(Items.iron_horse_armor))); builder.addValidOreDictNames(builderOreDictNames); - builder.addValidItems(Arrays.asList( - new ItemStack(Blocks.torch), - new ItemStack(Blocks.redstone_torch), - new ItemStack(Blocks.redstone_lamp), - new ItemStack(Blocks.stonebrick, 1, OreDictionary.WILDCARD_VALUE), - new ItemStack(Blocks.sandstone, 1, 1), - new ItemStack(Blocks.sandstone, 1, 2), - new ItemStack(Blocks.brick_block), - new ItemStack(Blocks.clay), - new ItemStack(Blocks.hardened_clay, 1, OreDictionary.WILDCARD_VALUE), - new ItemStack(Blocks.stained_hardened_clay, 1, OreDictionary.WILDCARD_VALUE), - new ItemStack(Blocks.packed_ice), - new ItemStack(Blocks.nether_brick), - new ItemStack(Blocks.crafting_table), - new ItemStack(Blocks.furnace), - new ItemStack(Blocks.lever), - new ItemStack(Blocks.dispenser), - new ItemStack(Blocks.dropper), - new ItemStack(Blocks.ladder), - new ItemStack(Blocks.iron_bars), - new ItemStack(Blocks.quartz_block, 1, OreDictionary.WILDCARD_VALUE), - new ItemStack(Items.sign), - new ItemStack(Items.item_frame))); + builder.addValidItems( + Arrays.asList( + new ItemStack(Blocks.torch), + new ItemStack(Blocks.redstone_torch), + new ItemStack(Blocks.redstone_lamp), + new ItemStack(Blocks.stonebrick, 1, OreDictionary.WILDCARD_VALUE), + new ItemStack(Blocks.sandstone, 1, 1), + new ItemStack(Blocks.sandstone, 1, 2), + new ItemStack(Blocks.brick_block), + new ItemStack(Blocks.clay), + new ItemStack(Blocks.hardened_clay, 1, OreDictionary.WILDCARD_VALUE), + new ItemStack(Blocks.stained_hardened_clay, 1, OreDictionary.WILDCARD_VALUE), + new ItemStack(Blocks.packed_ice), + new ItemStack(Blocks.nether_brick), + new ItemStack(Blocks.crafting_table), + new ItemStack(Blocks.furnace), + new ItemStack(Blocks.lever), + new ItemStack(Blocks.dispenser), + new ItemStack(Blocks.dropper), + new ItemStack(Blocks.ladder), + new ItemStack(Blocks.iron_bars), + new ItemStack(Blocks.quartz_block, 1, OreDictionary.WILDCARD_VALUE), + new ItemStack(Items.sign), + new ItemStack(Items.item_frame))); BlockRegistryApiculture beeBlocks = PluginApiculture.blocks; if (beeBlocks != null) { @@ -437,13 +451,21 @@ public class PluginStorage extends ForestryPlugin { FluidStack water = Fluids.WATER.getFluid(Constants.CARPENTER_CRATING_LIQUID_QUANTITY); ItemStack box = items.crate.getItemStack(); RecipeManagers.carpenterManager.addRecipe( - Constants.CARPENTER_CRATING_CYCLES, water, box, crateStack, "###", "###", "###", '#', uncrated); + Constants.CARPENTER_CRATING_CYCLES, + water, + box, + crateStack, + "###", + "###", + "###", + '#', + uncrated); } private static void addUncrating(ItemStack crateStack, ItemStack uncrated) { ItemStack product = new ItemStack(uncrated.getItem(), 9, uncrated.getItemDamage()); - RecipeManagers.carpenterManager.addRecipe( - Constants.CARPENTER_UNCRATING_CYCLES, null, product, "#", '#', crateStack); + RecipeManagers.carpenterManager + .addRecipe(Constants.CARPENTER_UNCRATING_CYCLES, null, product, "#", '#', crateStack); } @Override @@ -530,7 +552,18 @@ public class PluginStorage extends ForestryPlugin { private static void addBackpackRecipe(Item backpack, Object material, Object chest) { RecipeUtil.addRecipe( - backpack, "X#X", "VYV", "X#X", '#', Blocks.wool, 'X', Items.string, 'V', material, 'Y', chest); + backpack, + "X#X", + "VYV", + "X#X", + '#', + Blocks.wool, + 'X', + Items.string, + 'V', + material, + 'Y', + chest); } private static void addT2BackpackRecipe(Item backpackT1, Item backpackT2) { diff --git a/src/main/java/forestry/plugins/compat/PluginAgriCraft.java b/src/main/java/forestry/plugins/compat/PluginAgriCraft.java index 62046f36d..45b03cf1a 100644 --- a/src/main/java/forestry/plugins/compat/PluginAgriCraft.java +++ b/src/main/java/forestry/plugins/compat/PluginAgriCraft.java @@ -1,16 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins.compat; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + import com.google.common.collect.ImmutableList; + import cpw.mods.fml.common.registry.GameRegistry; import forestry.api.core.ForestryAPI; import forestry.api.farming.Farmables; @@ -23,8 +25,6 @@ import forestry.farming.logic.FarmableReference; import forestry.plugins.ForestryPlugin; import forestry.plugins.Plugin; import forestry.plugins.PluginManager; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; @Plugin( pluginID = "AgriCraft", @@ -85,8 +85,8 @@ public class PluginAgriCraft extends ForestryPlugin { for (String seedName : seeds) { ItemStack seed = GameRegistry.findItemStack(AgriCraft, "seed" + seedName, 1); if (seed != null) { - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {seed}, Fluids.SEEDOIL.getFluid(seedamount)); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { seed }, Fluids.SEEDOIL.getFluid(seedamount)); } } diff --git a/src/main/java/forestry/plugins/compat/PluginBiomesOPlenty.java b/src/main/java/forestry/plugins/compat/PluginBiomesOPlenty.java index b30b58ca6..89df63c98 100644 --- a/src/main/java/forestry/plugins/compat/PluginBiomesOPlenty.java +++ b/src/main/java/forestry/plugins/compat/PluginBiomesOPlenty.java @@ -1,15 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins.compat; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + import cpw.mods.fml.common.event.FMLInterModComms; import cpw.mods.fml.common.registry.GameData; import cpw.mods.fml.common.registry.GameRegistry; @@ -31,12 +37,6 @@ import forestry.plugins.ForestryPlugin; import forestry.plugins.Plugin; import forestry.plugins.PluginCore; import forestry.plugins.PluginManager; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; @Plugin( pluginID = "BiomesOPlenty", @@ -109,12 +109,13 @@ public class PluginBiomesOPlenty extends ForestryPlugin { Item saplingItem = GameRegistry.findItem(BoP, key); String saplingName = GameData.getItemRegistry().getNameForObject(saplingItem); FMLInterModComms.sendMessage( - Constants.MOD, "add-farmable-sapling", String.format("farmArboreal@%s.-1", saplingName)); + Constants.MOD, + "add-farmable-sapling", + String.format("farmArboreal@%s.-1", saplingName)); } if (saplings != null && persimmon != null) { - Farmables.farmables - .get(FarmableReference.Arboreal.get()) + Farmables.farmables.get(FarmableReference.Arboreal.get()) .add(new FarmableGenericSapling(saplings, 15, persimmon)); } @@ -123,8 +124,7 @@ public class PluginBiomesOPlenty extends ForestryPlugin { Item boPTurnipSeeds = GameRegistry.findItem(BoP, "turnipSeeds"); ItemStack boPTurnipSeedStack = new ItemStack(boPTurnipSeeds, 1, 0); if (boPTurnipSeeds != null) { - Farmables.farmables - .get(FarmableReference.Vegetables.get()) + Farmables.farmables.get(FarmableReference.Vegetables.get()) .add(new FarmableGenericCrop(boPTurnipSeedStack, boPTurnip, 7)); } @@ -137,12 +137,16 @@ public class PluginBiomesOPlenty extends ForestryPlugin { if (saplings != null) { RecipeUtil.addFermenterRecipes( - new ItemStack(saplings, 1, OreDictionary.WILDCARD_VALUE), saplingYield, Fluids.BIOMASS); + new ItemStack(saplings, 1, OreDictionary.WILDCARD_VALUE), + saplingYield, + Fluids.BIOMASS); } if (colorizedSaplings != null) { RecipeUtil.addFermenterRecipes( - new ItemStack(colorizedSaplings, 1, OreDictionary.WILDCARD_VALUE), saplingYield, Fluids.BIOMASS); + new ItemStack(colorizedSaplings, 1, OreDictionary.WILDCARD_VALUE), + saplingYield, + Fluids.BIOMASS); } } @@ -153,26 +157,26 @@ public class PluginBiomesOPlenty extends ForestryPlugin { if (misc != null) { ItemStack pinecone = new ItemStack(misc, 1, 13); if (pinecone != null) { - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {pinecone}, Fluids.SEEDOIL.getFluid(3 * amount)); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { pinecone }, Fluids.SEEDOIL.getFluid(3 * amount)); } } if (food != null) { - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {new ItemStack(food)}, Fluids.JUICE.getFluid(50), mulch, 5); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { new ItemStack(food) }, Fluids.JUICE.getFluid(50), mulch, 5); } if (persimmon != null) { - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {persimmon}, Fluids.JUICE.getFluid(200), mulch, 20); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { persimmon }, Fluids.JUICE.getFluid(200), mulch, 20); } ItemStack boPTurnipSeedStack = GameRegistry.findItemStack(BoP, "turnipSeeds", 1); if (boPTurnipSeedStack != null) { if (PluginManager.Module.FACTORY.isEnabled()) { - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {boPTurnipSeedStack}, Fluids.SEEDOIL.getFluid(amount)); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { boPTurnipSeedStack }, Fluids.SEEDOIL.getFluid(amount)); } } } @@ -181,7 +185,11 @@ public class PluginBiomesOPlenty extends ForestryPlugin { Block flowers = GameRegistry.findBlock(BoP, "flowers"); if (flowers != null) { FlowerManager.flowerRegistry.registerPlantableFlower( - flowers, 0, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); // Clover + flowers, + 0, + 1.0, + FlowerManager.FlowerTypeVanilla, + FlowerManager.FlowerTypeSnow); // Clover FlowerManager.flowerRegistry.registerPlantableFlower( flowers, 1, @@ -189,12 +197,20 @@ public class PluginBiomesOPlenty extends ForestryPlugin { FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow, FlowerManager.FlowerTypeMushrooms); // Swampflower - // FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 2, 1.0, FlowerManager.FlowerTypeNether); - // //Deathbloom + // FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 2, 1.0, FlowerManager.FlowerTypeNether); + // //Deathbloom FlowerManager.flowerRegistry.registerPlantableFlower( - flowers, 3, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); // GlowFlower + flowers, + 3, + 1.0, + FlowerManager.FlowerTypeVanilla, + FlowerManager.FlowerTypeSnow); // GlowFlower FlowerManager.flowerRegistry.registerPlantableFlower( - flowers, 4, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); // Blue Hydrangea + flowers, + 4, + 1.0, + FlowerManager.FlowerTypeVanilla, + FlowerManager.FlowerTypeSnow); // Blue Hydrangea FlowerManager.flowerRegistry.registerPlantableFlower( flowers, 5, @@ -203,58 +219,89 @@ public class PluginBiomesOPlenty extends ForestryPlugin { FlowerManager.FlowerTypeSnow, FlowerManager.FlowerTypeJungle); // Orange Cosmos FlowerManager.flowerRegistry.registerPlantableFlower( - flowers, 6, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); // Pink Daffodil + flowers, + 6, + 1.0, + FlowerManager.FlowerTypeVanilla, + FlowerManager.FlowerTypeSnow); // Pink Daffodil FlowerManager.flowerRegistry.registerPlantableFlower( - flowers, 7, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); // WildFlower + flowers, + 7, + 1.0, + FlowerManager.FlowerTypeVanilla, + FlowerManager.FlowerTypeSnow); // WildFlower FlowerManager.flowerRegistry.registerPlantableFlower( - flowers, 8, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); // Violet + flowers, + 8, + 1.0, + FlowerManager.FlowerTypeVanilla, + FlowerManager.FlowerTypeSnow); // Violet FlowerManager.flowerRegistry.registerPlantableFlower( - flowers, 9, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); // White Anemone + flowers, + 9, + 1.0, + FlowerManager.FlowerTypeVanilla, + FlowerManager.FlowerTypeSnow); // White Anemone FlowerManager.flowerRegistry.registerPlantableFlower( - flowers, 10, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); // Waterlily + flowers, + 10, + 1.0, + FlowerManager.FlowerTypeVanilla, + FlowerManager.FlowerTypeSnow); // Waterlily FlowerManager.flowerRegistry.registerPlantableFlower( flowers, 11, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); // EnderLotus (does not actually spawn in the end) + FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 12, 1.0, FlowerManager.FlowerTypeCacti); // Bromeliad + FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 13, 1.0, FlowerManager.FlowerTypeNether); // EyeBulb + // FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 14, 1.0, FlowerManager.FlowerTypeNether); + // // Unlisted top of the eyebulb FlowerManager.flowerRegistry.registerPlantableFlower( - flowers, 12, 1.0, FlowerManager.FlowerTypeCacti); // Bromeliad - FlowerManager.flowerRegistry.registerPlantableFlower( - flowers, 13, 1.0, FlowerManager.FlowerTypeNether); // EyeBulb - // FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 14, 1.0, FlowerManager.FlowerTypeNether); - // // Unlisted top of the eyebulb - FlowerManager.flowerRegistry.registerPlantableFlower( - flowers, 15, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); // Dandelion Puff + flowers, + 15, + 1.0, + FlowerManager.FlowerTypeVanilla, + FlowerManager.FlowerTypeSnow); // Dandelion Puff } Block flowers2 = GameRegistry.findBlock(BoP, "flowers2"); if (flowers2 != null) { FlowerManager.flowerRegistry.registerPlantableFlower( - flowers2, 0, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeJungle); // Pink Hibiscus + flowers2, + 0, + 1.0, + FlowerManager.FlowerTypeVanilla, + FlowerManager.FlowerTypeJungle); // Pink Hibiscus + FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 1, 1.0, FlowerManager.FlowerTypeVanilla); // Lily + // of + // the + // Valley + FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 2, 1.0, FlowerManager.FlowerTypeNether); // Burning + // Blososm + FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 3, 1.0, FlowerManager.FlowerTypeVanilla); // Lavender + FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 4, 1.0, FlowerManager.FlowerTypeVanilla); // Goldenrod + FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 5, 1.0, FlowerManager.FlowerTypeVanilla); // Bluebells + FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 6, 1.0, FlowerManager.FlowerTypeVanilla); // Miner's + // delight FlowerManager.flowerRegistry.registerPlantableFlower( - flowers2, 1, 1.0, FlowerManager.FlowerTypeVanilla); // Lily of the Valley - FlowerManager.flowerRegistry.registerPlantableFlower( - flowers2, 2, 1.0, FlowerManager.FlowerTypeNether); // Burning Blososm - FlowerManager.flowerRegistry.registerPlantableFlower( - flowers2, 3, 1.0, FlowerManager.FlowerTypeVanilla); // Lavender - FlowerManager.flowerRegistry.registerPlantableFlower( - flowers2, 4, 1.0, FlowerManager.FlowerTypeVanilla); // Goldenrod - FlowerManager.flowerRegistry.registerPlantableFlower( - flowers2, 5, 1.0, FlowerManager.FlowerTypeVanilla); // Bluebells - FlowerManager.flowerRegistry.registerPlantableFlower( - flowers2, 6, 1.0, FlowerManager.FlowerTypeVanilla); // Miner's delight - FlowerManager.flowerRegistry.registerPlantableFlower( - flowers2, 7, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); // Icy Iris - FlowerManager.flowerRegistry.registerPlantableFlower( - flowers2, 8, 1.0, FlowerManager.FlowerTypeVanilla); // Rose + flowers2, + 7, + 1.0, + FlowerManager.FlowerTypeVanilla, + FlowerManager.FlowerTypeSnow); // Icy Iris + FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 8, 1.0, FlowerManager.FlowerTypeVanilla); // Rose } - // Toadstool 0 Portobello 1 Blue Milk cap 2 Glowshroom 3 flat mushroom 4 shadow shroom 5 'plants:12' tiny + // Toadstool 0 Portobello 1 Blue Milk cap 2 Glowshroom 3 flat mushroom 4 shadow shroom 5 'plants:12' tiny // cactus Block mushrooms = GameRegistry.findBlock(BoP, "mushrooms"); if (mushrooms != null) { FlowerManager.flowerRegistry.registerPlantableFlower( - mushrooms, OreDictionary.WILDCARD_VALUE, 1.0, FlowerManager.FlowerTypeMushrooms); + mushrooms, + OreDictionary.WILDCARD_VALUE, + 1.0, + FlowerManager.FlowerTypeMushrooms); FlowerManager.flowerRegistry.registerPlantableFlower(mushrooms, 3, 1.0, FlowerManager.FlowerTypeNether); } Block plants = GameRegistry.findBlock(BoP, "plants"); diff --git a/src/main/java/forestry/plugins/compat/PluginBuildCraftFuels.java b/src/main/java/forestry/plugins/compat/PluginBuildCraftFuels.java index 7388f36e8..02ba5af25 100644 --- a/src/main/java/forestry/plugins/compat/PluginBuildCraftFuels.java +++ b/src/main/java/forestry/plugins/compat/PluginBuildCraftFuels.java @@ -1,15 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins.compat; +import net.minecraftforge.fluids.Fluid; + import buildcraft.api.fuels.BuildcraftFuelRegistry; import buildcraft.api.fuels.ICoolant; import buildcraft.api.fuels.ICoolantManager; @@ -20,7 +20,6 @@ import forestry.core.fluids.Fluids; import forestry.core.utils.ModUtil; import forestry.plugins.ForestryPlugin; import forestry.plugins.Plugin; -import net.minecraftforge.fluids.Fluid; @Plugin( pluginID = "BC6|Fuels", @@ -52,8 +51,9 @@ public class PluginBuildCraftFuels extends ForestryPlugin { Fluid ethanol = Fluids.ETHANOL.getFluid(); if (ethanol != null) { int ethanolPower = 40; - int ethanolBurnTime = Math.round(Constants.ENGINE_CYCLE_DURATION_ETHANOL - * ForestryAPI.activeMode.getFloatSetting("fuel.ethanol.combustion")); + int ethanolBurnTime = Math.round( + Constants.ENGINE_CYCLE_DURATION_ETHANOL + * ForestryAPI.activeMode.getFloatSetting("fuel.ethanol.combustion")); BuildcraftFuelRegistry.fuel.addFuel(ethanol, ethanolPower, ethanolBurnTime); } } diff --git a/src/main/java/forestry/plugins/compat/PluginBuildCraftRecipes.java b/src/main/java/forestry/plugins/compat/PluginBuildCraftRecipes.java index 78076ed8b..9a23ca309 100644 --- a/src/main/java/forestry/plugins/compat/PluginBuildCraftRecipes.java +++ b/src/main/java/forestry/plugins/compat/PluginBuildCraftRecipes.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins.compat; @@ -40,7 +38,7 @@ public class PluginBuildCraftRecipes extends ForestryPlugin { @Override protected void registerRecipes() { // Add recipe for ethanol - BuildcraftRecipeRegistry.refinery.addRecipe( - "forestry:BiomassToEthanol", Fluids.BIOMASS.getFluid(4), Fluids.ETHANOL.getFluid(1), 100, 1); + BuildcraftRecipeRegistry.refinery + .addRecipe("forestry:BiomassToEthanol", Fluids.BIOMASS.getFluid(4), Fluids.ETHANOL.getFluid(1), 100, 1); } } diff --git a/src/main/java/forestry/plugins/compat/PluginBuildCraftStatements.java b/src/main/java/forestry/plugins/compat/PluginBuildCraftStatements.java index 468fd9f90..1e1709dfd 100644 --- a/src/main/java/forestry/plugins/compat/PluginBuildCraftStatements.java +++ b/src/main/java/forestry/plugins/compat/PluginBuildCraftStatements.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins.compat; +import java.util.Collection; + +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; + import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.ITriggerExternal; import buildcraft.api.statements.ITriggerInternal; @@ -20,9 +23,6 @@ import forestry.core.config.Constants; import forestry.core.utils.ModUtil; import forestry.plugins.ForestryPlugin; import forestry.plugins.Plugin; -import java.util.Collection; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; @Plugin( pluginID = "BC6|Statements", diff --git a/src/main/java/forestry/plugins/compat/PluginBuildCraftTransport.java b/src/main/java/forestry/plugins/compat/PluginBuildCraftTransport.java index 42f2a546a..98cb1230d 100644 --- a/src/main/java/forestry/plugins/compat/PluginBuildCraftTransport.java +++ b/src/main/java/forestry/plugins/compat/PluginBuildCraftTransport.java @@ -1,15 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins.compat; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + import cpw.mods.fml.common.registry.GameRegistry; import forestry.core.config.Constants; import forestry.core.recipes.RecipeUtil; @@ -18,8 +19,6 @@ import forestry.core.utils.ModUtil; import forestry.plugins.ForestryPlugin; import forestry.plugins.Plugin; import forestry.plugins.PluginCore; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; @Plugin( pluginID = "BC6|Transport", diff --git a/src/main/java/forestry/plugins/compat/PluginChisel.java b/src/main/java/forestry/plugins/compat/PluginChisel.java index 99c25fab0..be4c98955 100644 --- a/src/main/java/forestry/plugins/compat/PluginChisel.java +++ b/src/main/java/forestry/plugins/compat/PluginChisel.java @@ -1,16 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins.compat; import com.google.common.collect.ImmutableList; + import cpw.mods.fml.common.event.FMLInterModComms; import forestry.core.config.Constants; import forestry.core.utils.ModUtil; @@ -40,11 +39,11 @@ public class PluginChisel extends ForestryPlugin { @Override protected void registerRecipes() { - ImmutableList worldgenBlocks = - ImmutableList.of("granite", "limestone", "marble", "andesite", "diorite"); + ImmutableList worldgenBlocks = ImmutableList + .of("granite", "limestone", "marble", "andesite", "diorite"); for (String wBlocks : worldgenBlocks) { - FMLInterModComms.sendMessage( - Constants.MOD, "add-backpack-items", String.format("digger@%s:%s", Chisel, wBlocks)); + FMLInterModComms + .sendMessage(Constants.MOD, "add-backpack-items", String.format("digger@%s:%s", Chisel, wBlocks)); } } } diff --git a/src/main/java/forestry/plugins/compat/PluginEnderIO.java b/src/main/java/forestry/plugins/compat/PluginEnderIO.java index b16b883f7..d1c7d69fb 100644 --- a/src/main/java/forestry/plugins/compat/PluginEnderIO.java +++ b/src/main/java/forestry/plugins/compat/PluginEnderIO.java @@ -1,5 +1,8 @@ package forestry.plugins.compat; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraftforge.fluids.Fluid; + import cpw.mods.fml.common.event.FMLInterModComms; import forestry.api.core.ForestryAPI; import forestry.core.config.Constants; @@ -7,8 +10,6 @@ import forestry.core.fluids.Fluids; import forestry.core.utils.ModUtil; import forestry.plugins.ForestryPlugin; import forestry.plugins.Plugin; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.Fluid; @Plugin( pluginID = "EnderIO", @@ -44,8 +45,9 @@ public class PluginEnderIO extends ForestryPlugin { public void doInit() { Fluid ethanol = Fluids.ETHANOL.getFluid(); if (ethanol != null) { - int ethanolBurnTime = Math.round(Constants.ENGINE_CYCLE_DURATION_ETHANOL - * ForestryAPI.activeMode.getFloatSetting("fuel.ethanol.combustion")); + int ethanolBurnTime = Math.round( + Constants.ENGINE_CYCLE_DURATION_ETHANOL + * ForestryAPI.activeMode.getFloatSetting("fuel.ethanol.combustion")); addFuel(ethanol, 40, ethanolBurnTime); } diff --git a/src/main/java/forestry/plugins/compat/PluginErebus.java b/src/main/java/forestry/plugins/compat/PluginErebus.java index 5eceb04e8..8fc467e76 100644 --- a/src/main/java/forestry/plugins/compat/PluginErebus.java +++ b/src/main/java/forestry/plugins/compat/PluginErebus.java @@ -1,15 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins.compat; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.fluids.FluidStack; + import cpw.mods.fml.common.registry.GameRegistry; import forestry.api.recipes.RecipeManagers; import forestry.apiculture.items.EnumPropolis; @@ -20,9 +22,6 @@ import forestry.plugins.ForestryPlugin; import forestry.plugins.Plugin; import forestry.plugins.PluginApiculture; import forestry.plugins.PluginManager; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; @Plugin( pluginID = "Erebus", @@ -55,7 +54,7 @@ public class PluginErebus extends ForestryPlugin { if (PluginManager.Module.APICULTURE.isEnabled()) { remnants = PluginApiculture.items.propolis.get(EnumPropolis.NORMAL, 1); } - RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[] {honeyDrip}, honeyOutput, remnants, 5); + RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[] { honeyDrip }, honeyOutput, remnants, 5); } } } diff --git a/src/main/java/forestry/plugins/compat/PluginExtraUtilities.java b/src/main/java/forestry/plugins/compat/PluginExtraUtilities.java index 5c08c28ca..e2eb64b52 100644 --- a/src/main/java/forestry/plugins/compat/PluginExtraUtilities.java +++ b/src/main/java/forestry/plugins/compat/PluginExtraUtilities.java @@ -1,15 +1,18 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins.compat; +import java.util.ArrayList; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + import cpw.mods.fml.common.registry.GameRegistry; import forestry.api.circuits.ChipsetManager; import forestry.api.circuits.ICircuitLayout; @@ -28,9 +31,6 @@ import forestry.plugins.ForestryPlugin; import forestry.plugins.Plugin; import forestry.plugins.PluginCore; import forestry.plugins.PluginManager; -import java.util.ArrayList; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; @Plugin( pluginID = "ExtraUtilities", @@ -60,8 +60,7 @@ public class PluginExtraUtilities extends ForestryPlugin { Farmables.farmables.put(FarmableReference.Ender.get(), new ArrayList()); if (Config.isExUtilEnderLilyEnabled()) { Circuit.farmEnderManaged = new CircuitFarmLogic("managedEnder", FarmLogicEnder.class); - Farmables.farmables - .get(FarmableReference.Ender.get()) + Farmables.farmables.get(FarmableReference.Ender.get()) .add(new FarmableGenericCrop(new ItemStack(exUEnderLilly, 1, 0), exUEnderLilly, 7)); } } @@ -73,7 +72,9 @@ public class PluginExtraUtilities extends ForestryPlugin { if (PluginManager.Module.FARMING.isEnabled() && Config.isExUtilEnderLilyEnabled()) { ICircuitLayout layoutManaged = ChipsetManager.circuitRegistry.getLayout("forestry.farms.managed"); ChipsetManager.solderManager.addRecipe( - layoutManaged, PluginCore.items.tubes.get(EnumElectronTube.ENDER, 1), Circuit.farmEnderManaged); + layoutManaged, + PluginCore.items.tubes.get(EnumElectronTube.ENDER, 1), + Circuit.farmEnderManaged); } } } diff --git a/src/main/java/forestry/plugins/compat/PluginGrowthCraft.java b/src/main/java/forestry/plugins/compat/PluginGrowthCraft.java index c4c5b451e..629647363 100644 --- a/src/main/java/forestry/plugins/compat/PluginGrowthCraft.java +++ b/src/main/java/forestry/plugins/compat/PluginGrowthCraft.java @@ -1,16 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins.compat; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + import com.google.common.collect.ImmutableMap; + import cpw.mods.fml.common.registry.GameRegistry; import forestry.api.core.ForestryAPI; import forestry.api.farming.Farmables; @@ -27,9 +30,6 @@ import forestry.plugins.Plugin; import forestry.plugins.PluginApiculture; import forestry.plugins.PluginCore; import forestry.plugins.PluginManager; -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; @Plugin( pluginID = "Growthcraft", @@ -64,23 +64,23 @@ public class PluginGrowthCraft extends ForestryPlugin { ItemStack riceSeed = GameRegistry.findItemStack("Growthcraft|Rice", "grc.rice", 1); if (appleSeed != null) { - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {appleSeed}, Fluids.SEEDOIL.getFluid(seedamount)); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { appleSeed }, Fluids.SEEDOIL.getFluid(seedamount)); BackpackManager.backpackItems[2].add(appleSeed); } if (grapeSeed != null) { - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {grapeSeed}, Fluids.SEEDOIL.getFluid(seedamount)); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { grapeSeed }, Fluids.SEEDOIL.getFluid(seedamount)); BackpackManager.backpackItems[2].add(grapeSeed); } if (hopSeed != null) { - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {hopSeed}, Fluids.SEEDOIL.getFluid(seedamount)); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { hopSeed }, Fluids.SEEDOIL.getFluid(seedamount)); BackpackManager.backpackItems[2].add(hopSeed); } if (riceSeed != null) { - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {riceSeed}, Fluids.SEEDOIL.getFluid(seedamount)); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { riceSeed }, Fluids.SEEDOIL.getFluid(seedamount)); BackpackManager.backpackItems[2].add(riceSeed); } @@ -92,14 +92,12 @@ public class PluginGrowthCraft extends ForestryPlugin { } Block hopVine = GameRegistry.findBlock("Growthcraft|Hops", "grc.hopVine"); if (hopVine != null) { - Farmables.farmables - .get(FarmableReference.Orchard.get()) + Farmables.farmables.get(FarmableReference.Orchard.get()) .add(new FarmableBasicGrowthCraft(hopVine, 3, false, false)); // need custom fruit to weed out rope } Block riceBlock = GameRegistry.findBlock("Growthcraft|Rice", "grc.riceBlock"); if (riceBlock != null) { - Farmables.farmables - .get(FarmableReference.Orchard.get()) + Farmables.farmables.get(FarmableReference.Orchard.get()) .add(new FarmableBasicGrowthCraft(riceBlock, 7, true, false)); // need to set paddyfield to 7 } @@ -107,16 +105,19 @@ public class PluginGrowthCraft extends ForestryPlugin { Item comb = GameRegistry.findItem("Growthcraft|Bees", "grc.honeyComb"); if (comb != null) { ItemStack emptyComb = new ItemStack(comb, 1, 0); - RecipeManagers.centrifugeManager.addRecipe( - 20, emptyComb, ImmutableMap.of(PluginCore.items.beeswax.getItemStack(), 1.0f)); + RecipeManagers.centrifugeManager + .addRecipe(20, emptyComb, ImmutableMap.of(PluginCore.items.beeswax.getItemStack(), 1.0f)); ItemStack fullComb = new ItemStack(comb, 1, 1); RecipeManagers.centrifugeManager.addRecipe( 20, fullComb, ImmutableMap.of( - PluginCore.items.beeswax.getItemStack(), 1.0f, - PluginApiculture.items.honeyDrop.getItemStack(), 0.9f, - PluginApiculture.items.honeydew.getItemStack(), 0.1f)); + PluginCore.items.beeswax.getItemStack(), + 1.0f, + PluginApiculture.items.honeyDrop.getItemStack(), + 0.9f, + PluginApiculture.items.honeydew.getItemStack(), + 0.1f)); } } @@ -139,13 +140,13 @@ public class PluginGrowthCraft extends ForestryPlugin { ItemStack grapes = GameRegistry.findItemStack("Growthcraft|Grapes", "grc.grapes", 1); // squeeze if (grapes.getItem() != null) { - RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[] {grapes}, Fluids.JUICE.getFluid(juiceAmount)); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { grapes }, Fluids.JUICE.getFluid(juiceAmount)); BackpackManager.backpackItems[2].add(grapes); } Block grapeBlock = GameRegistry.findBlock("Growthcraft|Grapes", "grc.grapeBlock"); if (grapeBlock != null) { - Farmables.farmables - .get(FarmableReference.Orchard.get()) + Farmables.farmables.get(FarmableReference.Orchard.get()) .add(new FarmableBasicGrowthCraft(grapeBlock, 0, false, true)); } diff --git a/src/main/java/forestry/plugins/compat/PluginHarvestCraft.java b/src/main/java/forestry/plugins/compat/PluginHarvestCraft.java index d891d5e21..ab8c10276 100644 --- a/src/main/java/forestry/plugins/compat/PluginHarvestCraft.java +++ b/src/main/java/forestry/plugins/compat/PluginHarvestCraft.java @@ -1,16 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins.compat; +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; + import com.google.common.collect.ImmutableList; + import cpw.mods.fml.common.registry.GameRegistry; import forestry.api.core.ForestryAPI; import forestry.api.farming.Farmables; @@ -28,9 +31,6 @@ import forestry.plugins.ForestryPlugin; import forestry.plugins.Plugin; import forestry.plugins.PluginCore; import forestry.plugins.PluginManager; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; @Plugin( pluginID = "HarvestCraft", @@ -56,11 +56,11 @@ public class PluginHarvestCraft extends ForestryPlugin { @Override protected void registerRecipes() { - ImmutableList berries = - ImmutableList.of("cranberry", "blackberry", "blueberry", "raspberry", "strawberry"); + ImmutableList berries = ImmutableList + .of("cranberry", "blackberry", "blueberry", "raspberry", "strawberry"); - ImmutableList fruits = - ImmutableList.of("pineapple", "cactusfruit", "cantaloupe", "grape", "kiwi", "chilipepper"); + ImmutableList fruits = ImmutableList + .of("pineapple", "cactusfruit", "cantaloupe", "grape", "kiwi", "chilipepper"); ImmutableList treeFruits = ImmutableList.of( "banana", @@ -87,20 +87,20 @@ public class PluginHarvestCraft extends ForestryPlugin { ImmutableList trees = ImmutableList.of("nutmeg", "olive", "peppercorn"); - ImmutableList treesSpecial = ImmutableList.of( - "cinnamon", - "maple", - "paperbark", - "vanillabean", - "apple" // to prevent apples from getting double registered - ); + ImmutableList treesSpecial = ImmutableList.of("cinnamon", "maple", "paperbark", "vanillabean", "apple" // to + // prevent + // apples + // from + // getting + // double + // registered + ); ImmutableList herbs = ImmutableList.of("garlic"); - ImmutableList spices = ImmutableList.of( - "ginger", "spiceleaf", "curryleaf" - // "mustardseed" Mustard is inconsistent and annoying. - ); + ImmutableList spices = ImmutableList.of("ginger", "spiceleaf", "curryleaf" + // "mustardseed" Mustard is inconsistent and annoying. + ); ImmutableList vegetables = ImmutableList.of( "asparagus", @@ -142,14 +142,9 @@ public class PluginHarvestCraft extends ForestryPlugin { ImmutableList cropNuts = ImmutableList.of("peanut", "sesameseeds"); - ImmutableList nuts = ImmutableList.of( - "walnut", - "almond", - "cashew", - "chestnut", - "pecan", - "pistachio", - "cherry" // Cherries in forestry make seed oil + ImmutableList nuts = ImmutableList + .of("walnut", "almond", "cashew", "chestnut", "pecan", "pistachio", "cherry" // Cherries in forestry + // make seed oil ); ImmutableList.Builder genericCropsBuilder = ImmutableList.builder(); @@ -177,16 +172,15 @@ public class PluginHarvestCraft extends ForestryPlugin { ItemStack berrySeed = GameRegistry.findItemStack(HC, berryName + "seedItem", 1); Block berryBlock = GameRegistry.findBlock(HC, "pam" + berryName + "Crop"); if (berry != null) { - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {berry}, Fluids.JUICE.getFluid(juiceAmount)); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { berry }, Fluids.JUICE.getFluid(juiceAmount)); } if (berrySeed != null) { - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {berrySeed}, Fluids.SEEDOIL.getFluid(seedamount)); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { berrySeed }, Fluids.SEEDOIL.getFluid(seedamount)); } if (PluginManager.Module.FARMING.isEnabled() && berrySeed != null && berryBlock != null) { - Farmables.farmables - .get(FarmableReference.Wheat.get()) + Farmables.farmables.get(FarmableReference.Wheat.get()) .add(new FarmableGenericCrop(berrySeed, berryBlock, 7)); Farmables.farmables.get(FarmableReference.Orchard.get()).add(new FarmableBasicFruit(berryBlock, 7)); } @@ -199,35 +193,33 @@ public class PluginHarvestCraft extends ForestryPlugin { ItemStack fruitSeed = GameRegistry.findItemStack(HC, fruitName + "seedItem", 1); Block fruitBlock = GameRegistry.findBlock(HC, "pam" + fruitName + "Crop"); if (fruit != null) { - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {fruit}, Fluids.JUICE.getFluid(juiceAmount)); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { fruit }, Fluids.JUICE.getFluid(juiceAmount)); } if (fruitSeed != null) { - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {fruitSeed}, Fluids.SEEDOIL.getFluid(seedamount)); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { fruitSeed }, Fluids.SEEDOIL.getFluid(seedamount)); } if (PluginManager.Module.FARMING.isEnabled() && fruitSeed != null && fruitBlock != null) { - Farmables.farmables - .get(FarmableReference.Wheat.get()) + Farmables.farmables.get(FarmableReference.Wheat.get()) .add(new FarmableGenericCrop(fruitSeed, fruitBlock, 7)); Farmables.farmables.get(FarmableReference.Orchard.get()).add(new FarmableBasicFruit(fruitBlock, 7)); } plants.add(fruitName); } - juiceAmount = - ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.apple") / 2; // vegetables produce less juice + juiceAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.apple") / 2; // vegetables produce less + // juice juiceAmount = Math.max(juiceAmount, 1); // Produce at least 1 mb of juice. for (String vegetableName : vegetables) { ItemStack vegetableSeed = GameRegistry.findItemStack(HC, vegetableName + "seedItem", 1); Block vegetableBlock = GameRegistry.findBlock(HC, "pam" + vegetableName + "Crop"); if (vegetableSeed != null) { - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {vegetableSeed}, Fluids.SEEDOIL.getFluid(seedamount)); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { vegetableSeed }, Fluids.SEEDOIL.getFluid(seedamount)); } if (PluginManager.Module.FARMING.isEnabled() && vegetableSeed != null && vegetableBlock != null) { - Farmables.farmables - .get(FarmableReference.Vegetables.get()) + Farmables.farmables.get(FarmableReference.Vegetables.get()) .add(new FarmableGenericCrop(vegetableSeed, vegetableBlock, 7)); Farmables.farmables.get(FarmableReference.Orchard.get()).add(new FarmableBasicFruit(vegetableBlock, 7)); } @@ -240,17 +232,16 @@ public class PluginHarvestCraft extends ForestryPlugin { Block grainBlock = GameRegistry.findBlock(HC, "pam" + grainName + "Crop"); if (grain != null && wheatamount.stackSize > 0) { RecipeUtil.addRecipe(wheatamount, " X ", "X#X", " X ", '#', Blocks.dirt, 'X', grain); - FuelManager.moistenerResource.put( - grain, new MoistenerFuel(grain, PluginCore.items.mouldyWheat.getItemStack(), 0, 300)); + FuelManager.moistenerResource + .put(grain, new MoistenerFuel(grain, PluginCore.items.mouldyWheat.getItemStack(), 0, 300)); } if (grainSeed != null) { - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {grainSeed}, Fluids.SEEDOIL.getFluid(seedamount)); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { grainSeed }, Fluids.SEEDOIL.getFluid(seedamount)); RecipeManagers.moistenerManager.addRecipe(grainSeed, new ItemStack(Blocks.mycelium), 5000); } if (PluginManager.Module.FARMING.isEnabled() && grainSeed != null && grainBlock != null) { - Farmables.farmables - .get(FarmableReference.Wheat.get()) + Farmables.farmables.get(FarmableReference.Wheat.get()) .add(new FarmableGenericCrop(grainSeed, grainBlock, 7)); Farmables.farmables.get(FarmableReference.Orchard.get()).add(new FarmableBasicFruit(grainBlock, 7)); } @@ -260,20 +251,21 @@ public class PluginHarvestCraft extends ForestryPlugin { for (String treeFruitName : treeFruits) { ItemStack treeFruit = GameRegistry.findItemStack(HC, treeFruitName + "Item", 1); Block treeFruitBlock = GameRegistry.findBlock( - HC, "pam" + (Character.toUpperCase(treeFruitName.charAt(0)) + treeFruitName.substring(1))); + HC, + "pam" + (Character.toUpperCase(treeFruitName.charAt(0)) + treeFruitName.substring(1))); if (PluginManager.Module.FARMING.isEnabled() && treeFruitBlock != null) { Farmables.farmables.get(FarmableReference.Orchard.get()).add(new FarmableBasicFruit(treeFruitBlock, 2)); } if (treeFruit != null) { - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {treeFruit}, Fluids.JUICE.getFluid(juiceAmount)); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { treeFruit }, Fluids.JUICE.getFluid(juiceAmount)); } plants.add(treeFruitName); } for (String treeName : trees) { - Block fruitBlock = GameRegistry.findBlock( - HC, "pam" + (Character.toUpperCase(treeName.charAt(0)) + treeName.substring(1))); + Block fruitBlock = GameRegistry + .findBlock(HC, "pam" + (Character.toUpperCase(treeName.charAt(0)) + treeName.substring(1))); if (PluginManager.Module.FARMING.isEnabled() && fruitBlock != null) { Farmables.farmables.get(FarmableReference.Orchard.get()).add(new FarmableBasicFruit(fruitBlock, 2)); } @@ -281,8 +273,8 @@ public class PluginHarvestCraft extends ForestryPlugin { } for (String treeName : treesSpecial) { - Block fruitBlock = GameRegistry.findBlock( - HC, "pam" + (Character.toUpperCase(treeName.charAt(0)) + treeName.substring(1))); + Block fruitBlock = GameRegistry + .findBlock(HC, "pam" + (Character.toUpperCase(treeName.charAt(0)) + treeName.substring(1))); if (PluginManager.Module.FARMING.isEnabled() && fruitBlock != null) { Farmables.farmables.get(FarmableReference.Orchard.get()).add(new FarmableBasicFruit(fruitBlock, 2)); } @@ -292,15 +284,13 @@ public class PluginHarvestCraft extends ForestryPlugin { ItemStack genericCropSeed = GameRegistry.findItemStack(HC, cropName + "seedItem", 1); Block genericCropBlock = GameRegistry.findBlock(HC, "pam" + cropName + "Crop"); if (genericCropSeed != null) { - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {genericCropSeed}, Fluids.SEEDOIL.getFluid(seedamount)); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { genericCropSeed }, Fluids.SEEDOIL.getFluid(seedamount)); } if (PluginManager.Module.FARMING.isEnabled() && genericCropSeed != null && genericCropBlock != null) { - Farmables.farmables - .get(FarmableReference.Wheat.get()) + Farmables.farmables.get(FarmableReference.Wheat.get()) .add(new FarmableGenericCrop(genericCropSeed, genericCropBlock, 7)); - Farmables.farmables - .get(FarmableReference.Orchard.get()) + Farmables.farmables.get(FarmableReference.Orchard.get()) .add(new FarmableBasicFruit(genericCropBlock, 7)); } plants.add(cropName); @@ -310,25 +300,28 @@ public class PluginHarvestCraft extends ForestryPlugin { Block mustardCropBlock = GameRegistry.findBlock(HC, "pam" + "mustardseeds" + "Crop"); ItemStack mustardFruit = GameRegistry.findItemStack(HC, "mustard" + "seedsItem", 1); if (mustardCropSeed != null) { - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {mustardCropSeed}, Fluids.SEEDOIL.getFluid(seedamount)); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { mustardCropSeed }, Fluids.SEEDOIL.getFluid(seedamount)); } if (PluginManager.Module.FARMING.isEnabled() && mustardCropSeed != null && mustardCropBlock != null) { - Farmables.farmables - .get(FarmableReference.Wheat.get()) + Farmables.farmables.get(FarmableReference.Wheat.get()) .add(new FarmableGenericCrop(mustardCropSeed, mustardCropBlock, 7)); Farmables.farmables.get(FarmableReference.Orchard.get()).add(new FarmableBasicFruit(mustardCropBlock, 7)); } if (mustardFruit != null) { RecipeUtil.addFermenterRecipes( - mustardFruit, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat"), Fluids.BIOMASS); + mustardFruit, + ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat"), + Fluids.BIOMASS); } for (String plantName : plants.build()) { ItemStack plant = GameRegistry.findItemStack(HC, plantName + "Item", 1); if (plant != null) { RecipeUtil.addFermenterRecipes( - plant, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat"), Fluids.BIOMASS); + plant, + ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat"), + Fluids.BIOMASS); } } @@ -337,44 +330,48 @@ public class PluginHarvestCraft extends ForestryPlugin { ItemStack cropnutSeed = GameRegistry.findItemStack(HC, cropnutName + "seedItem", 1); Block cropnutBlock = GameRegistry.findBlock(HC, "pam" + cropnutName + "Crop"); if (cropnutSeed != null) { - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {cropnutSeed}, Fluids.SEEDOIL.getFluid(seedamount)); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { cropnutSeed }, Fluids.SEEDOIL.getFluid(seedamount)); } if (PluginManager.Module.FARMING.isEnabled() && cropnutSeed != null && cropnutBlock != null) { - Farmables.farmables - .get(FarmableReference.Wheat.get()) + Farmables.farmables.get(FarmableReference.Wheat.get()) .add(new FarmableGenericCrop(cropnutSeed, cropnutBlock, 7)); Farmables.farmables.get(FarmableReference.Orchard.get()).add(new FarmableBasicFruit(cropnutBlock, 7)); } if (cropnut != null) { - RecipeManagers.squeezerManager.addRecipe( - 20, new ItemStack[] {cropnut}, Fluids.SEEDOIL.getFluid(12 * seedamount)); + RecipeManagers.squeezerManager + .addRecipe(20, new ItemStack[] { cropnut }, Fluids.SEEDOIL.getFluid(12 * seedamount)); } } for (String nutName : nuts) { ItemStack nut = GameRegistry.findItemStack(HC, nutName + "Item", 1); - Block nutBlock = GameRegistry.findBlock( - HC, "pam" + (Character.toUpperCase(nutName.charAt(0)) + nutName.substring(1))); + Block nutBlock = GameRegistry + .findBlock(HC, "pam" + (Character.toUpperCase(nutName.charAt(0)) + nutName.substring(1))); if (PluginManager.Module.FARMING.isEnabled() && nutBlock != null) { Farmables.farmables.get(FarmableReference.Orchard.get()).add(new FarmableBasicFruit(nutBlock, 2)); } if (nut != null) { - RecipeManagers.squeezerManager.addRecipe( - 20, new ItemStack[] {nut}, Fluids.SEEDOIL.getFluid(15 * seedamount)); + RecipeManagers.squeezerManager + .addRecipe(20, new ItemStack[] { nut }, Fluids.SEEDOIL.getFluid(15 * seedamount)); } } ItemStack hcHoneyItem = GameRegistry.findItemStack(HC, "honeyItem", 1); if (hcHoneyItem != null) { RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {hcHoneyItem}, Fluids.HONEY.getFluid(Constants.FLUID_PER_HONEY_DROP)); + 10, + new ItemStack[] { hcHoneyItem }, + Fluids.HONEY.getFluid(Constants.FLUID_PER_HONEY_DROP)); } ItemStack hcBeeswaxItem = GameRegistry.findItemStack(HC, "beeswaxItem", 1); if (hcBeeswaxItem != null) { RecipeUtil.addRecipe( - ForestryAPI.activeMode.getStackSetting("recipe.output.capsule"), "XXX ", 'X', hcBeeswaxItem); + ForestryAPI.activeMode.getStackSetting("recipe.output.capsule"), + "XXX ", + 'X', + hcBeeswaxItem); } // Recipe registering for Pam's Harvest the Nether @@ -384,26 +381,24 @@ public class PluginHarvestCraft extends ForestryPlugin { Block genericNetherCropBlock = GameRegistry.findBlock(HCN, netherCropName + "Crop"); if (genericNetherCropSeed != null) { RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {genericNetherCropSeed}, Fluids.SEEDOIL.getFluid(seedamount)); + 10, + new ItemStack[] { genericNetherCropSeed }, + Fluids.SEEDOIL.getFluid(seedamount)); } - if (PluginManager.Module.FARMING.isEnabled() - && genericNetherCropSeed != null + if (PluginManager.Module.FARMING.isEnabled() && genericNetherCropSeed != null && genericNetherCropBlock != null) { // Add all crops to orchard farms - Farmables.farmables - .get(FarmableReference.Orchard.get()) + Farmables.farmables.get(FarmableReference.Orchard.get()) .add(new FarmableBasicFruit(genericNetherCropBlock, 7)); if (netherCropName == "glowflower") { // Add glowflowers to managed and manual crop farms - Farmables.farmables - .get(FarmableReference.Wheat.get()) + Farmables.farmables.get(FarmableReference.Wheat.get()) .add(new FarmableGenericCrop(genericNetherCropSeed, genericNetherCropBlock, 7)); } else { // Add every other crop to infernal farms, since they only grow on soul sand - Farmables.farmables - .get(FarmableReference.Infernal.get()) + Farmables.farmables.get(FarmableReference.Infernal.get()) .add(new FarmableGenericCrop(genericNetherCropSeed, genericNetherCropBlock, 7)); } } diff --git a/src/main/java/forestry/plugins/compat/PluginIC2.java b/src/main/java/forestry/plugins/compat/PluginIC2.java index 2ee521682..37f41419a 100644 --- a/src/main/java/forestry/plugins/compat/PluginIC2.java +++ b/src/main/java/forestry/plugins/compat/PluginIC2.java @@ -1,16 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins.compat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.EnumSet; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.fluids.FluidRegistry; +import net.minecraftforge.fluids.FluidStack; + import com.google.common.collect.ImmutableMap; + import cpw.mods.fml.common.Optional; import cpw.mods.fml.common.event.FMLInterModComms; import cpw.mods.fml.common.registry.GameData; @@ -58,15 +68,6 @@ import ic2.api.crops.ICropTile; import ic2.api.item.IC2Items; import ic2.api.recipe.RecipeInputItemStack; import ic2.api.recipe.Recipes; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.EnumSet; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; @Plugin( pluginID = "IC2", @@ -129,7 +130,8 @@ public class PluginIC2 extends ForestryPlugin { BlockRegistryEnergy energyBlocks = PluginEnergy.blocks; if (energyBlocks != null) { energyBlocks.engine.addDefinitions( - new EngineDefinition(BlockEngineType.ELECTRIC), new EngineDefinition(BlockEngineType.GENERATOR)); + new EngineDefinition(BlockEngineType.ELECTRIC), + new EngineDefinition(BlockEngineType.GENERATOR)); } emptyCell = IC2Items.getItem("cell"); @@ -249,7 +251,9 @@ public class PluginIC2 extends ForestryPlugin { if (plantBall != null) { RecipeUtil.addFermenterRecipes( - plantBall, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat") * 9, Fluids.BIOMASS); + plantBall, + ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat") * 9, + Fluids.BIOMASS); } if (compressedPlantBall != null) { RecipeUtil.addFermenterRecipes( @@ -261,8 +265,8 @@ public class PluginIC2 extends ForestryPlugin { if (PluginManager.Module.APICULTURE.isEnabled()) { if (resin != null) { ItemRegistryApiculture beeItems = PluginApiculture.items; - RecipeManagers.centrifugeManager.addRecipe( - 20, beeItems.propolis.get(EnumPropolis.NORMAL, 1), ImmutableMap.of(resin, 1.0f)); + RecipeManagers.centrifugeManager + .addRecipe(20, beeItems.propolis.get(EnumPropolis.NORMAL, 1), ImmutableMap.of(resin, 1.0f)); } else { Log.fine("Missing IC2 resin, skipping centrifuge recipe for propolis to resin."); } @@ -270,7 +274,9 @@ public class PluginIC2 extends ForestryPlugin { if (rubbersapling != null) { RecipeUtil.addFermenterRecipes( - rubbersapling, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.sapling"), Fluids.BIOMASS); + rubbersapling, + ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.sapling"), + Fluids.BIOMASS); } else { Log.fine("Missing IC2 rubber sapling, skipping fermenter recipe for converting rubber sapling to biomass."); } @@ -280,7 +286,10 @@ public class PluginIC2 extends ForestryPlugin { String resinName = GameData.getItemRegistry().getNameForObject(resin.getItem()); String imc = String.format( "farmArboreal@%s.%s.%s.%s", - saplingName, rubbersapling.getItemDamage(), resinName, resin.getItemDamage()); + saplingName, + rubbersapling.getItemDamage(), + resinName, + resin.getItemDamage()); Log.finest("Sending IMC '%s'.", imc); FMLInterModComms.sendMessage(Constants.MOD, "add-farmable-sapling", imc); } @@ -308,25 +317,35 @@ public class PluginIC2 extends ForestryPlugin { // / Solder Manager ChipsetManager.solderManager.addRecipe( - layout, PluginCore.items.tubes.get(EnumElectronTube.COPPER, 1), Circuit.energyElectricChoke1); + layout, + PluginCore.items.tubes.get(EnumElectronTube.COPPER, 1), + Circuit.energyElectricChoke1); + ChipsetManager.solderManager + .addRecipe(layout, PluginCore.items.tubes.get(EnumElectronTube.TIN, 1), Circuit.energyElectricBoost1); ChipsetManager.solderManager.addRecipe( - layout, PluginCore.items.tubes.get(EnumElectronTube.TIN, 1), Circuit.energyElectricBoost1); + layout, + PluginCore.items.tubes.get(EnumElectronTube.BRONZE, 1), + Circuit.energyElectricBoost2); ChipsetManager.solderManager.addRecipe( - layout, PluginCore.items.tubes.get(EnumElectronTube.BRONZE, 1), Circuit.energyElectricBoost2); - ChipsetManager.solderManager.addRecipe( - layout, PluginCore.items.tubes.get(EnumElectronTube.IRON, 1), Circuit.energyElectricEfficiency1); + layout, + PluginCore.items.tubes.get(EnumElectronTube.IRON, 1), + Circuit.energyElectricEfficiency1); if (PluginManager.Module.FARMING.isEnabled() && resin != null && rubberwood != null) { ICircuitLayout layoutManual = ChipsetManager.circuitRegistry.getLayout("forestry.farms.manual"); ChipsetManager.solderManager.addRecipe( - layoutManual, PluginCore.items.tubes.get(EnumElectronTube.RUBBER, 1), Circuit.farmRubberManual); + layoutManual, + PluginCore.items.tubes.get(EnumElectronTube.RUBBER, 1), + Circuit.farmRubberManual); } Block ic2Crop = GameRegistry.findBlock("IC2", "blockCrop"); if (PluginManager.Module.FARMING.isEnabled() && ic2Crop != null) { ICircuitLayout layoutManaged = ChipsetManager.circuitRegistry.getLayout("forestry.farms.manual"); ChipsetManager.solderManager.addRecipe( - layoutManaged, PluginCore.items.tubes.get(EnumElectronTube.URANIUM, 1), Circuit.farmIC2CropsManual); + layoutManaged, + PluginCore.items.tubes.get(EnumElectronTube.URANIUM, 1), + Circuit.farmIC2CropsManual); Farmables.farmables.put(FarmableReference.IC2Crops.get(), new ArrayList<>()); Farmables.farmables.get(FarmableReference.IC2Crops.get()).add(new FarmableBasicIC2Crop()); } @@ -363,6 +382,7 @@ public class PluginIC2 extends ForestryPlugin { /** * Check if there is an instance of ICropTile. + * * @param tileEntity tile entity to be checked. * @return true if there is an IC2 crop and false otherwise. */ @@ -373,6 +393,7 @@ public class PluginIC2 extends ForestryPlugin { /** * Check if an IC2 crop is ready to be harvested. + * * @param tileEntity tile entity to be checked. * @return true if crop size is optimal for harvest and false otherwise. */ @@ -390,6 +411,7 @@ public class PluginIC2 extends ForestryPlugin { /** * Perform some of the actions of the crop-matron. + * * @param tileEntity */ @Optional.Method(modid = "IC2") @@ -397,12 +419,9 @@ public class PluginIC2 extends ForestryPlugin { if (isIC2Crop(tileEntity)) { ICropTile crop = (ICropTile) tileEntity; /* - This part might be unbalanced until a custom farm logic is added and makes use of weed-ex. - if (crop.getCrop() != null) { - if (crop.getCrop().isWeed(crop)) { - crop.reset(); - } - }*/ + * This part might be unbalanced until a custom farm logic is added and makes use of weed-ex. if + * (crop.getCrop() != null) { if (crop.getCrop().isWeed(crop)) { crop.reset(); } } + */ if (crop.getHydrationStorage() <= 200) { crop.setHydrationStorage(200); } @@ -413,8 +432,9 @@ public class PluginIC2 extends ForestryPlugin { } /** - * This function takes care of everything related to the harvesting of the - * crop meaning it will calculate the drops and also do setSizeAfterHarvest(). + * This function takes care of everything related to the harvesting of the crop meaning it will calculate the drops + * and also do setSizeAfterHarvest(). + * * @param tileEntity tile entity to be checked. * @return arraylist containing the drops. */ diff --git a/src/main/java/forestry/plugins/compat/PluginImmersiveEngineering.java b/src/main/java/forestry/plugins/compat/PluginImmersiveEngineering.java index 0659b043f..e6bb1e167 100644 --- a/src/main/java/forestry/plugins/compat/PluginImmersiveEngineering.java +++ b/src/main/java/forestry/plugins/compat/PluginImmersiveEngineering.java @@ -1,15 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins.compat; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + import cpw.mods.fml.common.registry.GameRegistry; import forestry.api.core.ForestryAPI; import forestry.api.farming.Farmables; @@ -21,8 +22,6 @@ import forestry.farming.logic.FarmableGenericCrop; import forestry.farming.logic.FarmableReference; import forestry.plugins.ForestryPlugin; import forestry.plugins.Plugin; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; @Plugin( pluginID = "ImmersiveEngineering", @@ -52,10 +51,9 @@ public class PluginImmersiveEngineering extends ForestryPlugin { ItemStack hempFiber = new ItemStack(GameRegistry.findItem(ImEng, "material"), 1, 3); int seedAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.seed"); if (hempSeed != null && hempCrop != null) { - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {hempSeed}, Fluids.SEEDOIL.getFluid(seedAmount)); - Farmables.farmables - .get(FarmableReference.Wheat.get()) + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { hempSeed }, Fluids.SEEDOIL.getFluid(seedAmount)); + Farmables.farmables.get(FarmableReference.Wheat.get()) .add(new FarmableGenericCrop(hempSeed, hempCrop, 4, hempFiber)); } } diff --git a/src/main/java/forestry/plugins/compat/PluginMagicalCrops.java b/src/main/java/forestry/plugins/compat/PluginMagicalCrops.java index 64d21af91..41b2b51c2 100644 --- a/src/main/java/forestry/plugins/compat/PluginMagicalCrops.java +++ b/src/main/java/forestry/plugins/compat/PluginMagicalCrops.java @@ -1,16 +1,20 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins.compat; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + import com.google.common.collect.ImmutableList; + import cpw.mods.fml.common.registry.GameRegistry; import forestry.api.core.ForestryAPI; import forestry.api.farming.Farmables; @@ -24,10 +28,6 @@ import forestry.farming.logic.FarmableGenericCrop; import forestry.farming.logic.FarmableReference; import forestry.plugins.ForestryPlugin; import forestry.plugins.Plugin; -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; @Plugin( pluginID = "MagicalCrops", @@ -102,8 +102,8 @@ public class PluginMagicalCrops extends ForestryPlugin { "Sulfur", "Darkiron"); - ImmutableList soulSeeds = - ImmutableList.of("Cow", "Creeper", "Magma", "Skeleton", "Slime", "Spider", "Ghast", "Wither"); + ImmutableList soulSeeds = ImmutableList + .of("Cow", "Creeper", "Magma", "Skeleton", "Slime", "Spider", "Ghast", "Wither"); ImmutableList potionSeeds = ImmutableList.of("Fire", "Water", "Strength", "Regen", "Night", "Speed"); @@ -234,10 +234,15 @@ public class PluginMagicalCrops extends ForestryPlugin { if (cropProduce != null) { int juiceAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.apple"); ItemStack produce = new ItemStack( - GameRegistry.findItem(MagCrop, MagCrop + "_CropProduce"), 1, OreDictionary.WILDCARD_VALUE); + GameRegistry.findItem(MagCrop, MagCrop + "_CropProduce"), + 1, + OreDictionary.WILDCARD_VALUE); RecipeUtil.addFermenterRecipes( - produce, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat"), Fluids.BIOMASS); - RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[] {produce}, Fluids.JUICE.getFluid(juiceAmount)); + produce, + ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat"), + Fluids.BIOMASS); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { produce }, Fluids.JUICE.getFluid(juiceAmount)); } } @@ -245,7 +250,8 @@ public class PluginMagicalCrops extends ForestryPlugin { ItemStack seed = GameRegistry.findItemStack(MagCrop, MagCrop + seedPrefix + name, 1); Block crop = GameRegistry.findBlock(MagCrop, MagCrop + cropPrefix + name); if (seed != null) { - RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[] {seed}, Fluids.SEEDOIL.getFluid(fluidAmount)); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { seed }, Fluids.SEEDOIL.getFluid(fluidAmount)); } if (seed != null && crop != null && Config.isMagicalCropsSupportEnabled()) { Farmables.farmables.get(FarmableReference.Wheat.get()).add(new FarmableGenericCrop(seed, crop, 7)); diff --git a/src/main/java/forestry/plugins/compat/PluginMineFactoryReloaded.java b/src/main/java/forestry/plugins/compat/PluginMineFactoryReloaded.java index 4966758e7..ae6f99bd5 100644 --- a/src/main/java/forestry/plugins/compat/PluginMineFactoryReloaded.java +++ b/src/main/java/forestry/plugins/compat/PluginMineFactoryReloaded.java @@ -1,16 +1,19 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins.compat; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + import com.google.common.collect.ImmutableMap; + import cpw.mods.fml.common.event.FMLInterModComms; import cpw.mods.fml.common.registry.GameData; import cpw.mods.fml.common.registry.GameRegistry; @@ -26,9 +29,6 @@ import forestry.plugins.ForestryPlugin; import forestry.plugins.Plugin; import forestry.plugins.PluginApiculture; import forestry.plugins.PluginManager; -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; @Plugin( pluginID = "MinefactoryReloaded", @@ -61,16 +61,20 @@ public class PluginMineFactoryReloaded extends ForestryPlugin { if (PluginManager.Module.APICULTURE.isEnabled() && !PluginManager.Module.INDUSTRIALCRAFT.isEnabled()) { if (rubberRaw != null) { ItemRegistryApiculture beeItems = PluginApiculture.items; - RecipeManagers.centrifugeManager.addRecipe( - 20, beeItems.propolis.get(EnumPropolis.NORMAL, 1), ImmutableMap.of(rubberRaw, 1.0f)); + RecipeManagers.centrifugeManager + .addRecipe(20, beeItems.propolis.get(EnumPropolis.NORMAL, 1), ImmutableMap.of(rubberRaw, 1.0f)); } } if (rubbersapling != null && rubberRaw != null) { RecipeUtil.addFermenterRecipes( - saplingStack, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.sapling"), Fluids.BIOMASS); + saplingStack, + ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.sapling"), + Fluids.BIOMASS); String saplingName = GameData.getItemRegistry().getNameForObject(saplingItem); FMLInterModComms.sendMessage( - Constants.MOD, "add-farmable-sapling", String.format("farmArboreal@%s.-1", saplingName)); + Constants.MOD, + "add-farmable-sapling", + String.format("farmArboreal@%s.-1", saplingName)); } } } diff --git a/src/main/java/forestry/plugins/compat/PluginNatura.java b/src/main/java/forestry/plugins/compat/PluginNatura.java index 4bb72a48c..9da2281a5 100644 --- a/src/main/java/forestry/plugins/compat/PluginNatura.java +++ b/src/main/java/forestry/plugins/compat/PluginNatura.java @@ -1,15 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins.compat; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.block.Block; +import net.minecraft.init.Blocks; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + import cpw.mods.fml.common.event.FMLInterModComms; import cpw.mods.fml.common.registry.GameData; import cpw.mods.fml.common.registry.GameRegistry; @@ -29,13 +36,6 @@ import forestry.farming.logic.FarmableReference; import forestry.plugins.ForestryPlugin; import forestry.plugins.Plugin; import forestry.plugins.PluginCore; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; @Plugin( pluginID = "Natura", @@ -97,11 +97,15 @@ public class PluginNatura extends ForestryPlugin { ItemStack saplingWild = new ItemStack(saplingItem, 1, OreDictionary.WILDCARD_VALUE); RecipeUtil.addFermenterRecipes( - saplingWild, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.sapling"), Fluids.BIOMASS); + saplingWild, + ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.sapling"), + Fluids.BIOMASS); String saplingName = GameData.getItemRegistry().getNameForObject(saplingItem); FMLInterModComms.sendMessage( - Constants.MOD, "add-farmable-sapling", String.format("farmArboreal@%s.-1", saplingName)); + Constants.MOD, + "add-farmable-sapling", + String.format("farmArboreal@%s.-1", saplingName)); } berryBlight = GameRegistry.findItemStack(NATURA, "berryBlight", 1); @@ -218,7 +222,8 @@ public class PluginNatura extends ForestryPlugin { int amount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.seed"); for (ItemStack aSeedList : seedList) { - RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[] {aSeedList}, Fluids.SEEDOIL.getFluid(amount)); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { aSeedList }, Fluids.SEEDOIL.getFluid(amount)); } Block cropBlock = GameRegistry.findBlock(NATURA, "N Crops"); @@ -257,7 +262,7 @@ public class PluginNatura extends ForestryPlugin { ItemStack mulch = PluginCore.items.mulch.getItemStack(); RecipeManagers.squeezerManager.addRecipe( 10, - new ItemStack[] {netherFood}, + new ItemStack[] { netherFood }, Fluids.JUICE.getFluid(amount), mulch, ForestryAPI.activeMode.getIntegerSetting("squeezer.mulch.apple")); @@ -266,18 +271,21 @@ public class PluginNatura extends ForestryPlugin { amount = Math.max(amount, 1); // Produce at least 1 mb of juice. for (ItemStack berry : berries) { - RecipeManagers.squeezerManager.addRecipe(3, new ItemStack[] {berry}, Fluids.JUICE.getFluid(amount)); + RecipeManagers.squeezerManager.addRecipe(3, new ItemStack[] { berry }, Fluids.JUICE.getFluid(amount)); } if (itemBarley != null) { RecipeUtil.addFermenterRecipes( - itemBarley, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat"), Fluids.BIOMASS); + itemBarley, + ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat"), + Fluids.BIOMASS); if (ForestryAPI.activeMode.getStackSetting("recipe.output.compost.wheat").stackSize > 0) { ItemStack compostWheat = ForestryAPI.activeMode.getStackSetting("recipe.output.compost.wheat"); RecipeUtil.addRecipe(compostWheat, " X ", "X#X", " X ", '#', Blocks.dirt, 'X', itemBarley); } FuelManager.moistenerResource.put( - itemBarley, new MoistenerFuel(itemBarley, PluginCore.items.mouldyWheat.getItemStack(), 0, 300)); + itemBarley, + new MoistenerFuel(itemBarley, PluginCore.items.mouldyWheat.getItemStack(), 0, 300)); } } } diff --git a/src/main/java/forestry/plugins/compat/PluginPlantMegaPack.java b/src/main/java/forestry/plugins/compat/PluginPlantMegaPack.java index 3d0f6b9ce..7915e48ac 100644 --- a/src/main/java/forestry/plugins/compat/PluginPlantMegaPack.java +++ b/src/main/java/forestry/plugins/compat/PluginPlantMegaPack.java @@ -1,17 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins.compat; +import java.util.Map; + +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; + import cpw.mods.fml.common.registry.GameRegistry; import forestry.api.apiculture.FlowerManager; import forestry.api.core.ForestryAPI; @@ -28,9 +32,6 @@ import forestry.farming.logic.FarmableStacked; import forestry.plugins.ForestryPlugin; import forestry.plugins.Plugin; import forestry.plugins.PluginManager; -import java.util.Map; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; @Plugin( pluginID = "PlantMegaPack", @@ -86,253 +87,110 @@ public class PluginPlantMegaPack extends ForestryPlugin { "Tomato"); ImmutableMap desertPlant = ImmutableMap.builder() - .put("cactusArmatocereusMatucanensis", 6) - .put("cactusBaseballBat", 6) - .put("cactusEchinocereusMetornii", 2) - .put("cactusGoldenCereus", 3) - .put("cactusGoldenSaguaro", 6) - .put("cactusMatucanaAureiflora", 1) - .put("cactusPricklyPear", 5) - .put("cactusSnowPole", 6) - .put("cactusToothpick", 6) - .put("desertApachePlume", 4) - .put("desertBrittlebush", 4) - .put("desertBroadLeafGilia", 4) - .put("desertBroomSnakeweed", 4) - .put("desertKangarooPaw", 4) - .put("desertOcotillo", 4) - .put("desertPeninsulaOnion", 4) - .put("desertSeepwood", 4) - .put("desertWhiteSage", 4) - .build(); + .put("cactusArmatocereusMatucanensis", 6).put("cactusBaseballBat", 6) + .put("cactusEchinocereusMetornii", 2).put("cactusGoldenCereus", 3).put("cactusGoldenSaguaro", 6) + .put("cactusMatucanaAureiflora", 1).put("cactusPricklyPear", 5).put("cactusSnowPole", 6) + .put("cactusToothpick", 6).put("desertApachePlume", 4).put("desertBrittlebush", 4) + .put("desertBroadLeafGilia", 4).put("desertBroomSnakeweed", 4).put("desertKangarooPaw", 4) + .put("desertOcotillo", 4).put("desertPeninsulaOnion", 4).put("desertSeepwood", 4) + .put("desertWhiteSage", 4).build(); ImmutableMap nonGrowingFlowers = ImmutableMap.builder() .put("flowerAchillea", 9) // number of flowers in the block, usually meta+1 - .put("flowerAlpineThistle", 1) - .put("flowerAzalea", 13) - .put("flowerBegonia", 9) - .put("flowerBell", 10) - .put("flowerBirdofParadise", 1) - .put("flowerBlueStar", 1) - .put("flowerBurningLove", 1) - .put("flowerCandelabraAloe", 1) - .put("flowerCarnation", 7) - .put("flowerCelosia", 7) + .put("flowerAlpineThistle", 1).put("flowerAzalea", 13).put("flowerBegonia", 9).put("flowerBell", 10) + .put("flowerBirdofParadise", 1).put("flowerBlueStar", 1).put("flowerBurningLove", 1) + .put("flowerCandelabraAloe", 1).put("flowerCarnation", 7).put("flowerCelosia", 7) // .put("flowerColumbine", 5) //poisonous - .put("flowerDahlia", 8) - .put("flowerDaisy", 8) - .put("flowerDelphinium", 4) - .put("flowerDottedBlazingstar", 1) - .put("flowerElephantEars", 1) - .put("flowerFoamFlower", 1) - .put("flowerFuchsia", 1) - .put("flowerGeranium", 5) - .put("flowerGladiolus", 9) - .put("flowerHawkweed", 4) - .put("flowerHydrangea", 6) - .put("flowerJacobsLadder", 1) - .put("flowerLily", 5) - .put("flowerLionsTail", 1) - .put("flowerLupine", 10) - .put("flowerMarigold", 2) - .put("flowerMediterraneanSeaHolly", 1) + .put("flowerDahlia", 8).put("flowerDaisy", 8).put("flowerDelphinium", 4) + .put("flowerDottedBlazingstar", 1).put("flowerElephantEars", 1).put("flowerFoamFlower", 1) + .put("flowerFuchsia", 1).put("flowerGeranium", 5).put("flowerGladiolus", 9).put("flowerHawkweed", 4) + .put("flowerHydrangea", 6).put("flowerJacobsLadder", 1).put("flowerLily", 5).put("flowerLionsTail", 1) + .put("flowerLupine", 10).put("flowerMarigold", 2).put("flowerMediterraneanSeaHolly", 1) // .put("flowerMezereon", 1) //poisonous - .put("flowerNemesia", 12) - .put("flowerNewGuineaImpatiens", 1) - .put("flowerParrotsBeak", 1) - .put("flowerPeruvianLily", 1) - .put("flowerPurpleConeflower", 1) - .put("flowerRose", 13) - .put("flowerRoseCampion", 1) - .put("flowerStreamsideBluebells", 1) - .put("flowerTorchLily", 1) - .put("flowerTulip", 7) - .put("flowerViolet", 1) - .put("flowerWildCarrot", 1) // is not actually a carrot - .put("flowerWildDaffodil", 1) - .put("flowerWoodlandPinkroot", 1) - .put("flowerYellowToadflax", 1) - .put("floatingWaterHyacinth", 1) - .put("floatingWaterLily", 13) - .build(); + .put("flowerNemesia", 12).put("flowerNewGuineaImpatiens", 1).put("flowerParrotsBeak", 1) + .put("flowerPeruvianLily", 1).put("flowerPurpleConeflower", 1).put("flowerRose", 13) + .put("flowerRoseCampion", 1).put("flowerStreamsideBluebells", 1).put("flowerTorchLily", 1) + .put("flowerTulip", 7).put("flowerViolet", 1).put("flowerWildCarrot", 1) // is not actually a carrot + .put("flowerWildDaffodil", 1).put("flowerWoodlandPinkroot", 1).put("flowerYellowToadflax", 1) + .put("floatingWaterHyacinth", 1).put("floatingWaterLily", 13).build(); ImmutableMap floatingWaterPlant = ImmutableMap.builder() - .put("cropSacredLotus", 4) - .put("cropWatercress", 4) - .put("cropTaro", 4) - .put("cropWasabi", 4) - .put("cropLaksaLeaf", 4) - .put("cropCentella", 4) - .put("cropRice", 4) - .put("cropWaterSpinach", 4) - .put("cropWildRice", 4) - .put("immersedArrowArum", 4) - .put("immersedCommonReed", 4) - .put("immersedDuckPotato", 4) - .put("immersedEuropeanBurReed", 4) - .put("immersedGreySedge", 4) - .put("immersedSimplestemBurReed", 4) - .put("immersedSoftstemBulrush", 4) - .put("immersedWaterMannagrass", 4) - .put("immersedYellowFlag", 4) - .build(); + .put("cropSacredLotus", 4).put("cropWatercress", 4).put("cropTaro", 4).put("cropWasabi", 4) + .put("cropLaksaLeaf", 4).put("cropCentella", 4).put("cropRice", 4).put("cropWaterSpinach", 4) + .put("cropWildRice", 4).put("immersedArrowArum", 4).put("immersedCommonReed", 4) + .put("immersedDuckPotato", 4).put("immersedEuropeanBurReed", 4).put("immersedGreySedge", 4) + .put("immersedSimplestemBurReed", 4).put("immersedSoftstemBulrush", 4).put("immersedWaterMannagrass", 4) + .put("immersedYellowFlag", 4).build(); ImmutableMap fungusPlant = ImmutableMap.builder() - .put("fungusBlackPowderpuff", 1) - .put("fungusChanterelle", 1) + .put("fungusBlackPowderpuff", 1).put("fungusChanterelle", 1) // .put("fungusDeathCap", 1) poisonous - .put("fungusGiantClub", 1) - .put("fungusParasol", 2) - .put("fungusStinkhorn", 1) - .put("fungusWeepingMilkCap", 1) - .put("fungusWoodBlewit", 1) + .put("fungusGiantClub", 1).put("fungusParasol", 2).put("fungusStinkhorn", 1) + .put("fungusWeepingMilkCap", 1).put("fungusWoodBlewit", 1) // .put("fungusWoollyGomphus", 2) poisonous .build(); ImmutableMap junglePlant = ImmutableMap.builder() - .put("jungleConeHeadedGuzmania", 2) - .put("jungleDevilsTongue", 6) - .put("jungleHoneySpurge", 1) - .put("jungleJungleLantern", 6) - .put("jungleLazarusBell", 2) - .put("jungleLobsterClaws", 6) - .put("jungleLollipopPlant", 2) - .put("jungleMadagascarPalm", 6) - .put("junglePalmLily", 6) - .put("junglePanamaQueen", 2) - .put("junglePorteaAlatisepala", 2) - .put("jungleRacinaeaFraseri", 6) + .put("jungleConeHeadedGuzmania", 2).put("jungleDevilsTongue", 6).put("jungleHoneySpurge", 1) + .put("jungleJungleLantern", 6).put("jungleLazarusBell", 2).put("jungleLobsterClaws", 6) + .put("jungleLollipopPlant", 2).put("jungleMadagascarPalm", 6).put("junglePalmLily", 6) + .put("junglePanamaQueen", 2).put("junglePorteaAlatisepala", 2).put("jungleRacinaeaFraseri", 6) .put("jungleRicheaDracophylla", 2) // .put("jungleShellflower", 4) 2 tall needs specialcase - .put("jungleSilverVase", 2) - .put("jungleStaghornClubmoss", 2) - .put("jungleTorchGinger", 2) - .put("jungleVoodooLily", 6) - .put("leafyEmeraldPhilodendron", 2) // jungle plant + .put("jungleSilverVase", 2).put("jungleStaghornClubmoss", 2).put("jungleTorchGinger", 2) + .put("jungleVoodooLily", 6).put("leafyEmeraldPhilodendron", 2) // jungle plant .build(); - ImmutableMap vanillaPlant = ImmutableMap.builder() - .put("beachHighTideBush", 6) - .put("beachSeaLavender", 4) - .put("beachSeaSandwort", 4) - .put("leafyDustyMiller", 1) // beach plant + ImmutableMap vanillaPlant = ImmutableMap.builder().put("beachHighTideBush", 6) + .put("beachSeaLavender", 4).put("beachSeaSandwort", 4).put("leafyDustyMiller", 1) // beach plant .put("fernCretanBrake", 1) // .put("fernDwarfPalmetto", 0) doesn't grow - .put("fernHayScented", 2) - .put("fernKangaroo", 2) - .put("fernMaidenhairSpleenwort", 3) - .put("fernOstrich", 6) - .put("fernScalyTree", 6) - .put("fernSword", 6) - .put("fernWoodsia", 2) - .put("forestArcticGentian", 1) - .put("forestAustralianBugle", 2) - .put("forestBroadleafMeadowsweet", 2) - .put("forestDeadnettle", 2) - .put("forestDeceivingTrillium", 2) - .put("forestFairySlipper", 2) - .put("forestHorseweed", 2) - .put("forestKneelingAngelica", 2) + .put("fernHayScented", 2).put("fernKangaroo", 2).put("fernMaidenhairSpleenwort", 3) + .put("fernOstrich", 6).put("fernScalyTree", 6).put("fernSword", 6).put("fernWoodsia", 2) + .put("forestArcticGentian", 1).put("forestAustralianBugle", 2).put("forestBroadleafMeadowsweet", 2) + .put("forestDeadnettle", 2).put("forestDeceivingTrillium", 2).put("forestFairySlipper", 2) + .put("forestHorseweed", 2).put("forestKneelingAngelica", 2) // .put("forestLilyoftheValley", //poisonous - .put("forestNorthernPitcherPlant", 2) - .put("forestPinesap", 2) - .put("forestRedHelleborine", 2) - .put("forestSalal", 2) - .put("forestVanillaLeaf", 1) - .put("forestWesternWallflower", 2) - .put("forestWildColumbine", 2) - .put("forestWildMint", 2) - .put("forestWolfsFootClubmoss", 1) + .put("forestNorthernPitcherPlant", 2).put("forestPinesap", 2).put("forestRedHelleborine", 2) + .put("forestSalal", 2).put("forestVanillaLeaf", 1).put("forestWesternWallflower", 2) + .put("forestWildColumbine", 2).put("forestWildMint", 2).put("forestWolfsFootClubmoss", 1) .put("leafyColeus", 1) // forest plant .put("leafyStonecrop", 1) // forest plant - .put("grassBlueWheatgrass", 1) - .put("grassCord", 6) - .put("grassFountain", 2) - .put("grassMeadow", 2) - .put("grassMeadowFoxtail", 1) - .put("grassPrairie", 1) - .put("grassSilverMoor", 2) - .put("grassSwitch", 6) - .put("mountainAlpineArmeria", 2) - .put("mountainAlpineBellflower", 2) - .put("mountainBistort", 2) - .put("mountainEdelweiss", 2) - .put("mountainHouseleek", 2) - .put("mountainIris", 1) - .put("mountainNorthernWillowherb", 2) - .put("mountainScarletTrumpet", 2) - .put("mountainYellowBellflower", 1) - .put("leafyKrisPlant", 2) // mountain plaint + .put("grassBlueWheatgrass", 1).put("grassCord", 6).put("grassFountain", 2).put("grassMeadow", 2) + .put("grassMeadowFoxtail", 1).put("grassPrairie", 1).put("grassSilverMoor", 2).put("grassSwitch", 6) + .put("mountainAlpineArmeria", 2).put("mountainAlpineBellflower", 2).put("mountainBistort", 2) + .put("mountainEdelweiss", 2).put("mountainHouseleek", 2).put("mountainIris", 1) + .put("mountainNorthernWillowherb", 2).put("mountainScarletTrumpet", 2) + .put("mountainYellowBellflower", 1).put("leafyKrisPlant", 2) // mountain plaint .put("plainsPrairieBrome", 6) // skips some metas - .put("plainsPrairieSage", 4) - .put("plainsReedCanaryGrass", 6) // skips some metas - .put("plainsShortrayFleabane", 4) - .put("plainsSmallPasqueFlower", 4) - .put("plainsSmoothAster", 4) - .put("plainsThreeFloweredAvens", 4) - .put("leafyPricklyLettuce", 1) // plains plant + .put("plainsPrairieSage", 4).put("plainsReedCanaryGrass", 6) // skips some metas + .put("plainsShortrayFleabane", 4).put("plainsSmallPasqueFlower", 4).put("plainsSmoothAster", 4) + .put("plainsThreeFloweredAvens", 4).put("leafyPricklyLettuce", 1) // plains plant // .put("leafyStingingNettle", 2) plains plant, poisonous - .put("savannaButterflyWeed", 2) - .put("savannaHoaryVervain", 2) - .put("savannaLeadplant", 2) - .put("savannaMarcela", 2) - .put("savannaNorthernBedstraw", 1) - .put("savannaPiersonsMilkVetch", 2) - .put("savannaPropellerPlant", 2) - .put("savannaShonaCabbage", 2) - .put("savannaTexasTickseed", 2) + .put("savannaButterflyWeed", 2).put("savannaHoaryVervain", 2).put("savannaLeadplant", 2) + .put("savannaMarcela", 2).put("savannaNorthernBedstraw", 1).put("savannaPiersonsMilkVetch", 2) + .put("savannaPropellerPlant", 2).put("savannaShonaCabbage", 2).put("savannaTexasTickseed", 2) .put("leafyPaleYucca", 2) // savanna Plant - .put("leafyDevilsShoestring", 2) - .put("shrubAlpineCurrant", 2) - .put("shrubBarberry", 2) - .put("shrubBoxwood", 2) - .put("shrubButterfly", 2) - .put("shrubCanyonCreekAbelia", 2) - .put("shrubCapeJasmine", 2) - .put("shrubCedarCylinder", 6) - .put("shrubCedarGlobe", 2) - .put("shrubCedarPyramid", 6) - .put("shrubCypressGreen", 1) - .put("shrubCypressYellow", 1) + .put("leafyDevilsShoestring", 2).put("shrubAlpineCurrant", 2).put("shrubBarberry", 2) + .put("shrubBoxwood", 2).put("shrubButterfly", 2).put("shrubCanyonCreekAbelia", 2) + .put("shrubCapeJasmine", 2).put("shrubCedarCylinder", 6).put("shrubCedarGlobe", 2) + .put("shrubCedarPyramid", 6).put("shrubCypressGreen", 1).put("shrubCypressYellow", 1) .put("shrubDaphne", 2) // .put("shrubDwarfElder", 4) poisonous, also grows 2 tall at meta 4 - .put("shrubHolly", 2) - .put("shrubHummingbirdBush", 2) - .put("shrubJuniperSavin", 2) - .put("shrubKerria", 2) - .put("shrubLavender", 2) - .put("shrubLindera", 3) - .put("shrubMeadowsweet", 2) - .put("shrubMottlecah", 2) - .put("shrubNinebark", 2) - .put("shrubSargentViburnum", 2) + .put("shrubHolly", 2).put("shrubHummingbirdBush", 2).put("shrubJuniperSavin", 2).put("shrubKerria", 2) + .put("shrubLavender", 2).put("shrubLindera", 3).put("shrubMeadowsweet", 2).put("shrubMottlecah", 2) + .put("shrubNinebark", 2).put("shrubSargentViburnum", 2) // .put("shrubSpicebush",2) poisonous - .put("shrubWeepingForsythia", 2) - .put("shrubWinterberry", 2) - .put("shrubWolfWillow", 2) - .put("wetlandsCattails", 6) - .put("wetlandsClubrush", 2) - .put("wetlandsCommonRush", 2) - .put("wetlandsFloweringRush", 2) - .put("wetlandsPickerelweed", 2) - .put("wetlandsReedMannagrass", 2) - .put("wetlandsSwampMilkweed", 2) - .put("wetlandsWaterHorsetail", 1) - .put("wetlandsWhiteTurtlehead", 2) + .put("shrubWeepingForsythia", 2).put("shrubWinterberry", 2).put("shrubWolfWillow", 2) + .put("wetlandsCattails", 6).put("wetlandsClubrush", 2).put("wetlandsCommonRush", 2) + .put("wetlandsFloweringRush", 2).put("wetlandsPickerelweed", 2).put("wetlandsReedMannagrass", 2) + .put("wetlandsSwampMilkweed", 2).put("wetlandsWaterHorsetail", 1).put("wetlandsWhiteTurtlehead", 2) .build(); - ImmutableMap berryBushPlant = ImmutableMap.builder() - .put("Beauty", 4) - .put("Black", 4) - .put("Blue", 4) - .put("Elder", 4) - .put("Goose", 4) - .put("Huckle", 4) - .put("Orange", 4) - .put("Snow", 4) - .put("Straw", 4) - .build(); + ImmutableMap berryBushPlant = ImmutableMap.builder().put("Beauty", 4) + .put("Black", 4).put("Blue", 4).put("Elder", 4).put("Goose", 4).put("Huckle", 4).put("Orange", 4) + .put("Snow", 4).put("Straw", 4).build(); ImmutableList waterPlant = ImmutableList.of( "oceanCommonEelgrass", @@ -353,8 +211,7 @@ public class PluginPlantMegaPack extends ForestryPlugin { ImmutableMap specialCaseTwoTall = ImmutableMap.builder() .put("grassSeaOats", FlowerManager.FlowerTypeVanilla) - .put("jungleShellflower", FlowerManager.FlowerTypeJungle) - .build(); + .put("jungleShellflower", FlowerManager.FlowerTypeJungle).build(); int seedamount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.seed"); int juiceAmount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.apple"); @@ -364,7 +221,9 @@ public class PluginPlantMegaPack extends ForestryPlugin { ItemStack reedStack = GameRegistry.findItemStack(PlantMP, reedLike, 1); if (reedBlock != null && reedStack != null) { RecipeUtil.addFermenterRecipes( - reedStack, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat"), Fluids.BIOMASS); + reedStack, + ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.wheat"), + Fluids.BIOMASS); if (PluginManager.Module.FARMING.isEnabled()) { Farmables.farmables.get(FarmableReference.Poales.get()).add(new FarmableStacked(reedBlock, 14, 4)); } @@ -377,19 +236,17 @@ public class PluginPlantMegaPack extends ForestryPlugin { ItemStack foodStack = GameRegistry.findItemStack(PlantMP, "food" + landCrop, 1); if (landCropBlock != null) { if (foodStack != null) { - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {foodStack}, Fluids.JUICE.getFluid(juiceAmount)); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { foodStack }, Fluids.JUICE.getFluid(juiceAmount)); } if (seedStack != null) { - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {seedStack}, Fluids.SEEDOIL.getFluid(seedamount)); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { seedStack }, Fluids.SEEDOIL.getFluid(seedamount)); } if (PluginManager.Module.FARMING.isEnabled()) { - Farmables.farmables - .get(FarmableReference.Wheat.get()) + Farmables.farmables.get(FarmableReference.Wheat.get()) .add(new FarmableGenericCrop(seedStack, landCropBlock, 4)); - Farmables.farmables - .get(FarmableReference.Orchard.get()) + Farmables.farmables.get(FarmableReference.Orchard.get()) .add(new FarmableBasicFruit(landCropBlock, 4)); } } @@ -399,8 +256,8 @@ public class PluginPlantMegaPack extends ForestryPlugin { Block flowerPlantBlock = GameRegistry.findBlock(PlantMP, flower.getKey()); if (flowerPlantBlock != null) { for (int i = 0; i < flower.getValue(); i++) { - FlowerManager.flowerRegistry.registerPlantableFlower( - flowerPlantBlock, i, 0.75, FlowerManager.FlowerTypeVanilla); + FlowerManager.flowerRegistry + .registerPlantableFlower(flowerPlantBlock, i, 0.75, FlowerManager.FlowerTypeVanilla); } } } @@ -408,8 +265,7 @@ public class PluginPlantMegaPack extends ForestryPlugin { for (Map.Entry wPlant : floatingWaterPlant.entrySet()) { Block waterPlantBlock = GameRegistry.findBlock(PlantMP, wPlant.getKey()); if (PluginManager.Module.FARMING.isEnabled() && waterPlantBlock != null) { - Farmables.farmables - .get(FarmableReference.Orchard.get()) + Farmables.farmables.get(FarmableReference.Orchard.get()) .add(new FarmableBasicFruit(waterPlantBlock, wPlant.getValue())); } } @@ -423,15 +279,13 @@ public class PluginPlantMegaPack extends ForestryPlugin { ItemStack foodStack = GameRegistry.findItemStack(PlantMP, "berries" + berryBushCrop.getKey(), 1); if (berryBushCropBlock != null) { if (foodStack != null) { - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {foodStack}, Fluids.JUICE.getFluid(juiceAmount)); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { foodStack }, Fluids.JUICE.getFluid(juiceAmount)); } if (PluginManager.Module.FARMING.isEnabled()) { - Farmables.farmables - .get(FarmableReference.Wheat.get()) + Farmables.farmables.get(FarmableReference.Wheat.get()) .add(new FarmableGenericCrop(berryBushStack, berryBushCropBlock, berryBushCrop.getValue())); - Farmables.farmables - .get(FarmableReference.Orchard.get()) + Farmables.farmables.get(FarmableReference.Orchard.get()) .add(new FarmableBasicFruit(berryBushCropBlock, berryBushCrop.getValue())); } } @@ -449,8 +303,7 @@ public class PluginPlantMegaPack extends ForestryPlugin { FlowerManager.flowerRegistry.registerAcceptableFlower(plantBlock, special.getValue()); FlowerManager.flowerRegistry.registerPlantableFlower(plantBlock, 0, 0.75, special.getValue()); if (PluginManager.Module.FARMING.isEnabled()) { - Farmables.farmables - .get(FarmableReference.Wheat.get()) + Farmables.farmables.get(FarmableReference.Wheat.get()) .add(new FarmableGenericCrop(specialStack, plantBlock, 4)); } } @@ -467,8 +320,8 @@ public class PluginPlantMegaPack extends ForestryPlugin { } } - private static void addMetaFlower( - ImmutableMap flowerMap, boolean plantable, String... flowertype) { + private static void addMetaFlower(ImmutableMap flowerMap, boolean plantable, + String... flowertype) { for (Map.Entry flower : flowerMap.entrySet()) { Block flowerBlock = GameRegistry.findBlock(PlantMP, flower.getKey()); ItemStack flowerStack = GameRegistry.findItemStack(PlantMP, flower.getKey(), 1); @@ -477,12 +330,10 @@ public class PluginPlantMegaPack extends ForestryPlugin { FlowerManager.flowerRegistry.registerPlantableFlower(flowerBlock, 0, 0.75, flowertype); } if (PluginManager.Module.FARMING.isEnabled() && flowerStack != null && flowerBlock != null) { - Farmables.farmables - .get(FarmableReference.Wheat.get()) + Farmables.farmables.get(FarmableReference.Wheat.get()) .add(new FarmableGenericCrop(flowerStack, flowerBlock, flower.getValue())); if (flower.getValue() < 5) { - Farmables.farmables - .get(FarmableReference.Orchard.get()) + Farmables.farmables.get(FarmableReference.Orchard.get()) .add(new FarmableBasicFruit(flowerBlock, flower.getValue())); } } diff --git a/src/main/java/forestry/plugins/compat/PluginRotaryCraft.java b/src/main/java/forestry/plugins/compat/PluginRotaryCraft.java index 53a983a80..09b2cd4dd 100644 --- a/src/main/java/forestry/plugins/compat/PluginRotaryCraft.java +++ b/src/main/java/forestry/plugins/compat/PluginRotaryCraft.java @@ -1,15 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins.compat; +import net.minecraft.block.Block; +import net.minecraft.item.ItemStack; + import cpw.mods.fml.common.registry.GameRegistry; import forestry.api.core.ForestryAPI; import forestry.api.farming.Farmables; @@ -23,8 +24,6 @@ import forestry.farming.logic.FarmableReference; import forestry.plugins.ForestryPlugin; import forestry.plugins.Plugin; import forestry.plugins.PluginManager; -import net.minecraft.block.Block; -import net.minecraft.item.ItemStack; @Plugin( pluginID = "RotaryCraft", @@ -56,12 +55,11 @@ public class PluginRotaryCraft extends ForestryPlugin { seedAmount = Math.max(seedAmount, 1); // Produce at least 1 mb. if (canolaSeed != null && canolaCrop != null) { if (PluginManager.Module.FACTORY.isEnabled()) { - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {canolaSeed}, Fluids.SEEDOIL.getFluid(seedAmount)); + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { canolaSeed }, Fluids.SEEDOIL.getFluid(seedAmount)); } if (PluginManager.Module.FARMING.isEnabled()) { - Farmables.farmables - .get(FarmableReference.Wheat.get()) + Farmables.farmables.get(FarmableReference.Wheat.get()) .add(new FarmableGenericCrop(canolaSeed, canolaCrop, 9)); Farmables.farmables.get(FarmableReference.Orchard.get()).add(new FarmableBasicFruit(canolaCrop, 9)); } diff --git a/src/main/java/forestry/plugins/compat/PluginWitchery.java b/src/main/java/forestry/plugins/compat/PluginWitchery.java index 27a63aeac..99813974c 100644 --- a/src/main/java/forestry/plugins/compat/PluginWitchery.java +++ b/src/main/java/forestry/plugins/compat/PluginWitchery.java @@ -1,17 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.plugins.compat; +import java.util.Map; + +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraftforge.oredict.OreDictionary; + import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; + import cpw.mods.fml.common.event.FMLInterModComms; import cpw.mods.fml.common.registry.GameData; import cpw.mods.fml.common.registry.GameRegistry; @@ -28,11 +34,6 @@ import forestry.farming.logic.FarmableGenericCrop; import forestry.farming.logic.FarmableReference; import forestry.plugins.ForestryPlugin; import forestry.plugins.Plugin; -import java.util.Map; -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; @Plugin( pluginID = "Witchery", @@ -59,43 +60,39 @@ public class PluginWitchery extends ForestryPlugin { ImmutableList flowersAccept = ImmutableList.of("bloodrose", "plantmine", "glintweed"); - ImmutableMap cropSeed = ImmutableMap.builder() - .put("belladonna", 4) - .put("mandrake", 4) - .put("mindrake", 4) - .put("snowbell", 4) - .put("wolfsbane", 7) - .put("wormwood", 4) + ImmutableMap cropSeed = ImmutableMap.builder().put("belladonna", 4) + .put("mandrake", 4).put("mindrake", 4).put("snowbell", 4).put("wolfsbane", 7).put("wormwood", 4) .build(); - ImmutableList cropDirect = ImmutableList.of( - "garlic" // meta 5 - ); + ImmutableList cropDirect = ImmutableList.of("garlic" // meta 5 + ); int seedamount = ForestryAPI.activeMode.getIntegerSetting("squeezer.liquid.seed"); Item saplingItem = GameRegistry.findItem(Witch, "witchsapling"); ItemStack saplingStack = new ItemStack(saplingItem, 1, OreDictionary.WILDCARD_VALUE); RecipeUtil.addFermenterRecipes( - saplingStack, ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.sapling"), Fluids.BIOMASS); + saplingStack, + ForestryAPI.activeMode.getIntegerSetting("fermenter.yield.sapling"), + Fluids.BIOMASS); String saplingName = GameData.getItemRegistry().getNameForObject(saplingItem); - FMLInterModComms.sendMessage( - Constants.MOD, "add-farmable-sapling", String.format("farmArboreal@%s.-1", saplingName)); + FMLInterModComms + .sendMessage(Constants.MOD, "add-farmable-sapling", String.format("farmArboreal@%s.-1", saplingName)); for (String flowerAcceptName : flowersAccept) { Block flowerBlock = GameRegistry.findBlock(Witch, flowerAcceptName); if (flowerBlock != null) { FlowerManager.flowerRegistry.registerAcceptableFlower( - flowerBlock, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); + flowerBlock, + FlowerManager.FlowerTypeVanilla, + FlowerManager.FlowerTypeSnow); } } for (String cropDirectName : cropDirect) { Block cropDirectBlock = GameRegistry.findBlock(Witch, cropDirectName + "plant"); ItemStack cropDirectStack = GameRegistry.findItemStack(Witch, cropDirectName, 1); if (cropDirectStack != null && cropDirectBlock != null) { - Farmables.farmables - .get(FarmableReference.Wheat.get()) + Farmables.farmables.get(FarmableReference.Wheat.get()) .add(new FarmableGenericCrop(cropDirectStack, cropDirectBlock, 5)); - Farmables.farmables - .get(FarmableReference.Orchard.get()) + Farmables.farmables.get(FarmableReference.Orchard.get()) .add(new FarmableBasicFruit(cropDirectBlock, 5)); } } @@ -103,13 +100,11 @@ public class PluginWitchery extends ForestryPlugin { Block cropSeedBlock = GameRegistry.findBlock(Witch, cropSeedName.getKey()); ItemStack cropSeedStack = GameRegistry.findItemStack(Witch, "seeds" + cropSeedName.getKey(), 1); if (cropSeedStack != null && cropSeedBlock != null) { - RecipeManagers.squeezerManager.addRecipe( - 10, new ItemStack[] {cropSeedStack}, Fluids.SEEDOIL.getFluid(seedamount)); - Farmables.farmables - .get(FarmableReference.Wheat.get()) + RecipeManagers.squeezerManager + .addRecipe(10, new ItemStack[] { cropSeedStack }, Fluids.SEEDOIL.getFluid(seedamount)); + Farmables.farmables.get(FarmableReference.Wheat.get()) .add(new FarmableGenericCrop(cropSeedStack, cropSeedBlock, cropSeedName.getValue())); - Farmables.farmables - .get(FarmableReference.Orchard.get()) + Farmables.farmables.get(FarmableReference.Orchard.get()) .add(new FarmableBasicFruit(cropSeedBlock, cropSeedName.getValue())); } } diff --git a/src/main/java/forestry/storage/BackpackDefinition.java b/src/main/java/forestry/storage/BackpackDefinition.java index 8e94e11a6..04937a539 100755 --- a/src/main/java/forestry/storage/BackpackDefinition.java +++ b/src/main/java/forestry/storage/BackpackDefinition.java @@ -1,22 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.storage; -import cpw.mods.fml.common.registry.GameData; -import forestry.api.apiculture.BeeManager; -import forestry.api.lepidopterology.ButterflyManager; -import forestry.api.storage.IBackpackDefinition; import java.util.HashSet; import java.util.List; import java.util.Set; + import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -24,6 +19,11 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.StatCollector; import net.minecraftforge.oredict.OreDictionary; +import cpw.mods.fml.common.registry.GameData; +import forestry.api.apiculture.BeeManager; +import forestry.api.lepidopterology.ButterflyManager; +import forestry.api.storage.IBackpackDefinition; + public class BackpackDefinition implements IBackpackDefinition { private final String name; @@ -54,8 +54,8 @@ public class BackpackDefinition implements IBackpackDefinition { @Override public String getName(ItemStack backpack) { Item item = backpack.getItem(); - String display = - ("" + StatCollector.translateToLocal(item.getUnlocalizedNameInefficiently(backpack) + ".name")).trim(); + String display = ("" + StatCollector.translateToLocal(item.getUnlocalizedNameInefficiently(backpack) + ".name")) + .trim(); if (backpack.stackTagCompound != null && backpack.stackTagCompound.hasKey("display", 10)) { NBTTagCompound nbt = backpack.stackTagCompound.getCompoundTag("display"); @@ -112,11 +112,11 @@ public class BackpackDefinition implements IBackpackDefinition { } public void addValidOreDictName(String oreDictName) { - // if (OreDictionary.doesOreNameExist(oreDictName)) { //TODO: add this back when using a forge version that + // if (OreDictionary.doesOreNameExist(oreDictName)) { //TODO: add this back when using a forge version that // supports it int oreId = OreDictionary.getOreID(oreDictName); validOreIds.add(oreId); - // } + // } } public void addValidOreDictNames(List oreDictNames) { diff --git a/src/main/java/forestry/storage/BackpackInterface.java b/src/main/java/forestry/storage/BackpackInterface.java index 1bdde9834..552f550f7 100644 --- a/src/main/java/forestry/storage/BackpackInterface.java +++ b/src/main/java/forestry/storage/BackpackInterface.java @@ -1,23 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.storage; +import net.minecraft.item.Item; + import forestry.api.storage.BackpackManager; import forestry.api.storage.EnumBackpackType; import forestry.api.storage.IBackpackDefinition; import forestry.api.storage.IBackpackInterface; import forestry.storage.items.ItemBackpack; -import net.minecraft.item.Item; public class BackpackInterface implements IBackpackInterface { + @Override public Item addBackpack(IBackpackDefinition definition, EnumBackpackType type) { BackpackManager.definitions.put(definition.getKey(), definition); diff --git a/src/main/java/forestry/storage/BackpackMode.java b/src/main/java/forestry/storage/BackpackMode.java index 2d2204826..b22a626d2 100755 --- a/src/main/java/forestry/storage/BackpackMode.java +++ b/src/main/java/forestry/storage/BackpackMode.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.storage; diff --git a/src/main/java/forestry/storage/CrateRegistry.java b/src/main/java/forestry/storage/CrateRegistry.java index b7a92fcd3..40fc8d56a 100644 --- a/src/main/java/forestry/storage/CrateRegistry.java +++ b/src/main/java/forestry/storage/CrateRegistry.java @@ -1,24 +1,23 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.storage; +import net.minecraft.block.Block; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + import cpw.mods.fml.common.registry.GameRegistry; import forestry.api.storage.ICrateRegistry; import forestry.core.items.ItemCrated; import forestry.core.utils.Log; import forestry.core.utils.StringUtil; import forestry.plugins.PluginStorage; -import net.minecraft.block.Block; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; public class CrateRegistry implements ICrateRegistry { diff --git a/src/main/java/forestry/storage/PickupHandlerStorage.java b/src/main/java/forestry/storage/PickupHandlerStorage.java index a4f37bf86..2203c84d8 100755 --- a/src/main/java/forestry/storage/PickupHandlerStorage.java +++ b/src/main/java/forestry/storage/PickupHandlerStorage.java @@ -1,23 +1,22 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.storage; +import net.minecraft.entity.item.EntityItem; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import forestry.api.storage.IBackpackDefinition; import forestry.core.IPickupHandler; import forestry.storage.gui.ContainerBackpack; import forestry.storage.gui.ContainerNaturalistBackpack; import forestry.storage.items.ItemBackpack; -import net.minecraft.entity.item.EntityItem; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class PickupHandlerStorage implements IPickupHandler { @@ -63,8 +62,8 @@ public class PickupHandlerStorage implements IPickupHandler { } /** - * This tops off existing stacks in the player's inventory. That way you can keep f.e. a stack of dirt or cobblestone in your inventory which gets refreshed - * constantly by picked up items. + * This tops off existing stacks in the player's inventory. That way you can keep f.e. a stack of dirt or + * cobblestone in your inventory which gets refreshed constantly by picked up items. */ private static void topOffPlayerInventory(EntityPlayer player, ItemStack itemstack) { diff --git a/src/main/java/forestry/storage/ResupplyHandler.java b/src/main/java/forestry/storage/ResupplyHandler.java index 9f8d5ab4a..bb213d812 100755 --- a/src/main/java/forestry/storage/ResupplyHandler.java +++ b/src/main/java/forestry/storage/ResupplyHandler.java @@ -1,28 +1,28 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.storage; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.ContainerPlayer; +import net.minecraft.item.ItemStack; +import net.minecraftforge.common.MinecraftForge; + import cpw.mods.fml.common.eventhandler.Event; import forestry.api.storage.BackpackResupplyEvent; import forestry.core.IResupplyHandler; import forestry.core.inventory.ItemInventory; import forestry.storage.inventory.ItemInventoryBackpack; import forestry.storage.items.ItemBackpack; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.ContainerPlayer; -import net.minecraft.item.ItemStack; -import net.minecraftforge.common.MinecraftForge; public class ResupplyHandler implements IResupplyHandler { @@ -59,8 +59,10 @@ public class ResupplyHandler implements IResupplyHandler { // Load their inventory ItemBackpack backpackItem = ((ItemBackpack) backpack.getItem()); - ItemInventory backpackInventory = - new ItemInventoryBackpack(player, backpackItem.getBackpackSize(), backpack); + ItemInventory backpackInventory = new ItemInventoryBackpack( + player, + backpackItem.getBackpackSize(), + backpack); Event event = new BackpackResupplyEvent(player, backpackItem.getDefinition(), backpackInventory); MinecraftForge.EVENT_BUS.post(event); diff --git a/src/main/java/forestry/storage/gui/ContainerBackpack.java b/src/main/java/forestry/storage/gui/ContainerBackpack.java index 1350384f0..a9d869f30 100755 --- a/src/main/java/forestry/storage/gui/ContainerBackpack.java +++ b/src/main/java/forestry/storage/gui/ContainerBackpack.java @@ -1,24 +1,24 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.storage.gui; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import forestry.core.gui.ContainerItemInventory; import forestry.core.gui.slots.SlotFilteredInventory; import forestry.storage.inventory.ItemInventoryBackpack; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class ContainerBackpack extends ContainerItemInventory { public enum Size { + DEFAULT(3, 5, 44, 19), T2(5, 9, 8, 8); diff --git a/src/main/java/forestry/storage/gui/ContainerNaturalistBackpack.java b/src/main/java/forestry/storage/gui/ContainerNaturalistBackpack.java index 439e25bcd..be5abb19a 100755 --- a/src/main/java/forestry/storage/gui/ContainerNaturalistBackpack.java +++ b/src/main/java/forestry/storage/gui/ContainerNaturalistBackpack.java @@ -1,22 +1,21 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.storage.gui; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.EntityPlayerMP; + import forestry.core.gui.ContainerItemInventory; import forestry.core.gui.ContainerNaturalistInventory; import forestry.core.gui.IGuiSelectable; import forestry.core.network.packets.PacketGuiSelectRequest; import forestry.storage.inventory.ItemInventoryBackpackPaged; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; public class ContainerNaturalistBackpack extends ContainerItemInventory implements IGuiSelectable { diff --git a/src/main/java/forestry/storage/gui/GuiBackpack.java b/src/main/java/forestry/storage/gui/GuiBackpack.java index 18d27b31c..38c430580 100755 --- a/src/main/java/forestry/storage/gui/GuiBackpack.java +++ b/src/main/java/forestry/storage/gui/GuiBackpack.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.storage.gui; +import net.minecraft.inventory.IInventory; + import forestry.core.config.Constants; import forestry.core.gui.GuiForestry; -import net.minecraft.inventory.IInventory; public class GuiBackpack extends GuiForestry { diff --git a/src/main/java/forestry/storage/gui/GuiBackpackT2.java b/src/main/java/forestry/storage/gui/GuiBackpackT2.java index 1e21a0379..30fa33483 100755 --- a/src/main/java/forestry/storage/gui/GuiBackpackT2.java +++ b/src/main/java/forestry/storage/gui/GuiBackpackT2.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.storage.gui; diff --git a/src/main/java/forestry/storage/inventory/ItemInventoryBackpack.java b/src/main/java/forestry/storage/inventory/ItemInventoryBackpack.java index 5bc7a6d61..7b4d4f168 100644 --- a/src/main/java/forestry/storage/inventory/ItemInventoryBackpack.java +++ b/src/main/java/forestry/storage/inventory/ItemInventoryBackpack.java @@ -1,11 +1,12 @@ package forestry.storage.inventory; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; + import forestry.api.storage.IBackpackDefinition; import forestry.core.inventory.ItemInventory; import forestry.storage.items.ItemBackpack; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; public class ItemInventoryBackpack extends ItemInventory { diff --git a/src/main/java/forestry/storage/inventory/ItemInventoryBackpackPaged.java b/src/main/java/forestry/storage/inventory/ItemInventoryBackpackPaged.java index 3176bc557..6cfc0f6de 100644 --- a/src/main/java/forestry/storage/inventory/ItemInventoryBackpackPaged.java +++ b/src/main/java/forestry/storage/inventory/ItemInventoryBackpackPaged.java @@ -1,26 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.storage.inventory; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import forestry.core.gui.GuiHandler; import forestry.core.gui.IPagedInventory; import forestry.storage.items.ItemBackpackNaturalist; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class ItemInventoryBackpackPaged extends ItemInventoryBackpack implements IPagedInventory { + private final ItemBackpackNaturalist backpackNaturalist; - public ItemInventoryBackpackPaged( - EntityPlayer player, int size, ItemStack itemstack, ItemBackpackNaturalist backpackNaturalist) { + public ItemInventoryBackpackPaged(EntityPlayer player, int size, ItemStack itemstack, + ItemBackpackNaturalist backpackNaturalist) { super(player, size, itemstack); this.backpackNaturalist = backpackNaturalist; } diff --git a/src/main/java/forestry/storage/items/ItemBackpack.java b/src/main/java/forestry/storage/items/ItemBackpack.java index 45a237088..311859914 100755 --- a/src/main/java/forestry/storage/items/ItemBackpack.java +++ b/src/main/java/forestry/storage/items/ItemBackpack.java @@ -1,15 +1,26 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.storage.items; +import java.util.List; +import java.util.Locale; + +import net.minecraft.client.renderer.texture.IIconRegister; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.IIcon; +import net.minecraft.world.World; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.common.util.ForgeDirection; + import cpw.mods.fml.common.eventhandler.Event; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; @@ -32,19 +43,9 @@ import forestry.storage.gui.ContainerBackpack; import forestry.storage.gui.GuiBackpack; import forestry.storage.gui.GuiBackpackT2; import forestry.storage.inventory.ItemInventoryBackpack; -import java.util.List; -import java.util.Locale; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; -import net.minecraftforge.common.util.ForgeDirection; public class ItemBackpack extends ItemWithGui { + private final IBackpackDefinition definition; private final EnumBackpackType type; @@ -81,32 +82,14 @@ public class ItemBackpack extends ItemWithGui { } @Override - public boolean onItemUse( - ItemStack itemstack, - EntityPlayer player, - World world, - int x, - int y, - int z, - int side, - float hitX, - float hitY, - float hitZ) { + public boolean onItemUse(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int side, + float hitX, float hitY, float hitZ) { return getInventoryHit(world, x, y, z, side) != null; } @Override - public boolean onItemUseFirst( - ItemStack itemstack, - EntityPlayer player, - World world, - int x, - int y, - int z, - int side, - float hitX, - float hitY, - float hitZ) { + public boolean onItemUseFirst(ItemStack itemstack, EntityPlayer player, World world, int x, int y, int z, int side, + float hitX, float hitY, float hitZ) { if (world.isRemote) { return false; @@ -221,7 +204,7 @@ public class ItemBackpack extends ItemWithGui { return getSlotsForType(type); } - @SuppressWarnings({"rawtypes", "unchecked"}) + @SuppressWarnings({ "rawtypes", "unchecked" }) @Override public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean flag) { int occupied = ItemInventory.getOccupiedSlotCount(itemstack); @@ -234,9 +217,9 @@ public class ItemBackpack extends ItemWithGui { } else if (mode == BackpackMode.RESUPPLY) { list.add(StringUtil.localize("storage.backpack.mode.resupply")); } - list.add(StringUtil.localize("gui.slots") - .replaceAll("%USED", String.valueOf(occupied)) - .replaceAll("%SIZE", String.valueOf(getBackpackSize()))); + list.add( + StringUtil.localize("gui.slots").replaceAll("%USED", String.valueOf(occupied)) + .replaceAll("%SIZE", String.valueOf(getBackpackSize()))); } @Override diff --git a/src/main/java/forestry/storage/items/ItemBackpackNaturalist.java b/src/main/java/forestry/storage/items/ItemBackpackNaturalist.java index 9acc5d21f..f597ce34f 100644 --- a/src/main/java/forestry/storage/items/ItemBackpackNaturalist.java +++ b/src/main/java/forestry/storage/items/ItemBackpackNaturalist.java @@ -1,15 +1,16 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.storage.items; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.item.ItemStack; + import forestry.api.genetics.ISpeciesRoot; import forestry.api.storage.EnumBackpackType; import forestry.api.storage.IBackpackDefinition; @@ -18,10 +19,9 @@ import forestry.core.gui.GuiHandler; import forestry.core.gui.GuiNaturalistInventory; import forestry.storage.gui.ContainerNaturalistBackpack; import forestry.storage.inventory.ItemInventoryBackpackPaged; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; public class ItemBackpackNaturalist extends ItemBackpack { + private final ISpeciesRoot speciesRoot; public ItemBackpackNaturalist(ISpeciesRoot speciesRoot, IBackpackDefinition definition, EnumBackpackType type) { @@ -36,16 +36,22 @@ public class ItemBackpackNaturalist extends ItemBackpack { @Override public Object getGui(EntityPlayer player, ItemStack heldItem, int page) { - ItemInventoryBackpackPaged inventory = - new ItemInventoryBackpackPaged(player, Constants.SLOTS_BACKPACK_APIARIST, heldItem, this); + ItemInventoryBackpackPaged inventory = new ItemInventoryBackpackPaged( + player, + Constants.SLOTS_BACKPACK_APIARIST, + heldItem, + this); ContainerNaturalistBackpack container = new ContainerNaturalistBackpack(player, inventory, page); return new GuiNaturalistInventory(speciesRoot, player, container, inventory, page, 5); } @Override public Object getContainer(EntityPlayer player, ItemStack heldItem, int page) { - ItemInventoryBackpackPaged inventory = - new ItemInventoryBackpackPaged(player, Constants.SLOTS_BACKPACK_APIARIST, heldItem, this); + ItemInventoryBackpackPaged inventory = new ItemInventoryBackpackPaged( + player, + Constants.SLOTS_BACKPACK_APIARIST, + heldItem, + this); return new ContainerNaturalistBackpack(player, inventory, page); } } diff --git a/src/main/java/forestry/storage/items/ItemRegistryStorage.java b/src/main/java/forestry/storage/items/ItemRegistryStorage.java index 7dccf2374..2299cba20 100644 --- a/src/main/java/forestry/storage/items/ItemRegistryStorage.java +++ b/src/main/java/forestry/storage/items/ItemRegistryStorage.java @@ -1,15 +1,15 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.storage.items; +import net.minecraft.item.Item; + import forestry.api.apiculture.BeeManager; import forestry.api.core.Tabs; import forestry.api.lepidopterology.ButterflyManager; @@ -19,9 +19,9 @@ import forestry.api.storage.IBackpackDefinition; import forestry.core.items.ItemCrated; import forestry.core.items.ItemRegistry; import forestry.plugins.PluginManager; -import net.minecraft.item.Item; public class ItemRegistryStorage extends ItemRegistry { + public final ItemCrated crate; public final ItemBackpackNaturalist apiaristBackpack; public final ItemBackpackNaturalist lepidopteristBackpack; @@ -56,8 +56,10 @@ public class ItemRegistryStorage extends ItemRegistry { if (PluginManager.Module.LEPIDOPTEROLOGY.isEnabled()) { definition = BackpackManager.definitions.get("lepidopterist"); - lepidopteristBackpack = - new ItemBackpackNaturalist(ButterflyManager.butterflyRoot, definition, EnumBackpackType.APIARIST); + lepidopteristBackpack = new ItemBackpackNaturalist( + ButterflyManager.butterflyRoot, + definition, + EnumBackpackType.APIARIST); lepidopteristBackpack.setCreativeTab(Tabs.tabLepidopterology); registerItem(lepidopteristBackpack, "lepidopteristBag"); } else { @@ -66,38 +68,50 @@ public class ItemRegistryStorage extends ItemRegistry { definition = BackpackManager.definitions.get("miner"); minerBackpack = registerItem( - BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), "minerBag"); + BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), + "minerBag"); minerBackpackT2 = registerItem( - BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), "minerBagT2"); + BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), + "minerBagT2"); definition = BackpackManager.definitions.get("digger"); diggerBackpack = registerItem( - BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), "diggerBag"); + BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), + "diggerBag"); diggerBackpackT2 = registerItem( - BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), "diggerBagT2"); + BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), + "diggerBagT2"); definition = BackpackManager.definitions.get("forester"); foresterBackpack = registerItem( - BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), "foresterBag"); + BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), + "foresterBag"); foresterBackpackT2 = registerItem( - BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), "foresterBagT2"); + BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), + "foresterBagT2"); definition = BackpackManager.definitions.get("hunter"); hunterBackpack = registerItem( - BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), "hunterBag"); + BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), + "hunterBag"); hunterBackpackT2 = registerItem( - BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), "hunterBagT2"); + BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), + "hunterBagT2"); definition = BackpackManager.definitions.get("adventurer"); adventurerBackpack = registerItem( - BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), "adventurerBag"); + BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), + "adventurerBag"); adventurerBackpackT2 = registerItem( - BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), "adventurerBagT2"); + BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), + "adventurerBagT2"); definition = BackpackManager.definitions.get("builder"); builderBackpack = registerItem( - BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), "builderBag"); + BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T1), + "builderBag"); builderBackpackT2 = registerItem( - BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), "builderBagT2"); + BackpackManager.backpackInterface.addBackpack(definition, EnumBackpackType.T2), + "builderBagT2"); } } diff --git a/src/main/java/forestry/storage/proxy/ProxyStorage.java b/src/main/java/forestry/storage/proxy/ProxyStorage.java index 5bfe7f307..4e23506d2 100644 --- a/src/main/java/forestry/storage/proxy/ProxyStorage.java +++ b/src/main/java/forestry/storage/proxy/ProxyStorage.java @@ -1,12 +1,10 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.storage.proxy; diff --git a/src/main/java/forestry/storage/proxy/ProxyStorageClient.java b/src/main/java/forestry/storage/proxy/ProxyStorageClient.java index b0e6c5321..afedef85e 100644 --- a/src/main/java/forestry/storage/proxy/ProxyStorageClient.java +++ b/src/main/java/forestry/storage/proxy/ProxyStorageClient.java @@ -1,18 +1,17 @@ /******************************************************************************* - * 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 + * 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 + * Various Contributors including, but not limited to: SirSengir (original work), CovertJaguar, Player, Binnie, + * MysteriousAges ******************************************************************************/ package forestry.storage.proxy; +import net.minecraftforge.client.MinecraftForgeClient; + import forestry.core.items.ItemCrated; import forestry.core.render.RenderCrateItem; -import net.minecraftforge.client.MinecraftForgeClient; public class ProxyStorageClient extends ProxyStorage {