diff --git a/src/main/java/forestry/api/apiculture/BeeManager.java b/src/main/java/forestry/api/apiculture/BeeManager.java index c4ef330aa..778600052 100644 --- a/src/main/java/forestry/api/apiculture/BeeManager.java +++ b/src/main/java/forestry/api/apiculture/BeeManager.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.apiculture; @@ -9,10 +9,11 @@ import java.util.ArrayList; import java.util.HashMap; import net.minecraft.item.ItemStack; + /** - * + * * Some miscellaneous lists and settings for bees. - * + * * @author SirSengir */ public class BeeManager { diff --git a/src/main/java/forestry/api/apiculture/DefaultBeeModifier.java b/src/main/java/forestry/api/apiculture/DefaultBeeModifier.java index 69c7f7194..41d30e052 100644 --- a/src/main/java/forestry/api/apiculture/DefaultBeeModifier.java +++ b/src/main/java/forestry/api/apiculture/DefaultBeeModifier.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.apiculture; diff --git a/src/main/java/forestry/api/apiculture/EnumBeeChromosome.java b/src/main/java/forestry/api/apiculture/EnumBeeChromosome.java index 845d76612..ba146d225 100644 --- a/src/main/java/forestry/api/apiculture/EnumBeeChromosome.java +++ b/src/main/java/forestry/api/apiculture/EnumBeeChromosome.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.apiculture; @@ -19,7 +19,7 @@ import forestry.api.genetics.ISpeciesRoot; /** * Enum representing the order of chromosomes in a bee's genome and what they control. - * + * * @author SirSengir */ public enum EnumBeeChromosome implements IChromosomeType { diff --git a/src/main/java/forestry/api/apiculture/EnumBeeType.java b/src/main/java/forestry/api/apiculture/EnumBeeType.java index c1b6244a1..a3f564e81 100644 --- a/src/main/java/forestry/api/apiculture/EnumBeeType.java +++ b/src/main/java/forestry/api/apiculture/EnumBeeType.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.apiculture; diff --git a/src/main/java/forestry/api/apiculture/FlowerManager.java b/src/main/java/forestry/api/apiculture/FlowerManager.java index c3e020307..e83269ae1 100644 --- a/src/main/java/forestry/api/apiculture/FlowerManager.java +++ b/src/main/java/forestry/api/apiculture/FlowerManager.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.apiculture; @@ -8,7 +8,7 @@ package forestry.api.apiculture; import forestry.api.genetics.IFlowerRegistry; public class FlowerManager { - /** + /** *
e.g. FlowerManager.flowerRegister.registerPlantableFlower(new ItemStack(Blocks.red_flower), 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow);
*/ public static IFlowerRegistry flowerRegistry; diff --git a/src/main/java/forestry/api/apiculture/IAlleleBeeEffect.java b/src/main/java/forestry/api/apiculture/IAlleleBeeEffect.java index b2dddb319..9744ebe79 100644 --- a/src/main/java/forestry/api/apiculture/IAlleleBeeEffect.java +++ b/src/main/java/forestry/api/apiculture/IAlleleBeeEffect.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.apiculture; @@ -12,7 +12,7 @@ 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 @@ -24,7 +24,7 @@ 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. diff --git a/src/main/java/forestry/api/apiculture/IAlleleBeeSpecies.java b/src/main/java/forestry/api/apiculture/IAlleleBeeSpecies.java index b1d198421..d77bbb8d3 100644 --- a/src/main/java/forestry/api/apiculture/IAlleleBeeSpecies.java +++ b/src/main/java/forestry/api/apiculture/IAlleleBeeSpecies.java @@ -9,8 +9,10 @@ import java.util.Map; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.ItemStack; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.genetics.IAlleleSpecies; public interface IAlleleBeeSpecies extends IAlleleSpecies { diff --git a/src/main/java/forestry/api/apiculture/IApiaristTracker.java b/src/main/java/forestry/api/apiculture/IApiaristTracker.java index 0c65f56be..942c45db3 100644 --- a/src/main/java/forestry/api/apiculture/IApiaristTracker.java +++ b/src/main/java/forestry/api/apiculture/IApiaristTracker.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.apiculture; @@ -10,14 +10,14 @@ import forestry.api.genetics.IIndividual; /** * Can be used to garner information on bee breeding. See {@link forestry.api.genetics.ISpeciesRoot} for retrieval functions. - * + * * @author SirSengir */ public interface IApiaristTracker extends IBreedingTracker { /** * Register the birth of a queen. Will mark species as discovered. - * + * * @param queen * Created queen. */ @@ -30,7 +30,7 @@ public interface IApiaristTracker extends IBreedingTracker { /** * Register the birth of a princess. Will mark species as discovered. - * + * * @param princess * Created princess. */ @@ -43,7 +43,7 @@ public interface IApiaristTracker extends IBreedingTracker { /** * Register the birth of a drone. Will mark species as discovered. - * + * * @param drone * Created drone. */ diff --git a/src/main/java/forestry/api/apiculture/IArmorApiarist.java b/src/main/java/forestry/api/apiculture/IArmorApiarist.java index a2d15bc59..f6b38c020 100644 --- a/src/main/java/forestry/api/apiculture/IArmorApiarist.java +++ b/src/main/java/forestry/api/apiculture/IArmorApiarist.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.apiculture; diff --git a/src/main/java/forestry/api/apiculture/IBee.java b/src/main/java/forestry/api/apiculture/IBee.java index fa8927bd8..8333cdfa9 100644 --- a/src/main/java/forestry/api/apiculture/IBee.java +++ b/src/main/java/forestry/api/apiculture/IBee.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.apiculture; @@ -20,7 +20,7 @@ import forestry.api.genetics.IIndividualLiving; /** * Other implementations than Forestry's default one are not supported. - * + * * @author SirSengir */ public interface IBee extends IIndividualLiving { diff --git a/src/main/java/forestry/api/apiculture/IBeeGenome.java b/src/main/java/forestry/api/apiculture/IBeeGenome.java index f759fc72e..af2365aaf 100644 --- a/src/main/java/forestry/api/apiculture/IBeeGenome.java +++ b/src/main/java/forestry/api/apiculture/IBeeGenome.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.apiculture; @@ -11,9 +11,9 @@ import forestry.api.genetics.IGenome; /** * Only the default implementation is supported. - * + * * @author SirSengir - * + * */ public interface IBeeGenome extends IGenome { diff --git a/src/main/java/forestry/api/apiculture/IBeeHousing.java b/src/main/java/forestry/api/apiculture/IBeeHousing.java index 520a57243..e4aa5c019 100644 --- a/src/main/java/forestry/api/apiculture/IBeeHousing.java +++ b/src/main/java/forestry/api/apiculture/IBeeHousing.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.apiculture; @@ -33,15 +33,21 @@ public interface IBeeHousing extends IHousing, IErrorLogicSource { Iterable getBeeListeners(); IBeeHousingInventory getBeeInventory(); + IBeekeepingLogic getBeekeepingLogic(); EnumTemperature getTemperature(); + EnumHumidity getHumidity(); + int getBlockLightValue(); + boolean canBlockSeeTheSky(); World getWorld(); + BiomeGenBase getBiome(); + GameProfile getOwner(); /** diff --git a/src/main/java/forestry/api/apiculture/IBeeHousingInventory.java b/src/main/java/forestry/api/apiculture/IBeeHousingInventory.java index c579a19f7..38362992b 100644 --- a/src/main/java/forestry/api/apiculture/IBeeHousingInventory.java +++ b/src/main/java/forestry/api/apiculture/IBeeHousingInventory.java @@ -10,9 +10,11 @@ import net.minecraft.item.ItemStack; public interface IBeeHousingInventory { ItemStack getQueen(); + ItemStack getDrone(); void setQueen(ItemStack itemstack); + void setDrone(ItemStack itemstack); /** diff --git a/src/main/java/forestry/api/apiculture/IBeeModelProvider.java b/src/main/java/forestry/api/apiculture/IBeeModelProvider.java index 1bab611ba..62c584e93 100644 --- a/src/main/java/forestry/api/apiculture/IBeeModelProvider.java +++ b/src/main/java/forestry/api/apiculture/IBeeModelProvider.java @@ -5,11 +5,13 @@ ******************************************************************************/ package forestry.api.apiculture; -import forestry.api.core.IModelManager; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.Item; +import forestry.api.core.IModelManager; + public interface IBeeModelProvider { void registerModels(Item item, IModelManager manager); + ModelResourceLocation getModel(EnumBeeType type); } diff --git a/src/main/java/forestry/api/apiculture/IBeeMutation.java b/src/main/java/forestry/api/apiculture/IBeeMutation.java index ead92f84d..f0bec0fd3 100644 --- a/src/main/java/forestry/api/apiculture/IBeeMutation.java +++ b/src/main/java/forestry/api/apiculture/IBeeMutation.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.apiculture; diff --git a/src/main/java/forestry/api/apiculture/IBeeRoot.java b/src/main/java/forestry/api/apiculture/IBeeRoot.java index 3621fb50c..c01590936 100644 --- a/src/main/java/forestry/api/apiculture/IBeeRoot.java +++ b/src/main/java/forestry/api/apiculture/IBeeRoot.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.apiculture; @@ -48,6 +48,7 @@ public interface IBeeRoot extends ISpeciesRoot { IBeeGenome templateAsGenome(IAllele[] templateActive, IAllele[] templateInactive); /* BREEDING TRACKER */ + /** * @param world * @return {@link IApiaristTracker} associated with the passed world. @@ -56,6 +57,7 @@ public interface IBeeRoot extends ISpeciesRoot { IApiaristTracker getBreedingTracker(World world, GameProfile player); /* BEE SPECIFIC */ + /** * @return type of bee encoded on the itemstack. EnumBeeType.NONE if it isn't a bee. */ @@ -81,7 +83,7 @@ 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 @@ -112,6 +114,7 @@ public interface IBeeRoot extends ISpeciesRoot { void setBeekeepingMode(World world, String name); /* MISC */ + /** * Creates beekeepingLogic for a housing. * Should be used when the housing is created, see IBeekeepingLogic diff --git a/src/main/java/forestry/api/apiculture/IBeekeepingLogic.java b/src/main/java/forestry/api/apiculture/IBeekeepingLogic.java index d591c4b3c..3efb08d85 100644 --- a/src/main/java/forestry/api/apiculture/IBeekeepingLogic.java +++ b/src/main/java/forestry/api/apiculture/IBeekeepingLogic.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.apiculture; @@ -37,6 +37,7 @@ public interface IBeekeepingLogic extends INBTTagable { * (i.e. when tile.getDescriptionPacket() is called) */ void syncToClient(); + void syncToClient(EntityPlayerMP player); /** diff --git a/src/main/java/forestry/api/apiculture/IBeekeepingMode.java b/src/main/java/forestry/api/apiculture/IBeekeepingMode.java index b3a469c44..ca288dc00 100644 --- a/src/main/java/forestry/api/apiculture/IBeekeepingMode.java +++ b/src/main/java/forestry/api/apiculture/IBeekeepingMode.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.apiculture; @@ -47,7 +47,7 @@ public interface IBeekeepingMode { boolean isOverworked(IBee queen, IBeeHousing housing); /** - * + * * @param queen * @param offspring * @param housing diff --git a/src/main/java/forestry/api/apiculture/IHiveDrop.java b/src/main/java/forestry/api/apiculture/IHiveDrop.java index 151be26d6..9edaa8d92 100644 --- a/src/main/java/forestry/api/apiculture/IHiveDrop.java +++ b/src/main/java/forestry/api/apiculture/IHiveDrop.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.apiculture; @@ -13,9 +13,9 @@ import net.minecraft.world.World; /** * Bees can be seeded either as hive drops or as mutation results. - * + * * Add IHiveDrops with HiveManager.get___Hive.addDrop - * + * * @author SirSengir */ public interface IHiveDrop { @@ -28,7 +28,7 @@ public interface IHiveDrop { /** * Chance to drop. Default drops have 80 (= 80 %). - * + * * @param world Minecraft world this is called for. * @param pos Coordinates of the broken hive. * @return Chance for drop as an integer of 0 - 100. diff --git a/src/main/java/forestry/api/apiculture/IHiveFrame.java b/src/main/java/forestry/api/apiculture/IHiveFrame.java index 08259cae7..008c95b6c 100644 --- a/src/main/java/forestry/api/apiculture/IHiveFrame.java +++ b/src/main/java/forestry/api/apiculture/IHiveFrame.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.apiculture; @@ -11,7 +11,7 @@ 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. diff --git a/src/main/java/forestry/api/apiculture/hives/IHiveDescription.java b/src/main/java/forestry/api/apiculture/hives/IHiveDescription.java index 52e248b31..c0fdec989 100644 --- a/src/main/java/forestry/api/apiculture/hives/IHiveDescription.java +++ b/src/main/java/forestry/api/apiculture/hives/IHiveDescription.java @@ -24,6 +24,7 @@ public interface IHiveDescription { * The hive block to be placed in the world. */ Block getBlock(); + int getMeta(); /** @@ -31,14 +32,16 @@ public interface IHiveDescription { * Used as a fast early-elimination check for hives that have no hope of spawning in the area. */ boolean isGoodBiome(BiomeGenBase biome); + boolean isGoodHumidity(EnumHumidity humidity); + boolean isGoodTemperature(EnumTemperature temperature); /** * float representing the relative chance a hive will generate in a chunk. * Default is 1.0, higher numbers result in more hives, smaller will result in fewer. * Tree hives want around 3.0 to 4.0 since there are less locations to generate on. - */ + */ float getGenChance(); /** diff --git a/src/main/java/forestry/api/apiculture/hives/IHiveRegistry.java b/src/main/java/forestry/api/apiculture/hives/IHiveRegistry.java index 4d00bbd37..bd761d3ee 100644 --- a/src/main/java/forestry/api/apiculture/hives/IHiveRegistry.java +++ b/src/main/java/forestry/api/apiculture/hives/IHiveRegistry.java @@ -29,8 +29,7 @@ public interface IHiveRegistry { private final String name; - public String getHiveName() - { + public String getHiveName() { return name; } @@ -50,5 +49,6 @@ public interface IHiveRegistry { * Add drops to a registered hive. */ void addDrops(String hiveName, IHiveDrop... drops); + void addDrops(String hiveName, List drop); } diff --git a/src/main/java/forestry/api/apiculture/hives/package-info.java b/src/main/java/forestry/api/apiculture/hives/package-info.java index 0750c5d17..18fb3c8b4 100644 --- a/src/main/java/forestry/api/apiculture/hives/package-info.java +++ b/src/main/java/forestry/api/apiculture/hives/package-info.java @@ -3,7 +3,7 @@ * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ -@API(apiVersion="4.1.0", owner="ForestryAPI|apiculture", provides="ForestryAPI|hives") +@API(apiVersion = "4.1.0", owner = "ForestryAPI|apiculture", provides = "ForestryAPI|hives") package forestry.api.apiculture.hives; import net.minecraftforge.fml.common.API; diff --git a/src/main/java/forestry/api/apiculture/package-info.java b/src/main/java/forestry/api/apiculture/package-info.java index bde28aea1..8af2fe07e 100644 --- a/src/main/java/forestry/api/apiculture/package-info.java +++ b/src/main/java/forestry/api/apiculture/package-info.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ -@API(apiVersion="4.8.0", owner="ForestryAPI|core", provides="ForestryAPI|apiculture") +@API(apiVersion = "4.8.0", owner = "ForestryAPI|core", provides = "ForestryAPI|apiculture") package forestry.api.apiculture; import net.minecraftforge.fml.common.API; diff --git a/src/main/java/forestry/api/arboriculture/EnumGermlingType.java b/src/main/java/forestry/api/arboriculture/EnumGermlingType.java index ead88b1d7..c1e403068 100644 --- a/src/main/java/forestry/api/arboriculture/EnumGermlingType.java +++ b/src/main/java/forestry/api/arboriculture/EnumGermlingType.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.arboriculture; diff --git a/src/main/java/forestry/api/arboriculture/EnumGrowthConditions.java b/src/main/java/forestry/api/arboriculture/EnumGrowthConditions.java index 8b28601c1..39556b51c 100644 --- a/src/main/java/forestry/api/arboriculture/EnumGrowthConditions.java +++ b/src/main/java/forestry/api/arboriculture/EnumGrowthConditions.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.arboriculture; diff --git a/src/main/java/forestry/api/arboriculture/EnumTreeChromosome.java b/src/main/java/forestry/api/arboriculture/EnumTreeChromosome.java index 29fcebad3..544535637 100644 --- a/src/main/java/forestry/api/arboriculture/EnumTreeChromosome.java +++ b/src/main/java/forestry/api/arboriculture/EnumTreeChromosome.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.arboriculture; @@ -71,8 +71,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/IAlleleFruit.java b/src/main/java/forestry/api/arboriculture/IAlleleFruit.java index 4fee1c62a..23c0726c7 100644 --- a/src/main/java/forestry/api/arboriculture/IAlleleFruit.java +++ b/src/main/java/forestry/api/arboriculture/IAlleleFruit.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.arboriculture; diff --git a/src/main/java/forestry/api/arboriculture/IAlleleGrowth.java b/src/main/java/forestry/api/arboriculture/IAlleleGrowth.java index 6cb4b4389..a15563fd4 100644 --- a/src/main/java/forestry/api/arboriculture/IAlleleGrowth.java +++ b/src/main/java/forestry/api/arboriculture/IAlleleGrowth.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.arboriculture; diff --git a/src/main/java/forestry/api/arboriculture/IAlleleLeafEffect.java b/src/main/java/forestry/api/arboriculture/IAlleleLeafEffect.java index 2fe4bd054..690322291 100644 --- a/src/main/java/forestry/api/arboriculture/IAlleleLeafEffect.java +++ b/src/main/java/forestry/api/arboriculture/IAlleleLeafEffect.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.arboriculture; diff --git a/src/main/java/forestry/api/arboriculture/IAlleleTreeSpecies.java b/src/main/java/forestry/api/arboriculture/IAlleleTreeSpecies.java index daa8c8a84..05a70f8cf 100644 --- a/src/main/java/forestry/api/arboriculture/IAlleleTreeSpecies.java +++ b/src/main/java/forestry/api/arboriculture/IAlleleTreeSpecies.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.arboriculture; @@ -9,9 +9,11 @@ import java.util.Collection; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.resources.model.ModelResourceLocation; + import net.minecraftforge.common.EnumPlantType; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.core.IModelManager; import forestry.api.genetics.IAlleleSpecies; import forestry.api.genetics.IFruitFamily; diff --git a/src/main/java/forestry/api/arboriculture/IArboristTracker.java b/src/main/java/forestry/api/arboriculture/IArboristTracker.java index 9777e8763..9f5bd2f92 100644 --- a/src/main/java/forestry/api/arboriculture/IArboristTracker.java +++ b/src/main/java/forestry/api/arboriculture/IArboristTracker.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.arboriculture; diff --git a/src/main/java/forestry/api/arboriculture/IFruitProvider.java b/src/main/java/forestry/api/arboriculture/IFruitProvider.java index cfffeb9bc..851ee8388 100644 --- a/src/main/java/forestry/api/arboriculture/IFruitProvider.java +++ b/src/main/java/forestry/api/arboriculture/IFruitProvider.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.arboriculture; @@ -9,8 +9,10 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.genetics.IFruitFamily; public interface IFruitProvider { @@ -41,6 +43,7 @@ public interface IFruitProvider { String getModID(); /* TEXTURE OVERLAY */ + /** * @param genome * @param world @@ -59,7 +62,7 @@ public interface IFruitProvider { /** * Tries to spawn a fruit block at the potential position when the tree generates. - * + * * @param genome * @param world * @param pos diff --git a/src/main/java/forestry/api/arboriculture/IGermlingModelProvider.java b/src/main/java/forestry/api/arboriculture/IGermlingModelProvider.java index 47f47c685..be3474b0f 100644 --- a/src/main/java/forestry/api/arboriculture/IGermlingModelProvider.java +++ b/src/main/java/forestry/api/arboriculture/IGermlingModelProvider.java @@ -5,9 +5,10 @@ ******************************************************************************/ package forestry.api.arboriculture; -import forestry.api.core.IModelManager; import net.minecraft.client.resources.model.ModelResourceLocation; +import forestry.api.core.IModelManager; + /** * Provides icons for saplings, pollen, etc. * You must implement this yourself to use TreeManager.treeFactory.createSpecies() @@ -15,5 +16,6 @@ import net.minecraft.client.resources.model.ModelResourceLocation; */ public interface IGermlingModelProvider { void registerModels(IModelManager manager); + ModelResourceLocation getModel(EnumGermlingType type); } diff --git a/src/main/java/forestry/api/arboriculture/IGrowthProvider.java b/src/main/java/forestry/api/arboriculture/IGrowthProvider.java index 909762c4b..41dd17314 100644 --- a/src/main/java/forestry/api/arboriculture/IGrowthProvider.java +++ b/src/main/java/forestry/api/arboriculture/IGrowthProvider.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.arboriculture; @@ -12,7 +12,7 @@ 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 pos Coordinates to attempt growth at. diff --git a/src/main/java/forestry/api/arboriculture/ILeafSpriteProvider.java b/src/main/java/forestry/api/arboriculture/ILeafSpriteProvider.java index fefda5f0c..d111956aa 100644 --- a/src/main/java/forestry/api/arboriculture/ILeafSpriteProvider.java +++ b/src/main/java/forestry/api/arboriculture/ILeafSpriteProvider.java @@ -16,5 +16,6 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite; */ public interface ILeafSpriteProvider { TextureAtlasSprite getSprite(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 5a2112a42..a83b98746 100644 --- a/src/main/java/forestry/api/arboriculture/ILeafTickHandler.java +++ b/src/main/java/forestry/api/arboriculture/ILeafTickHandler.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.arboriculture; diff --git a/src/main/java/forestry/api/arboriculture/IToolGrafter.java b/src/main/java/forestry/api/arboriculture/IToolGrafter.java index 7273947dc..77ef7197a 100644 --- a/src/main/java/forestry/api/arboriculture/IToolGrafter.java +++ b/src/main/java/forestry/api/arboriculture/IToolGrafter.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.arboriculture; @@ -13,7 +13,7 @@ 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 pos Coordinate of the broken leaf block. diff --git a/src/main/java/forestry/api/arboriculture/ITree.java b/src/main/java/forestry/api/arboriculture/ITree.java index 864200a8f..617a44a76 100644 --- a/src/main/java/forestry/api/arboriculture/ITree.java +++ b/src/main/java/forestry/api/arboriculture/ITree.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.arboriculture; diff --git a/src/main/java/forestry/api/arboriculture/ITreeGenome.java b/src/main/java/forestry/api/arboriculture/ITreeGenome.java index fae3e72a0..4578d020e 100644 --- a/src/main/java/forestry/api/arboriculture/ITreeGenome.java +++ b/src/main/java/forestry/api/arboriculture/ITreeGenome.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.arboriculture; diff --git a/src/main/java/forestry/api/arboriculture/ITreeModifier.java b/src/main/java/forestry/api/arboriculture/ITreeModifier.java index 775f91ebe..ba4bd21d5 100644 --- a/src/main/java/forestry/api/arboriculture/ITreeModifier.java +++ b/src/main/java/forestry/api/arboriculture/ITreeModifier.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.arboriculture; @@ -8,28 +8,28 @@ package forestry.api.arboriculture; public interface ITreeModifier { /** - * + * * @param genome * @return Float used to modify the height. */ float getHeightModifier(ITreeGenome genome, float currentModifier); /** - * + * * @param genome * @return Float used to modify the yield. */ float getYieldModifier(ITreeGenome genome, float currentModifier); /** - * + * * @param genome * @return Float used to modify the sappiness. */ float getSappinessModifier(ITreeGenome genome, float currentModifier); /** - * + * * @param genome * @return Float used to modify the maturation. */ diff --git a/src/main/java/forestry/api/arboriculture/ITreeMutation.java b/src/main/java/forestry/api/arboriculture/ITreeMutation.java index ad2960cf2..32e68e798 100644 --- a/src/main/java/forestry/api/arboriculture/ITreeMutation.java +++ b/src/main/java/forestry/api/arboriculture/ITreeMutation.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.arboriculture; diff --git a/src/main/java/forestry/api/arboriculture/ITreeRoot.java b/src/main/java/forestry/api/arboriculture/ITreeRoot.java index 85ad24410..91b92275c 100644 --- a/src/main/java/forestry/api/arboriculture/ITreeRoot.java +++ b/src/main/java/forestry/api/arboriculture/ITreeRoot.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.arboriculture; @@ -50,6 +50,7 @@ public interface ITreeRoot extends ISpeciesRoot { IArboristTracker getBreedingTracker(World world, GameProfile player); /* TREE SPECIFIC */ + /** * Register a leaf tick handler. * @param handler the {@link ILeafTickHandler} to register. diff --git a/src/main/java/forestry/api/arboriculture/ITreekeepingMode.java b/src/main/java/forestry/api/arboriculture/ITreekeepingMode.java index cc5224d8a..f366c65a0 100644 --- a/src/main/java/forestry/api/arboriculture/ITreekeepingMode.java +++ b/src/main/java/forestry/api/arboriculture/ITreekeepingMode.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.arboriculture; diff --git a/src/main/java/forestry/api/arboriculture/IWoodItemAccess.java b/src/main/java/forestry/api/arboriculture/IWoodItemAccess.java index 023fdbd23..063f56471 100644 --- a/src/main/java/forestry/api/arboriculture/IWoodItemAccess.java +++ b/src/main/java/forestry/api/arboriculture/IWoodItemAccess.java @@ -9,8 +9,12 @@ import net.minecraft.item.ItemStack; public interface IWoodItemAccess { ItemStack getLog(EnumWoodType woodType, boolean fireproof); + ItemStack getPlanks(EnumWoodType woodType, boolean fireproof); + ItemStack getSlab(EnumWoodType woodType, boolean fireproof); + ItemStack getFence(EnumWoodType woodType, boolean fireproof); + ItemStack getStairs(EnumWoodType woodType, boolean fireproof); } diff --git a/src/main/java/forestry/api/arboriculture/package-info.java b/src/main/java/forestry/api/arboriculture/package-info.java index a2548cc83..e4dedb7c7 100644 --- a/src/main/java/forestry/api/arboriculture/package-info.java +++ b/src/main/java/forestry/api/arboriculture/package-info.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ @API(apiVersion = "4.2.1", owner = "ForestryAPI|core", provides = "ForestryAPI|arboriculture") diff --git a/src/main/java/forestry/api/circuits/ChipsetManager.java b/src/main/java/forestry/api/circuits/ChipsetManager.java index c5f0db5c3..bbc376df9 100644 --- a/src/main/java/forestry/api/circuits/ChipsetManager.java +++ b/src/main/java/forestry/api/circuits/ChipsetManager.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.circuits; diff --git a/src/main/java/forestry/api/circuits/ICircuit.java b/src/main/java/forestry/api/circuits/ICircuit.java index 62c35f358..aecfbbc87 100644 --- a/src/main/java/forestry/api/circuits/ICircuit.java +++ b/src/main/java/forestry/api/circuits/ICircuit.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.circuits; diff --git a/src/main/java/forestry/api/circuits/ICircuitBoard.java b/src/main/java/forestry/api/circuits/ICircuitBoard.java index ef09575c2..14666f046 100644 --- a/src/main/java/forestry/api/circuits/ICircuitBoard.java +++ b/src/main/java/forestry/api/circuits/ICircuitBoard.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.circuits; diff --git a/src/main/java/forestry/api/circuits/ICircuitLayout.java b/src/main/java/forestry/api/circuits/ICircuitLayout.java index 8c49ab120..9988b78dd 100644 --- a/src/main/java/forestry/api/circuits/ICircuitLayout.java +++ b/src/main/java/forestry/api/circuits/ICircuitLayout.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.circuits; diff --git a/src/main/java/forestry/api/circuits/ICircuitLibrary.java b/src/main/java/forestry/api/circuits/ICircuitLibrary.java index 0d65ba458..268c0f204 100644 --- a/src/main/java/forestry/api/circuits/ICircuitLibrary.java +++ b/src/main/java/forestry/api/circuits/ICircuitLibrary.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.circuits; diff --git a/src/main/java/forestry/api/circuits/ICircuitRegistry.java b/src/main/java/forestry/api/circuits/ICircuitRegistry.java index 9f8c05185..9226b9454 100644 --- a/src/main/java/forestry/api/circuits/ICircuitRegistry.java +++ b/src/main/java/forestry/api/circuits/ICircuitRegistry.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.circuits; diff --git a/src/main/java/forestry/api/circuits/ISolderManager.java b/src/main/java/forestry/api/circuits/ISolderManager.java index af9b41f1b..5eb30791c 100644 --- a/src/main/java/forestry/api/circuits/ISolderManager.java +++ b/src/main/java/forestry/api/circuits/ISolderManager.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.circuits; diff --git a/src/main/java/forestry/api/core/EnumHumidity.java b/src/main/java/forestry/api/core/EnumHumidity.java index e6e400a03..ae7f39d1f 100644 --- a/src/main/java/forestry/api/core/EnumHumidity.java +++ b/src/main/java/forestry/api/core/EnumHumidity.java @@ -1,13 +1,13 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.core; /** * Many things Forestry use temperature and humidity of a biome to determine whether they can or how they can work or spawn at a given location. - * + * * This enum concerns humidity. */ public enum EnumHumidity { @@ -32,11 +32,9 @@ public enum EnumHumidity { public static EnumHumidity getFromValue(float rawHumidity) { if (rawHumidity > 0.85f) { // matches BiomeGenBase.isHighHumidity() return DAMP; - } - else if (rawHumidity >= 0.3f) { + } else if (rawHumidity >= 0.3f) { return NORMAL; - } - else { + } else { return ARID; } } diff --git a/src/main/java/forestry/api/core/EnumTemperature.java b/src/main/java/forestry/api/core/EnumTemperature.java index 5776ff8b4..5c1c6fd20 100644 --- a/src/main/java/forestry/api/core/EnumTemperature.java +++ b/src/main/java/forestry/api/core/EnumTemperature.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.core; @@ -14,7 +14,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; /** * Many things Forestry use temperature and humidity of a biome to determine whether they can or how they can work or spawn at a given location. - * + * * This enum concerns temperature. */ public enum EnumTemperature { @@ -48,17 +48,13 @@ public enum EnumTemperature { public static EnumTemperature getFromValue(float rawTemp) { if (rawTemp > 1.00f) { return HOT; - } - else if (rawTemp > 0.85f) { + } else if (rawTemp > 0.85f) { return WARM; - } - else if (rawTemp > 0.35f) { + } else if (rawTemp > 0.35f) { return NORMAL; - } - else if (rawTemp > 0.0f) { + } else if (rawTemp > 0.0f) { return COLD; - } - else { + } else { return ICY; } } diff --git a/src/main/java/forestry/api/core/ForestryAPI.java b/src/main/java/forestry/api/core/ForestryAPI.java index 7a79e1777..12bc8db3b 100644 --- a/src/main/java/forestry/api/core/ForestryAPI.java +++ b/src/main/java/forestry/api/core/ForestryAPI.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.core; @@ -12,10 +12,10 @@ import net.minecraftforge.fml.relauncher.SideOnly; /** * Forestry's API is divided into several subcategories to make it easier to understand. - * + * * If you need to distribute API files, try to only include the parts you are actually * using to minimize conflicts due to API changes. - * + * * .core - Miscallenous base classes and interfaces as well as some basics for tools, armor, game modes and stuff needed by biome mods. * .fuels - Managers and classes to facilitate adding fuels to various engines and machines. * .recipes - Managers and helpers to facilitate adding new recipes to various machines. @@ -25,7 +25,7 @@ import net.minecraftforge.fml.relauncher.SideOnly; * \ .apiculture - Bees. * \ .arboriculture - Trees. * \ .lepidopterology - Butterflies. - * + * * Note that if Forestry is not present, all these references will be null. */ public class ForestryAPI { diff --git a/src/main/java/forestry/api/core/ForestryEvent.java b/src/main/java/forestry/api/core/ForestryEvent.java index d5fa539bc..8ec8390e8 100644 --- a/src/main/java/forestry/api/core/ForestryEvent.java +++ b/src/main/java/forestry/api/core/ForestryEvent.java @@ -1,15 +1,16 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.core; import net.minecraft.entity.player.EntityPlayer; -import net.minecraftforge.fml.common.eventhandler.Event; import com.mojang.authlib.GameProfile; +import net.minecraftforge.fml.common.eventhandler.Event; + import forestry.api.genetics.IAlleleSpecies; import forestry.api.genetics.IBreedingTracker; import forestry.api.genetics.IMutation; @@ -32,6 +33,7 @@ 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) { super(root, username, tracker); this.species = species; @@ -40,7 +42,8 @@ public abstract class ForestryEvent extends Event { public static class MutationDiscovered extends BreedingEvent { public final IMutation allele; - public MutationDiscovered(ISpeciesRoot root, GameProfile username, IMutation allele, IBreedingTracker tracker) { + + public MutationDiscovered(ISpeciesRoot root, GameProfile username, IMutation allele, IBreedingTracker tracker) { super(root, username, tracker); this.allele = allele; } @@ -49,6 +52,7 @@ public abstract class ForestryEvent extends Event { public static class SyncedBreedingTracker extends ForestryEvent { public final IBreedingTracker tracker; public final EntityPlayer player; + public SyncedBreedingTracker(IBreedingTracker tracker, EntityPlayer player) { super(); this.tracker = tracker; diff --git a/src/main/java/forestry/api/core/IArmorNaturalist.java b/src/main/java/forestry/api/core/IArmorNaturalist.java index b4978e2d4..3b7b8775b 100644 --- a/src/main/java/forestry/api/core/IArmorNaturalist.java +++ b/src/main/java/forestry/api/core/IArmorNaturalist.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.core; @@ -12,7 +12,7 @@ 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 diff --git a/src/main/java/forestry/api/core/IErrorLogic.java b/src/main/java/forestry/api/core/IErrorLogic.java index 03a9eb54f..61e9597bb 100644 --- a/src/main/java/forestry/api/core/IErrorLogic.java +++ b/src/main/java/forestry/api/core/IErrorLogic.java @@ -40,5 +40,6 @@ public interface IErrorLogic extends IErrorSource { * Network serialization for syncing errors to the client from the server. */ void writeData(DataOutputStream data) throws IOException; + void readData(DataInputStream data) throws IOException; } diff --git a/src/main/java/forestry/api/core/IErrorState.java b/src/main/java/forestry/api/core/IErrorState.java index e09fc2827..9310c952e 100644 --- a/src/main/java/forestry/api/core/IErrorState.java +++ b/src/main/java/forestry/api/core/IErrorState.java @@ -6,6 +6,7 @@ package forestry.api.core; import net.minecraft.client.renderer.texture.TextureAtlasSprite; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; diff --git a/src/main/java/forestry/api/core/IErrorStateRegistry.java b/src/main/java/forestry/api/core/IErrorStateRegistry.java index fc67ae78a..bfc56a051 100644 --- a/src/main/java/forestry/api/core/IErrorStateRegistry.java +++ b/src/main/java/forestry/api/core/IErrorStateRegistry.java @@ -9,10 +9,13 @@ import java.util.Set; public interface IErrorStateRegistry { void registerErrorState(IErrorState state); + void addAlias(IErrorState state, String name); IErrorState getErrorState(short id); + IErrorState getErrorState(String name); + Set getErrorStates(); IErrorLogic createErrorLogic(); diff --git a/src/main/java/forestry/api/core/IForestryConstants.java b/src/main/java/forestry/api/core/IForestryConstants.java index 00ec55322..4e565fc21 100644 --- a/src/main/java/forestry/api/core/IForestryConstants.java +++ b/src/main/java/forestry/api/core/IForestryConstants.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.core; diff --git a/src/main/java/forestry/api/core/IGameMode.java b/src/main/java/forestry/api/core/IGameMode.java index 0b2b0c55d..9a599b10a 100644 --- a/src/main/java/forestry/api/core/IGameMode.java +++ b/src/main/java/forestry/api/core/IGameMode.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.core; diff --git a/src/main/java/forestry/api/core/IItemModelRegister.java b/src/main/java/forestry/api/core/IItemModelRegister.java index d2d57da26..85897293c 100644 --- a/src/main/java/forestry/api/core/IItemModelRegister.java +++ b/src/main/java/forestry/api/core/IItemModelRegister.java @@ -1,11 +1,12 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.core; import net.minecraft.item.Item; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; diff --git a/src/main/java/forestry/api/core/IModelBaker.java b/src/main/java/forestry/api/core/IModelBaker.java index 3bd3375ae..faa1d75e5 100644 --- a/src/main/java/forestry/api/core/IModelBaker.java +++ b/src/main/java/forestry/api/core/IModelBaker.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.core; @@ -20,7 +20,7 @@ public interface IModelBaker { void setRenderBoundsFromBlock(Block block); - void setRenderBounds(double d, double e, double f, double g, double h, double i ); + void setRenderBounds(double d, double e, double f, double g, double h, double i); void setColorIndex(int color); @@ -34,7 +34,7 @@ public interface IModelBaker { void renderFaceZNeg(BlockPos pos, TextureAtlasSprite sprite); - void renderFaceYPos(BlockPos pos, TextureAtlasSprite sprite); + void renderFaceYPos(BlockPos pos, TextureAtlasSprite sprite); void renderFaceZPos(BlockPos pos, TextureAtlasSprite sprite); diff --git a/src/main/java/forestry/api/core/IModelManager.java b/src/main/java/forestry/api/core/IModelManager.java index 9591a3125..5bad377b3 100644 --- a/src/main/java/forestry/api/core/IModelManager.java +++ b/src/main/java/forestry/api/core/IModelManager.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.core; @@ -9,6 +9,7 @@ import net.minecraft.client.renderer.ItemMeshDefinition; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraft.util.ResourceLocation; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; diff --git a/src/main/java/forestry/api/core/IModelProvider.java b/src/main/java/forestry/api/core/IModelProvider.java index e6723f716..16838f1d4 100644 --- a/src/main/java/forestry/api/core/IModelProvider.java +++ b/src/main/java/forestry/api/core/IModelProvider.java @@ -1,12 +1,13 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.core; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.Item; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; diff --git a/src/main/java/forestry/api/core/INBTTagable.java b/src/main/java/forestry/api/core/INBTTagable.java index 1d3f85808..f55cd1c0f 100644 --- a/src/main/java/forestry/api/core/INBTTagable.java +++ b/src/main/java/forestry/api/core/INBTTagable.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.core; diff --git a/src/main/java/forestry/api/core/ISpriteProvider.java b/src/main/java/forestry/api/core/ISpriteProvider.java index 4d6288adc..359995c34 100644 --- a/src/main/java/forestry/api/core/ISpriteProvider.java +++ b/src/main/java/forestry/api/core/ISpriteProvider.java @@ -1,11 +1,12 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.core; import net.minecraft.client.renderer.texture.TextureAtlasSprite; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; diff --git a/src/main/java/forestry/api/core/IStateMapperRegister.java b/src/main/java/forestry/api/core/IStateMapperRegister.java index 2be1168f5..4eda1219b 100644 --- a/src/main/java/forestry/api/core/IStateMapperRegister.java +++ b/src/main/java/forestry/api/core/IStateMapperRegister.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.core; diff --git a/src/main/java/forestry/api/core/ITextureManager.java b/src/main/java/forestry/api/core/ITextureManager.java index 6d0a061a4..2d01e57ce 100644 --- a/src/main/java/forestry/api/core/ITextureManager.java +++ b/src/main/java/forestry/api/core/ITextureManager.java @@ -1,13 +1,14 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.core; import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraftforge.fml.relauncher.SideOnly; + import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; @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 f5f1a6338..5230aa3ef 100644 --- a/src/main/java/forestry/api/core/IToolPipette.java +++ b/src/main/java/forestry/api/core/IToolPipette.java @@ -19,36 +19,36 @@ import net.minecraftforge.fluids.FluidStack; */ public interface IToolPipette { - /** - * @param pipette - * ItemStack of the pipette. - * @return Capacity of the pipette. - */ - int getCapacity(ItemStack pipette); + /** + * @param pipette + * ItemStack of the pipette. + * @return Capacity of the pipette. + */ + int getCapacity(ItemStack pipette); - /** - * @param pipette - * @return true if the pipette can pipette. - */ - boolean canPipette(ItemStack pipette); + /** + * @param pipette + * @return true if the pipette can pipette. + */ + boolean canPipette(ItemStack pipette); - /** - * Fills the pipette with the given liquid stack. - * - * @param pipette - * @param liquid - * @param doFill - * @return Amount of liquid used in filling the pipette. - */ - int fill(ItemStack pipette, FluidStack liquid, boolean doFill); + /** + * Fills the pipette with the given liquid stack. + * + * @param pipette + * @param liquid + * @param doFill + * @return Amount of liquid used in filling the pipette. + */ + int fill(ItemStack pipette, FluidStack liquid, boolean doFill); - /** - * Drains liquid from the pipette - * - * @param pipette - * @param maxDrain - * @param doDrain - * @return Fluid stack representing the liquid and amount drained from the pipette. - */ - FluidStack drain(ItemStack pipette, int maxDrain, boolean doDrain); + /** + * Drains liquid from the pipette + * + * @param pipette + * @param maxDrain + * @param doDrain + * @return Fluid stack representing the liquid and amount drained from the pipette. + */ + FluidStack drain(ItemStack pipette, int maxDrain, boolean doDrain); } diff --git a/src/main/java/forestry/api/core/IToolScoop.java b/src/main/java/forestry/api/core/IToolScoop.java index 583b6c7ed..1db380a1d 100644 --- a/src/main/java/forestry/api/core/IToolScoop.java +++ b/src/main/java/forestry/api/core/IToolScoop.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.core; diff --git a/src/main/java/forestry/api/core/Tabs.java b/src/main/java/forestry/api/core/Tabs.java index 4ce85838d..75f60e3bc 100644 --- a/src/main/java/forestry/api/core/Tabs.java +++ b/src/main/java/forestry/api/core/Tabs.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.core; diff --git a/src/main/java/forestry/api/farming/FarmDirection.java b/src/main/java/forestry/api/farming/FarmDirection.java index b65f3da2d..165bce29c 100644 --- a/src/main/java/forestry/api/farming/FarmDirection.java +++ b/src/main/java/forestry/api/farming/FarmDirection.java @@ -25,10 +25,14 @@ public enum FarmDirection { public static FarmDirection getFarmDirection(EnumFacing forgeDirection) { switch (forgeDirection) { - case NORTH: return NORTH; - case EAST: return EAST; - case SOUTH: return SOUTH; - case WEST: return WEST; + case NORTH: + return NORTH; + case EAST: + return EAST; + case SOUTH: + return SOUTH; + case WEST: + return WEST; } return null; } diff --git a/src/main/java/forestry/api/farming/Farmables.java b/src/main/java/forestry/api/farming/Farmables.java index 35319a848..47004cb6f 100644 --- a/src/main/java/forestry/api/farming/Farmables.java +++ b/src/main/java/forestry/api/farming/Farmables.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.farming; @@ -11,7 +11,7 @@ import java.util.HashMap; public class Farmables { /** * Can be used to add IFarmables to some of the vanilla farm logics. - * + * * Identifiers: farmArboreal farmWheat farmGourd farmInfernal farmPoales farmSucculentes farmVegetables farmShroom */ public static HashMap> farmables = new HashMap<>(); diff --git a/src/main/java/forestry/api/farming/ICrop.java b/src/main/java/forestry/api/farming/ICrop.java index 22575477d..6dd967df3 100644 --- a/src/main/java/forestry/api/farming/ICrop.java +++ b/src/main/java/forestry/api/farming/ICrop.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.farming; @@ -13,7 +13,7 @@ public interface ICrop { /** * Harvests this crop. Performs the necessary manipulations to set the crop into a "harvested" state. - * + * * @return Products harvested. */ Collection harvest(); diff --git a/src/main/java/forestry/api/farming/IFarmHousing.java b/src/main/java/forestry/api/farming/IFarmHousing.java index 81c01b215..c2bd3a623 100644 --- a/src/main/java/forestry/api/farming/IFarmHousing.java +++ b/src/main/java/forestry/api/farming/IFarmHousing.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.farming; @@ -15,8 +15,11 @@ import forestry.api.core.IErrorLogicSource; public interface IFarmHousing extends IErrorLogicSource { int[] getCoords(); + int[] getArea(); + int[] getOffset(); + World getWorld(); /** @@ -25,6 +28,7 @@ public interface IFarmHousing extends IErrorLogicSource { boolean doWork(); boolean hasLiquid(FluidStack liquid); + void removeLiquid(FluidStack liquid); /** @@ -41,7 +45,9 @@ public interface IFarmHousing extends IErrorLogicSource { /* LOGIC */ void setFarmLogic(FarmDirection direction, IFarmLogic logic); + void resetFarmLogic(FarmDirection direction); + IFarmLogic getFarmLogic(FarmDirection direction); /* GUI */ diff --git a/src/main/java/forestry/api/farming/IFarmInventory.java b/src/main/java/forestry/api/farming/IFarmInventory.java index 36f45ea39..f086cf86b 100644 --- a/src/main/java/forestry/api/farming/IFarmInventory.java +++ b/src/main/java/forestry/api/farming/IFarmInventory.java @@ -10,14 +10,20 @@ import net.minecraft.item.ItemStack; public interface IFarmInventory { boolean hasResources(ItemStack[] resources); + void removeResources(ItemStack[] resources); boolean acceptsAsGermling(ItemStack itemstack); + boolean acceptsAsResource(ItemStack itemstack); + boolean acceptsAsFertilizer(ItemStack itemstack); IInventory getProductInventory(); + IInventory getGermlingsInventory(); + IInventory getResourcesInventory(); + IInventory getFertilizerInventory(); } diff --git a/src/main/java/forestry/api/farming/IFarmListener.java b/src/main/java/forestry/api/farming/IFarmListener.java index 20a98cadd..a0cc54b2a 100644 --- a/src/main/java/forestry/api/farming/IFarmListener.java +++ b/src/main/java/forestry/api/farming/IFarmListener.java @@ -14,7 +14,7 @@ public interface IFarmListener { /** * Called before a crop is harvested. - * + * * @param crop ICrop about to be harvested. * @return true to cancel further processing of this crop. */ @@ -22,7 +22,7 @@ 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} */ @@ -30,7 +30,7 @@ public interface IFarmListener { /** * 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! */ void hasCollected(Collection collected, IFarmLogic logic); diff --git a/src/main/java/forestry/api/farming/IFarmLogic.java b/src/main/java/forestry/api/farming/IFarmLogic.java index 9d9e2755f..49d64d752 100644 --- a/src/main/java/forestry/api/farming/IFarmLogic.java +++ b/src/main/java/forestry/api/farming/IFarmLogic.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.farming; @@ -10,6 +10,7 @@ import java.util.Collection; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.util.ResourceLocation; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; diff --git a/src/main/java/forestry/api/farming/IFarmable.java b/src/main/java/forestry/api/farming/IFarmable.java index e1438715d..91f41158d 100644 --- a/src/main/java/forestry/api/farming/IFarmable.java +++ b/src/main/java/forestry/api/farming/IFarmable.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.farming; diff --git a/src/main/java/forestry/api/farming/package-info.java b/src/main/java/forestry/api/farming/package-info.java index d916d01bd..00a3edefb 100644 --- a/src/main/java/forestry/api/farming/package-info.java +++ b/src/main/java/forestry/api/farming/package-info.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ -@API(apiVersion="2.1.0", owner="ForestryAPI|core", provides="ForestryAPI|farming") +@API(apiVersion = "2.1.0", owner = "ForestryAPI|core", provides = "ForestryAPI|farming") package forestry.api.farming; import net.minecraftforge.fml.common.API; diff --git a/src/main/java/forestry/api/food/BeverageManager.java b/src/main/java/forestry/api/food/BeverageManager.java index 2b0143ab1..39ef247db 100644 --- a/src/main/java/forestry/api/food/BeverageManager.java +++ b/src/main/java/forestry/api/food/BeverageManager.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.food; diff --git a/src/main/java/forestry/api/food/IBeverageEffect.java b/src/main/java/forestry/api/food/IBeverageEffect.java index 6a787411d..3022cf24b 100644 --- a/src/main/java/forestry/api/food/IBeverageEffect.java +++ b/src/main/java/forestry/api/food/IBeverageEffect.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.food; diff --git a/src/main/java/forestry/api/food/IInfuserManager.java b/src/main/java/forestry/api/food/IInfuserManager.java index d778ffa41..da843bb66 100644 --- a/src/main/java/forestry/api/food/IInfuserManager.java +++ b/src/main/java/forestry/api/food/IInfuserManager.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.food; diff --git a/src/main/java/forestry/api/food/IIngredientManager.java b/src/main/java/forestry/api/food/IIngredientManager.java index fab0e0129..7331d6bdd 100644 --- a/src/main/java/forestry/api/food/IIngredientManager.java +++ b/src/main/java/forestry/api/food/IIngredientManager.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.food; diff --git a/src/main/java/forestry/api/food/package-info.java b/src/main/java/forestry/api/food/package-info.java index c7dbfd01f..fbaab061f 100644 --- a/src/main/java/forestry/api/food/package-info.java +++ b/src/main/java/forestry/api/food/package-info.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ -@API(apiVersion="1.1.0", owner="ForestryAPI|core", provides="ForestryAPI|food") +@API(apiVersion = "1.1.0", owner = "ForestryAPI|core", provides = "ForestryAPI|food") package forestry.api.food; import net.minecraftforge.fml.common.API; diff --git a/src/main/java/forestry/api/fuels/EngineBronzeFuel.java b/src/main/java/forestry/api/fuels/EngineBronzeFuel.java index cbab0cafc..2b5cd83e4 100644 --- a/src/main/java/forestry/api/fuels/EngineBronzeFuel.java +++ b/src/main/java/forestry/api/fuels/EngineBronzeFuel.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.fuels; diff --git a/src/main/java/forestry/api/fuels/EngineCopperFuel.java b/src/main/java/forestry/api/fuels/EngineCopperFuel.java index af568dd41..9afcda3c8 100644 --- a/src/main/java/forestry/api/fuels/EngineCopperFuel.java +++ b/src/main/java/forestry/api/fuels/EngineCopperFuel.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.fuels; diff --git a/src/main/java/forestry/api/fuels/FermenterFuel.java b/src/main/java/forestry/api/fuels/FermenterFuel.java index 32989a803..24581263f 100644 --- a/src/main/java/forestry/api/fuels/FermenterFuel.java +++ b/src/main/java/forestry/api/fuels/FermenterFuel.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.fuels; diff --git a/src/main/java/forestry/api/fuels/FuelManager.java b/src/main/java/forestry/api/fuels/FuelManager.java index f53d6fb71..b5bfe74f6 100644 --- a/src/main/java/forestry/api/fuels/FuelManager.java +++ b/src/main/java/forestry/api/fuels/FuelManager.java @@ -1,15 +1,16 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.fuels; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.Fluid; - import java.util.HashMap; +import net.minecraft.item.ItemStack; + +import net.minecraftforge.fluids.Fluid; + public class FuelManager { /** diff --git a/src/main/java/forestry/api/fuels/GeneratorFuel.java b/src/main/java/forestry/api/fuels/GeneratorFuel.java index 16e2ee4d3..35ae2f2d0 100644 --- a/src/main/java/forestry/api/fuels/GeneratorFuel.java +++ b/src/main/java/forestry/api/fuels/GeneratorFuel.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.fuels; diff --git a/src/main/java/forestry/api/fuels/MoistenerFuel.java b/src/main/java/forestry/api/fuels/MoistenerFuel.java index 4c4c7a0b6..a76a9189e 100644 --- a/src/main/java/forestry/api/fuels/MoistenerFuel.java +++ b/src/main/java/forestry/api/fuels/MoistenerFuel.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.fuels; diff --git a/src/main/java/forestry/api/fuels/RainSubstrate.java b/src/main/java/forestry/api/fuels/RainSubstrate.java index ab0deb5a3..c9e2b301f 100644 --- a/src/main/java/forestry/api/fuels/RainSubstrate.java +++ b/src/main/java/forestry/api/fuels/RainSubstrate.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.fuels; diff --git a/src/main/java/forestry/api/fuels/package-info.java b/src/main/java/forestry/api/fuels/package-info.java index c6bf9e745..fb2f50abd 100644 --- a/src/main/java/forestry/api/fuels/package-info.java +++ b/src/main/java/forestry/api/fuels/package-info.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ -@API(apiVersion="2.0.1", owner="ForestryAPI|core", provides="ForestryAPI|fuels") +@API(apiVersion = "2.0.1", owner = "ForestryAPI|core", provides = "ForestryAPI|fuels") package forestry.api.fuels; import net.minecraftforge.fml.common.API; diff --git a/src/main/java/forestry/api/genetics/AlleleManager.java b/src/main/java/forestry/api/genetics/AlleleManager.java index b42955b55..ad3c69005 100644 --- a/src/main/java/forestry/api/genetics/AlleleManager.java +++ b/src/main/java/forestry/api/genetics/AlleleManager.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; diff --git a/src/main/java/forestry/api/genetics/EnumTolerance.java b/src/main/java/forestry/api/genetics/EnumTolerance.java index 6ff0085eb..41954d48d 100644 --- a/src/main/java/forestry/api/genetics/EnumTolerance.java +++ b/src/main/java/forestry/api/genetics/EnumTolerance.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; diff --git a/src/main/java/forestry/api/genetics/IAllele.java b/src/main/java/forestry/api/genetics/IAllele.java index 527474102..5c79d0842 100644 --- a/src/main/java/forestry/api/genetics/IAllele.java +++ b/src/main/java/forestry/api/genetics/IAllele.java @@ -1,17 +1,17 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; /** * An {@link IIndividual}'s {@link IGenome} is composed of {@link IChromosome}s consisting each of a primary and secondary {@link IAllele}. - * + * * {@link IAllele}s hold all information regarding an {@link IIndividual}'s traits, from species to size, temperature tolerances, etc. - * + * * Should be extended for different types of alleles. ISpeciesAllele, IBiomeAllele, etc. - * + * * @author SirSengir */ public interface IAllele { @@ -32,8 +32,8 @@ public interface IAllele { String getName(); /** - * @return The unlocalized identifier - */ + * @return The unlocalized identifier + */ String getUnlocalizedName(); } diff --git a/src/main/java/forestry/api/genetics/IAlleleArea.java b/src/main/java/forestry/api/genetics/IAlleleArea.java index 7277ff0a1..4d31e0144 100644 --- a/src/main/java/forestry/api/genetics/IAlleleArea.java +++ b/src/main/java/forestry/api/genetics/IAlleleArea.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; diff --git a/src/main/java/forestry/api/genetics/IAlleleBoolean.java b/src/main/java/forestry/api/genetics/IAlleleBoolean.java index 887da3b90..ba67931ad 100644 --- a/src/main/java/forestry/api/genetics/IAlleleBoolean.java +++ b/src/main/java/forestry/api/genetics/IAlleleBoolean.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; diff --git a/src/main/java/forestry/api/genetics/IAlleleEffect.java b/src/main/java/forestry/api/genetics/IAlleleEffect.java index 7b94e6b16..314d6a8d7 100644 --- a/src/main/java/forestry/api/genetics/IAlleleEffect.java +++ b/src/main/java/forestry/api/genetics/IAlleleEffect.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; @@ -17,7 +17,7 @@ public interface IAlleleEffect extends IAllele { /** * 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/IAlleleFloat.java b/src/main/java/forestry/api/genetics/IAlleleFloat.java index 6ca28776a..66ad69aed 100644 --- a/src/main/java/forestry/api/genetics/IAlleleFloat.java +++ b/src/main/java/forestry/api/genetics/IAlleleFloat.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; diff --git a/src/main/java/forestry/api/genetics/IAlleleFlowers.java b/src/main/java/forestry/api/genetics/IAlleleFlowers.java index 0368ca41c..9242af4a8 100644 --- a/src/main/java/forestry/api/genetics/IAlleleFlowers.java +++ b/src/main/java/forestry/api/genetics/IAlleleFlowers.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; diff --git a/src/main/java/forestry/api/genetics/IAlleleHandler.java b/src/main/java/forestry/api/genetics/IAlleleHandler.java index 0e25c652b..797ebe188 100644 --- a/src/main/java/forestry/api/genetics/IAlleleHandler.java +++ b/src/main/java/forestry/api/genetics/IAlleleHandler.java @@ -1,22 +1,22 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; /** * @author Alex Binnie - * + * * Handler for events that occur in IAlleleRegistry, such as registering alleles, branches etc. Useful for handling plugin specific behavior (i.e. * creating a list of all bee species etc.) - * + * */ public interface IAlleleHandler { /** * Called when an allele is registered with {@link IAlleleRegistry}. - * + * * @param allele * Allele which was registered. */ @@ -24,7 +24,7 @@ public interface IAlleleHandler { /** * Called when a classification is registered with {@link IAlleleRegistry}. - * + * * @param classification * Classification which was registered. */ @@ -32,7 +32,7 @@ public interface IAlleleHandler { /** * Called when a fruit family is registered with {@link IAlleleRegistry}. - * + * * @param family * Fruit family which was registered. */ diff --git a/src/main/java/forestry/api/genetics/IAlleleInteger.java b/src/main/java/forestry/api/genetics/IAlleleInteger.java index 6991efe5f..7b6499706 100644 --- a/src/main/java/forestry/api/genetics/IAlleleInteger.java +++ b/src/main/java/forestry/api/genetics/IAlleleInteger.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; diff --git a/src/main/java/forestry/api/genetics/IAllelePlantType.java b/src/main/java/forestry/api/genetics/IAllelePlantType.java index dc447c525..0e18e95b4 100644 --- a/src/main/java/forestry/api/genetics/IAllelePlantType.java +++ b/src/main/java/forestry/api/genetics/IAllelePlantType.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; diff --git a/src/main/java/forestry/api/genetics/IAlleleRegistry.java b/src/main/java/forestry/api/genetics/IAlleleRegistry.java index 3591c8198..f8736c597 100644 --- a/src/main/java/forestry/api/genetics/IAlleleRegistry.java +++ b/src/main/java/forestry/api/genetics/IAlleleRegistry.java @@ -22,6 +22,7 @@ import forestry.api.genetics.IClassification.EnumClassLevel; public interface IAlleleRegistry { /* SPECIES ROOT CLASSES */ + /** * Register a {@link ISpeciesRoot}. * @param root {@link ISpeciesRoot} to register. @@ -55,9 +56,10 @@ public interface IAlleleRegistry { ISpeciesRoot getSpeciesRoot(Class clz); /* INDIVIDUAL */ + /** * Tests the itemstack for genetic information. - * + * * @param stack * @return true if the itemstack is an individual. */ @@ -65,7 +67,7 @@ public interface IAlleleRegistry { /** * Retrieve genetic information from an itemstack. - * + * * @param stack * Stack to retrieve genetic information for. * @return IIndividual containing genetic information, null if none could be extracted. @@ -98,7 +100,7 @@ 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 @@ -108,7 +110,7 @@ public interface IAlleleRegistry { /** * Gets an allele - * + * * @param uid * String based unique identifier of the allele to retrieve. * @return IAllele if found or a replacement is found in the Deprecated Allele map, null otherwise. @@ -122,6 +124,7 @@ public interface IAlleleRegistry { Collection getRegisteredAlleles(IChromosomeType type); /* CLASSIFICATIONS */ + /** * @return HashMap of all currently registered classifications. */ @@ -129,7 +132,7 @@ public interface IAlleleRegistry { /** * Registers a classification. - * + * * @param classification * IClassification to register. */ @@ -137,7 +140,7 @@ public interface IAlleleRegistry { /** * Creates and returns a classification. - * + * * @param level * EnumClassLevel of the classification to create. * @param uid @@ -147,11 +150,12 @@ public interface IAlleleRegistry { * @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); /** * Gets a classification. - * + * * @param uid * String based unique identifier of the classification to retrieve. * @return {@link IClassification} if found, null otherwise. @@ -159,41 +163,44 @@ public interface IAlleleRegistry { IClassification getClassification(String uid); /* FRUIT FAMILIES */ + /** * Get all registered fruit families. - * + * * @return A map of registered fruit families and their UIDs. */ Map getRegisteredFruitFamilies(); /** * Registers a new fruit family. - * + * * @param family */ void registerFruitFamily(IFruitFamily family); /** * Retrieves a fruit family identified by uid. - * + * * @param uid * @return {IFruitFamily} if found, false otherwise. */ IFruitFamily getFruitFamily(String uid); /* ALLELE HANDLERS */ + /** * Registers a new IAlleleHandler - * + * * @param handler * IAlleleHandler to register. */ void registerAlleleHandler(IAlleleHandler handler); /* BLACKLIST */ + /** * Blacklist an allele identified by its UID from mutation. - * + * * @param uid * UID of the allele to blacklist. */ @@ -212,6 +219,7 @@ public interface IAlleleRegistry { boolean isBlacklisted(String uid); /* RESEARCH */ + /** * @param researcher Username of the player who researched this note. * @param species {@link IAlleleSpecies} to encode on the research note. diff --git a/src/main/java/forestry/api/genetics/IAlleleSpecies.java b/src/main/java/forestry/api/genetics/IAlleleSpecies.java index d3a355267..81bdf2ead 100644 --- a/src/main/java/forestry/api/genetics/IAlleleSpecies.java +++ b/src/main/java/forestry/api/genetics/IAlleleSpecies.java @@ -1,17 +1,18 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import com.mojang.authlib.GameProfile; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.core.EnumHumidity; import forestry.api.core.EnumTemperature; import forestry.api.core.IModelProvider; @@ -34,14 +35,14 @@ public interface IAlleleSpecies extends IAllele { /** * Binomial name of the species sans genus ("Apis"). Returning "humboldti" will have the bee species flavour name be "Apis humboldti". Feel free to use fun * names or return null. - * + * * @return flavour text (may be null) */ String getBinomial(); /** * Authority for the binomial name, e.g. "Sengir" on species of base Forestry. - * + * * @return flavour text (may be null) */ String getAuthority(); @@ -52,6 +53,7 @@ public interface IAlleleSpecies extends IAllele { IClassification getBranch(); /* RESEARCH */ + /** * Complexity determines the difficulty researching a species. The values of primary and secondary are * added together (and rounded) to determine the amount of pairs needed for successful research. @@ -75,6 +77,7 @@ public interface IAlleleSpecies extends IAllele { ItemStack[] getResearchBounty(World world, GameProfile gameProfile, IIndividual individual, int bountyLevel); /* CLIMATE */ + /** * @return Preferred temperature */ @@ -86,6 +89,7 @@ public interface IAlleleSpecies extends IAllele { EnumHumidity getHumidity(); /* MISC */ + /** * @return true if the species icon should have a glowing effect. */ @@ -102,6 +106,7 @@ public interface IAlleleSpecies extends IAllele { boolean isCounted(); /* APPEARANCE */ + /** * @param renderPass Render pass to get the colour for. * @return Colour to use for the render pass. diff --git a/src/main/java/forestry/api/genetics/IAlleleSpeciesCustom.java b/src/main/java/forestry/api/genetics/IAlleleSpeciesCustom.java index ff1381628..771f26124 100644 --- a/src/main/java/forestry/api/genetics/IAlleleSpeciesCustom.java +++ b/src/main/java/forestry/api/genetics/IAlleleSpeciesCustom.java @@ -11,6 +11,7 @@ import forestry.api.core.EnumTemperature; public interface IAlleleSpeciesCustom extends IAlleleSpecies { IAlleleSpeciesCustom setTemperature(EnumTemperature temperature); + IAlleleSpeciesCustom setHumidity(EnumHumidity humidity); IAlleleSpeciesCustom setHasEffect(); diff --git a/src/main/java/forestry/api/genetics/IAlleleTolerance.java b/src/main/java/forestry/api/genetics/IAlleleTolerance.java index f5ba9e670..4693e72ca 100644 --- a/src/main/java/forestry/api/genetics/IAlleleTolerance.java +++ b/src/main/java/forestry/api/genetics/IAlleleTolerance.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; diff --git a/src/main/java/forestry/api/genetics/IBreedingTracker.java b/src/main/java/forestry/api/genetics/IBreedingTracker.java index 7533a59a6..13f67a70b 100644 --- a/src/main/java/forestry/api/genetics/IBreedingTracker.java +++ b/src/main/java/forestry/api/genetics/IBreedingTracker.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; @@ -12,7 +12,7 @@ import forestry.api.apiculture.IBeekeepingMode; /** * Keeps track of who bred, discovered, and researched which species in a world. - * + * * @author SirSengir */ public interface IBreedingTracker { @@ -34,35 +34,35 @@ public interface IBreedingTracker { /** * Register the birth of an individual. Will mark it as discovered. - * + * * @param individual */ void registerBirth(IIndividual individual); /** * Register the pickup of an individual. - * + * * @param individual */ void registerPickup(IIndividual individual); /** * Marks a species as discovered. Should only be called from registerIndividual normally. - * + * * @param species */ void registerSpecies(IAlleleSpecies species); /** * Register a successful mutation. Will mark it as discovered. - * + * * @param mutation */ void registerMutation(IMutation mutation); /** * Queries the tracker for discovered species. - * + * * @param mutation * Mutation to query for. * @return true if the mutation has been discovered. @@ -71,7 +71,7 @@ public interface IBreedingTracker { /** * Queries the tracker for discovered species. - * + * * @param species * Species to check. * @return true if the species has been bred. diff --git a/src/main/java/forestry/api/genetics/IChromosome.java b/src/main/java/forestry/api/genetics/IChromosome.java index d501efbac..0d2b1c04e 100644 --- a/src/main/java/forestry/api/genetics/IChromosome.java +++ b/src/main/java/forestry/api/genetics/IChromosome.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; @@ -9,7 +9,7 @@ import forestry.api.core.INBTTagable; /** * Implementations other than Forestry's default one are not supported! - * + * * @author SirSengir */ public interface IChromosome extends INBTTagable { diff --git a/src/main/java/forestry/api/genetics/IChromosomeType.java b/src/main/java/forestry/api/genetics/IChromosomeType.java index a3b1f8e0c..1f727b252 100644 --- a/src/main/java/forestry/api/genetics/IChromosomeType.java +++ b/src/main/java/forestry/api/genetics/IChromosomeType.java @@ -1,24 +1,24 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; - + /* * Interface to be implemented by the enums representing the various chromosomes */ public interface IChromosomeType { - - /* - * Get class which all alleles on this chromosome must interface - */ - Class getAlleleClass(); - - String getName(); - - ISpeciesRoot getSpeciesRoot(); - - int ordinal(); - + + /* + * Get class which all alleles on this chromosome must interface + */ + Class getAlleleClass(); + + String getName(); + + ISpeciesRoot getSpeciesRoot(); + + int ordinal(); + } diff --git a/src/main/java/forestry/api/genetics/IClassification.java b/src/main/java/forestry/api/genetics/IClassification.java index f2faa8e64..b681537c2 100644 --- a/src/main/java/forestry/api/genetics/IClassification.java +++ b/src/main/java/forestry/api/genetics/IClassification.java @@ -1,13 +1,13 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; /** * Biological classifications from domain down to genus. - * + * * Used by the *alyzers to display hierarchies. */ public interface IClassification { @@ -61,7 +61,7 @@ public interface IClassification { /** * A branch approximates a "genus" in real life. Real life examples: "Micrapis", "Megapis" - * + * * @return flavour text (may be null) */ String getScientific(); @@ -88,7 +88,7 @@ public interface IClassification { /** * Used by the allele registry to populate internal collection of branch members on the fly. - * + * * @param species */ void addMemberSpecies(IAlleleSpecies species); @@ -100,7 +100,7 @@ public interface IClassification { /** * Only used internally by the AlleleRegistry if this classification has been added to another one. - * + * * @param parent */ void setParent(IClassification parent); diff --git a/src/main/java/forestry/api/genetics/IClimateHelper.java b/src/main/java/forestry/api/genetics/IClimateHelper.java index 481460427..3607b0fb1 100644 --- a/src/main/java/forestry/api/genetics/IClimateHelper.java +++ b/src/main/java/forestry/api/genetics/IClimateHelper.java @@ -21,6 +21,7 @@ public interface IClimateHelper { EnumHumidity baseHumid, EnumTolerance tolHumid); boolean isWithinLimits(EnumTemperature temperature, EnumTemperature baseTemp, EnumTolerance tolTemp); + boolean isWithinLimits(EnumHumidity humidity, EnumHumidity baseHumid, EnumTolerance tolHumid); /** @@ -30,6 +31,7 @@ public interface IClimateHelper { * @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. @@ -44,6 +46,7 @@ public interface IClimateHelper { * @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. diff --git a/src/main/java/forestry/api/genetics/IEffectData.java b/src/main/java/forestry/api/genetics/IEffectData.java index 909ab78df..a1fe33ba0 100644 --- a/src/main/java/forestry/api/genetics/IEffectData.java +++ b/src/main/java/forestry/api/genetics/IEffectData.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; @@ -9,7 +9,7 @@ import forestry.api.core.INBTTagable; /** * Container to hold some temporary data for bee, tree and butterfly effects. - * + * * @author SirSengir */ public interface IEffectData extends INBTTagable { diff --git a/src/main/java/forestry/api/genetics/IFlowerGrowthRule.java b/src/main/java/forestry/api/genetics/IFlowerGrowthRule.java index 1cef316fb..88b5e54ac 100644 --- a/src/main/java/forestry/api/genetics/IFlowerGrowthRule.java +++ b/src/main/java/forestry/api/genetics/IFlowerGrowthRule.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; diff --git a/src/main/java/forestry/api/genetics/IFlowerProvider.java b/src/main/java/forestry/api/genetics/IFlowerProvider.java index 208b3184e..5a428a6e8 100644 --- a/src/main/java/forestry/api/genetics/IFlowerProvider.java +++ b/src/main/java/forestry/api/genetics/IFlowerProvider.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; diff --git a/src/main/java/forestry/api/genetics/IFlowerRegistry.java b/src/main/java/forestry/api/genetics/IFlowerRegistry.java index dad1d5976..9ecc564e3 100644 --- a/src/main/java/forestry/api/genetics/IFlowerRegistry.java +++ b/src/main/java/forestry/api/genetics/IFlowerRegistry.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; @@ -29,6 +29,7 @@ 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. */ diff --git a/src/main/java/forestry/api/genetics/IFruitBearer.java b/src/main/java/forestry/api/genetics/IFruitBearer.java index 5316f9ebc..2b73edd8b 100644 --- a/src/main/java/forestry/api/genetics/IFruitBearer.java +++ b/src/main/java/forestry/api/genetics/IFruitBearer.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; @@ -11,7 +11,7 @@ import net.minecraft.item.ItemStack; /** * Can be implemented by tile entities which can bear fruit. - * + * * @author SirSengir */ public interface IFruitBearer { @@ -28,7 +28,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. * @return Picked fruits. @@ -42,7 +42,7 @@ public interface IFruitBearer { /** * Increases the ripeness of the fruit. - * + * * @param add * Float to add to the ripeness. Will truncate to valid values. */ diff --git a/src/main/java/forestry/api/genetics/IFruitFamily.java b/src/main/java/forestry/api/genetics/IFruitFamily.java index d48a4d8a1..357e8f7be 100644 --- a/src/main/java/forestry/api/genetics/IFruitFamily.java +++ b/src/main/java/forestry/api/genetics/IFruitFamily.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; @@ -19,7 +19,7 @@ public interface IFruitFamily { /** * A scientific-y name for this fruit family - * + * * @return flavour text (may be null) */ String getScientific(); diff --git a/src/main/java/forestry/api/genetics/IGenome.java b/src/main/java/forestry/api/genetics/IGenome.java index 0d3ad2319..12fcad835 100644 --- a/src/main/java/forestry/api/genetics/IGenome.java +++ b/src/main/java/forestry/api/genetics/IGenome.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; @@ -9,7 +9,7 @@ import forestry.api.core.INBTTagable; /** * Holds the {@link IChromosome}s which comprise the traits of a given individual. - * + * * Only the default implementation is supported. */ public interface IGenome extends INBTTagable { diff --git a/src/main/java/forestry/api/genetics/IHousing.java b/src/main/java/forestry/api/genetics/IHousing.java index e9ac7af1b..b13624b97 100644 --- a/src/main/java/forestry/api/genetics/IHousing.java +++ b/src/main/java/forestry/api/genetics/IHousing.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; diff --git a/src/main/java/forestry/api/genetics/IIndividual.java b/src/main/java/forestry/api/genetics/IIndividual.java index f2a8772e8..d5a34de48 100644 --- a/src/main/java/forestry/api/genetics/IIndividual.java +++ b/src/main/java/forestry/api/genetics/IIndividual.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; @@ -12,7 +12,7 @@ import forestry.api.core.INBTTagable; /** * An actual individual with genetic information. - * + * * Only the default implementation is supported. */ public interface IIndividual extends INBTTagable { diff --git a/src/main/java/forestry/api/genetics/IIndividualLiving.java b/src/main/java/forestry/api/genetics/IIndividualLiving.java index 67ce0a975..f935dd204 100644 --- a/src/main/java/forestry/api/genetics/IIndividualLiving.java +++ b/src/main/java/forestry/api/genetics/IIndividualLiving.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; diff --git a/src/main/java/forestry/api/genetics/IMutation.java b/src/main/java/forestry/api/genetics/IMutation.java index bf7ae62f1..2e04420ac 100644 --- a/src/main/java/forestry/api/genetics/IMutation.java +++ b/src/main/java/forestry/api/genetics/IMutation.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; @@ -9,9 +9,9 @@ import java.util.Collection; /** * Individuals can be seeded either as hive drops or as mutation results. - * + * * {@link IAlleleRegistry} manages these. - * + * * @author SirSengir */ public interface IMutation { @@ -33,7 +33,7 @@ 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. */ IAllele[] getTemplate(); diff --git a/src/main/java/forestry/api/genetics/IMutationCustom.java b/src/main/java/forestry/api/genetics/IMutationCustom.java index 42235eee4..786eef316 100644 --- a/src/main/java/forestry/api/genetics/IMutationCustom.java +++ b/src/main/java/forestry/api/genetics/IMutationCustom.java @@ -20,10 +20,12 @@ public interface IMutationCustom extends IMutation { /** Require a specific temperature for this mutation to occur */ IMutationCustom restrictTemperature(EnumTemperature temperature); + IMutationCustom restrictTemperature(EnumTemperature minTemperature, EnumTemperature maxTemperature); /** Require a specific humidity for this mutation to occur */ IMutationCustom restrictHumidity(EnumHumidity humidity); + IMutationCustom restrictHumidity(EnumHumidity minHumidity, EnumHumidity maxHumidity); /** @@ -37,10 +39,12 @@ public interface IMutationCustom extends IMutation { /** Restrict the time of day that this mutation can occur */ IMutationCustom requireDay(); + IMutationCustom requireNight(); /** Require a specific resource to be under the location of the mutation */ IMutationCustom requireResource(Block block, int meta); + IMutationCustom requireResource(String oreDictName); /** Require some other custom mutation condition */ diff --git a/src/main/java/forestry/api/genetics/IPollinatable.java b/src/main/java/forestry/api/genetics/IPollinatable.java index a3716789f..68278b3c1 100644 --- a/src/main/java/forestry/api/genetics/IPollinatable.java +++ b/src/main/java/forestry/api/genetics/IPollinatable.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; @@ -11,7 +11,7 @@ import net.minecraftforge.common.EnumPlantType; /** * Can be implemented by tile entities, if they wish to be pollinatable. - * + * * @author SirSengir */ public interface IPollinatable { @@ -28,9 +28,9 @@ public interface IPollinatable { /** * Checks whether this {@link IPollinatable} can mate with the given pollen. - * + * * Must be the one to check genetic equivalency. - * + * * @param pollen * IIndividual representing the pollen. * @return true if mating is possible, false otherwise. @@ -39,7 +39,7 @@ public interface IPollinatable { /** * Pollinates this entity. - * + * * @param pollen * IIndividual representing the pollen. */ diff --git a/src/main/java/forestry/api/genetics/ISpeciesRoot.java b/src/main/java/forestry/api/genetics/ISpeciesRoot.java index 4cb622852..f2e40b12c 100644 --- a/src/main/java/forestry/api/genetics/ISpeciesRoot.java +++ b/src/main/java/forestry/api/genetics/ISpeciesRoot.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.genetics; @@ -84,23 +84,24 @@ public interface ISpeciesRoot { IGenome templateAsGenome(IAllele[] templateActive, IAllele[] templateInactive); /* TEMPLATES */ + /** * Registers a bee template using the UID of the first allele as identifier. - * + * * @param template */ void registerTemplate(IAllele[] template); /** * Registers a bee template using the passed identifier. - * + * * @param template */ void registerTemplate(String identifier, IAllele[] template); /** * Retrieves a registered template using the passed identifier. - * + * * @param identifier * @return Array of {@link IAllele} representing a genome. */ @@ -118,12 +119,14 @@ public interface ISpeciesRoot { IAllele[] getRandomTemplate(Random rand); Map getGenomeTemplates(); + ArrayList getIndividualTemplates(); /* MUTATIONS */ + /** * Use to register mutations. - * + * * @param mutation */ void registerMutation(IMutation mutation); @@ -148,6 +151,7 @@ public interface ISpeciesRoot { Collection getPaths(IAllele result, IChromosomeType chromosomeType); /* RESEARCH */ + /** * @return List of generic catalysts which should be accepted for research by species of this class. */ diff --git a/src/main/java/forestry/api/genetics/package-info.java b/src/main/java/forestry/api/genetics/package-info.java index 1d7804648..58ecf21d7 100644 --- a/src/main/java/forestry/api/genetics/package-info.java +++ b/src/main/java/forestry/api/genetics/package-info.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ @API(apiVersion = "4.7.1", owner = "ForestryAPI|core", provides = "ForestryAPI|genetics") diff --git a/src/main/java/forestry/api/lepidopterology/EnumButterflyChromosome.java b/src/main/java/forestry/api/lepidopterology/EnumButterflyChromosome.java index 798c898f2..1c8906997 100644 --- a/src/main/java/forestry/api/lepidopterology/EnumButterflyChromosome.java +++ b/src/main/java/forestry/api/lepidopterology/EnumButterflyChromosome.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.lepidopterology; @@ -73,8 +73,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 d0c7aee60..7d42e9d4c 100644 --- a/src/main/java/forestry/api/lepidopterology/EnumFlutterType.java +++ b/src/main/java/forestry/api/lepidopterology/EnumFlutterType.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.lepidopterology; diff --git a/src/main/java/forestry/api/lepidopterology/IAlleleButterflyEffect.java b/src/main/java/forestry/api/lepidopterology/IAlleleButterflyEffect.java index 6457dbe89..6b3e000b2 100644 --- a/src/main/java/forestry/api/lepidopterology/IAlleleButterflyEffect.java +++ b/src/main/java/forestry/api/lepidopterology/IAlleleButterflyEffect.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.lepidopterology; diff --git a/src/main/java/forestry/api/lepidopterology/IAlleleButterflySpecies.java b/src/main/java/forestry/api/lepidopterology/IAlleleButterflySpecies.java index c397b0422..dc97ba14e 100644 --- a/src/main/java/forestry/api/lepidopterology/IAlleleButterflySpecies.java +++ b/src/main/java/forestry/api/lepidopterology/IAlleleButterflySpecies.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.lepidopterology; @@ -11,6 +11,7 @@ import java.util.Map; import net.minecraft.item.ItemStack; import net.minecraftforge.common.BiomeDictionary; + import forestry.api.core.ISpriteProvider; import forestry.api.genetics.IAlleleSpecies; @@ -29,7 +30,7 @@ public interface IAlleleButterflySpecies extends IAlleleSpecies { /** * Allows butterflies to restrict random spawns beyond the restrictions set by getTemperature() and getHumidity(). - * + * * @return EnumSet of biome tags this butterfly species can be spawned in. */ EnumSet getSpawnBiomes(); diff --git a/src/main/java/forestry/api/lepidopterology/IAlleleButterflySpeciesCustom.java b/src/main/java/forestry/api/lepidopterology/IAlleleButterflySpeciesCustom.java index e89fd0fdd..37bda181b 100644 --- a/src/main/java/forestry/api/lepidopterology/IAlleleButterflySpeciesCustom.java +++ b/src/main/java/forestry/api/lepidopterology/IAlleleButterflySpeciesCustom.java @@ -14,6 +14,8 @@ import forestry.api.genetics.IAlleleSpeciesCustom; public interface IAlleleButterflySpeciesCustom extends IAlleleButterflySpecies, IAlleleSpeciesCustom { IAlleleButterflySpeciesCustom setRarity(float rarity); + IAlleleButterflySpeciesCustom setFlightDistance(float flightDistance); + IAlleleButterflySpeciesCustom setNocturnal(); } diff --git a/src/main/java/forestry/api/lepidopterology/IButterfly.java b/src/main/java/forestry/api/lepidopterology/IButterfly.java index 97aec520e..c19c54f91 100644 --- a/src/main/java/forestry/api/lepidopterology/IButterfly.java +++ b/src/main/java/forestry/api/lepidopterology/IButterfly.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.lepidopterology; diff --git a/src/main/java/forestry/api/lepidopterology/IButterflyGenome.java b/src/main/java/forestry/api/lepidopterology/IButterflyGenome.java index 2659a3de3..324a2f358 100644 --- a/src/main/java/forestry/api/lepidopterology/IButterflyGenome.java +++ b/src/main/java/forestry/api/lepidopterology/IButterflyGenome.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.lepidopterology; diff --git a/src/main/java/forestry/api/lepidopterology/IButterflyMutation.java b/src/main/java/forestry/api/lepidopterology/IButterflyMutation.java index 027e96eb2..d9bf32766 100644 --- a/src/main/java/forestry/api/lepidopterology/IButterflyMutation.java +++ b/src/main/java/forestry/api/lepidopterology/IButterflyMutation.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.lepidopterology; diff --git a/src/main/java/forestry/api/lepidopterology/IButterflyNursery.java b/src/main/java/forestry/api/lepidopterology/IButterflyNursery.java index 56e42f2ec..463fb4bda 100644 --- a/src/main/java/forestry/api/lepidopterology/IButterflyNursery.java +++ b/src/main/java/forestry/api/lepidopterology/IButterflyNursery.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.lepidopterology; diff --git a/src/main/java/forestry/api/lepidopterology/IButterflyRoot.java b/src/main/java/forestry/api/lepidopterology/IButterflyRoot.java index 41ea06e4a..f867645f0 100644 --- a/src/main/java/forestry/api/lepidopterology/IButterflyRoot.java +++ b/src/main/java/forestry/api/lepidopterology/IButterflyRoot.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.lepidopterology; diff --git a/src/main/java/forestry/api/lepidopterology/IEntityButterfly.java b/src/main/java/forestry/api/lepidopterology/IEntityButterfly.java index 963c72103..8e9551e04 100644 --- a/src/main/java/forestry/api/lepidopterology/IEntityButterfly.java +++ b/src/main/java/forestry/api/lepidopterology/IEntityButterfly.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.lepidopterology; diff --git a/src/main/java/forestry/api/lepidopterology/ILepidopteristTracker.java b/src/main/java/forestry/api/lepidopterology/ILepidopteristTracker.java index 79926975f..befa591d9 100644 --- a/src/main/java/forestry/api/lepidopterology/ILepidopteristTracker.java +++ b/src/main/java/forestry/api/lepidopterology/ILepidopteristTracker.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.lepidopterology; diff --git a/src/main/java/forestry/api/lepidopterology/package-info.java b/src/main/java/forestry/api/lepidopterology/package-info.java index 827f1c9f1..ad9aef2e9 100644 --- a/src/main/java/forestry/api/lepidopterology/package-info.java +++ b/src/main/java/forestry/api/lepidopterology/package-info.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ -@API(apiVersion="1.3.0", owner="ForestryAPI|core", provides="ForestryAPI|lepidopterology") +@API(apiVersion = "1.3.0", owner = "ForestryAPI|core", provides = "ForestryAPI|lepidopterology") package forestry.api.lepidopterology; import net.minecraftforge.fml.common.API; diff --git a/src/main/java/forestry/api/mail/EnumAddressee.java b/src/main/java/forestry/api/mail/EnumAddressee.java index 64dc6b5e7..7b4482d36 100644 --- a/src/main/java/forestry/api/mail/EnumAddressee.java +++ b/src/main/java/forestry/api/mail/EnumAddressee.java @@ -12,9 +12,10 @@ public enum EnumAddressee { public static EnumAddressee fromString(String ident) { ident = ident.toLowerCase(Locale.ENGLISH); - for(EnumAddressee addr : values()) { - if(addr.toString().equals(ident)) + for (EnumAddressee addr : values()) { + if (addr.toString().equals(ident)) { return addr; + } } return null; diff --git a/src/main/java/forestry/api/mail/EnumPostage.java b/src/main/java/forestry/api/mail/EnumPostage.java index e59a0093a..df492b69c 100644 --- a/src/main/java/forestry/api/mail/EnumPostage.java +++ b/src/main/java/forestry/api/mail/EnumPostage.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.mail; diff --git a/src/main/java/forestry/api/mail/ILetter.java b/src/main/java/forestry/api/mail/ILetter.java index 42df8acb5..0bc4b4748 100644 --- a/src/main/java/forestry/api/mail/ILetter.java +++ b/src/main/java/forestry/api/mail/ILetter.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.mail; diff --git a/src/main/java/forestry/api/mail/ILetterHandler.java b/src/main/java/forestry/api/mail/ILetterHandler.java index 576a0d7da..159d9265c 100644 --- a/src/main/java/forestry/api/mail/ILetterHandler.java +++ b/src/main/java/forestry/api/mail/ILetterHandler.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.mail; diff --git a/src/main/java/forestry/api/mail/IMailAddress.java b/src/main/java/forestry/api/mail/IMailAddress.java index 8441b09a4..d646cd2d5 100644 --- a/src/main/java/forestry/api/mail/IMailAddress.java +++ b/src/main/java/forestry/api/mail/IMailAddress.java @@ -12,11 +12,13 @@ import forestry.api.core.INBTTagable; public interface IMailAddress extends INBTTagable { EnumAddressee getType(); + String getName(); boolean isValid(); boolean isPlayer(); + boolean isTrader(); GameProfile getPlayerProfile(); diff --git a/src/main/java/forestry/api/mail/IPostOffice.java b/src/main/java/forestry/api/mail/IPostOffice.java index a8a14eac1..b97a0715b 100644 --- a/src/main/java/forestry/api/mail/IPostOffice.java +++ b/src/main/java/forestry/api/mail/IPostOffice.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.mail; diff --git a/src/main/java/forestry/api/mail/IPostRegistry.java b/src/main/java/forestry/api/mail/IPostRegistry.java index f20352d93..dadb155d4 100644 --- a/src/main/java/forestry/api/mail/IPostRegistry.java +++ b/src/main/java/forestry/api/mail/IPostRegistry.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.mail; @@ -19,6 +19,7 @@ public interface IPostRegistry { /* MAIL ADDRESSES */ IMailAddress getMailAddress(GameProfile gameProfile); + IMailAddress getMailAddress(String traderName); /* LETTERS */ @@ -31,6 +32,7 @@ public interface IPostRegistry { ItemStack createLetterStack(ILetter letter); /* CARRIERS */ + /** * Registers a new {@link IPostalCarrier}. See {@link IPostalCarrier} for details. * @param carrier {@link IPostalCarrier} to register. diff --git a/src/main/java/forestry/api/mail/IPostalCarrier.java b/src/main/java/forestry/api/mail/IPostalCarrier.java index e3b22b1d0..6b979e587 100644 --- a/src/main/java/forestry/api/mail/IPostalCarrier.java +++ b/src/main/java/forestry/api/mail/IPostalCarrier.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.mail; @@ -8,12 +8,13 @@ package forestry.api.mail; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.item.ItemStack; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; /** * Postal Carriers are systems which can be hooked into Forestry's mail system to handle mail delivery. - * + * * The two available carriers in vanilla Forestry are * "player" - Delivers mail to individual players. * "trader" - Handles mail addressed to trade stations. diff --git a/src/main/java/forestry/api/mail/IPostalState.java b/src/main/java/forestry/api/mail/IPostalState.java index bc843621a..9aae5a87b 100644 --- a/src/main/java/forestry/api/mail/IPostalState.java +++ b/src/main/java/forestry/api/mail/IPostalState.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.mail; diff --git a/src/main/java/forestry/api/mail/IStamps.java b/src/main/java/forestry/api/mail/IStamps.java index 4332a811c..750f3cafb 100644 --- a/src/main/java/forestry/api/mail/IStamps.java +++ b/src/main/java/forestry/api/mail/IStamps.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.mail; diff --git a/src/main/java/forestry/api/mail/ITradeStation.java b/src/main/java/forestry/api/mail/ITradeStation.java index 78a498a04..b8353ab56 100644 --- a/src/main/java/forestry/api/mail/ITradeStation.java +++ b/src/main/java/forestry/api/mail/ITradeStation.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.mail; diff --git a/src/main/java/forestry/api/mail/PostManager.java b/src/main/java/forestry/api/mail/PostManager.java index c3f0e45bb..401cd0f8b 100644 --- a/src/main/java/forestry/api/mail/PostManager.java +++ b/src/main/java/forestry/api/mail/PostManager.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.mail; diff --git a/src/main/java/forestry/api/mail/TradeStationInfo.java b/src/main/java/forestry/api/mail/TradeStationInfo.java index 14424bedf..04983c3be 100644 --- a/src/main/java/forestry/api/mail/TradeStationInfo.java +++ b/src/main/java/forestry/api/mail/TradeStationInfo.java @@ -1,12 +1,12 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.mail; -import java.lang.IllegalArgumentException; import net.minecraft.item.ItemStack; + import com.mojang.authlib.GameProfile; public class TradeStationInfo { @@ -17,9 +17,9 @@ public class TradeStationInfo { public final IPostalState state; public TradeStationInfo(IMailAddress address, GameProfile owner, ItemStack tradegood, ItemStack[] required, IPostalState state) { - if (!address.isTrader()) { - throw new IllegalArgumentException("TradeStation address must be a trader"); - } + if (!address.isTrader()) { + throw new IllegalArgumentException("TradeStation address must be a trader"); + } this.address = address; this.owner = owner; this.tradegood = tradegood; diff --git a/src/main/java/forestry/api/mail/package-info.java b/src/main/java/forestry/api/mail/package-info.java index 3f5491f12..9d66f8243 100644 --- a/src/main/java/forestry/api/mail/package-info.java +++ b/src/main/java/forestry/api/mail/package-info.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ -@API(apiVersion="3.0.0", owner="ForestryAPI|core", provides="ForestryAPI|mail") +@API(apiVersion = "3.0.0", owner = "ForestryAPI|core", provides = "ForestryAPI|mail") package forestry.api.mail; import net.minecraftforge.fml.common.API; diff --git a/src/main/java/forestry/api/multiblock/IAlvearyComponent.java b/src/main/java/forestry/api/multiblock/IAlvearyComponent.java index 92c96d387..34e215254 100644 --- a/src/main/java/forestry/api/multiblock/IAlvearyComponent.java +++ b/src/main/java/forestry/api/multiblock/IAlvearyComponent.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.multiblock; @@ -52,6 +52,7 @@ public interface IAlvearyComponent extends IM */ interface Active extends IAlvearyComponent { void updateServer(int tickCount); + void updateClient(int tickCount); } diff --git a/src/main/java/forestry/api/multiblock/IFarmComponent.java b/src/main/java/forestry/api/multiblock/IFarmComponent.java index 28f22dacc..44175593d 100644 --- a/src/main/java/forestry/api/multiblock/IFarmComponent.java +++ b/src/main/java/forestry/api/multiblock/IFarmComponent.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.multiblock; @@ -32,6 +32,7 @@ public interface IFarmComponent extends IMultibl */ interface Active extends IFarmComponent { void updateServer(int tickCount); + void updateClient(int tickCount); } } diff --git a/src/main/java/forestry/api/multiblock/IMultiblockComponent.java b/src/main/java/forestry/api/multiblock/IMultiblockComponent.java index 305af916d..6f3c10d90 100644 --- a/src/main/java/forestry/api/multiblock/IMultiblockComponent.java +++ b/src/main/java/forestry/api/multiblock/IMultiblockComponent.java @@ -5,10 +5,10 @@ ******************************************************************************/ package forestry.api.multiblock; -import com.mojang.authlib.GameProfile; - import net.minecraft.util.BlockPos; +import com.mojang.authlib.GameProfile; + /** * Basic interface for a multiblock machine component. * Implemented by TileEntities. diff --git a/src/main/java/forestry/api/multiblock/MultiblockTileEntityBase.java b/src/main/java/forestry/api/multiblock/MultiblockTileEntityBase.java index 5ad4d3f53..196bd6b50 100644 --- a/src/main/java/forestry/api/multiblock/MultiblockTileEntityBase.java +++ b/src/main/java/forestry/api/multiblock/MultiblockTileEntityBase.java @@ -73,10 +73,9 @@ public abstract class MultiblockTileEntityBase exten } @Override - public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newSate) - { - return oldState.getBlock() != newSate.getBlock(); - } + public boolean shouldRefresh(World world, BlockPos pos, IBlockState oldState, IBlockState newSate) { + return oldState.getBlock() != newSate.getBlock(); + } /* Network Communication */ diff --git a/src/main/java/forestry/api/recipes/ICarpenterManager.java b/src/main/java/forestry/api/recipes/ICarpenterManager.java index e30c82a52..accc0c199 100644 --- a/src/main/java/forestry/api/recipes/ICarpenterManager.java +++ b/src/main/java/forestry/api/recipes/ICarpenterManager.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.recipes; @@ -12,20 +12,20 @@ import net.minecraftforge.fluids.FluidStack; /** * Provides an interface to the recipe manager of the carpenter. - * + * * The manager is initialized at the beginning of Forestry's BaseMod.load() cycle. Begin adding recipes in BaseMod.ModsLoaded() and this shouldn't be null even * if your mod loads before Forestry. - * + * * Accessible via {@link RecipeManagers} - * + * * Only shaped recipes can be added currently. - * + * * @author SirSengir */ public interface ICarpenterManager extends ICraftingProvider { /** * Add a shaped recipe to the carpenter. - * + * * @param box * ItemStack of one item representing the required box (carton, crate) for this recipe. May be null. * @param product @@ -37,7 +37,7 @@ public interface ICarpenterManager extends ICraftingProvider { /** * Add a shaped recipe to the carpenter. - * + * * @param packagingTime * Number of work cycles required to craft the recipe once. * @param box @@ -51,7 +51,7 @@ public interface ICarpenterManager extends ICraftingProvider { /** * Add a shaped recipe to the carpenter. - * + * * @param packagingTime * Number of work cycles required to craft the recipe once. * @param liquid diff --git a/src/main/java/forestry/api/recipes/ICentrifugeManager.java b/src/main/java/forestry/api/recipes/ICentrifugeManager.java index 1d407f07d..4d1030c90 100644 --- a/src/main/java/forestry/api/recipes/ICentrifugeManager.java +++ b/src/main/java/forestry/api/recipes/ICentrifugeManager.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.recipes; @@ -11,12 +11,12 @@ import net.minecraft.item.ItemStack; /** * Provides an interface to the recipe manager of the centrifuge. - * + * * The manager is initialized at the beginning of Forestry's BaseMod.load() cycle. Begin adding recipes in BaseMod.ModsLoaded() and this shouldn't be null even * if your mod loads before Forestry. - * + * * Accessible via {@link RecipeManagers} - * + * * @author SirSengir */ public interface ICentrifugeManager extends ICraftingProvider { diff --git a/src/main/java/forestry/api/recipes/ICraftingProvider.java b/src/main/java/forestry/api/recipes/ICraftingProvider.java index bb3935be0..36dfd4bf6 100644 --- a/src/main/java/forestry/api/recipes/ICraftingProvider.java +++ b/src/main/java/forestry/api/recipes/ICraftingProvider.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.recipes; diff --git a/src/main/java/forestry/api/recipes/IFabricatorManager.java b/src/main/java/forestry/api/recipes/IFabricatorManager.java index 2d9729aae..d6df1c08d 100644 --- a/src/main/java/forestry/api/recipes/IFabricatorManager.java +++ b/src/main/java/forestry/api/recipes/IFabricatorManager.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.recipes; diff --git a/src/main/java/forestry/api/recipes/IFermenterManager.java b/src/main/java/forestry/api/recipes/IFermenterManager.java index 3a1b6e3dc..4723628a0 100644 --- a/src/main/java/forestry/api/recipes/IFermenterManager.java +++ b/src/main/java/forestry/api/recipes/IFermenterManager.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.recipes; diff --git a/src/main/java/forestry/api/recipes/IMoistenerManager.java b/src/main/java/forestry/api/recipes/IMoistenerManager.java index 08531b964..64d7bb634 100644 --- a/src/main/java/forestry/api/recipes/IMoistenerManager.java +++ b/src/main/java/forestry/api/recipes/IMoistenerManager.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.recipes; @@ -9,19 +9,19 @@ import net.minecraft.item.ItemStack; /** * Provides an interface to the recipe manager of the moistener. - * + * * The manager is initialized at the beginning of Forestry's BaseMod.load() cycle. Begin adding recipes in BaseMod.ModsLoaded() and this shouldn't be null even * if your mod loads before Forestry. - * + * * Accessible via {@link RecipeManagers} - * + * * @author SirSengir */ public interface IMoistenerManager extends ICraftingProvider { /** * Add a recipe to the moistener - * + * * @param resource * Item required in resource stack. Will be reduced by one per produced item. * @param product diff --git a/src/main/java/forestry/api/recipes/ISqueezerManager.java b/src/main/java/forestry/api/recipes/ISqueezerManager.java index 2190035c9..0635c4dff 100644 --- a/src/main/java/forestry/api/recipes/ISqueezerManager.java +++ b/src/main/java/forestry/api/recipes/ISqueezerManager.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.recipes; @@ -13,19 +13,19 @@ import net.minecraftforge.fluids.FluidStack; /** * Provides an interface to the recipe manager of the suqeezer. - * + * * The manager is initialized at the beginning of Forestry's BaseMod.load() cycle. Begin adding recipes in BaseMod.ModsLoaded() and this shouldn't be null even * if your mod loads before Forestry. - * + * * Accessible via {@link RecipeManagers} - * + * * @author SirSengir */ public interface ISqueezerManager extends ICraftingProvider { /** * Add a recipe to the squeezer. - * + * * @param timePerItem Number of work cycles required to squeeze one set of resources. * @param resources Array of item stacks representing the required resources for one process. Stack size will be taken into account. * @param liquid {@link FluidStack} representing the output of this recipe. @@ -36,7 +36,7 @@ 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. diff --git a/src/main/java/forestry/api/recipes/IStillManager.java b/src/main/java/forestry/api/recipes/IStillManager.java index a49ce2703..01adab4ab 100644 --- a/src/main/java/forestry/api/recipes/IStillManager.java +++ b/src/main/java/forestry/api/recipes/IStillManager.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.recipes; @@ -9,20 +9,20 @@ import net.minecraftforge.fluids.FluidStack; /** * Provides an interface to the recipe manager of the still. - * + * * The manager is initialized at the beginning of Forestry's BaseMod.load() cycle. Begin adding recipes in BaseMod.ModsLoaded() and this shouldn't be null even * if your mod loads before Forestry. - * + * * Accessible via {@link RecipeManagers} - * + * * Note that this is untested with anything other than biomass->biofuel conversion. - * + * * @author SirSengir */ public interface IStillManager extends ICraftingProvider { /** * Add a recipe to the still - * + * * @param cyclesPerUnit * Amount of work cycles required to run through the conversion once. * @param input diff --git a/src/main/java/forestry/api/recipes/IVariableFermentable.java b/src/main/java/forestry/api/recipes/IVariableFermentable.java index f0997f531..a970ff74d 100644 --- a/src/main/java/forestry/api/recipes/IVariableFermentable.java +++ b/src/main/java/forestry/api/recipes/IVariableFermentable.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.recipes; diff --git a/src/main/java/forestry/api/recipes/RecipeManagers.java b/src/main/java/forestry/api/recipes/RecipeManagers.java index 7af77f0de..b3f608d34 100644 --- a/src/main/java/forestry/api/recipes/RecipeManagers.java +++ b/src/main/java/forestry/api/recipes/RecipeManagers.java @@ -1,13 +1,13 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.recipes; /** * Contains all available recipe managers for Forestry machines and items. - * + * * @author SirSengir */ public class RecipeManagers { diff --git a/src/main/java/forestry/api/recipes/package-info.java b/src/main/java/forestry/api/recipes/package-info.java index 34eff1c1a..9e4ec065c 100644 --- a/src/main/java/forestry/api/recipes/package-info.java +++ b/src/main/java/forestry/api/recipes/package-info.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ -@API(apiVersion="5.4.0", owner="ForestryAPI|core", provides="ForestryAPI|recipes") +@API(apiVersion = "5.4.0", owner = "ForestryAPI|core", provides = "ForestryAPI|recipes") package forestry.api.recipes; import net.minecraftforge.fml.common.API; diff --git a/src/main/java/forestry/api/storage/BackpackEvent.java b/src/main/java/forestry/api/storage/BackpackEvent.java index f9f215cf8..b7d4719d6 100644 --- a/src/main/java/forestry/api/storage/BackpackEvent.java +++ b/src/main/java/forestry/api/storage/BackpackEvent.java @@ -1,12 +1,13 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.storage; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; + import net.minecraftforge.fml.common.eventhandler.Event; diff --git a/src/main/java/forestry/api/storage/BackpackManager.java b/src/main/java/forestry/api/storage/BackpackManager.java index b90b337a8..d63adfe25 100644 --- a/src/main/java/forestry/api/storage/BackpackManager.java +++ b/src/main/java/forestry/api/storage/BackpackManager.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.storage; @@ -13,7 +13,7 @@ import net.minecraft.item.ItemStack; public class BackpackManager { /** * 0 - Miner's Backpack 1 - Digger's Backpack 2 - Forester's Backpack 3 - Hunter's Backpack 4 - Adventurer's Backpack - * + * * Use IMC messages to achieve the same effect! */ public static ArrayList[] backpackItems; diff --git a/src/main/java/forestry/api/storage/BackpackResupplyEvent.java b/src/main/java/forestry/api/storage/BackpackResupplyEvent.java index 949ab0355..326c6c0a7 100644 --- a/src/main/java/forestry/api/storage/BackpackResupplyEvent.java +++ b/src/main/java/forestry/api/storage/BackpackResupplyEvent.java @@ -1,12 +1,13 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.storage; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; + import net.minecraftforge.fml.common.eventhandler.Cancelable; /** diff --git a/src/main/java/forestry/api/storage/BackpackStowEvent.java b/src/main/java/forestry/api/storage/BackpackStowEvent.java index b34bd0c7c..bfa495f5d 100644 --- a/src/main/java/forestry/api/storage/BackpackStowEvent.java +++ b/src/main/java/forestry/api/storage/BackpackStowEvent.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.storage; @@ -8,6 +8,7 @@ package forestry.api.storage; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; + import net.minecraftforge.fml.common.eventhandler.Cancelable; /** diff --git a/src/main/java/forestry/api/storage/EnumBackpackType.java b/src/main/java/forestry/api/storage/EnumBackpackType.java index 48ad7ee09..61f2d3ed0 100644 --- a/src/main/java/forestry/api/storage/EnumBackpackType.java +++ b/src/main/java/forestry/api/storage/EnumBackpackType.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.storage; diff --git a/src/main/java/forestry/api/storage/IBackpackDefinition.java b/src/main/java/forestry/api/storage/IBackpackDefinition.java index 31c666312..b582d99a1 100644 --- a/src/main/java/forestry/api/storage/IBackpackDefinition.java +++ b/src/main/java/forestry/api/storage/IBackpackDefinition.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.storage; @@ -33,10 +33,11 @@ public interface IBackpackDefinition { /** * Adds an item as valid for this backpack. - * + * * @param validItem */ void addValidItem(ItemStack validItem); + void addValidItems(List validItems); /** diff --git a/src/main/java/forestry/api/storage/IBackpackInterface.java b/src/main/java/forestry/api/storage/IBackpackInterface.java index 27a2eba56..0894d880c 100644 --- a/src/main/java/forestry/api/storage/IBackpackInterface.java +++ b/src/main/java/forestry/api/storage/IBackpackInterface.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.storage; @@ -11,7 +11,7 @@ public interface IBackpackInterface { /** * Adds a backpack with the given definition and type, returning the item. - * + * * @param definition * Definition of backpack behaviour. * @param type diff --git a/src/main/java/forestry/api/storage/ICrateRegistry.java b/src/main/java/forestry/api/storage/ICrateRegistry.java index 868511e3d..27ea23b3c 100644 --- a/src/main/java/forestry/api/storage/ICrateRegistry.java +++ b/src/main/java/forestry/api/storage/ICrateRegistry.java @@ -19,14 +19,18 @@ public interface ICrateRegistry { * Can only be called during the Init stage. */ void registerCrate(Item item, String uid); + void registerCrate(Block block, String uid); + void registerCrate(ItemStack stack, String uid); /** * Same as the above, but uses the ore dictionary for the Carpenter crating recipe. */ void registerCrateUsingOreDict(Item item, String uid); + void registerCrateUsingOreDict(Block block, String uid); + void registerCrateUsingOreDict(ItemStack stack, String uid); } diff --git a/src/main/java/forestry/api/storage/package-info.java b/src/main/java/forestry/api/storage/package-info.java index 01dbc196e..afbc72c86 100644 --- a/src/main/java/forestry/api/storage/package-info.java +++ b/src/main/java/forestry/api/storage/package-info.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ -@API(apiVersion="3.0.0", owner="ForestryAPI|core", provides="ForestryAPI|storage") +@API(apiVersion = "3.0.0", owner = "ForestryAPI|core", provides = "ForestryAPI|storage") package forestry.api.storage; import net.minecraftforge.fml.common.API; diff --git a/src/main/java/forestry/api/world/ITreeGenData.java b/src/main/java/forestry/api/world/ITreeGenData.java index bec04a509..f2422006a 100644 --- a/src/main/java/forestry/api/world/ITreeGenData.java +++ b/src/main/java/forestry/api/world/ITreeGenData.java @@ -1,6 +1,6 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ package forestry.api.world; @@ -22,6 +22,7 @@ public interface ITreeGenData { boolean canGrow(World world, BlockPos pos, int expectedGirth, int expectedHeight); void setLeaves(World world, GameProfile owner, BlockPos pos); + void setLeavesDecorative(World world, GameProfile owner, BlockPos pos); void setLogBlock(World world, BlockPos pos, EnumFacing facing); diff --git a/src/main/java/forestry/api/world/package-info.java b/src/main/java/forestry/api/world/package-info.java index bb6e6aa46..866184615 100644 --- a/src/main/java/forestry/api/world/package-info.java +++ b/src/main/java/forestry/api/world/package-info.java @@ -1,9 +1,9 @@ /******************************************************************************* * Copyright 2011-2014 SirSengir - * + * * This work (the API) is licensed under the "MIT" License, see LICENSE.txt for details. ******************************************************************************/ -@API(apiVersion="2.1.0", owner="ForestryAPI|core", provides="ForestryAPI|world") +@API(apiVersion = "2.1.0", owner = "ForestryAPI|core", provides = "ForestryAPI|world") package forestry.api.world; import net.minecraftforge.fml.common.API; diff --git a/src/main/java/forestry/apiculture/InventoryBeeHousing.java b/src/main/java/forestry/apiculture/InventoryBeeHousing.java index 621247b89..8baa3e0db 100644 --- a/src/main/java/forestry/apiculture/InventoryBeeHousing.java +++ b/src/main/java/forestry/apiculture/InventoryBeeHousing.java @@ -12,6 +12,7 @@ package forestry.apiculture; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.EnumBeeType; import forestry.api.apiculture.IBeeHousingInventory; diff --git a/src/main/java/forestry/apiculture/blocks/BlockAlveary.java b/src/main/java/forestry/apiculture/blocks/BlockAlveary.java index c2eb4ab5c..d1f08717f 100644 --- a/src/main/java/forestry/apiculture/blocks/BlockAlveary.java +++ b/src/main/java/forestry/apiculture/blocks/BlockAlveary.java @@ -196,7 +196,7 @@ public class BlockAlveary extends BlockStructure implements IStateMapperRegister @Override protected BlockState createBlockState() { - return new BlockState(this, new IProperty[] { TYPE, STATE, LEVEL }); + return new BlockState(this, new IProperty[]{TYPE, STATE, LEVEL}); } @Override diff --git a/src/main/java/forestry/apiculture/blocks/BlockBeehives.java b/src/main/java/forestry/apiculture/blocks/BlockBeehives.java index 99eb9f7c6..816a23ae8 100644 --- a/src/main/java/forestry/apiculture/blocks/BlockBeehives.java +++ b/src/main/java/forestry/apiculture/blocks/BlockBeehives.java @@ -199,10 +199,9 @@ public class BlockBeehives extends BlockContainer implements IItemModelRegister manager.registerItemModel(item, 7, "beehives/" + HiveType.SWAMP.getName()); } - @Override - public int getRenderType() - { - return 3; - } + @Override + public int getRenderType() { + return 3; + } } diff --git a/src/main/java/forestry/apiculture/blocks/BlockCandle.java b/src/main/java/forestry/apiculture/blocks/BlockCandle.java index 392cd0587..81f97c5db 100644 --- a/src/main/java/forestry/apiculture/blocks/BlockCandle.java +++ b/src/main/java/forestry/apiculture/blocks/BlockCandle.java @@ -106,13 +106,14 @@ public class BlockCandle extends BlockTorch implements IItemModelRegister { @Override protected BlockState createBlockState() { - return new BlockState(this, new IProperty[] { FACING, STATE }); + return new BlockState(this, new IProperty[]{FACING, STATE}); } @Override public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) { - if(((TileCandle)world.getTileEntity(pos)).isLit()) + if (((TileCandle) world.getTileEntity(pos)).isLit()) { state = state.withProperty(STATE, State.ON); + } return super.getActualState(state, world, pos); } @@ -144,7 +145,7 @@ public class BlockCandle extends BlockTorch implements IItemModelRegister { @Override public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) { - return ((TileCandle)worldIn.getTileEntity(pos)).getColour(); + return ((TileCandle) worldIn.getTileEntity(pos)).getColour(); } @SuppressWarnings({"rawtypes", "unchecked"}) @@ -202,9 +203,9 @@ public class BlockCandle extends BlockTorch implements IItemModelRegister { if (toggleLitState) { tileCandle.setLit(!isLit); world.markBlockForUpdate(pos); - world.theProfiler.startSection("checkLight"); - world.checkLight(pos); - world.theProfiler.endSection(); + world.theProfiler.startSection("checkLight"); + world.checkLight(pos); + world.theProfiler.endSection(); flag = true; } return flag; diff --git a/src/main/java/forestry/apiculture/blocks/BlockStump.java b/src/main/java/forestry/apiculture/blocks/BlockStump.java index 59bc41a9f..f8ca6c3ef 100644 --- a/src/main/java/forestry/apiculture/blocks/BlockStump.java +++ b/src/main/java/forestry/apiculture/blocks/BlockStump.java @@ -24,10 +24,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import forestry.api.core.IModelManager; + import forestry.api.core.IItemModelRegister; +import forestry.api.core.IModelManager; import forestry.api.core.Tabs; import forestry.apiculture.tiles.TileCandle; import forestry.core.config.Constants; diff --git a/src/main/java/forestry/apiculture/commands/CommandBeeGive.java b/src/main/java/forestry/apiculture/commands/CommandBeeGive.java index f74fbd6b2..c8516e8be 100644 --- a/src/main/java/forestry/apiculture/commands/CommandBeeGive.java +++ b/src/main/java/forestry/apiculture/commands/CommandBeeGive.java @@ -19,6 +19,7 @@ import net.minecraft.command.PlayerNotFoundException; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.EnumBeeType; import forestry.api.apiculture.IAlleleBeeSpecies; diff --git a/src/main/java/forestry/apiculture/entities/EntityBee.java b/src/main/java/forestry/apiculture/entities/EntityBee.java index d36e723cb..13d8cca7f 100755 --- a/src/main/java/forestry/apiculture/entities/EntityBee.java +++ b/src/main/java/forestry/apiculture/entities/EntityBee.java @@ -14,8 +14,10 @@ import net.minecraft.entity.EntityCreature; import net.minecraft.entity.passive.IAnimals; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.EnumBeeType; import forestry.api.apiculture.IAlleleBeeSpecies; diff --git a/src/main/java/forestry/apiculture/entities/EntityFXBee.java b/src/main/java/forestry/apiculture/entities/EntityFXBee.java index b7e564018..1ba6af580 100644 --- a/src/main/java/forestry/apiculture/entities/EntityFXBee.java +++ b/src/main/java/forestry/apiculture/entities/EntityFXBee.java @@ -70,9 +70,9 @@ public class EntityFXBee extends EntityFX { float f12 = (float) ((prevPosY + (posY - prevPosY) * f) - interpPosY); float f13 = (float) ((prevPosZ + (posZ - prevPosZ) * f) - interpPosZ); - int i = this.getBrightnessForRender(f); - int j = i >> 16 & 65535; - int k = i & 65535; + int i = this.getBrightnessForRender(f); + int j = i >> 16 & 65535; + int k = i & 65535; wR.pos(f11 - f1 * f10 - f4 * f10, f12 - f2 * f10, f13 - f3 * f10 - f5 * f10).tex(maxU, maxV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex(); wR.pos((f11 - f1 * f10) + f4 * f10, f12 + f2 * f10, (f13 - f3 * f10) + f5 * f10).tex(maxU, minV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex(); wR.pos(f11 + f1 * f10 + f4 * f10, f12 + f2 * f10, f13 + f3 * f10 + f5 * f10).tex(minU, minV).color(particleRed, particleGreen, particleBlue, 1.0F).lightmap(j, k).endVertex(); diff --git a/src/main/java/forestry/apiculture/entities/EntityMinecartBeeHousingBase.java b/src/main/java/forestry/apiculture/entities/EntityMinecartBeeHousingBase.java index 3760bb29a..8f8c62a85 100644 --- a/src/main/java/forestry/apiculture/entities/EntityMinecartBeeHousingBase.java +++ b/src/main/java/forestry/apiculture/entities/EntityMinecartBeeHousingBase.java @@ -20,6 +20,7 @@ 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; diff --git a/src/main/java/forestry/apiculture/flowers/FlowerProvider.java b/src/main/java/forestry/apiculture/flowers/FlowerProvider.java index bde5b6f74..8e4865a1b 100644 --- a/src/main/java/forestry/apiculture/flowers/FlowerProvider.java +++ b/src/main/java/forestry/apiculture/flowers/FlowerProvider.java @@ -11,6 +11,7 @@ package forestry.apiculture.flowers; import java.util.EnumSet; + import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.world.World; diff --git a/src/main/java/forestry/apiculture/genetics/Bee.java b/src/main/java/forestry/apiculture/genetics/Bee.java index d4198b8b8..bb2663d27 100644 --- a/src/main/java/forestry/apiculture/genetics/Bee.java +++ b/src/main/java/forestry/apiculture/genetics/Bee.java @@ -710,7 +710,7 @@ public class Bee extends IndividualLiving implements IBee { } Vect area = getArea(genome, beeModifier); - Vect offset = new Vect(-area.getX()/ 2, -area.getY() / 4, -area.getZ() / 2); + Vect offset = new Vect(-area.getX() / 2, -area.getY() / 4, -area.getZ() / 2); Vect housingPos = new Vect(housing.getCoordinates()); IIndividual pollen = null; diff --git a/src/main/java/forestry/apiculture/genetics/BeeDefinition.java b/src/main/java/forestry/apiculture/genetics/BeeDefinition.java index 3ba4fe9ac..abdd51689 100644 --- a/src/main/java/forestry/apiculture/genetics/BeeDefinition.java +++ b/src/main/java/forestry/apiculture/genetics/BeeDefinition.java @@ -990,7 +990,7 @@ public enum BeeDefinition implements IBeeDefinition { } } - public static void preInit(){ + public static void preInit() { } diff --git a/src/main/java/forestry/apiculture/genetics/BeeHelper.java b/src/main/java/forestry/apiculture/genetics/BeeHelper.java index 144011b6b..df7d926c9 100755 --- a/src/main/java/forestry/apiculture/genetics/BeeHelper.java +++ b/src/main/java/forestry/apiculture/genetics/BeeHelper.java @@ -20,10 +20,11 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; -import net.minecraftforge.fml.common.FMLCommonHandler; import com.mojang.authlib.GameProfile; +import net.minecraftforge.fml.common.FMLCommonHandler; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.EnumBeeChromosome; import forestry.api.apiculture.EnumBeeType; diff --git a/src/main/java/forestry/apiculture/genetics/DefaultBeeModelProvider.java b/src/main/java/forestry/apiculture/genetics/DefaultBeeModelProvider.java index 8f26e445e..d5f6d0d53 100644 --- a/src/main/java/forestry/apiculture/genetics/DefaultBeeModelProvider.java +++ b/src/main/java/forestry/apiculture/genetics/DefaultBeeModelProvider.java @@ -15,8 +15,10 @@ import java.util.Locale; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.SideOnly; + import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.apiculture.EnumBeeType; import forestry.api.apiculture.IBeeModelProvider; import forestry.api.core.IModelManager; @@ -36,7 +38,7 @@ public class DefaultBeeModelProvider implements IBeeModelProvider { @Override public void registerModels(Item item, IModelManager manager) { String beeIconDir = "bees/default/"; - EnumBeeType beeType = ((ItemBeeGE)item).getType(); + EnumBeeType beeType = ((ItemBeeGE) item).getType(); String beeTypeNameBase = beeIconDir + beeType.toString().toLowerCase(Locale.ENGLISH); models[beeType.ordinal()] = manager.getModelLocation(beeTypeNameBase); diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleBeeSpecies.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleBeeSpecies.java index 94b95b618..57434509a 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleBeeSpecies.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleBeeSpecies.java @@ -19,26 +19,27 @@ import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import com.mojang.authlib.GameProfile; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.EnumBeeType; import forestry.api.apiculture.IAlleleBeeSpeciesCustom; import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeHousing; -import forestry.api.apiculture.IBeeSpriteColourProvider; import forestry.api.apiculture.IBeeModelProvider; import forestry.api.apiculture.IBeeRoot; +import forestry.api.apiculture.IBeeSpriteColourProvider; import forestry.api.apiculture.IJubilanceProvider; import forestry.api.core.IModelManager; import forestry.api.core.IModelProvider; import forestry.api.genetics.IClassification; import forestry.api.genetics.IIndividual; -import forestry.apiculture.genetics.DefaultBeeSpriteColourProvider; import forestry.apiculture.genetics.DefaultBeeModelProvider; +import forestry.apiculture.genetics.DefaultBeeSpriteColourProvider; import forestry.apiculture.genetics.JubilanceDefault; import forestry.core.genetics.alleles.AlleleSpecies; import forestry.core.utils.ItemStackUtil; diff --git a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectPotion.java b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectPotion.java index d81831bf1..1c686f86e 100644 --- a/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectPotion.java +++ b/src/main/java/forestry/apiculture/genetics/alleles/AlleleEffectPotion.java @@ -21,7 +21,9 @@ import net.minecraft.potion.PotionEffect; import net.minecraft.potion.PotionHelper; import net.minecraft.util.Vec3; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.ReflectionHelper; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.IBeeGenome; import forestry.api.apiculture.IBeeHousing; diff --git a/src/main/java/forestry/apiculture/gui/widgets/HabitatSlot.java b/src/main/java/forestry/apiculture/gui/widgets/HabitatSlot.java index e4b2e41d6..af5aed021 100644 --- a/src/main/java/forestry/apiculture/gui/widgets/HabitatSlot.java +++ b/src/main/java/forestry/apiculture/gui/widgets/HabitatSlot.java @@ -17,6 +17,7 @@ import java.util.Locale; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.player.EntityPlayer; + import net.minecraftforge.common.BiomeDictionary; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; diff --git a/src/main/java/forestry/apiculture/items/ItemBeeGE.java b/src/main/java/forestry/apiculture/items/ItemBeeGE.java index 9d6b3b6eb..b04082cdc 100755 --- a/src/main/java/forestry/apiculture/items/ItemBeeGE.java +++ b/src/main/java/forestry/apiculture/items/ItemBeeGE.java @@ -19,8 +19,10 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.EnumBeeChromosome; import forestry.api.apiculture.EnumBeeType; diff --git a/src/main/java/forestry/apiculture/items/ItemBlockCandle.java b/src/main/java/forestry/apiculture/items/ItemBlockCandle.java index 3abc3cc30..41f34d714 100644 --- a/src/main/java/forestry/apiculture/items/ItemBlockCandle.java +++ b/src/main/java/forestry/apiculture/items/ItemBlockCandle.java @@ -13,8 +13,10 @@ package forestry.apiculture.items; import net.minecraft.block.Block; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.apiculture.blocks.BlockCandle; import forestry.core.items.ItemBlockForestry; diff --git a/src/main/java/forestry/apiculture/items/ItemHabitatLocator.java b/src/main/java/forestry/apiculture/items/ItemHabitatLocator.java index a71ff54bb..3130cd46c 100644 --- a/src/main/java/forestry/apiculture/items/ItemHabitatLocator.java +++ b/src/main/java/forestry/apiculture/items/ItemHabitatLocator.java @@ -19,8 +19,10 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; import net.minecraft.world.biome.BiomeGenBase; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.core.EnumHumidity; import forestry.api.core.EnumTemperature; import forestry.api.core.Tabs; diff --git a/src/main/java/forestry/apiculture/items/ItemHoneycomb.java b/src/main/java/forestry/apiculture/items/ItemHoneycomb.java index 260c7252a..188e5f5da 100755 --- a/src/main/java/forestry/apiculture/items/ItemHoneycomb.java +++ b/src/main/java/forestry/apiculture/items/ItemHoneycomb.java @@ -17,8 +17,10 @@ import java.util.Random; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.core.IModelManager; import forestry.api.core.Tabs; import forestry.core.config.Config; diff --git a/src/main/java/forestry/apiculture/items/ItemMinecartBeehouse.java b/src/main/java/forestry/apiculture/items/ItemMinecartBeehouse.java index f300b0863..08bcc1e6b 100644 --- a/src/main/java/forestry/apiculture/items/ItemMinecartBeehouse.java +++ b/src/main/java/forestry/apiculture/items/ItemMinecartBeehouse.java @@ -25,10 +25,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import forestry.api.core.IModelManager; + import forestry.api.core.IItemModelRegister; +import forestry.api.core.IModelManager; import forestry.apiculture.entities.EntityMinecartApiary; import forestry.apiculture.entities.EntityMinecartBeeHousingBase; import forestry.apiculture.entities.EntityMinecartBeehouse; @@ -36,22 +38,20 @@ import forestry.apiculture.entities.EntityMinecartBeehouse; public class ItemMinecartBeehouse extends ItemMinecart implements IItemModelRegister { private final String[] definition = new String[]{"cart.beehouse", "cart.apiary"}; - private static final IBehaviorDispenseItem dispenserMinecartBehavior = new BehaviorDefaultDispenseItem() - { - private final BehaviorDefaultDispenseItem behaviourDefaultDispenseItem = new BehaviorDefaultDispenseItem(); - - @Override - public ItemStack dispenseStack(IBlockSource source, ItemStack stack) - { - return stack; - } - }; + private static final IBehaviorDispenseItem dispenserMinecartBehavior = new BehaviorDefaultDispenseItem() { + private final BehaviorDefaultDispenseItem behaviourDefaultDispenseItem = new BehaviorDefaultDispenseItem(); + + @Override + public ItemStack dispenseStack(IBlockSource source, ItemStack stack) { + return stack; + } + }; public ItemMinecartBeehouse() { super(null); setMaxDamage(0); setHasSubtypes(true); - BlockDispenser.dispenseBehaviorRegistry.putObject(this,new BehaviorDefaultDispenseItem()); + BlockDispenser.dispenseBehaviorRegistry.putObject(this, new BehaviorDefaultDispenseItem()); } @Override diff --git a/src/main/java/forestry/apiculture/multiblock/TileAlvearyClimatiser.java b/src/main/java/forestry/apiculture/multiblock/TileAlvearyClimatiser.java index 21fcc6837..e0f3fe73a 100644 --- a/src/main/java/forestry/apiculture/multiblock/TileAlvearyClimatiser.java +++ b/src/main/java/forestry/apiculture/multiblock/TileAlvearyClimatiser.java @@ -12,6 +12,7 @@ package forestry.apiculture.multiblock; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; + import forestry.api.core.IClimateControlled; import forestry.api.multiblock.IAlvearyComponent; import forestry.apiculture.network.packets.PacketActiveUpdate; diff --git a/src/main/java/forestry/apiculture/multiblock/TileAlvearyHygroregulator.java b/src/main/java/forestry/apiculture/multiblock/TileAlvearyHygroregulator.java index 970e582b5..7de9b3aee 100644 --- a/src/main/java/forestry/apiculture/multiblock/TileAlvearyHygroregulator.java +++ b/src/main/java/forestry/apiculture/multiblock/TileAlvearyHygroregulator.java @@ -14,6 +14,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; + import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; diff --git a/src/main/java/forestry/apiculture/multiblock/TileAlvearyPlain.java b/src/main/java/forestry/apiculture/multiblock/TileAlvearyPlain.java index 60d2153bd..34a55bdb4 100644 --- a/src/main/java/forestry/apiculture/multiblock/TileAlvearyPlain.java +++ b/src/main/java/forestry/apiculture/multiblock/TileAlvearyPlain.java @@ -16,7 +16,9 @@ import java.util.Collection; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; + import net.minecraftforge.fml.common.Optional; + import forestry.api.multiblock.IMultiblockController; import forestry.apiculture.blocks.BlockAlveary; import forestry.apiculture.trigger.ApicultureTriggers; diff --git a/src/main/java/forestry/apiculture/network/packets/PacketHabitatBiomePointer.java b/src/main/java/forestry/apiculture/network/packets/PacketHabitatBiomePointer.java index 6273a8576..8caa10f5b 100644 --- a/src/main/java/forestry/apiculture/network/packets/PacketHabitatBiomePointer.java +++ b/src/main/java/forestry/apiculture/network/packets/PacketHabitatBiomePointer.java @@ -14,6 +14,7 @@ import java.io.IOException; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.BlockPos; + import forestry.core.network.DataInputStreamForestry; import forestry.core.network.IForestryPacketClient; import forestry.core.network.PacketIdClient; diff --git a/src/main/java/forestry/apiculture/tiles/TileApiary.java b/src/main/java/forestry/apiculture/tiles/TileApiary.java index a96c2792f..037bb331b 100644 --- a/src/main/java/forestry/apiculture/tiles/TileApiary.java +++ b/src/main/java/forestry/apiculture/tiles/TileApiary.java @@ -19,7 +19,9 @@ import java.util.List; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; + import net.minecraftforge.fml.common.Optional; + import forestry.api.apiculture.IBeeHousingInventory; import forestry.api.apiculture.IBeeListener; import forestry.api.apiculture.IBeeModifier; diff --git a/src/main/java/forestry/apiculture/trigger/TriggerMissingDrone.java b/src/main/java/forestry/apiculture/trigger/TriggerMissingDrone.java index 0c9be81e8..153c8bc22 100644 --- a/src/main/java/forestry/apiculture/trigger/TriggerMissingDrone.java +++ b/src/main/java/forestry/apiculture/trigger/TriggerMissingDrone.java @@ -12,9 +12,11 @@ package forestry.apiculture.trigger; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; + import forestry.api.core.IErrorLogicSource; import forestry.core.errors.EnumErrorCode; import forestry.core.triggers.Trigger; + import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.IStatementParameter; diff --git a/src/main/java/forestry/apiculture/trigger/TriggerMissingQueen.java b/src/main/java/forestry/apiculture/trigger/TriggerMissingQueen.java index a7d8b1822..6cff4c162 100644 --- a/src/main/java/forestry/apiculture/trigger/TriggerMissingQueen.java +++ b/src/main/java/forestry/apiculture/trigger/TriggerMissingQueen.java @@ -12,6 +12,7 @@ package forestry.apiculture.trigger; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; + import forestry.api.core.IErrorLogicSource; import forestry.core.errors.EnumErrorCode; import forestry.core.triggers.Trigger; diff --git a/src/main/java/forestry/apiculture/trigger/TriggerNoFrames.java b/src/main/java/forestry/apiculture/trigger/TriggerNoFrames.java index a026a8066..8a8080905 100755 --- a/src/main/java/forestry/apiculture/trigger/TriggerNoFrames.java +++ b/src/main/java/forestry/apiculture/trigger/TriggerNoFrames.java @@ -12,6 +12,7 @@ package forestry.apiculture.trigger; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; + import forestry.apiculture.inventory.InventoryApiary; import forestry.apiculture.tiles.TileApiary; import forestry.core.triggers.Trigger; diff --git a/src/main/java/forestry/apiculture/worldgen/HiveGenGround.java b/src/main/java/forestry/apiculture/worldgen/HiveGenGround.java index 17c12e54c..2438c0a6d 100644 --- a/src/main/java/forestry/apiculture/worldgen/HiveGenGround.java +++ b/src/main/java/forestry/apiculture/worldgen/HiveGenGround.java @@ -13,12 +13,13 @@ package forestry.apiculture.worldgen; import java.util.HashSet; import java.util.Set; -import forestry.core.utils.BlockUtil; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.util.BlockPos; import net.minecraft.world.World; +import forestry.core.utils.BlockUtil; + public class HiveGenGround extends HiveGen { private final Set groundMaterials = new HashSet<>(); diff --git a/src/main/java/forestry/apiculture/worldgen/HiveGenTree.java b/src/main/java/forestry/apiculture/worldgen/HiveGenTree.java index dd4f7c415..9061532fb 100644 --- a/src/main/java/forestry/apiculture/worldgen/HiveGenTree.java +++ b/src/main/java/forestry/apiculture/worldgen/HiveGenTree.java @@ -38,7 +38,7 @@ public class HiveGenTree extends HiveGen { // get to the bottom of the leaves do { y--; - } while (world.getBlockState(new BlockPos(x, y, z)).getBlock().isLeaves(world,new BlockPos(x, y, z))); + } while (world.getBlockState(new BlockPos(x, y, z)).getBlock().isLeaves(world, new BlockPos(x, y, z))); return y; } diff --git a/src/main/java/forestry/arboriculture/FruitProviderPod.java b/src/main/java/forestry/arboriculture/FruitProviderPod.java index 47369ea5c..5d2fc1209 100755 --- a/src/main/java/forestry/arboriculture/FruitProviderPod.java +++ b/src/main/java/forestry/arboriculture/FruitProviderPod.java @@ -37,7 +37,7 @@ public class FruitProviderPod extends FruitProviderNone { uids = new short[]{stage1, stage2, stage3}; } - public String getModelName(){ + public String getModelName() { return toString().toLowerCase(Locale.ENGLISH); } } diff --git a/src/main/java/forestry/arboriculture/LeafDecayHelper.java b/src/main/java/forestry/arboriculture/LeafDecayHelper.java index 51a83e795..61c4af902 100644 --- a/src/main/java/forestry/arboriculture/LeafDecayHelper.java +++ b/src/main/java/forestry/arboriculture/LeafDecayHelper.java @@ -1,12 +1,13 @@ package forestry.arboriculture; -import forestry.core.utils.BlockUtil; import net.minecraft.block.Block; import net.minecraft.block.BlockLeavesBase; import net.minecraft.block.state.IBlockState; import net.minecraft.util.BlockPos; import net.minecraft.world.World; +import forestry.core.utils.BlockUtil; + /** 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; diff --git a/src/main/java/forestry/arboriculture/blocks/BlockArbFence.java b/src/main/java/forestry/arboriculture/blocks/BlockArbFence.java index e9f806353..eabd94a63 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockArbFence.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockArbFence.java @@ -62,7 +62,7 @@ public class BlockArbFence extends BlockFence implements IWoodTyped, IItemModelR harvestTool = new String[EnumWoodType.values().length]; harvestLevel = new int[harvestTool.length]; - for(int i = 0;i < harvestTool.length;i++){ + for (int i = 0; i < harvestTool.length; i++) { harvestLevel[i] = -1; } @@ -124,7 +124,7 @@ public class BlockArbFence extends BlockFence implements IWoodTyped, IItemModelR @SideOnly(Side.CLIENT) @Override public void registerModel(Item item, IModelManager manager) { - if(!isFireproof()){ + if (!isFireproof()) { manager.registerVariant(item, ItemBlockWood.getVariants(this)); } manager.registerItemModel(item, new WoodMeshDefinition(this)); @@ -203,22 +203,22 @@ public class BlockArbFence extends BlockFence implements IWoodTyped, IItemModelR return fireproof; } - @Override - public void setHarvestLevel(String toolClass, int level, IBlockState state){ - int idx = this.getMetaFromState(state); - this.harvestTool[idx] = toolClass; - this.harvestLevel[idx] = level; - } + @Override + public void setHarvestLevel(String toolClass, int level, IBlockState state) { + int idx = this.getMetaFromState(state); + this.harvestTool[idx] = toolClass; + this.harvestLevel[idx] = level; + } - @Override - public String getHarvestTool(IBlockState state){ - return harvestTool[getMetaFromState(state)]; - } + @Override + public String getHarvestTool(IBlockState state) { + return harvestTool[getMetaFromState(state)]; + } - @Override - public int getHarvestLevel(IBlockState state){ - return harvestLevel[getMetaFromState(state)]; - } + @Override + public int getHarvestLevel(IBlockState state) { + return harvestLevel[getMetaFromState(state)]; + } /* Particles */ @SideOnly(Side.CLIENT) diff --git a/src/main/java/forestry/arboriculture/blocks/BlockArbStairs.java b/src/main/java/forestry/arboriculture/blocks/BlockArbStairs.java index 97fa9e40c..6f1355d21 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockArbStairs.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockArbStairs.java @@ -30,12 +30,14 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.arboriculture.EnumWoodType; import forestry.api.arboriculture.TreeManager; -import forestry.api.core.IModelManager; import forestry.api.core.IItemModelRegister; +import forestry.api.core.IModelManager; import forestry.api.core.Tabs; import forestry.arboriculture.IWoodTyped; import forestry.arboriculture.items.ItemBlockWood; @@ -54,13 +56,13 @@ public class BlockArbStairs extends BlockStairs implements IWoodTyped, IItemMode public BlockArbStairs(Block par2Block, boolean fireproof) { super(par2Block.getStateFromMeta(0)); - this.setDefaultState(this.blockState.getBaseState().withProperty(EnumWoodType.WOODTYPE, EnumWoodType.LARCH).withProperty(FACING, EnumFacing.NORTH).withProperty(HALF, BlockStairs.EnumHalf.BOTTOM).withProperty(SHAPE, BlockStairs.EnumShape.STRAIGHT)); + this.setDefaultState(this.blockState.getBaseState().withProperty(EnumWoodType.WOODTYPE, EnumWoodType.LARCH).withProperty(FACING, EnumFacing.NORTH).withProperty(HALF, BlockStairs.EnumHalf.BOTTOM).withProperty(SHAPE, BlockStairs.EnumShape.STRAIGHT)); this.fireproof = fireproof; harvestTool = new String[EnumWoodType.values().length]; harvestLevel = new int[harvestTool.length]; - for(int i = 0;i < harvestTool.length;i++){ + for (int i = 0; i < harvestTool.length; i++) { harvestLevel[i] = -1; } @@ -75,7 +77,7 @@ public class BlockArbStairs extends BlockStairs implements IWoodTyped, IItemMode @Override protected BlockState createBlockState() { - return new BlockState(this, new IProperty[] { EnumWoodType.WOODTYPE, FACING, HALF, SHAPE }); + return new BlockState(this, new IProperty[]{EnumWoodType.WOODTYPE, FACING, HALF, SHAPE}); } @Override @@ -129,7 +131,7 @@ public class BlockArbStairs extends BlockStairs implements IWoodTyped, IItemMode @SideOnly(Side.CLIENT) @Override public void registerModel(Item item, IModelManager manager) { - if(!isFireproof()){ + if (!isFireproof()) { manager.registerVariant(item, ItemBlockWood.getVariants(this)); } manager.registerItemModel(item, new WoodMeshDefinition(this)); @@ -155,22 +157,22 @@ public class BlockArbStairs extends BlockStairs implements IWoodTyped, IItemMode return new TileWood(); } - @Override - public void setHarvestLevel(String toolClass, int level, IBlockState state){ - int idx = this.getMetaFromState(state); - this.harvestTool[idx] = toolClass; - this.harvestLevel[idx] = level; - } + @Override + public void setHarvestLevel(String toolClass, int level, IBlockState state) { + int idx = this.getMetaFromState(state); + this.harvestTool[idx] = toolClass; + this.harvestLevel[idx] = level; + } - @Override - public String getHarvestTool(IBlockState state){ - return harvestTool[getMetaFromState(state)]; - } + @Override + public String getHarvestTool(IBlockState state) { + return harvestTool[getMetaFromState(state)]; + } - @Override - public int getHarvestLevel(IBlockState state){ - return harvestLevel[getMetaFromState(state)]; - } + @Override + public int getHarvestLevel(IBlockState state) { + return harvestLevel[getMetaFromState(state)]; + } /* Particles */ @SideOnly(Side.CLIENT) diff --git a/src/main/java/forestry/arboriculture/blocks/BlockForestryLeaves.java b/src/main/java/forestry/arboriculture/blocks/BlockForestryLeaves.java index 33919cae6..c23549906 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockForestryLeaves.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockForestryLeaves.java @@ -87,7 +87,7 @@ public class BlockForestryLeaves extends BlockLeavesBase implements ITileEntityP @Override protected BlockState createBlockState() { - return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[] { UnlistedBlockPos.POS, UnlistedBlockAccess.BLOCKACCESS }); + return new ExtendedBlockState(this, new IProperty[0], new IUnlistedProperty[]{UnlistedBlockPos.POS, UnlistedBlockAccess.BLOCKACCESS}); } /* TILE ENTITY */ @@ -278,7 +278,7 @@ public class BlockForestryLeaves extends BlockLeavesBase implements ITileEntityP @SideOnly(Side.CLIENT) @Override public int colorMultiplier(IBlockAccess world, BlockPos pos, int renderPass) { - TileLeaves leaves = getLeafTile(world,pos); + TileLeaves leaves = getLeafTile(world, pos); if (leaves == null) { return super.colorMultiplier(world, pos, 0); } @@ -288,7 +288,7 @@ public class BlockForestryLeaves extends BlockLeavesBase implements ITileEntityP if (colour == 0 || colour == PluginArboriculture.proxy.getFoliageColorBasic()) { return super.colorMultiplier(world, pos, 0); } - }else{ + } else { colour = leaves.getFruitColour(); if (colour == 0) { return super.colorMultiplier(world, pos, 0); diff --git a/src/main/java/forestry/arboriculture/blocks/BlockFruitPod.java b/src/main/java/forestry/arboriculture/blocks/BlockFruitPod.java index 30f9cd842..6c042cbcf 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockFruitPod.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockFruitPod.java @@ -13,6 +13,7 @@ package forestry.arboriculture.blocks; import java.util.ArrayList; import java.util.List; import java.util.Random; + import net.minecraft.block.BlockCocoa; import net.minecraft.block.properties.IProperty; import net.minecraft.block.state.BlockState; @@ -23,11 +24,13 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + +import net.minecraftforge.common.property.ExtendedBlockState; import net.minecraftforge.common.property.IExtendedBlockState; import net.minecraftforge.common.property.IUnlistedProperty; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import net.minecraftforge.common.property.ExtendedBlockState; + import forestry.api.arboriculture.IAlleleFruit; import forestry.api.core.IStateMapperRegister; import forestry.api.genetics.AlleleManager; @@ -57,8 +60,8 @@ public class BlockFruitPod extends BlockCocoa implements IStateMapperRegister { @Override protected BlockState createBlockState() { - return new ExtendedBlockState(this, new IProperty[] { FACING, AGE, FRUIT }, - new IUnlistedProperty[] { UnlistedBlockPos.POS, UnlistedBlockAccess.BLOCKACCESS }); + return new ExtendedBlockState(this, new IProperty[]{FACING, AGE, FRUIT}, + new IUnlistedProperty[]{UnlistedBlockPos.POS, UnlistedBlockAccess.BLOCKACCESS}); } @Override diff --git a/src/main/java/forestry/arboriculture/blocks/BlockLog.java b/src/main/java/forestry/arboriculture/blocks/BlockLog.java index 60753c8be..3ff8587a6 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockLog.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockLog.java @@ -46,7 +46,7 @@ public class BlockLog extends BlockWood { harvestTool = new String[EnumWoodType.values().length]; harvestLevel = new int[harvestTool.length]; - for(int i = 0;i < harvestTool.length;i++){ + for (int i = 0; i < harvestTool.length; i++) { harvestLevel[i] = -1; } diff --git a/src/main/java/forestry/arboriculture/blocks/BlockPlanks.java b/src/main/java/forestry/arboriculture/blocks/BlockPlanks.java index 577082cc6..e790443af 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockPlanks.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockPlanks.java @@ -14,6 +14,7 @@ import java.util.List; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; + import forestry.api.arboriculture.EnumWoodType; import forestry.api.arboriculture.TreeManager; diff --git a/src/main/java/forestry/arboriculture/blocks/BlockSapling.java b/src/main/java/forestry/arboriculture/blocks/BlockSapling.java index f6cec3903..942f50d4a 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockSapling.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockSapling.java @@ -13,6 +13,7 @@ package forestry.arboriculture.blocks; 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; @@ -29,8 +30,10 @@ import net.minecraft.util.EnumWorldBlockLayer; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.arboriculture.EnumGermlingType; import forestry.api.arboriculture.IAlleleTreeSpecies; import forestry.api.arboriculture.TreeManager; @@ -97,7 +100,7 @@ public class BlockSapling extends BlockTreeContainer implements IGrowable, IStat @Override public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) { - if(world.getTileEntity(pos) instanceof TileSapling){ + if (world.getTileEntity(pos) instanceof TileSapling) { TileSapling sapling = (TileSapling) world.getTileEntity(pos); IAlleleTreeSpecies species = sapling.getTree().getGenome().getPrimary(); state = state.withProperty(TREE, species); diff --git a/src/main/java/forestry/arboriculture/blocks/BlockSlab.java b/src/main/java/forestry/arboriculture/blocks/BlockSlab.java index ec779800d..e58c40218 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockSlab.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockSlab.java @@ -30,12 +30,14 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.arboriculture.EnumWoodType; import forestry.api.arboriculture.TreeManager; -import forestry.api.core.IModelManager; import forestry.api.core.IItemModelRegister; +import forestry.api.core.IModelManager; import forestry.api.core.Tabs; import forestry.arboriculture.IWoodTyped; import forestry.arboriculture.items.ItemBlockWood; @@ -59,7 +61,7 @@ public class BlockSlab extends net.minecraft.block.BlockSlab implements IWoodTyp harvestTool = new String[EnumWoodType.values().length]; harvestLevel = new int[harvestTool.length]; - for(int i = 0;i < harvestTool.length;i++){ + for (int i = 0; i < harvestTool.length; i++) { harvestLevel[i] = -1; } @@ -70,37 +72,37 @@ public class BlockSlab extends net.minecraft.block.BlockSlab implements IWoodTyp setStepSound(soundTypeWood); setHarvestLevel("axe", 0); - IBlockState iblockstate = this.blockState.getBaseState(); + IBlockState iblockstate = this.blockState.getBaseState(); - if (!isDouble()) - { - iblockstate = iblockstate.withProperty(HALF, EnumBlockHalf.BOTTOM); - } + if (!isDouble()) { + iblockstate = iblockstate.withProperty(HALF, EnumBlockHalf.BOTTOM); + } - setDefaultState(iblockstate.withProperty(EnumWoodType.WOODTYPE, EnumWoodType.LARCH)); + setDefaultState(iblockstate.withProperty(EnumWoodType.WOODTYPE, EnumWoodType.LARCH)); this.particleCallback = new ParticleHelper.DefaultCallback(this); } @Override protected BlockState createBlockState() { - return this.isDouble() ? new BlockState(this, new IProperty[] { EnumWoodType.WOODTYPE }): new BlockState(this, new IProperty[] { HALF, EnumWoodType.WOODTYPE }); + return this.isDouble() ? new BlockState(this, new IProperty[]{EnumWoodType.WOODTYPE}) : new BlockState(this, new IProperty[]{HALF, EnumWoodType.WOODTYPE}); } - @Override + @Override public IBlockState getStateFromMeta(int meta) { - if (this == PluginArboriculture.blocks.slabsDouble || this == PluginArboriculture.blocks.slabsDoubleFireproof) - return getDefaultState(); - return getDefaultState().withProperty(HALF, EnumBlockHalf.values()[meta]); - } + if (this == PluginArboriculture.blocks.slabsDouble || this == PluginArboriculture.blocks.slabsDoubleFireproof) { + return getDefaultState(); + } + return getDefaultState().withProperty(HALF, EnumBlockHalf.values()[meta]); + } - @Override - public int getMetaFromState(IBlockState state){ - if(!state.getProperties().containsKey(HALF)) { - return 0; - } - return state.getValue(HALF).ordinal(); - } + @Override + public int getMetaFromState(IBlockState state) { + if (!state.getProperties().containsKey(HALF)) { + return 0; + } + return state.getValue(HALF).ordinal(); + } @Override public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) { @@ -115,7 +117,7 @@ public class BlockSlab extends net.minecraft.block.BlockSlab implements IWoodTyp @SideOnly(Side.CLIENT) @Override public void registerModel(Item item, IModelManager manager) { - if(!isFireproof()){ + if (!isFireproof()) { manager.registerVariant(item, ItemBlockWood.getVariants(this)); } manager.registerItemModel(item, new WoodMeshDefinition(this)); @@ -177,7 +179,7 @@ public class BlockSlab extends net.minecraft.block.BlockSlab implements IWoodTyp @Override public float getBlockHardness(World world, BlockPos pos) { - TileWood wood = TileWood.getWoodTile(world,pos); + TileWood wood = TileWood.getWoodTile(world, pos); if (wood == null) { return EnumWoodType.DEFAULT_HARDNESS; } @@ -249,20 +251,20 @@ public class BlockSlab extends net.minecraft.block.BlockSlab implements IWoodTyp return ItemBlockWood.getWoodType(stack); } - @Override - public void setHarvestLevel(String toolClass, int level, IBlockState state){ - int idx = this.getMetaFromState(state); - this.harvestTool[idx] = toolClass; - this.harvestLevel[idx] = level; - } + @Override + public void setHarvestLevel(String toolClass, int level, IBlockState state) { + int idx = this.getMetaFromState(state); + this.harvestTool[idx] = toolClass; + this.harvestLevel[idx] = level; + } - @Override - public String getHarvestTool(IBlockState state){ - return harvestTool[getMetaFromState(state)]; - } + @Override + public String getHarvestTool(IBlockState state) { + return harvestTool[getMetaFromState(state)]; + } - @Override - public int getHarvestLevel(IBlockState state){ - return harvestLevel[getMetaFromState(state)]; - } + @Override + public int getHarvestLevel(IBlockState state) { + return harvestLevel[getMetaFromState(state)]; + } } diff --git a/src/main/java/forestry/arboriculture/blocks/BlockWood.java b/src/main/java/forestry/arboriculture/blocks/BlockWood.java index 9ee309798..2372d4b7b 100644 --- a/src/main/java/forestry/arboriculture/blocks/BlockWood.java +++ b/src/main/java/forestry/arboriculture/blocks/BlockWood.java @@ -29,11 +29,13 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.arboriculture.EnumWoodType; -import forestry.api.core.IModelManager; import forestry.api.core.IItemModelRegister; +import forestry.api.core.IModelManager; import forestry.api.core.Tabs; import forestry.arboriculture.IWoodTyped; import forestry.arboriculture.items.ItemBlockWood; @@ -57,7 +59,7 @@ public abstract class BlockWood extends Block implements ITileEntityProvider, II harvestTool = new String[EnumWoodType.values().length]; harvestLevel = new int[harvestTool.length]; - for(int i = 0;i < harvestTool.length;i++){ + for (int i = 0; i < harvestTool.length; i++) { harvestLevel[i] = -1; } @@ -70,7 +72,7 @@ public abstract class BlockWood extends Block implements ITileEntityProvider, II @Override protected BlockState createBlockState() { - return new BlockState(this, new IProperty[] { EnumWoodType.WOODTYPE }); + return new BlockState(this, new IProperty[]{EnumWoodType.WOODTYPE}); } @Override @@ -91,7 +93,7 @@ public abstract class BlockWood extends Block implements ITileEntityProvider, II @SideOnly(Side.CLIENT) @Override public void registerModel(Item item, IModelManager manager) { - if(!isFireproof()){ + if (!isFireproof()) { manager.registerVariant(item, ItemBlockWood.getVariants(this)); } manager.registerItemModel(item, new WoodMeshDefinition(this)); @@ -164,22 +166,22 @@ public abstract class BlockWood extends Block implements ITileEntityProvider, II return isFireproof() ? 0 : 5; } - @Override + @Override public void setHarvestLevel(String toolClass, int level, IBlockState state) { - int idx = this.getMetaFromState(state); - this.harvestTool[idx] = toolClass; - this.harvestLevel[idx] = level; - } + int idx = this.getMetaFromState(state); + this.harvestTool[idx] = toolClass; + this.harvestLevel[idx] = level; + } - @Override - public String getHarvestTool(IBlockState state){ - return harvestTool[getMetaFromState(state)]; - } + @Override + public String getHarvestTool(IBlockState state) { + return harvestTool[getMetaFromState(state)]; + } - @Override - public int getHarvestLevel(IBlockState state){ - return harvestLevel[getMetaFromState(state)]; - } + @Override + public int getHarvestLevel(IBlockState state) { + return harvestLevel[getMetaFromState(state)]; + } /* Particles */ @SideOnly(Side.CLIENT) diff --git a/src/main/java/forestry/arboriculture/blocks/property/PropertyFruit.java b/src/main/java/forestry/arboriculture/blocks/property/PropertyFruit.java index ee92c575d..9ba42d4c4 100644 --- a/src/main/java/forestry/arboriculture/blocks/property/PropertyFruit.java +++ b/src/main/java/forestry/arboriculture/blocks/property/PropertyFruit.java @@ -1,11 +1,11 @@ package forestry.arboriculture.blocks.property; +import com.google.common.base.Objects; + import java.util.ArrayList; import java.util.Collection; import java.util.List; -import com.google.common.base.Objects; - import forestry.api.arboriculture.IAlleleFruit; import forestry.api.arboriculture.IAlleleTreeSpecies; import forestry.api.genetics.AlleleManager; @@ -14,35 +14,34 @@ import forestry.core.blocks.propertys.PropertyAllele; public class PropertyFruit extends PropertyAllele { - public PropertyFruit(String name){ - super(name); - } + public PropertyFruit(String name) { + super(name); + } - @Override - public Class getValueClass() - { - return IAlleleFruit.class; - } + @Override + public Class getValueClass() { + return IAlleleFruit.class; + } - @Override - public String toString() - { - return Objects.toStringHelper(this).add("name", this.name).add("clazz", IAlleleFruit.class).add("values", this.getAllowedValues()).toString(); - } + @Override + public String toString() { + return Objects.toStringHelper(this).add("name", this.name).add("clazz", IAlleleFruit.class).add("values", this.getAllowedValues()).toString(); + } - @Override - public int hashCode() - { - return 31 * IAlleleTreeSpecies.class.hashCode() + this.name.hashCode(); - } + @Override + public int hashCode() { + return 31 * IAlleleTreeSpecies.class.hashCode() + this.name.hashCode(); + } @Override public Collection getAllowedValues() { - List trees = new ArrayList(); - for(IAllele allele : AlleleManager.alleleRegistry.getRegisteredAlleles().values()){ - if(allele instanceof IAlleleFruit) - if(((IAlleleFruit) allele).getModelName() != null) + List trees = new ArrayList<>(); + for (IAllele allele : AlleleManager.alleleRegistry.getRegisteredAlleles().values()) { + if (allele instanceof IAlleleFruit) { + if (((IAlleleFruit) allele).getModelName() != null) { trees.add((IAlleleFruit) allele); + } + } } return trees; } diff --git a/src/main/java/forestry/arboriculture/blocks/property/PropertyTree.java b/src/main/java/forestry/arboriculture/blocks/property/PropertyTree.java index 03944938b..830b29ba8 100644 --- a/src/main/java/forestry/arboriculture/blocks/property/PropertyTree.java +++ b/src/main/java/forestry/arboriculture/blocks/property/PropertyTree.java @@ -1,11 +1,11 @@ package forestry.arboriculture.blocks.property; +import com.google.common.base.Objects; + import java.util.ArrayList; import java.util.Collection; import java.util.List; -import com.google.common.base.Objects; - import forestry.api.arboriculture.IAlleleTreeSpecies; import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IAllele; @@ -13,34 +13,32 @@ import forestry.core.blocks.propertys.PropertyAllele; public class PropertyTree extends PropertyAllele { - public PropertyTree(String name){ - super(name); - } + public PropertyTree(String name) { + super(name); + } - @Override - public Class getValueClass() - { - return IAlleleTreeSpecies.class; - } + @Override + public Class getValueClass() { + return IAlleleTreeSpecies.class; + } - @Override - public String toString() - { - return Objects.toStringHelper(this).add("name", this.name).add("clazz", IAlleleTreeSpecies.class).add("values", this.getAllowedValues()).toString(); - } + @Override + public String toString() { + return Objects.toStringHelper(this).add("name", this.name).add("clazz", IAlleleTreeSpecies.class).add("values", this.getAllowedValues()).toString(); + } - @Override - public int hashCode() - { - return 31 * IAlleleTreeSpecies.class.hashCode() + this.name.hashCode(); - } + @Override + public int hashCode() { + return 31 * IAlleleTreeSpecies.class.hashCode() + this.name.hashCode(); + } @Override public Collection getAllowedValues() { List trees = new ArrayList<>(); - for(IAllele allele : AlleleManager.alleleRegistry.getRegisteredAlleles().values()){ - if(allele instanceof IAlleleTreeSpecies) + for (IAllele allele : AlleleManager.alleleRegistry.getRegisteredAlleles().values()) { + if (allele instanceof IAlleleTreeSpecies) { trees.add((IAlleleTreeSpecies) allele); + } } return trees; } diff --git a/src/main/java/forestry/arboriculture/commands/CommandTreeSpawn.java b/src/main/java/forestry/arboriculture/commands/CommandTreeSpawn.java index d5fa374fc..9eddf3c41 100644 --- a/src/main/java/forestry/arboriculture/commands/CommandTreeSpawn.java +++ b/src/main/java/forestry/arboriculture/commands/CommandTreeSpawn.java @@ -19,6 +19,7 @@ import net.minecraft.command.ICommandSender; import net.minecraft.command.PlayerNotFoundException; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.BlockPos; + import forestry.api.arboriculture.IAlleleTreeSpecies; import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IAllele; diff --git a/src/main/java/forestry/arboriculture/commands/ForestSpawner.java b/src/main/java/forestry/arboriculture/commands/ForestSpawner.java index eedd68f60..7b3ffe0cd 100644 --- a/src/main/java/forestry/arboriculture/commands/ForestSpawner.java +++ b/src/main/java/forestry/arboriculture/commands/ForestSpawner.java @@ -10,14 +10,15 @@ ******************************************************************************/ package forestry.arboriculture.commands; -import forestry.core.commands.SpeciesNotFoundException; -import forestry.core.commands.TemplateNotFoundException; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.BlockPos; import net.minecraft.util.Vec3; import net.minecraft.world.gen.feature.WorldGenerator; +import forestry.core.commands.SpeciesNotFoundException; +import forestry.core.commands.TemplateNotFoundException; + public class ForestSpawner implements ITreeSpawner { @Override diff --git a/src/main/java/forestry/arboriculture/commands/ITreeSpawner.java b/src/main/java/forestry/arboriculture/commands/ITreeSpawner.java index 70064277a..a53cad904 100644 --- a/src/main/java/forestry/arboriculture/commands/ITreeSpawner.java +++ b/src/main/java/forestry/arboriculture/commands/ITreeSpawner.java @@ -10,11 +10,12 @@ ******************************************************************************/ package forestry.arboriculture.commands; -import forestry.core.commands.SpeciesNotFoundException; -import forestry.core.commands.TemplateNotFoundException; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; +import forestry.core.commands.SpeciesNotFoundException; +import forestry.core.commands.TemplateNotFoundException; + public interface ITreeSpawner { boolean spawn(ICommandSender sender, String treeName, EntityPlayer player) throws SpeciesNotFoundException, TemplateNotFoundException; diff --git a/src/main/java/forestry/arboriculture/commands/TreeSpawner.java b/src/main/java/forestry/arboriculture/commands/TreeSpawner.java index 2920c9860..2d27c5061 100644 --- a/src/main/java/forestry/arboriculture/commands/TreeSpawner.java +++ b/src/main/java/forestry/arboriculture/commands/TreeSpawner.java @@ -10,14 +10,15 @@ ******************************************************************************/ package forestry.arboriculture.commands; -import forestry.core.commands.SpeciesNotFoundException; -import forestry.core.commands.TemplateNotFoundException; import net.minecraft.command.ICommandSender; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.BlockPos; import net.minecraft.util.Vec3; import net.minecraft.world.gen.feature.WorldGenerator; +import forestry.core.commands.SpeciesNotFoundException; +import forestry.core.commands.TemplateNotFoundException; + public class TreeSpawner implements ITreeSpawner { @Override diff --git a/src/main/java/forestry/arboriculture/genetics/Tree.java b/src/main/java/forestry/arboriculture/genetics/Tree.java index 653a1a239..d9177a2c1 100755 --- a/src/main/java/forestry/arboriculture/genetics/Tree.java +++ b/src/main/java/forestry/arboriculture/genetics/Tree.java @@ -32,6 +32,7 @@ import com.mojang.authlib.GameProfile; import net.minecraftforge.common.EnumPlantType; import net.minecraftforge.common.IPlantable; + import forestry.api.arboriculture.EnumGrowthConditions; import forestry.api.arboriculture.EnumTreeChromosome; import forestry.api.arboriculture.IAlleleLeafEffect; diff --git a/src/main/java/forestry/arboriculture/items/ItemBlockLeaves.java b/src/main/java/forestry/arboriculture/items/ItemBlockLeaves.java index 71b282396..aea0a6d9d 100644 --- a/src/main/java/forestry/arboriculture/items/ItemBlockLeaves.java +++ b/src/main/java/forestry/arboriculture/items/ItemBlockLeaves.java @@ -63,9 +63,9 @@ public class ItemBlockLeaves extends ItemBlockForestry { TileLeaves tileLeaves = new TileLeaves(); tileLeaves.readFromNBT(itemStack.getTagCompound()); - if(renderPass == 1){ + if (renderPass == 1) { return tileLeaves.getFruitColour(); - }else{ + } else { return tileLeaves.getFoliageColour(Proxies.common.getPlayer()); } } diff --git a/src/main/java/forestry/arboriculture/items/ItemBlockWood.java b/src/main/java/forestry/arboriculture/items/ItemBlockWood.java index b5b86f185..acf563139 100644 --- a/src/main/java/forestry/arboriculture/items/ItemBlockWood.java +++ b/src/main/java/forestry/arboriculture/items/ItemBlockWood.java @@ -174,8 +174,9 @@ public class ItemBlockWood extends ItemBlockForestry { public static ResourceLocation[] getVariants(IWoodTyped typed) { List variants = new ArrayList<>(); - for (EnumWoodType type : EnumWoodType.values()) - variants.add(new ResourceLocation("forestry", typed.getBlockKind() + "/" + type.getName().toLowerCase())); + for (EnumWoodType type : EnumWoodType.values()) { + variants.add(new ResourceLocation("forestry", typed.getBlockKind() + "/" + type.getName().toLowerCase())); + } return variants.toArray(new ResourceLocation[variants.size()]); } diff --git a/src/main/java/forestry/arboriculture/items/ItemBlockWoodSlab.java b/src/main/java/forestry/arboriculture/items/ItemBlockWoodSlab.java index 5b66b49b5..b24cf1b62 100644 --- a/src/main/java/forestry/arboriculture/items/ItemBlockWoodSlab.java +++ b/src/main/java/forestry/arboriculture/items/ItemBlockWoodSlab.java @@ -29,20 +29,14 @@ public class ItemBlockWoodSlab extends ItemBlockWood { } @Override - public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) - { - if (stack.stackSize == 0) - { - return false; - } - else if (!player.canPlayerEdit(pos.offset(side), side, stack)) - { - return false; - } - else - { - IBlockState iblockstate = world.getBlockState(pos); - + public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumFacing side, float hitX, float hitY, float hitZ) { + if (stack.stackSize == 0) { + return false; + } else if (!player.canPlayerEdit(pos.offset(side), side, stack)) { + return false; + } else { + IBlockState iblockstate = world.getBlockState(pos); + EnumWoodType blockWoodType = null; EnumWoodType stackWoodType = getWoodType(stack); TileWood tile = TileUtil.getTile(world, pos, TileWood.class); @@ -50,33 +44,31 @@ public class ItemBlockWoodSlab extends ItemBlockWood { blockWoodType = tile.getWoodType(); } - if (iblockstate.getBlock() == this.slab){ - EnumBlockHalf blockslab$enumblockhalf = iblockstate.getValue(net.minecraft.block.BlockSlab.HALF); + if (iblockstate.getBlock() == this.slab) { + EnumBlockHalf blockslab$enumblockhalf = iblockstate.getValue(net.minecraft.block.BlockSlab.HALF); - if ((side == EnumFacing.UP && blockslab$enumblockhalf == EnumBlockHalf.BOTTOM || side == EnumFacing.DOWN && blockslab$enumblockhalf == EnumBlockHalf.TOP) && blockWoodType == stackWoodType) - { - if (world.checkNoEntityCollision(this.doubleSlab.getCollisionBoundingBox(world, pos, iblockstate)) ) - { - if(placeWood(stack, stackWoodType, doubleSlab.getDefaultState(), player, world, pos)){ - world.playSoundEffect(pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, this.doubleSlab.stepSound.getPlaceSound(), (this.doubleSlab.stepSound.getVolume() + 1.0F) / 2.0F, this.doubleSlab.stepSound.getFrequency() * 0.8F); - --stack.stackSize; - } - } + if ((side == EnumFacing.UP && blockslab$enumblockhalf == EnumBlockHalf.BOTTOM || side == EnumFacing.DOWN && blockslab$enumblockhalf == EnumBlockHalf.TOP) && blockWoodType == stackWoodType) { + if (world.checkNoEntityCollision(this.doubleSlab.getCollisionBoundingBox(world, pos, iblockstate))) { + if (placeWood(stack, stackWoodType, doubleSlab.getDefaultState(), player, world, pos)) { + world.playSoundEffect(pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, this.doubleSlab.stepSound.getPlaceSound(), (this.doubleSlab.stepSound.getVolume() + 1.0F) / 2.0F, this.doubleSlab.stepSound.getFrequency() * 0.8F); + --stack.stackSize; + } + } - return true; - } - } + return true; + } + } return this.tryPlace(stack, world, pos.offset(side), stackWoodType) || super.onItemUse(stack, player, world, pos, side, hitX, hitY, hitZ); } - } + } @Override @SideOnly(Side.CLIENT) public boolean canPlaceBlockOnSide(World world, BlockPos pos, EnumFacing side, EntityPlayer player, ItemStack itemStack) { - BlockPos blockpos = pos; - IBlockState iblockstate = world.getBlockState(pos); - + BlockPos blockpos = pos; + IBlockState iblockstate = world.getBlockState(pos); + EnumWoodType blockWoodType = null; EnumWoodType stackWoodType = getWoodType(itemStack); TileWood tile = TileUtil.getTile(world, pos, TileWood.class); @@ -84,47 +76,41 @@ public class ItemBlockWoodSlab extends ItemBlockWood { blockWoodType = tile.getWoodType(); } - if (iblockstate.getBlock() == slab) - { - boolean flag = iblockstate.getValue(net.minecraft.block.BlockSlab.HALF) == EnumBlockHalf.TOP; + if (iblockstate.getBlock() == slab) { + boolean flag = iblockstate.getValue(net.minecraft.block.BlockSlab.HALF) == EnumBlockHalf.TOP; - if ((side == EnumFacing.UP && !flag || side == EnumFacing.DOWN && flag) && stackWoodType == blockWoodType) - { - return true; - } - } + if ((side == EnumFacing.UP && !flag || side == EnumFacing.DOWN && flag) && stackWoodType == blockWoodType) { + return true; + } + } - pos = pos.offset(side); - IBlockState iblockstate1 = world.getBlockState(pos); + pos = pos.offset(side); + IBlockState iblockstate1 = world.getBlockState(pos); return iblockstate1.getBlock() == this.slab && stackWoodType == blockWoodType || super.canPlaceBlockOnSide(world, blockpos, side, player, itemStack); } - private boolean tryPlace(ItemStack itemStack, World world, BlockPos pos, Object variantInStack) - { - IBlockState iblockstate = world.getBlockState(pos); + private boolean tryPlace(ItemStack itemStack, World world, BlockPos pos, Object variantInStack) { + IBlockState iblockstate = world.getBlockState(pos); EnumWoodType blockWoodType = null; TileWood tile = TileUtil.getTile(world, pos, TileWood.class); if (tile != null) { blockWoodType = tile.getWoodType(); } - - if (iblockstate.getBlock() == slab) - { - if (blockWoodType == variantInStack) - { - if (world.checkNoEntityCollision(this.doubleSlab.getCollisionBoundingBox(world, pos, doubleSlab.getDefaultState()))) - { - if(placeWood(itemStack, (EnumWoodType) variantInStack, doubleSlab.getDefaultState(), null, world, pos)){ - world.playSoundEffect(pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, this.doubleSlab.stepSound.getPlaceSound(), (this.doubleSlab.stepSound.getVolume() + 1.0F) / 2.0F, this.doubleSlab.stepSound.getFrequency() * 0.8F); - --itemStack.stackSize; - } - } - return true; - } - } + if (iblockstate.getBlock() == slab) { + if (blockWoodType == variantInStack) { + if (world.checkNoEntityCollision(this.doubleSlab.getCollisionBoundingBox(world, pos, doubleSlab.getDefaultState()))) { + if (placeWood(itemStack, (EnumWoodType) variantInStack, doubleSlab.getDefaultState(), null, world, pos)) { + world.playSoundEffect(pos.getX() + 0.5F, pos.getY() + 0.5F, pos.getZ() + 0.5F, this.doubleSlab.stepSound.getPlaceSound(), (this.doubleSlab.stepSound.getVolume() + 1.0F) / 2.0F, this.doubleSlab.stepSound.getFrequency() * 0.8F); + --itemStack.stackSize; + } + } - return false; - } + return true; + } + } + + return false; + } } diff --git a/src/main/java/forestry/arboriculture/items/ItemGermlingGE.java b/src/main/java/forestry/arboriculture/items/ItemGermlingGE.java index 7ff39f537..5db568fba 100755 --- a/src/main/java/forestry/arboriculture/items/ItemGermlingGE.java +++ b/src/main/java/forestry/arboriculture/items/ItemGermlingGE.java @@ -21,8 +21,10 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.arboriculture.EnumGermlingType; import forestry.api.arboriculture.IAlleleTreeSpecies; import forestry.api.arboriculture.ITree; diff --git a/src/main/java/forestry/arboriculture/render/FluidPodStateMapper.java b/src/main/java/forestry/arboriculture/render/FluidPodStateMapper.java index 655f5318f..e037bb246 100644 --- a/src/main/java/forestry/arboriculture/render/FluidPodStateMapper.java +++ b/src/main/java/forestry/arboriculture/render/FluidPodStateMapper.java @@ -23,23 +23,23 @@ import forestry.arboriculture.blocks.BlockFruitPod; import forestry.core.render.ForestryStateMapper; @SideOnly(Side.CLIENT) -public class FluidPodStateMapper extends ForestryStateMapper{ +public class FluidPodStateMapper extends ForestryStateMapper { private final Map mapStateModelLocations = Maps.newLinkedHashMap(); @Override public Map putStateModelLocations(Block block) { - for (EnumFacing facing : EnumFacing.values()){ - if(facing != EnumFacing.UP && facing != EnumFacing.DOWN){ - for (int age = 0;age < BlockCocoa.AGE.getAllowedValues().size();age++){ + for (EnumFacing facing : EnumFacing.values()) { + if (facing != EnumFacing.UP && facing != EnumFacing.DOWN) { + for (int age = 0; age < BlockCocoa.AGE.getAllowedValues().size(); age++) { for (IAllele allele : AlleleManager.alleleRegistry.getRegisteredAlleles().values()) { if (allele instanceof IAlleleFruit) { IAlleleFruit fruit = (IAlleleFruit) allele; - if(fruit.getModelName() != null){ + if (fruit.getModelName() != null) { IBlockState state = block.getDefaultState().withProperty(BlockFruitPod.FRUIT, fruit).withProperty(BlockDirectional.FACING, facing).withProperty(BlockCocoa.AGE, age); LinkedHashMap linkedhashmap = Maps.newLinkedHashMap(state.getProperties()); String modID = fruit.getModID(); - if(modID == null){ + if (modID == null) { modID = "forestry"; } String modelName = BlockFruitPod.FRUIT.getName((IAlleleFruit) linkedhashmap.remove(BlockFruitPod.FRUIT)); diff --git a/src/main/java/forestry/arboriculture/render/ModelProviderGermling.java b/src/main/java/forestry/arboriculture/render/ModelProviderGermling.java index f310bca54..3b3134a84 100644 --- a/src/main/java/forestry/arboriculture/render/ModelProviderGermling.java +++ b/src/main/java/forestry/arboriculture/render/ModelProviderGermling.java @@ -10,12 +10,13 @@ ******************************************************************************/ package forestry.arboriculture.render; +import net.minecraft.client.resources.model.ModelResourceLocation; +import net.minecraft.util.ResourceLocation; + import forestry.api.arboriculture.EnumGermlingType; import forestry.api.arboriculture.IGermlingModelProvider; import forestry.api.core.IModelManager; import forestry.plugins.PluginArboriculture; -import net.minecraft.client.resources.model.ModelResourceLocation; -import net.minecraft.util.ResourceLocation; public class ModelProviderGermling implements IGermlingModelProvider { diff --git a/src/main/java/forestry/arboriculture/render/ModelProviderGermlingVanilla.java b/src/main/java/forestry/arboriculture/render/ModelProviderGermlingVanilla.java index bd1e6c365..6cd636557 100644 --- a/src/main/java/forestry/arboriculture/render/ModelProviderGermlingVanilla.java +++ b/src/main/java/forestry/arboriculture/render/ModelProviderGermlingVanilla.java @@ -10,10 +10,11 @@ ******************************************************************************/ package forestry.arboriculture.render; +import net.minecraft.client.resources.model.ModelResourceLocation; + import forestry.api.arboriculture.EnumGermlingType; import forestry.api.arboriculture.IGermlingModelProvider; import forestry.api.core.IModelManager; -import net.minecraft.client.resources.model.ModelResourceLocation; public class ModelProviderGermlingVanilla implements IGermlingModelProvider { @@ -29,24 +30,24 @@ public class ModelProviderGermlingVanilla implements IGermlingModelProvider { @Override public void registerModels(IModelManager manager) { switch (vanillaMap) { - case 0: - model = manager.getModelLocation("minecraft", "oak_sapling"); - break; - case 1: - model = manager.getModelLocation("minecraft", "spruce_sapling"); - break; - case 2: - model = manager.getModelLocation("minecraft", "birch_sapling"); - break; - case 3: - model = manager.getModelLocation("minecraft", "jungle_sapling"); - break; - case 4: - model = manager.getModelLocation("minecraft", "dark_oak_sapling"); - break; - case 5: - model = manager.getModelLocation("minecraft", "acacia_sapling"); - break; + case 0: + model = manager.getModelLocation("minecraft", "oak_sapling"); + break; + case 1: + model = manager.getModelLocation("minecraft", "spruce_sapling"); + break; + case 2: + model = manager.getModelLocation("minecraft", "birch_sapling"); + break; + case 3: + model = manager.getModelLocation("minecraft", "jungle_sapling"); + break; + case 4: + model = manager.getModelLocation("minecraft", "dark_oak_sapling"); + break; + case 5: + model = manager.getModelLocation("minecraft", "acacia_sapling"); + break; } pollenModel = manager.getModelLocation("pollen"); } diff --git a/src/main/java/forestry/arboriculture/render/SaplingStateMapper.java b/src/main/java/forestry/arboriculture/render/SaplingStateMapper.java index 28acb4863..2ac948729 100644 --- a/src/main/java/forestry/arboriculture/render/SaplingStateMapper.java +++ b/src/main/java/forestry/arboriculture/render/SaplingStateMapper.java @@ -26,11 +26,11 @@ public class SaplingStateMapper extends ForestryStateMapper { public Map putStateModelLocations(Block block) { for (IAllele allele : AlleleManager.alleleRegistry.getRegisteredAlleles().values()) { if (allele instanceof IAlleleTreeSpecies) { - IAlleleTreeSpecies tree = (IAlleleTreeSpecies)allele; + IAlleleTreeSpecies tree = (IAlleleTreeSpecies) allele; IBlockState state = block.getDefaultState().withProperty(BlockSapling.TREE, tree); LinkedHashMap linkedhashmap = Maps.newLinkedHashMap(state.getProperties()); String modID = tree.getModID(); - if(modID == null){ + if (modID == null) { modID = "forestry"; } String s = String.format("%s:%s", modID, "germlings"); diff --git a/src/main/java/forestry/arboriculture/render/TextureLeaves.java b/src/main/java/forestry/arboriculture/render/TextureLeaves.java index 945b80798..bb3cb38de 100644 --- a/src/main/java/forestry/arboriculture/render/TextureLeaves.java +++ b/src/main/java/forestry/arboriculture/render/TextureLeaves.java @@ -15,6 +15,7 @@ import java.util.Locale; import java.util.Map; import net.minecraft.client.renderer.texture.TextureAtlasSprite; + import forestry.api.arboriculture.EnumLeafType; import forestry.core.render.TextureManager; diff --git a/src/main/java/forestry/arboriculture/tiles/TileLeaves.java b/src/main/java/forestry/arboriculture/tiles/TileLeaves.java index 5369fc5f7..b46de9356 100644 --- a/src/main/java/forestry/arboriculture/tiles/TileLeaves.java +++ b/src/main/java/forestry/arboriculture/tiles/TileLeaves.java @@ -29,6 +29,7 @@ import com.mojang.authlib.GameProfile; import net.minecraftforge.common.EnumPlantType; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.arboriculture.EnumTreeChromosome; import forestry.api.arboriculture.IAlleleTreeSpecies; import forestry.api.arboriculture.IFruitProvider; diff --git a/src/main/java/forestry/arboriculture/tiles/TileTreeContainer.java b/src/main/java/forestry/arboriculture/tiles/TileTreeContainer.java index 120ed5833..9e80016f9 100644 --- a/src/main/java/forestry/arboriculture/tiles/TileTreeContainer.java +++ b/src/main/java/forestry/arboriculture/tiles/TileTreeContainer.java @@ -135,6 +135,7 @@ public abstract class TileTreeContainer extends TileEntity implements IStreamabl } /* UPDATING */ + /** * Leaves and saplings will implement their logic here. */ diff --git a/src/main/java/forestry/arboriculture/tiles/TileWood.java b/src/main/java/forestry/arboriculture/tiles/TileWood.java index 6624e8277..d85a5bbd2 100644 --- a/src/main/java/forestry/arboriculture/tiles/TileWood.java +++ b/src/main/java/forestry/arboriculture/tiles/TileWood.java @@ -20,6 +20,7 @@ import net.minecraft.network.Packet; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.world.IBlockAccess; + import forestry.api.arboriculture.EnumWoodType; import forestry.arboriculture.IWoodTyped; import forestry.arboriculture.blocks.BlockSlab; diff --git a/src/main/java/forestry/arboriculture/worldgen/BlockTypeVanillaStairs.java b/src/main/java/forestry/arboriculture/worldgen/BlockTypeVanillaStairs.java index 8aa3f0445..26b678c4e 100644 --- a/src/main/java/forestry/arboriculture/worldgen/BlockTypeVanillaStairs.java +++ b/src/main/java/forestry/arboriculture/worldgen/BlockTypeVanillaStairs.java @@ -12,6 +12,7 @@ package forestry.arboriculture.worldgen; import net.minecraft.init.Blocks; import net.minecraft.util.EnumFacing; + import forestry.core.worldgen.BlockType; public class BlockTypeVanillaStairs extends BlockType { diff --git a/src/main/java/forestry/arboriculture/worldgen/WorldGenArboriculture.java b/src/main/java/forestry/arboriculture/worldgen/WorldGenArboriculture.java index bc0f6d75a..e483832d4 100755 --- a/src/main/java/forestry/arboriculture/worldgen/WorldGenArboriculture.java +++ b/src/main/java/forestry/arboriculture/worldgen/WorldGenArboriculture.java @@ -134,7 +134,7 @@ public abstract class WorldGenArboriculture extends WorldGenBase { int offsetX = 0; int offsetZ = 0; - if(leanDirection != null){ + if (leanDirection != null) { offsetX = leanDirection.getFrontOffsetX(); offsetZ = leanDirection.getFrontOffsetZ(); } @@ -254,7 +254,7 @@ public abstract class WorldGenArboriculture extends WorldGenBase { int offsetX = 0; int offsetZ = 0; - if(branchDirection != null){ + if (branchDirection != null) { offsetX = branchDirection.getFrontOffsetX(); offsetZ = branchDirection.getFrontOffsetZ(); } diff --git a/src/main/java/forestry/core/EventHandlerCore.java b/src/main/java/forestry/core/EventHandlerCore.java index e8d191127..61cb3ddfe 100755 --- a/src/main/java/forestry/core/EventHandlerCore.java +++ b/src/main/java/forestry/core/EventHandlerCore.java @@ -22,6 +22,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.PlayerEvent; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IBreedingTracker; import forestry.api.genetics.ISpeciesRoot; diff --git a/src/main/java/forestry/core/TickHandlerCoreClient.java b/src/main/java/forestry/core/TickHandlerCoreClient.java index 884e97404..6db551dc3 100755 --- a/src/main/java/forestry/core/TickHandlerCoreClient.java +++ b/src/main/java/forestry/core/TickHandlerCoreClient.java @@ -13,9 +13,11 @@ package forestry.core; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.RenderGlobal; import net.minecraft.entity.player.EntityPlayer; + import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; + import forestry.core.utils.GeneticsUtil; public class TickHandlerCoreClient { diff --git a/src/main/java/forestry/core/TickHandlerCoreServer.java b/src/main/java/forestry/core/TickHandlerCoreServer.java index 76c8a2ba7..adedbad5d 100755 --- a/src/main/java/forestry/core/TickHandlerCoreServer.java +++ b/src/main/java/forestry/core/TickHandlerCoreServer.java @@ -24,6 +24,7 @@ import net.minecraftforge.event.world.ChunkDataEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; import net.minecraftforge.fml.common.gameevent.TickEvent.WorldTickEvent; + import forestry.core.config.Config; import forestry.core.config.Constants; import forestry.core.worldgen.WorldGenerator; diff --git a/src/main/java/forestry/core/access/EnumAccess.java b/src/main/java/forestry/core/access/EnumAccess.java index 62b4cf33b..c2c0608c9 100644 --- a/src/main/java/forestry/core/access/EnumAccess.java +++ b/src/main/java/forestry/core/access/EnumAccess.java @@ -11,6 +11,7 @@ package forestry.core.access; import net.minecraft.client.renderer.texture.TextureAtlasSprite; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; diff --git a/src/main/java/forestry/core/blocks/BlockBase.java b/src/main/java/forestry/core/blocks/BlockBase.java index 105b02e8f..eed36b2fd 100644 --- a/src/main/java/forestry/core/blocks/BlockBase.java +++ b/src/main/java/forestry/core/blocks/BlockBase.java @@ -65,7 +65,7 @@ public class BlockBase

& IBlockType & IStringSerializable> ext private final PropertyEnum

TYPE; private final PropertyEnum FACE; - protected final BlockState blockState; + protected final BlockState blockState; private boolean isReady = false; @@ -85,7 +85,7 @@ public class BlockBase

& IBlockType & IStringSerializable> ext TYPE = PropertyEnum.create("type", machinePropertiesClass); FACE = PropertyEnum.create("face", EnumFacing.class); - this.blockState = this.createBlockState(); + this.blockState = this.createBlockState(); IBlockState state = this.blockState.getBaseState().withProperty(FACE, EnumFacing.NORTH); this.setDefaultState(state); } @@ -275,8 +275,9 @@ public class BlockBase

& IBlockType & IStringSerializable> ext @Override protected BlockState createBlockState() { - if(!isReady) + if (!isReady) { return super.createBlockState(); + } return new BlockState(this, TYPE, FACE); } @@ -289,9 +290,9 @@ public class BlockBase

& IBlockType & IStringSerializable> ext @Override public IBlockState getStateFromMeta(int meta) { - for(Map.Entry entry : properties.entrySet()){ + for (Map.Entry entry : properties.entrySet()) { IMachineProperties machineProperties = entry.getValue(); - if (machineProperties.getMeta() == meta){ + if (machineProperties.getMeta() == meta) { P blockType = entry.getKey(); return getDefaultState().withProperty(this.TYPE, blockType); } @@ -309,17 +310,16 @@ public class BlockBase

& IBlockType & IStringSerializable> ext @Override public IBlockState getActualState(IBlockState state, IBlockAccess world, BlockPos pos) { TileForestry tile = TileUtil.getTile(world, pos, TileForestry.class); - if (tile != null ) { + if (tile != null) { state = state.withProperty(FACE, tile.getOrientation()); } return super.getActualState(state, world, pos); } - @Override - public BlockState getBlockState() - { - return this.blockState; - } + @Override + public BlockState getBlockState() { + return this.blockState; + } @Override public boolean getUseNeighborBrightness() { diff --git a/src/main/java/forestry/core/blocks/BlockRegistry.java b/src/main/java/forestry/core/blocks/BlockRegistry.java index 7fd880c0b..b8752ae09 100644 --- a/src/main/java/forestry/core/blocks/BlockRegistry.java +++ b/src/main/java/forestry/core/blocks/BlockRegistry.java @@ -13,6 +13,7 @@ package forestry.core.blocks; import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; + import net.minecraftforge.fml.common.registry.GameRegistry; import net.minecraftforge.oredict.OreDictionary; diff --git a/src/main/java/forestry/core/blocks/BlockResourceOre.java b/src/main/java/forestry/core/blocks/BlockResourceOre.java index 8d7d2ebd4..2f7b2079c 100644 --- a/src/main/java/forestry/core/blocks/BlockResourceOre.java +++ b/src/main/java/forestry/core/blocks/BlockResourceOre.java @@ -28,10 +28,12 @@ import net.minecraft.util.IStringSerializable; import net.minecraft.util.MathHelper; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import forestry.api.core.IModelManager; + import forestry.api.core.IItemModelRegister; +import forestry.api.core.IModelManager; import forestry.core.CreativeTabForestry; import forestry.plugins.PluginCore; @@ -71,7 +73,7 @@ public class BlockResourceOre extends Block implements IItemModelRegister { @Override protected BlockState createBlockState() { - return new BlockState(this, new IProperty[] { RESOURCE }); + return new BlockState(this, new IProperty[]{RESOURCE}); } @Override diff --git a/src/main/java/forestry/core/blocks/BlockResourceStorage.java b/src/main/java/forestry/core/blocks/BlockResourceStorage.java index 404a8bf9d..6a088c47c 100644 --- a/src/main/java/forestry/core/blocks/BlockResourceStorage.java +++ b/src/main/java/forestry/core/blocks/BlockResourceStorage.java @@ -13,16 +13,18 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IStringSerializable; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import forestry.api.core.IModelManager; + import forestry.api.core.IItemModelRegister; +import forestry.api.core.IModelManager; import forestry.core.CreativeTabForestry; public class BlockResourceStorage extends Block implements IItemModelRegister { public static final PropertyEnum RESOURCE = PropertyEnum.create("resource", ResourceType.class); - public enum ResourceType implements IStringSerializable{ + public enum ResourceType implements IStringSerializable { APATITE, COPPER, TIN, @@ -46,7 +48,7 @@ public class BlockResourceStorage extends Block implements IItemModelRegister { @Override protected BlockState createBlockState() { - return new BlockState(this, new IProperty[] { RESOURCE }); + return new BlockState(this, new IProperty[]{RESOURCE}); } @Override diff --git a/src/main/java/forestry/core/blocks/BlockSoil.java b/src/main/java/forestry/core/blocks/BlockSoil.java index 1f71b2e45..932ae49a5 100644 --- a/src/main/java/forestry/core/blocks/BlockSoil.java +++ b/src/main/java/forestry/core/blocks/BlockSoil.java @@ -82,7 +82,7 @@ public class BlockSoil extends Block implements IItemTyped, IItemModelRegister { @Override protected BlockState createBlockState() { - return new BlockState(this, new IProperty[] { SOIL }); + return new BlockState(this, new IProperty[]{SOIL}); } @Override diff --git a/src/main/java/forestry/core/blocks/BlockStructure.java b/src/main/java/forestry/core/blocks/BlockStructure.java index 540351ce1..2c7a2168b 100644 --- a/src/main/java/forestry/core/blocks/BlockStructure.java +++ b/src/main/java/forestry/core/blocks/BlockStructure.java @@ -62,7 +62,7 @@ public abstract class BlockStructure extends BlockForestry { // If the player's hands are empty and they right-click on a multiblock, they get a // multiblock-debugging message if the machine is not assembled. - if(player.getCurrentEquippedItem() == null){ + if (player.getCurrentEquippedItem() == null) { if (controller != null) { if (!controller.isAssembled()) { String validationError = controller.getLastValidationError(); diff --git a/src/main/java/forestry/core/blocks/IMachineProperties.java b/src/main/java/forestry/core/blocks/IMachineProperties.java index a06da2609..404672113 100644 --- a/src/main/java/forestry/core/blocks/IMachineProperties.java +++ b/src/main/java/forestry/core/blocks/IMachineProperties.java @@ -11,12 +11,8 @@ package forestry.core.blocks; import javax.annotation.Nonnull; - import java.util.List; -import forestry.api.core.IModelManager; -import forestry.core.tiles.TileForestry; - import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.creativetab.CreativeTabs; @@ -32,7 +28,10 @@ import net.minecraft.util.Vec3; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; -public interface IMachineProperties extends IStringSerializable{ +import forestry.api.core.IModelManager; +import forestry.core.tiles.TileForestry; + +public interface IMachineProperties extends IStringSerializable { int getMeta(); @Nonnull diff --git a/src/main/java/forestry/core/blocks/MachineProperties.java b/src/main/java/forestry/core/blocks/MachineProperties.java index 16be46d38..e64ce6557 100644 --- a/src/main/java/forestry/core/blocks/MachineProperties.java +++ b/src/main/java/forestry/core/blocks/MachineProperties.java @@ -2,7 +2,6 @@ package forestry.core.blocks; import javax.annotation.Nonnull; import javax.annotation.Nullable; - import java.util.List; import net.minecraft.block.Block; diff --git a/src/main/java/forestry/core/blocks/propertys/PropertyAllele.java b/src/main/java/forestry/core/blocks/propertys/PropertyAllele.java index cc2da41b8..cc386a031 100644 --- a/src/main/java/forestry/core/blocks/propertys/PropertyAllele.java +++ b/src/main/java/forestry/core/blocks/propertys/PropertyAllele.java @@ -16,34 +16,27 @@ import forestry.api.genetics.IAllele; public abstract class PropertyAllele> implements IProperty { - protected final String name; + protected final String name; - public PropertyAllele(String name){ - this.name = name; - } + public PropertyAllele(String name) { + this.name = name; + } - @Override - public String getName() - { - return this.name; - } + @Override + public String getName() { + return this.name; + } - @Override - public boolean equals(Object object) - { - if (this == object) - { - return true; - } - else if (object != null && this.getClass() == object.getClass()) - { - PropertyAllele propertyAllele = (PropertyAllele)object; - return name.equals(propertyAllele.name); - } - else - { - return false; - } - } + @Override + public boolean equals(Object object) { + if (this == object) { + return true; + } else if (object != null && this.getClass() == object.getClass()) { + PropertyAllele propertyAllele = (PropertyAllele) object; + return name.equals(propertyAllele.name); + } else { + return false; + } + } } diff --git a/src/main/java/forestry/core/blocks/propertys/UnlistedBlockAccess.java b/src/main/java/forestry/core/blocks/propertys/UnlistedBlockAccess.java index 89aefe1b8..52a408c37 100644 --- a/src/main/java/forestry/core/blocks/propertys/UnlistedBlockAccess.java +++ b/src/main/java/forestry/core/blocks/propertys/UnlistedBlockAccess.java @@ -11,6 +11,7 @@ package forestry.core.blocks.propertys; import net.minecraft.world.IBlockAccess; + import net.minecraftforge.common.property.IUnlistedProperty; public final class UnlistedBlockAccess implements IUnlistedProperty { diff --git a/src/main/java/forestry/core/blocks/propertys/UnlistedBlockPos.java b/src/main/java/forestry/core/blocks/propertys/UnlistedBlockPos.java index 613be7c3c..7e2eb46df 100644 --- a/src/main/java/forestry/core/blocks/propertys/UnlistedBlockPos.java +++ b/src/main/java/forestry/core/blocks/propertys/UnlistedBlockPos.java @@ -11,6 +11,7 @@ package forestry.core.blocks.propertys; import net.minecraft.util.BlockPos; + import net.minecraftforge.common.property.IUnlistedProperty; public final class UnlistedBlockPos implements IUnlistedProperty { diff --git a/src/main/java/forestry/core/circuits/ItemCircuitBoard.java b/src/main/java/forestry/core/circuits/ItemCircuitBoard.java index a4ffdc9ac..e5b2e3900 100755 --- a/src/main/java/forestry/core/circuits/ItemCircuitBoard.java +++ b/src/main/java/forestry/core/circuits/ItemCircuitBoard.java @@ -50,7 +50,7 @@ public class ItemCircuitBoard extends ItemForestry { @SideOnly(Side.CLIENT) @Override public void registerModel(Item item, IModelManager manager) { - for(int i = 0;i < 4;i++){ + for (int i = 0; i < 4; i++) { manager.registerItemModel(item, i, "chipsets"); } } diff --git a/src/main/java/forestry/core/config/ForestryGuiConfigFactory.java b/src/main/java/forestry/core/config/ForestryGuiConfigFactory.java index d6f8ef336..0b417f32e 100644 --- a/src/main/java/forestry/core/config/ForestryGuiConfigFactory.java +++ b/src/main/java/forestry/core/config/ForestryGuiConfigFactory.java @@ -14,6 +14,7 @@ import java.util.Set; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; + import net.minecraftforge.fml.client.IModGuiFactory; public class ForestryGuiConfigFactory implements IModGuiFactory { diff --git a/src/main/java/forestry/core/config/Version.java b/src/main/java/forestry/core/config/Version.java index ba1a39fa1..b7d6437b6 100755 --- a/src/main/java/forestry/core/config/Version.java +++ b/src/main/java/forestry/core/config/Version.java @@ -21,6 +21,7 @@ import net.minecraftforge.common.config.Configuration; import net.minecraftforge.common.config.Property; import net.minecraftforge.fml.common.FMLCommonHandler; import net.minecraftforge.fml.common.versioning.DefaultArtifactVersion; + import forestry.Forestry; import forestry.core.proxy.Proxies; import forestry.core.utils.Log; diff --git a/src/main/java/forestry/core/entities/EntityFXColoredDropParticle.java b/src/main/java/forestry/core/entities/EntityFXColoredDropParticle.java index b6264773d..80065776e 100644 --- a/src/main/java/forestry/core/entities/EntityFXColoredDropParticle.java +++ b/src/main/java/forestry/core/entities/EntityFXColoredDropParticle.java @@ -76,7 +76,7 @@ public class EntityFXColoredDropParticle extends EntityFX { IBlockState state = this.worldObj.getBlockState(new BlockPos(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ))); Material material = state.getBlock().getMaterial(); - + if (material.isLiquid() || material.isSolid()) { double d0 = MathHelper.floor_double(this.posY) + 1 - BlockLiquid.getLiquidHeightPercent(state.getBlock().getMetaFromState(state)); diff --git a/src/main/java/forestry/core/entities/EntityFXIgnition.java b/src/main/java/forestry/core/entities/EntityFXIgnition.java index 57d2d1107..789063b83 100644 --- a/src/main/java/forestry/core/entities/EntityFXIgnition.java +++ b/src/main/java/forestry/core/entities/EntityFXIgnition.java @@ -15,8 +15,9 @@ import net.minecraft.client.renderer.WorldRenderer; import net.minecraft.entity.Entity; import net.minecraft.util.EnumParticleTypes; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.SideOnly; + import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; @SideOnly(Side.CLIENT) public class EntityFXIgnition extends EntityFX { diff --git a/src/main/java/forestry/core/entities/EntityFXSnow.java b/src/main/java/forestry/core/entities/EntityFXSnow.java index 60a20e60c..6a4705dd8 100644 --- a/src/main/java/forestry/core/entities/EntityFXSnow.java +++ b/src/main/java/forestry/core/entities/EntityFXSnow.java @@ -63,9 +63,9 @@ public class EntityFXSnow extends EntityFX { } private void renderParticle(WorldRenderer worldRenderer, 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, float timeStep) { - int i = this.getBrightnessForRender(timeStep); - int j = i >> 16 & 65535; - int k = i & 65535; + int i = this.getBrightnessForRender(timeStep); + int j = i >> 16 & 65535; + int k = i & 65535; worldRenderer.pos((x - rotationX * scale - rotationYZ * scale), (y - rotationXZ * scale), (z - rotationZ * scale - rotationXY * scale)).tex(maxU, maxV).color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha).lightmap(j, k).endVertex(); worldRenderer.pos((x - rotationX * scale + rotationYZ * scale), (y + rotationXZ * scale), (z - rotationZ * scale + rotationXY * scale)).tex(maxU, minV).color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha).lightmap(j, k).endVertex(); worldRenderer.pos((x + rotationX * scale + rotationYZ * scale), (y + rotationXZ * scale), (z + rotationZ * scale + rotationXY * scale)).tex(minU, minV).color(this.particleRed, this.particleGreen, this.particleBlue, this.particleAlpha).lightmap(j, k).endVertex(); diff --git a/src/main/java/forestry/core/entities/EntitySelector.java b/src/main/java/forestry/core/entities/EntitySelector.java index 1e085ffdd..4eab6e1dd 100644 --- a/src/main/java/forestry/core/entities/EntitySelector.java +++ b/src/main/java/forestry/core/entities/EntitySelector.java @@ -27,8 +27,9 @@ public abstract class EntitySelector implements Predicate { @Override public boolean apply(Entity entity) { - if(entity == null) + if (entity == null) { return false; + } T castEntity = entityClass.cast(entity); return isEntityApplicableTyped(castEntity); } diff --git a/src/main/java/forestry/core/errors/EnumErrorCode.java b/src/main/java/forestry/core/errors/EnumErrorCode.java index 12bbf8197..8150a4f57 100644 --- a/src/main/java/forestry/core/errors/EnumErrorCode.java +++ b/src/main/java/forestry/core/errors/EnumErrorCode.java @@ -5,13 +5,15 @@ ******************************************************************************/ package forestry.core.errors; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; + +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.core.ForestryAPI; import forestry.api.core.IErrorState; import forestry.core.config.Constants; import forestry.core.render.TextureManager; -import net.minecraft.client.renderer.texture.TextureAtlasSprite; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; public enum EnumErrorCode implements IErrorState { diff --git a/src/main/java/forestry/core/errors/ErrorStateRegistry.java b/src/main/java/forestry/core/errors/ErrorStateRegistry.java index 4567a628e..aaaae4a13 100644 --- a/src/main/java/forestry/core/errors/ErrorStateRegistry.java +++ b/src/main/java/forestry/core/errors/ErrorStateRegistry.java @@ -18,11 +18,12 @@ import java.util.HashMap; import java.util.Map; import java.util.Set; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.core.IErrorLogic; import forestry.api.core.IErrorState; import forestry.api.core.IErrorStateRegistry; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; /** * diff --git a/src/main/java/forestry/core/fluids/BlockForestryFluid.java b/src/main/java/forestry/core/fluids/BlockForestryFluid.java index 016f16df4..bd871efb9 100644 --- a/src/main/java/forestry/core/fluids/BlockForestryFluid.java +++ b/src/main/java/forestry/core/fluids/BlockForestryFluid.java @@ -31,6 +31,7 @@ import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fml.client.FMLClientHandler; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.core.IItemModelRegister; import forestry.api.core.IModelManager; import forestry.core.entities.EntityFXColoredDropParticle; diff --git a/src/main/java/forestry/core/fluids/FakeTankManager.java b/src/main/java/forestry/core/fluids/FakeTankManager.java index bbd1ebee5..328b7744e 100644 --- a/src/main/java/forestry/core/fluids/FakeTankManager.java +++ b/src/main/java/forestry/core/fluids/FakeTankManager.java @@ -15,6 +15,7 @@ import java.util.List; import net.minecraft.inventory.Container; import net.minecraft.inventory.ICrafting; import net.minecraft.util.EnumFacing; + import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; diff --git a/src/main/java/forestry/core/fluids/FluidHelper.java b/src/main/java/forestry/core/fluids/FluidHelper.java index 00688712a..263646596 100644 --- a/src/main/java/forestry/core/fluids/FluidHelper.java +++ b/src/main/java/forestry/core/fluids/FluidHelper.java @@ -18,6 +18,7 @@ import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; + import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidContainerRegistry; import net.minecraftforge.fluids.FluidRegistry; diff --git a/src/main/java/forestry/core/fluids/Fluids.java b/src/main/java/forestry/core/fluids/Fluids.java index 736bc502f..414612060 100644 --- a/src/main/java/forestry/core/fluids/Fluids.java +++ b/src/main/java/forestry/core/fluids/Fluids.java @@ -26,11 +26,13 @@ import net.minecraft.client.resources.IResourceManager; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; + import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.core.config.Constants; import forestry.core.items.EnumContainerType; import forestry.core.items.ItemLiquidContainer; diff --git a/src/main/java/forestry/core/fluids/TankManager.java b/src/main/java/forestry/core/fluids/TankManager.java index a5fb8d00f..df2edfa68 100644 --- a/src/main/java/forestry/core/fluids/TankManager.java +++ b/src/main/java/forestry/core/fluids/TankManager.java @@ -27,6 +27,7 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.EnumFacing; + import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; @@ -176,8 +177,9 @@ public class TankManager implements ITankManager, ITankUpdateHandler, IStreamabl FluidStack fluid = tank.getFluid(); IForestryPacketClient packet = new PacketTankLevelUpdate(tile, tankIndex, fluid); for (ICrafting crafter : crafters) { - if(crafter instanceof EntityPlayerMP) + if (crafter instanceof EntityPlayerMP) { Proxies.net.sendToPlayer(packet, (EntityPlayerMP) crafter); + } } if (fluid == null) { diff --git a/src/main/java/forestry/core/genetics/ItemGE.java b/src/main/java/forestry/core/genetics/ItemGE.java index da77c293b..c855c8d9f 100755 --- a/src/main/java/forestry/core/genetics/ItemGE.java +++ b/src/main/java/forestry/core/genetics/ItemGE.java @@ -17,8 +17,10 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.core.IModelManager; import forestry.api.genetics.IAlleleSpecies; import forestry.api.genetics.IIndividual; diff --git a/src/main/java/forestry/core/genetics/alleles/AlleleSpecies.java b/src/main/java/forestry/core/genetics/alleles/AlleleSpecies.java index 33812a294..516a0ed8e 100644 --- a/src/main/java/forestry/core/genetics/alleles/AlleleSpecies.java +++ b/src/main/java/forestry/core/genetics/alleles/AlleleSpecies.java @@ -17,11 +17,12 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; import com.mojang.authlib.GameProfile; +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.core.EnumHumidity; import forestry.api.core.EnumTemperature; import forestry.api.core.IModelProvider; diff --git a/src/main/java/forestry/core/gui/GuiHandler.java b/src/main/java/forestry/core/gui/GuiHandler.java index 2bd31ed83..b75956bee 100644 --- a/src/main/java/forestry/core/gui/GuiHandler.java +++ b/src/main/java/forestry/core/gui/GuiHandler.java @@ -17,7 +17,9 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.world.World; + import net.minecraftforge.fml.common.network.IGuiHandler; + import forestry.api.core.ForestryAPI; public class GuiHandler implements IGuiHandler { diff --git a/src/main/java/forestry/core/gui/buttons/GuiBetterButton.java b/src/main/java/forestry/core/gui/buttons/GuiBetterButton.java index a9b50405f..1471fb211 100755 --- a/src/main/java/forestry/core/gui/buttons/GuiBetterButton.java +++ b/src/main/java/forestry/core/gui/buttons/GuiBetterButton.java @@ -14,8 +14,9 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiButton; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.fml.relauncher.SideOnly; + import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; import org.lwjgl.opengl.GL11; diff --git a/src/main/java/forestry/core/gui/ledgers/OwnerLedger.java b/src/main/java/forestry/core/gui/ledgers/OwnerLedger.java index 94e949122..c758daa11 100644 --- a/src/main/java/forestry/core/gui/ledgers/OwnerLedger.java +++ b/src/main/java/forestry/core/gui/ledgers/OwnerLedger.java @@ -15,6 +15,7 @@ import java.util.Locale; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.entity.player.EntityPlayer; + import com.mojang.authlib.GameProfile; import forestry.core.access.EnumAccess; diff --git a/src/main/java/forestry/core/gui/slots/SlotCrafter.java b/src/main/java/forestry/core/gui/slots/SlotCrafter.java index a4457ada5..6f66ae489 100755 --- a/src/main/java/forestry/core/gui/slots/SlotCrafter.java +++ b/src/main/java/forestry/core/gui/slots/SlotCrafter.java @@ -21,19 +21,21 @@ import net.minecraft.item.ItemPickaxe; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemSword; import net.minecraft.stats.AchievementList; + import net.minecraftforge.fml.common.FMLCommonHandler; + import forestry.factory.tiles.ICrafterWorktable; public class SlotCrafter extends Slot { - /** The craft matrix inventory linked to this result slot. */ + /** The craft matrix inventory linked to this result slot. */ private final IInventory craftMatrix; private final ICrafterWorktable crafter; - /** The player that is using the GUI where this slot resides. */ - private final EntityPlayer thePlayer; - /** The number of items that have been crafted so far. Gets passed to ItemStack.onCrafting before being reset. */ - private int amountCrafted; + /** The player that is using the GUI where this slot resides. */ + private final EntityPlayer thePlayer; + /** The number of items that have been crafted so far. Gets passed to ItemStack.onCrafting before being reset. */ + private int amountCrafted; public SlotCrafter(EntityPlayer player, IInventory craftMatrix, ICrafterWorktable crafter, int slot, int xPos, int yPos) { super(craftMatrix, slot, xPos, yPos); @@ -42,94 +44,79 @@ public class SlotCrafter extends Slot { this.thePlayer = player; } - /** - * Check if the stack is a valid item for this slot. Always true beside for the armor slots. - */ - @Override - public boolean isItemValid(ItemStack stack) - { - return false; - } + /** + * Check if the stack is a valid item for this slot. Always true beside for the armor slots. + */ + @Override + public boolean isItemValid(ItemStack stack) { + return false; + } - /** - * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an - * internal count then calls onCrafting(item). - */ - @Override - protected void onCrafting(ItemStack stack, int amount) - { - this.amountCrafted += amount; - this.onCrafting(stack); - } + /** + * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. Typically increases an + * internal count then calls onCrafting(item). + */ + @Override + protected void onCrafting(ItemStack stack, int amount) { + this.amountCrafted += amount; + this.onCrafting(stack); + } - /** - * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. - */ - @Override - protected void onCrafting(ItemStack stack) - { - if (this.amountCrafted > 0) - { - stack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted); - } + /** + * the itemStack passed in is the output - ie, iron ingots, and pickaxes, not ore and wood. + */ + @Override + protected void onCrafting(ItemStack stack) { + if (this.amountCrafted > 0) { + stack.onCrafting(this.thePlayer.worldObj, this.thePlayer, this.amountCrafted); + } - this.amountCrafted = 0; + this.amountCrafted = 0; - if (stack.getItem() == Item.getItemFromBlock(Blocks.crafting_table)) - { - this.thePlayer.triggerAchievement(AchievementList.buildWorkBench); - } + if (stack.getItem() == Item.getItemFromBlock(Blocks.crafting_table)) { + this.thePlayer.triggerAchievement(AchievementList.buildWorkBench); + } - if (stack.getItem() instanceof ItemPickaxe) - { - this.thePlayer.triggerAchievement(AchievementList.buildPickaxe); - } + if (stack.getItem() instanceof ItemPickaxe) { + this.thePlayer.triggerAchievement(AchievementList.buildPickaxe); + } - if (stack.getItem() == Item.getItemFromBlock(Blocks.furnace)) - { - this.thePlayer.triggerAchievement(AchievementList.buildFurnace); - } + if (stack.getItem() == Item.getItemFromBlock(Blocks.furnace)) { + this.thePlayer.triggerAchievement(AchievementList.buildFurnace); + } - if (stack.getItem() instanceof ItemHoe) - { - this.thePlayer.triggerAchievement(AchievementList.buildHoe); - } + if (stack.getItem() instanceof ItemHoe) { + this.thePlayer.triggerAchievement(AchievementList.buildHoe); + } - if (stack.getItem() == Items.bread) - { - this.thePlayer.triggerAchievement(AchievementList.makeBread); - } + if (stack.getItem() == Items.bread) { + this.thePlayer.triggerAchievement(AchievementList.makeBread); + } - if (stack.getItem() == Items.cake) - { - this.thePlayer.triggerAchievement(AchievementList.bakeCake); - } + if (stack.getItem() == Items.cake) { + this.thePlayer.triggerAchievement(AchievementList.bakeCake); + } - if (stack.getItem() instanceof ItemPickaxe && ((ItemPickaxe)stack.getItem()).getToolMaterial() != Item.ToolMaterial.WOOD) - { - this.thePlayer.triggerAchievement(AchievementList.buildBetterPickaxe); - } + if (stack.getItem() instanceof ItemPickaxe && ((ItemPickaxe) stack.getItem()).getToolMaterial() != Item.ToolMaterial.WOOD) { + this.thePlayer.triggerAchievement(AchievementList.buildBetterPickaxe); + } - if (stack.getItem() instanceof ItemSword) - { - this.thePlayer.triggerAchievement(AchievementList.buildSword); - } + if (stack.getItem() instanceof ItemSword) { + this.thePlayer.triggerAchievement(AchievementList.buildSword); + } - if (stack.getItem() == Item.getItemFromBlock(Blocks.enchanting_table)) - { - this.thePlayer.triggerAchievement(AchievementList.enchantments); - } + if (stack.getItem() == Item.getItemFromBlock(Blocks.enchanting_table)) { + this.thePlayer.triggerAchievement(AchievementList.enchantments); + } - if (stack.getItem() == Item.getItemFromBlock(Blocks.bookshelf)) - { - this.thePlayer.triggerAchievement(AchievementList.bookcase); - } + if (stack.getItem() == Item.getItemFromBlock(Blocks.bookshelf)) { + this.thePlayer.triggerAchievement(AchievementList.bookcase); + } - if (stack.getItem() == Items.golden_apple && stack.getMetadata() == 1) - { - this.thePlayer.triggerAchievement(AchievementList.overpowered); - } - } + if (stack.getItem() == Items.golden_apple && stack.getMetadata() == 1) { + this.thePlayer.triggerAchievement(AchievementList.overpowered); + } + } @Override public ItemStack decrStackSize(int amount) { diff --git a/src/main/java/forestry/core/gui/slots/SlotFiltered.java b/src/main/java/forestry/core/gui/slots/SlotFiltered.java index d229faba0..83f171b44 100644 --- a/src/main/java/forestry/core/gui/slots/SlotFiltered.java +++ b/src/main/java/forestry/core/gui/slots/SlotFiltered.java @@ -13,8 +13,10 @@ package forestry.core.gui.slots; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.core.render.TextureManager; import forestry.core.tiles.IFilterSlotDelegate; diff --git a/src/main/java/forestry/core/gui/slots/SlotOutput.java b/src/main/java/forestry/core/gui/slots/SlotOutput.java index ca6d59e56..917d948c5 100755 --- a/src/main/java/forestry/core/gui/slots/SlotOutput.java +++ b/src/main/java/forestry/core/gui/slots/SlotOutput.java @@ -13,6 +13,7 @@ package forestry.core.gui.slots; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; diff --git a/src/main/java/forestry/core/gui/widgets/GameTokenWidget.java b/src/main/java/forestry/core/gui/widgets/GameTokenWidget.java index 551598184..8f1cf6c15 100644 --- a/src/main/java/forestry/core/gui/widgets/GameTokenWidget.java +++ b/src/main/java/forestry/core/gui/widgets/GameTokenWidget.java @@ -16,6 +16,7 @@ import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; + import org.lwjgl.opengl.GL11; import forestry.core.gui.GuiUtil; diff --git a/src/main/java/forestry/core/gui/widgets/TankWidget.java b/src/main/java/forestry/core/gui/widgets/TankWidget.java index 85d97240f..cb046907b 100755 --- a/src/main/java/forestry/core/gui/widgets/TankWidget.java +++ b/src/main/java/forestry/core/gui/widgets/TankWidget.java @@ -14,6 +14,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; + import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidTank; diff --git a/src/main/java/forestry/core/inventory/AdjacentInventoryCache.java b/src/main/java/forestry/core/inventory/AdjacentInventoryCache.java index 092ad8a5a..42d3d9252 100644 --- a/src/main/java/forestry/core/inventory/AdjacentInventoryCache.java +++ b/src/main/java/forestry/core/inventory/AdjacentInventoryCache.java @@ -20,6 +20,7 @@ import java.util.List; import net.minecraft.inventory.IInventory; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; + import forestry.core.tiles.AdjacentTileCache; import forestry.core.tiles.TileUtil; diff --git a/src/main/java/forestry/core/inventory/FakeInventoryAdapter.java b/src/main/java/forestry/core/inventory/FakeInventoryAdapter.java index f19af3304..2c42cda93 100644 --- a/src/main/java/forestry/core/inventory/FakeInventoryAdapter.java +++ b/src/main/java/forestry/core/inventory/FakeInventoryAdapter.java @@ -15,6 +15,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraft.util.IChatComponent; + import forestry.core.config.Constants; public class FakeInventoryAdapter implements IInventoryAdapter { diff --git a/src/main/java/forestry/core/inventory/InventoryAdapter.java b/src/main/java/forestry/core/inventory/InventoryAdapter.java index b0b3ff7da..71e5fb01f 100755 --- a/src/main/java/forestry/core/inventory/InventoryAdapter.java +++ b/src/main/java/forestry/core/inventory/InventoryAdapter.java @@ -18,6 +18,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; import net.minecraft.util.IChatComponent; + import forestry.core.config.Constants; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; diff --git a/src/main/java/forestry/core/inventory/InventoryAdapterRestricted.java b/src/main/java/forestry/core/inventory/InventoryAdapterRestricted.java index 32cb06f19..e94cd5bda 100644 --- a/src/main/java/forestry/core/inventory/InventoryAdapterRestricted.java +++ b/src/main/java/forestry/core/inventory/InventoryAdapterRestricted.java @@ -13,6 +13,7 @@ package forestry.core.inventory; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; + import forestry.core.access.IAccessHandler; import forestry.core.config.Constants; diff --git a/src/main/java/forestry/core/inventory/InventoryAdapterTile.java b/src/main/java/forestry/core/inventory/InventoryAdapterTile.java index 999dc336e..c7ffcfcc7 100644 --- a/src/main/java/forestry/core/inventory/InventoryAdapterTile.java +++ b/src/main/java/forestry/core/inventory/InventoryAdapterTile.java @@ -13,6 +13,7 @@ package forestry.core.inventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; + import forestry.core.access.IRestrictedAccess; public class InventoryAdapterTile extends InventoryAdapterRestricted { diff --git a/src/main/java/forestry/core/inventory/InventoryEscritoire.java b/src/main/java/forestry/core/inventory/InventoryEscritoire.java index ee90d5b68..3d100542a 100644 --- a/src/main/java/forestry/core/inventory/InventoryEscritoire.java +++ b/src/main/java/forestry/core/inventory/InventoryEscritoire.java @@ -12,6 +12,7 @@ package forestry.core.inventory; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; + import forestry.api.genetics.AlleleManager; import forestry.api.genetics.IIndividual; import forestry.core.tiles.TileEscritoire; diff --git a/src/main/java/forestry/core/inventory/InventoryNaturalistChest.java b/src/main/java/forestry/core/inventory/InventoryNaturalistChest.java index 3c2002641..8fb5b515f 100644 --- a/src/main/java/forestry/core/inventory/InventoryNaturalistChest.java +++ b/src/main/java/forestry/core/inventory/InventoryNaturalistChest.java @@ -12,6 +12,7 @@ package forestry.core.inventory; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; + import forestry.api.genetics.ISpeciesRoot; import forestry.core.tiles.TileNaturalistChest; diff --git a/src/main/java/forestry/core/inventory/InventoryPlain.java b/src/main/java/forestry/core/inventory/InventoryPlain.java index bc446ba98..9272a1b04 100644 --- a/src/main/java/forestry/core/inventory/InventoryPlain.java +++ b/src/main/java/forestry/core/inventory/InventoryPlain.java @@ -16,6 +16,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ChatComponentText; import net.minecraft.util.IChatComponent; + import forestry.api.core.INBTTagable; import forestry.core.utils.InventoryUtil; diff --git a/src/main/java/forestry/core/inventory/ItemInventory.java b/src/main/java/forestry/core/inventory/ItemInventory.java index c60c8a295..09b581d3e 100755 --- a/src/main/java/forestry/core/inventory/ItemInventory.java +++ b/src/main/java/forestry/core/inventory/ItemInventory.java @@ -19,6 +19,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.ChatComponentText; import net.minecraft.util.IChatComponent; + import forestry.core.tiles.IFilterSlotDelegate; public abstract class ItemInventory implements IInventory, IFilterSlotDelegate { diff --git a/src/main/java/forestry/core/inventory/wrappers/ChestWrapper.java b/src/main/java/forestry/core/inventory/wrappers/ChestWrapper.java index aa087b531..daa49cfdf 100755 --- a/src/main/java/forestry/core/inventory/wrappers/ChestWrapper.java +++ b/src/main/java/forestry/core/inventory/wrappers/ChestWrapper.java @@ -207,7 +207,7 @@ public class ChestWrapper implements IInventory { } @Override - public void setField(int id, int value) { + public void setField(int id, int value) { } @Override @@ -216,7 +216,7 @@ public class ChestWrapper implements IInventory { } @Override - public void clear() { + public void clear() { } } diff --git a/src/main/java/forestry/core/inventory/wrappers/InventoryCopy.java b/src/main/java/forestry/core/inventory/wrappers/InventoryCopy.java index 17ac6f583..7d40e2be1 100755 --- a/src/main/java/forestry/core/inventory/wrappers/InventoryCopy.java +++ b/src/main/java/forestry/core/inventory/wrappers/InventoryCopy.java @@ -14,6 +14,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.util.IChatComponent; + import forestry.core.utils.InventoryUtil; /** diff --git a/src/main/java/forestry/core/items/ItemArmorNaturalist.java b/src/main/java/forestry/core/items/ItemArmorNaturalist.java index bbce516c9..74ddd08d0 100755 --- a/src/main/java/forestry/core/items/ItemArmorNaturalist.java +++ b/src/main/java/forestry/core/items/ItemArmorNaturalist.java @@ -15,11 +15,13 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.core.IArmorNaturalist; -import forestry.api.core.IModelManager; import forestry.api.core.IItemModelRegister; +import forestry.api.core.IModelManager; import forestry.core.CreativeTabForestry; import forestry.core.config.Constants; diff --git a/src/main/java/forestry/core/items/ItemCraftingMaterial.java b/src/main/java/forestry/core/items/ItemCraftingMaterial.java index 58527d88d..5d93c796e 100644 --- a/src/main/java/forestry/core/items/ItemCraftingMaterial.java +++ b/src/main/java/forestry/core/items/ItemCraftingMaterial.java @@ -15,8 +15,10 @@ import java.util.List; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.core.IModelManager; public class ItemCraftingMaterial extends ItemForestry { diff --git a/src/main/java/forestry/core/items/ItemCrated.java b/src/main/java/forestry/core/items/ItemCrated.java index 0e8edade5..37cf3dd9e 100755 --- a/src/main/java/forestry/core/items/ItemCrated.java +++ b/src/main/java/forestry/core/items/ItemCrated.java @@ -17,9 +17,11 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.StatCollector; import net.minecraft.world.World; + import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.core.IModelManager; import forestry.core.proxy.Proxies; import forestry.core.utils.ItemStackUtil; @@ -72,11 +74,11 @@ public class ItemCrated extends ItemForestry { @SideOnly(Side.CLIENT) @Override public void registerModel(Item item, IModelManager manager) { - if(contained == null){ + if (contained == null) { manager.registerItemModel(item, 0, false); manager.registerItemModel(item, 1, "crate-filled"); - }else{ - ModelResourceLocation modelLocation = new ModelResourceLocation("forestry:crate-filled", StringUtil.cleanItemName(item)); + } else { + ModelResourceLocation modelLocation = new ModelResourceLocation("forestry:crate-filled", StringUtil.cleanItemName(item)); ModelLoader.setCustomModelResourceLocation(item, 0, modelLocation); ModelBakery.registerItemVariants(item, modelLocation); } @@ -84,8 +86,9 @@ public class ItemCrated extends ItemForestry { @Override public int getColorFromItemStack(ItemStack stack, int renderPass) { - if(getContained() == null || renderPass == 100) + if (getContained() == null || renderPass == 100) { return super.getColorFromItemStack(stack, renderPass); + } return getContained().getItem().getColorFromItemStack(getContained(), renderPass); } diff --git a/src/main/java/forestry/core/items/ItemForestry.java b/src/main/java/forestry/core/items/ItemForestry.java index 3bacc3828..4b91a6c41 100755 --- a/src/main/java/forestry/core/items/ItemForestry.java +++ b/src/main/java/forestry/core/items/ItemForestry.java @@ -13,11 +13,13 @@ package forestry.core.items; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.oredict.OreDictionary; -import forestry.api.core.IModelManager; + import forestry.api.core.IItemModelRegister; +import forestry.api.core.IModelManager; import forestry.core.CreativeTabForestry; public class ItemForestry extends Item implements IItemModelRegister { diff --git a/src/main/java/forestry/core/items/ItemForestryFood.java b/src/main/java/forestry/core/items/ItemForestryFood.java index 221bba92d..414e7c10a 100755 --- a/src/main/java/forestry/core/items/ItemForestryFood.java +++ b/src/main/java/forestry/core/items/ItemForestryFood.java @@ -14,13 +14,15 @@ import net.minecraft.item.EnumAction; import net.minecraft.item.Item; import net.minecraft.item.ItemFood; import net.minecraft.item.ItemStack; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import forestry.api.core.IModelManager; + import forestry.api.core.IItemModelRegister; +import forestry.api.core.IModelManager; import forestry.core.CreativeTabForestry; -public class ItemForestryFood extends ItemFood implements IItemModelRegister{ +public class ItemForestryFood extends ItemFood implements IItemModelRegister { private boolean isDrink = false; diff --git a/src/main/java/forestry/core/items/ItemForestryTool.java b/src/main/java/forestry/core/items/ItemForestryTool.java index 63fff8e5a..ddd7809cf 100755 --- a/src/main/java/forestry/core/items/ItemForestryTool.java +++ b/src/main/java/forestry/core/items/ItemForestryTool.java @@ -21,6 +21,7 @@ import net.minecraft.world.World; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + import forestry.core.utils.ItemStackUtil; public class ItemForestryTool extends ItemForestry { @@ -44,8 +45,9 @@ public class ItemForestryTool extends ItemForestry { @Override public float getDigSpeed(ItemStack itemstack, IBlockState state) { for (String type : getToolClasses(itemstack)) { - if (state.getBlock().isToolEffective(type, state)) + if (state.getBlock().isToolEffective(type, state)) { return efficiencyOnProperMaterial; + } } return super.getDigSpeed(itemstack, state); } diff --git a/src/main/java/forestry/core/items/ItemFruit.java b/src/main/java/forestry/core/items/ItemFruit.java index 06009159b..57c9096da 100755 --- a/src/main/java/forestry/core/items/ItemFruit.java +++ b/src/main/java/forestry/core/items/ItemFruit.java @@ -16,8 +16,10 @@ import java.util.Locale; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.core.IModelManager; import forestry.plugins.PluginCore; diff --git a/src/main/java/forestry/core/items/ItemLiquidContainer.java b/src/main/java/forestry/core/items/ItemLiquidContainer.java index c17e80529..4f22d8a71 100755 --- a/src/main/java/forestry/core/items/ItemLiquidContainer.java +++ b/src/main/java/forestry/core/items/ItemLiquidContainer.java @@ -30,11 +30,13 @@ import net.minecraft.util.MovingObjectPosition; import net.minecraft.util.MovingObjectPosition.MovingObjectType; import net.minecraft.world.World; import net.minecraft.world.WorldProviderHell; + import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.IFluidBlock; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.core.IModelManager; import forestry.core.CreativeTabForestry; import forestry.core.fluids.BlockForestryFluid; diff --git a/src/main/java/forestry/core/items/ItemOverlay.java b/src/main/java/forestry/core/items/ItemOverlay.java index c4f4ce9f5..399266d92 100755 --- a/src/main/java/forestry/core/items/ItemOverlay.java +++ b/src/main/java/forestry/core/items/ItemOverlay.java @@ -15,8 +15,10 @@ import java.util.List; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.core.IModelManager; import forestry.core.config.Config; diff --git a/src/main/java/forestry/core/items/ItemRegistry.java b/src/main/java/forestry/core/items/ItemRegistry.java index 3169e1dbf..78138d05e 100644 --- a/src/main/java/forestry/core/items/ItemRegistry.java +++ b/src/main/java/forestry/core/items/ItemRegistry.java @@ -11,7 +11,9 @@ package forestry.core.items; import net.minecraft.item.Item; + import net.minecraftforge.fml.common.registry.GameRegistry; + import forestry.core.utils.StringUtil; import forestry.plugins.PluginManager; diff --git a/src/main/java/forestry/core/items/ItemWrench.java b/src/main/java/forestry/core/items/ItemWrench.java index 2d9e7a6b4..1a6141cf6 100755 --- a/src/main/java/forestry/core/items/ItemWrench.java +++ b/src/main/java/forestry/core/items/ItemWrench.java @@ -46,7 +46,8 @@ public class ItemWrench extends ItemForestry implements IToolWrench { } @Override - public void wrenchUsed(EntityPlayer player, BlockPos pos) {} + public void wrenchUsed(EntityPlayer player, BlockPos pos) { + } @Override public boolean canWrench(EntityPlayer entityPlayer, Entity entity) { @@ -54,5 +55,6 @@ public class ItemWrench extends ItemForestry implements IToolWrench { } @Override - public void wrenchUsed(EntityPlayer entityPlayer, Entity entity) {} + public void wrenchUsed(EntityPlayer entityPlayer, Entity entity) { + } } diff --git a/src/main/java/forestry/core/models/ModelBlockOverlay.java b/src/main/java/forestry/core/models/ModelBlockOverlay.java index 980b7fa57..a044a06e6 100644 --- a/src/main/java/forestry/core/models/ModelBlockOverlay.java +++ b/src/main/java/forestry/core/models/ModelBlockOverlay.java @@ -167,9 +167,9 @@ public abstract class ModelBlockOverlay implements ISmartItemMo B bBlock = blockClass.cast(block); baker.setRenderBoundsFromBlock(block); - try{ + try { renderInWorld(bBlock, world, pos, baker); - }catch(Exception e){ + } catch (Exception e) { return null; } @@ -187,9 +187,9 @@ public abstract class ModelBlockOverlay implements ISmartItemMo block.setBlockBoundsForItemRender(); baker.setRenderBoundsFromBlock(block); - try{ + try { renderInventory(bBlock, stack, baker); - }catch(Exception e){ + } catch (Exception e) { return null; } diff --git a/src/main/java/forestry/core/models/ModelCrate.java b/src/main/java/forestry/core/models/ModelCrate.java index 1ccd4ae8f..12bd30b25 100644 --- a/src/main/java/forestry/core/models/ModelCrate.java +++ b/src/main/java/forestry/core/models/ModelCrate.java @@ -70,155 +70,132 @@ public class ModelCrate implements ISmartItemModel { textureGetter = new CrateTextureGetter(); } - /** - * To bake the contained model - */ - private ImmutableMap bakeModels(ItemCrated crated){ - ImmutableMap.Builder pb = ImmutableMap.builder(); + /** + * To bake the contained model + */ + private ImmutableMap bakeModels(ItemCrated crated) { + ImmutableMap.Builder pb = ImmutableMap.builder(); - IFlexibleBakedModel flexModel = getModel(crated.getContained()); - - IdentityHashMap> modelResourceLocations = ObfuscationReflectionHelper.getPrivateValue(ItemModelMesherForge.class, (ItemModelMesherForge)Minecraft.getMinecraft().getRenderItem().getItemModelMesher(), 0); - - ModelResourceLocation modelResource = modelResourceLocations.get(crated.getContained().getItem()).get(crated.getContained().getItemDamage()); - ResourceLocation location = getItemLocation(modelResource); - - if(hasItemModel(location)){ - pb.put(String.valueOf(0), new TRSRBakedModel(flexModel, -0.0625F, 0, 0.0625F, 0.5F)); - pb.put(String.valueOf(1), new TRSRBakedModel(flexModel, -0.0625F, 0, -0.0625F, 0.5F)); - }else{ - pb.put(String.valueOf(0), new TRSRBakedModel(flexModel, -0.0625F, 0, 0, 0.5F)); - } - return pb.build(); - } - - /** - * @return The item model {@link ResourceLocation} from the {@link ModelResourceLocation} - */ - private ResourceLocation getItemLocation(ModelResourceLocation modelResource){ - ResourceLocation resourcelocation = new ResourceLocation(modelResource.toString().replaceAll("#.*", "")); - return new ResourceLocation(resourcelocation.getResourceDomain(), "item/" + resourcelocation.getResourcePath()); - } - - /** - * @return Return true, when the model from the {@link ResourceLocation} a item model is - */ - private boolean hasItemModel(ResourceLocation location){ - try{ - ModelBlock p_177581_1_ = loadModel(location); - if (p_177581_1_ == null){ - return false; - }else{ - ModelBlock modelblock = p_177581_1_.getRootModel(); - return modelblock == MODEL_GENERATED || modelblock == MODEL_COMPASS || modelblock == MODEL_CLOCK; - } - }catch(Exception e){ - return false; - } - } - - protected ModelBlock loadModel(ResourceLocation p_177594_1_) throws IOException - { - String s = p_177594_1_.getResourcePath(); + IFlexibleBakedModel flexModel = getModel(crated.getContained()); - if ("builtin/generated".equals(s)) - { - return MODEL_GENERATED; - } - else if ("builtin/compass".equals(s)) - { - return MODEL_COMPASS; - } - else if ("builtin/clock".equals(s)) - { - return MODEL_CLOCK; - } - else - { - Reader reader; + IdentityHashMap> modelResourceLocations = ObfuscationReflectionHelper.getPrivateValue(ItemModelMesherForge.class, (ItemModelMesherForge) Minecraft.getMinecraft().getRenderItem().getItemModelMesher(), 0); - if (s.startsWith("builtin/")) - { - String s1 = s.substring("builtin/".length()); - if(s1.equals("missing")){ - reader = new StringReader("{ \"textures\": { \"particle\": \"missingno\", \"missingno\": \"missingno\"}, \"elements\": [ { \"from\": [ 0, 0, 0 ], \"to\": [ 16, 16, 16 ], \"faces\": { \"down\": { \"uv\": [ 0, 0, 16, 16 ], \"cullface\": \"down\", \"texture\": \"#missingno\" }, \"up\": { \"uv\": [ 0, 0, 16, 16 ], \"cullface\": \"up\", \"texture\": \"#missingno\" }, \"north\": { \"uv\": [ 0, 0, 16, 16 ], \"cullface\": \"north\", \"texture\": \"#missingno\" }, \"south\": { \"uv\": [ 0, 0, 16, 16 ], \"cullface\": \"south\", \"texture\": \"#missingno\" }, \"west\": { \"uv\": [ 0, 0, 16, 16 ], \"cullface\": \"west\", \"texture\": \"#missingno\" }, \"east\": { \"uv\": [ 0, 0, 16, 16 ], \"cullface\": \"east\", \"texture\": \"#missingno\" } }}]}"); - } - else{ - throw new FileNotFoundException(p_177594_1_.toString()); - } - } - else - { - IResource iresource = Minecraft.getMinecraft().getResourceManager().getResource(this.getModelLocation(p_177594_1_)); - reader = new InputStreamReader(iresource.getInputStream(), Charsets.UTF_8); - } + ModelResourceLocation modelResource = modelResourceLocations.get(crated.getContained().getItem()).get(crated.getContained().getItemDamage()); + ResourceLocation location = getItemLocation(modelResource); - ModelBlock model; + if (hasItemModel(location)) { + pb.put(String.valueOf(0), new TRSRBakedModel(flexModel, -0.0625F, 0, 0.0625F, 0.5F)); + pb.put(String.valueOf(1), new TRSRBakedModel(flexModel, -0.0625F, 0, -0.0625F, 0.5F)); + } else { + pb.put(String.valueOf(0), new TRSRBakedModel(flexModel, -0.0625F, 0, 0, 0.5F)); + } + return pb.build(); + } - try - { - ModelBlock modelblock = ModelBlock.deserialize(reader); - modelblock.name = p_177594_1_.toString(); - model = modelblock; - } - finally - { - reader.close(); - } - - if(model != null && model.getParentLocation() != null){ - if(model.getParentLocation().getResourcePath().equals("builtin/generated")) - { - model.parent = MODEL_GENERATED; - } - else - { - try{ - model.parent = loadModel(model.getParentLocation()); - }catch (IOException e){ - } - } - } + /** + * @return The item model {@link ResourceLocation} from the {@link ModelResourceLocation} + */ + private ResourceLocation getItemLocation(ModelResourceLocation modelResource) { + ResourceLocation resourcelocation = new ResourceLocation(modelResource.toString().replaceAll("#.*", "")); + return new ResourceLocation(resourcelocation.getResourceDomain(), "item/" + resourcelocation.getResourcePath()); + } - return model; - } - } - - protected ResourceLocation getModelLocation(ResourceLocation p_177580_1_) - { - return new ResourceLocation(p_177580_1_.getResourceDomain(), "models/" + p_177580_1_.getResourcePath() + ".json"); - } - - /** - * @return The baked model from the filled crate - */ - private IFlexibleBakedModel getModel(ItemStack stack){ - IBakedModel model = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(stack); - if(model == null) { - return null; - } - else if(model instanceof IFlexibleBakedModel) { - return (IFlexibleBakedModel) model; - } - else { - return new IFlexibleBakedModel.Wrapper(model, DefaultVertexFormats.ITEM); - } - } - - private IFlexibleBakedModel getModelCrate(){ - IFlexibleBakedModel flexModel; - IBakedModel model = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(new ItemStack(PluginStorage.items.crate, 1, 1)); - if(model == null) { - return null; - } - else if(model instanceof IFlexibleBakedModel) { - flexModel = (IFlexibleBakedModel) model; - } - else { - flexModel = new IFlexibleBakedModel.Wrapper(model, DefaultVertexFormats.ITEM); - } - return crateModel.bake(crateModel.getDefaultState(), flexModel.getFormat(), textureGetter); - } + /** + * @return Return true, when the model from the {@link ResourceLocation} a item model is + */ + private boolean hasItemModel(ResourceLocation location) { + try { + ModelBlock p_177581_1_ = loadModel(location); + if (p_177581_1_ == null) { + return false; + } else { + ModelBlock modelblock = p_177581_1_.getRootModel(); + return modelblock == MODEL_GENERATED || modelblock == MODEL_COMPASS || modelblock == MODEL_CLOCK; + } + } catch (Exception e) { + return false; + } + } + + protected ModelBlock loadModel(ResourceLocation p_177594_1_) throws IOException { + String s = p_177594_1_.getResourcePath(); + + if ("builtin/generated".equals(s)) { + return MODEL_GENERATED; + } else if ("builtin/compass".equals(s)) { + return MODEL_COMPASS; + } else if ("builtin/clock".equals(s)) { + return MODEL_CLOCK; + } else { + Reader reader; + + if (s.startsWith("builtin/")) { + String s1 = s.substring("builtin/".length()); + if (s1.equals("missing")) { + reader = new StringReader("{ \"textures\": { \"particle\": \"missingno\", \"missingno\": \"missingno\"}, \"elements\": [ { \"from\": [ 0, 0, 0 ], \"to\": [ 16, 16, 16 ], \"faces\": { \"down\": { \"uv\": [ 0, 0, 16, 16 ], \"cullface\": \"down\", \"texture\": \"#missingno\" }, \"up\": { \"uv\": [ 0, 0, 16, 16 ], \"cullface\": \"up\", \"texture\": \"#missingno\" }, \"north\": { \"uv\": [ 0, 0, 16, 16 ], \"cullface\": \"north\", \"texture\": \"#missingno\" }, \"south\": { \"uv\": [ 0, 0, 16, 16 ], \"cullface\": \"south\", \"texture\": \"#missingno\" }, \"west\": { \"uv\": [ 0, 0, 16, 16 ], \"cullface\": \"west\", \"texture\": \"#missingno\" }, \"east\": { \"uv\": [ 0, 0, 16, 16 ], \"cullface\": \"east\", \"texture\": \"#missingno\" } }}]}"); + } else { + throw new FileNotFoundException(p_177594_1_.toString()); + } + } else { + IResource iresource = Minecraft.getMinecraft().getResourceManager().getResource(this.getModelLocation(p_177594_1_)); + reader = new InputStreamReader(iresource.getInputStream(), Charsets.UTF_8); + } + + ModelBlock model; + + try { + ModelBlock modelblock = ModelBlock.deserialize(reader); + modelblock.name = p_177594_1_.toString(); + model = modelblock; + } finally { + reader.close(); + } + + if (model != null && model.getParentLocation() != null) { + if (model.getParentLocation().getResourcePath().equals("builtin/generated")) { + model.parent = MODEL_GENERATED; + } else { + try { + model.parent = loadModel(model.getParentLocation()); + } catch (IOException e) { + } + } + } + + return model; + } + } + + protected ResourceLocation getModelLocation(ResourceLocation p_177580_1_) { + return new ResourceLocation(p_177580_1_.getResourceDomain(), "models/" + p_177580_1_.getResourcePath() + ".json"); + } + + /** + * @return The baked model from the filled crate + */ + private IFlexibleBakedModel getModel(ItemStack stack) { + IBakedModel model = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(stack); + if (model == null) { + return null; + } else if (model instanceof IFlexibleBakedModel) { + return (IFlexibleBakedModel) model; + } else { + return new IFlexibleBakedModel.Wrapper(model, DefaultVertexFormats.ITEM); + } + } + + private IFlexibleBakedModel getModelCrate() { + IFlexibleBakedModel flexModel; + IBakedModel model = Minecraft.getMinecraft().getRenderItem().getItemModelMesher().getItemModel(new ItemStack(PluginStorage.items.crate, 1, 1)); + if (model == null) { + return null; + } else if (model instanceof IFlexibleBakedModel) { + flexModel = (IFlexibleBakedModel) model; + } else { + flexModel = new IFlexibleBakedModel.Wrapper(model, DefaultVertexFormats.ITEM); + } + return crateModel.bake(crateModel.getDefaultState(), flexModel.getFormat(), textureGetter); + } @Override public List getFaceQuads(EnumFacing facing) { @@ -262,14 +239,14 @@ public class ModelCrate implements ISmartItemModel { public IBakedModel handleItemState(ItemStack stack) { ItemCrated crated = (ItemCrated) stack.getItem(); String crateUID = StringUtil.cleanItemName(crated); - if(crates.get(crateUID) == null){ - IFlexibleBakedModel baseBaked = getModelCrate(); - - //Set the crate color index to 100 - for(BakedQuad quad : baseBaked.getGeneralQuads()){ - ObfuscationReflectionHelper.setPrivateValue(BakedQuad.class, quad, 100, 1); - } - crates.put(crateUID, new MultiModel.Baked(baseBaked, bakeModels(crated))); + if (crates.get(crateUID) == null) { + IFlexibleBakedModel baseBaked = getModelCrate(); + + //Set the crate color index to 100 + for (BakedQuad quad : baseBaked.getGeneralQuads()) { + ObfuscationReflectionHelper.setPrivateValue(BakedQuad.class, quad, 100, 1); + } + crates.put(crateUID, new MultiModel.Baked(baseBaked, bakeModels(crated))); } return crates.get(crateUID); } diff --git a/src/main/java/forestry/core/models/ModelManager.java b/src/main/java/forestry/core/models/ModelManager.java index 3b8beb3c6..b01a5c604 100644 --- a/src/main/java/forestry/core/models/ModelManager.java +++ b/src/main/java/forestry/core/models/ModelManager.java @@ -10,6 +10,9 @@ ******************************************************************************/ package forestry.core.models; +import javax.annotation.Nonnull; +import java.util.ArrayList; + import net.minecraft.block.Block; import net.minecraft.client.renderer.ItemMeshDefinition; import net.minecraft.client.resources.model.ModelBakery; @@ -18,15 +21,13 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IRegistry; import net.minecraft.util.ResourceLocation; + import net.minecraftforge.client.event.ModelBakeEvent; import net.minecraftforge.client.model.ModelLoader; import net.minecraftforge.fml.common.registry.GameData; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import java.util.ArrayList; -import javax.annotation.Nonnull; - import forestry.api.core.ForestryAPI; import forestry.api.core.IItemModelRegister; import forestry.api.core.IModelManager; @@ -62,9 +63,9 @@ public class ModelManager implements IModelManager { @Override public void registerItemModel(Item item, int meta, boolean withMeta) { - if(withMeta){ + if (withMeta) { ModelLoader.setCustomModelResourceLocation(item, meta, getModelLocation(item, meta)); - }else{ + } else { ModelLoader.setCustomModelResourceLocation(item, meta, getModelLocation(item)); } } @@ -132,11 +133,11 @@ public class ModelManager implements IModelManager { } } - public static void registerCustomBlockModel(@Nonnull BlockModelIndex index){ + public static void registerCustomBlockModel(@Nonnull BlockModelIndex index) { customBlockModels.add(index); } - public static void registerCustomModel(@Nonnull ModelIndex index){ + public static void registerCustomModel(@Nonnull ModelIndex index) { customModels.add(index); } diff --git a/src/main/java/forestry/core/models/TRSRBakedModel.java b/src/main/java/forestry/core/models/TRSRBakedModel.java index 47fefbf96..1d1add8ec 100644 --- a/src/main/java/forestry/core/models/TRSRBakedModel.java +++ b/src/main/java/forestry/core/models/TRSRBakedModel.java @@ -1,13 +1,13 @@ /******************************************************************************* * The MIT License (MIT) * Copyright (c) 2013-2014 Slime Knights (mDiyo, fuj1n, Sunstrike, progwml6, pillbox, alexbegt) - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * * Any alternate licenses are noted where appropriate. ******************************************************************************/ package forestry.core.models; @@ -16,163 +16,162 @@ import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableMap; import com.google.common.collect.Maps; +import javax.vecmath.Matrix3f; +import javax.vecmath.Matrix4f; +import javax.vecmath.Vector3f; +import javax.vecmath.Vector4f; +import java.util.EnumMap; +import java.util.List; + import net.minecraft.client.renderer.block.model.BakedQuad; import net.minecraft.client.renderer.block.model.ItemCameraTransforms; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.vertex.VertexFormat; import net.minecraft.client.renderer.vertex.VertexFormatElement; import net.minecraft.util.EnumFacing; + import net.minecraftforge.client.model.IFlexibleBakedModel; import net.minecraftforge.client.model.TRSRTransformation; import net.minecraftforge.client.model.pipeline.UnpackedBakedQuad; import net.minecraftforge.client.model.pipeline.VertexTransformer; -import java.util.EnumMap; -import java.util.List; - -import javax.vecmath.Matrix3f; -import javax.vecmath.Matrix4f; -import javax.vecmath.Vector3f; -import javax.vecmath.Vector4f; - // for those wondering TRSR stands for Translation Rotation Scale Rotation public class TRSRBakedModel implements IFlexibleBakedModel { - protected final ImmutableList general; - protected final ImmutableMap> faces; - protected final IFlexibleBakedModel original; + protected final ImmutableList general; + protected final ImmutableMap> faces; + protected final IFlexibleBakedModel original; - public TRSRBakedModel(IFlexibleBakedModel original, float x, float y, float z, float scale) { - this(original, x, y, z, 0, 0, 0, scale, scale, scale); - } + public TRSRBakedModel(IFlexibleBakedModel original, float x, float y, float z, float scale) { + this(original, x, y, z, 0, 0, 0, scale, scale, scale); + } - public TRSRBakedModel(IFlexibleBakedModel original, float x, float y, float z, float rotX, float rotY, float rotZ, float scale) { - this(original, x, y, z, rotX, rotY, rotZ, scale, scale, scale); - } + public TRSRBakedModel(IFlexibleBakedModel original, float x, float y, float z, float rotX, float rotY, float rotZ, float scale) { + this(original, x, y, z, rotX, rotY, rotZ, scale, scale, scale); + } - public TRSRBakedModel(IFlexibleBakedModel original, float x, float y, float z, float rotX, float rotY, float rotZ, float scaleX, float scaleY, float scaleZ) { - this(original, new TRSRTransformation(new Vector3f(x, y, z), - null, - new Vector3f(scaleX, scaleY, scaleZ), - TRSRTransformation.quatFromYXZ(rotY, rotX, rotZ))); - } + public TRSRBakedModel(IFlexibleBakedModel original, float x, float y, float z, float rotX, float rotY, float rotZ, float scaleX, float scaleY, float scaleZ) { + this(original, new TRSRTransformation(new Vector3f(x, y, z), + null, + new Vector3f(scaleX, scaleY, scaleZ), + TRSRTransformation.quatFromYXZ(rotY, rotX, rotZ))); + } - public TRSRBakedModel(IFlexibleBakedModel original, TRSRTransformation transform) { - this.original = original; + public TRSRBakedModel(IFlexibleBakedModel original, TRSRTransformation transform) { + this.original = original; - ImmutableList.Builder builder; - builder = ImmutableList.builder(); + ImmutableList.Builder builder; + builder = ImmutableList.builder(); - transform = TRSRTransformation.blockCenterToCorner(transform); + transform = TRSRTransformation.blockCenterToCorner(transform); - // face quads - EnumMap> faces = Maps.newEnumMap(EnumFacing.class); - for(EnumFacing face : EnumFacing.values()) { - if(!original.isBuiltInRenderer()) { - for(BakedQuad quad : original.getFaceQuads(face)) { - Transformer transformer = new Transformer(transform, original.getFormat()); - quad.pipe(transformer); - builder.add(transformer.build()); - } - } - //faces.put(face, builder.build()); - faces.put(face, ImmutableList.of()); - } + // face quads + EnumMap> faces = Maps.newEnumMap(EnumFacing.class); + for (EnumFacing face : EnumFacing.values()) { + if (!original.isBuiltInRenderer()) { + for (BakedQuad quad : original.getFaceQuads(face)) { + Transformer transformer = new Transformer(transform, original.getFormat()); + quad.pipe(transformer); + builder.add(transformer.build()); + } + } + //faces.put(face, builder.build()); + faces.put(face, ImmutableList.of()); + } - // general quads - //builder = ImmutableList.builder(); - if(!original.isBuiltInRenderer()) { - for(BakedQuad quad : original.getGeneralQuads()) { - Transformer transformer = new Transformer(transform, original.getFormat()); - quad.pipe(transformer); - builder.add(transformer.build()); - } - } + // general quads + //builder = ImmutableList.builder(); + if (!original.isBuiltInRenderer()) { + for (BakedQuad quad : original.getGeneralQuads()) { + Transformer transformer = new Transformer(transform, original.getFormat()); + quad.pipe(transformer); + builder.add(transformer.build()); + } + } - this.general = builder.build(); - this.faces = Maps.immutableEnumMap(faces); - } + this.general = builder.build(); + this.faces = Maps.immutableEnumMap(faces); + } - @Override - public List getFaceQuads(EnumFacing side) { - return faces.get(side); - } + @Override + public List getFaceQuads(EnumFacing side) { + return faces.get(side); + } - @Override - public List getGeneralQuads() { - return general; - } + @Override + public List getGeneralQuads() { + return general; + } - @Override - public boolean isAmbientOcclusion() { - return false; - } + @Override + public boolean isAmbientOcclusion() { + return false; + } - @Override - public boolean isGui3d() { - return original.isGui3d(); - } + @Override + public boolean isGui3d() { + return original.isGui3d(); + } - @Override - public boolean isBuiltInRenderer() { - return original.isBuiltInRenderer(); - } + @Override + public boolean isBuiltInRenderer() { + return original.isBuiltInRenderer(); + } - @Override - public TextureAtlasSprite getParticleTexture() { - return original.getParticleTexture(); - } + @Override + public TextureAtlasSprite getParticleTexture() { + return original.getParticleTexture(); + } - @Override - public ItemCameraTransforms getItemCameraTransforms() { - return original.getItemCameraTransforms(); - } + @Override + public ItemCameraTransforms getItemCameraTransforms() { + return original.getItemCameraTransforms(); + } - @Override - public VertexFormat getFormat() { - return original.getFormat(); - } + @Override + public VertexFormat getFormat() { + return original.getFormat(); + } - public static class Transformer extends VertexTransformer { + public static class Transformer extends VertexTransformer { - protected Matrix4f transformation; - protected Matrix3f normalTransformation; + protected Matrix4f transformation; + protected Matrix3f normalTransformation; - public Transformer(TRSRTransformation transformation, VertexFormat format) { - super(new UnpackedBakedQuad.Builder(format)); - // position transform - this.transformation = transformation.getMatrix(); - // normal transform - this.normalTransformation = new Matrix3f(); - this.transformation.getRotationScale(this.normalTransformation); - this.normalTransformation.invert(); - this.normalTransformation.transpose(); - } + public Transformer(TRSRTransformation transformation, VertexFormat format) { + super(new UnpackedBakedQuad.Builder(format)); + // position transform + this.transformation = transformation.getMatrix(); + // normal transform + this.normalTransformation = new Matrix3f(); + this.transformation.getRotationScale(this.normalTransformation); + this.normalTransformation.invert(); + this.normalTransformation.transpose(); + } - @Override - public void put(int element, float... data) { - VertexFormatElement.EnumUsage usage = parent.getVertexFormat().getElement(element).getUsage(); + @Override + public void put(int element, float... data) { + VertexFormatElement.EnumUsage usage = parent.getVertexFormat().getElement(element).getUsage(); - // transform normals and position - if(usage == VertexFormatElement.EnumUsage.POSITION && data.length >= 3) { - Vector4f vec = new Vector4f(data); - vec.setW(1.0f); - transformation.transform(vec); - data = new float[4]; - vec.get(data); - } - else if(usage == VertexFormatElement.EnumUsage.NORMAL && data.length >= 3) { - Vector3f vec = new Vector3f(data); - normalTransformation.transform(vec); - vec.normalize(); - data = new float[4]; - vec.get(data); - } - super.put(element, data); - } + // transform normals and position + if (usage == VertexFormatElement.EnumUsage.POSITION && data.length >= 3) { + Vector4f vec = new Vector4f(data); + vec.setW(1.0f); + transformation.transform(vec); + data = new float[4]; + vec.get(data); + } else if (usage == VertexFormatElement.EnumUsage.NORMAL && data.length >= 3) { + Vector3f vec = new Vector3f(data); + normalTransformation.transform(vec); + vec.normalize(); + data = new float[4]; + vec.get(data); + } + super.put(element, data); + } - public UnpackedBakedQuad build() { - return ((UnpackedBakedQuad.Builder)parent).build(); - } - } + public UnpackedBakedQuad build() { + return ((UnpackedBakedQuad.Builder) parent).build(); + } + } } \ No newline at end of file diff --git a/src/main/java/forestry/core/models/baker/ModelBaker.java b/src/main/java/forestry/core/models/baker/ModelBaker.java index caccd0300..e54f41360 100644 --- a/src/main/java/forestry/core/models/baker/ModelBaker.java +++ b/src/main/java/forestry/core/models/baker/ModelBaker.java @@ -63,12 +63,13 @@ public class ModelBaker implements IModelBaker { protected final FaceBakery faceBakery = new FaceBakery(); - protected final float[] defUVs = new float[] { 0, 0, 1, 1 }; + protected final float[] defUVs = new float[]{0, 0, 1, 1}; @Override public void setRenderBoundsFromBlock(Block block) { - if (block == null) + if (block == null) { return; + } renderMinX = block.getBlockBoundsMinX(); renderMinY = block.getBlockBoundsMinY(); @@ -127,7 +128,7 @@ public class ModelBaker implements IModelBaker { return false; } - private final float quadsUV[] = new float[] { 0, 0, 1, 1, 0, 0, 1, 1 }; + private final float quadsUV[] = new float[]{0, 0, 1, 1, 0, 0, 1, 1}; protected EnumSet renderFaces = EnumSet.allOf(EnumFacing.class); private List faces = new ArrayList<>(); @@ -138,43 +139,43 @@ public class ModelBaker implements IModelBaker { float to_b = 0; switch (face) { - case UP: - from_a = from_16.x / 16.0f; - from_b = from_16.z / 16.0f; - to_a = to_16.x / 16.0f; - to_b = to_16.z / 16.0f; - break; - case DOWN: - from_a = from_16.x / 16.0f; - from_b = from_16.z / 16.0f; - to_a = to_16.x / 16.0f; - to_b = to_16.z / 16.0f; - break; - case SOUTH: - from_a = from_16.x / 16.0f; - from_b = from_16.y / 16.0f; - to_a = to_16.x / 16.0f; - to_b = to_16.y / 16.0f; - break; - case NORTH: - from_a = from_16.x / 16.0f; - from_b = from_16.y / 16.0f; - to_a = to_16.x / 16.0f; - to_b = to_16.y / 16.0f; - break; - case EAST: - from_a = from_16.y / 16.0f; - from_b = from_16.z / 16.0f; - to_a = to_16.y / 16.0f; - to_b = to_16.z / 16.0f; - break; - case WEST: - from_a = from_16.y / 16.0f; - from_b = from_16.z / 16.0f; - to_a = to_16.y / 16.0f; - to_b = to_16.z / 16.0f; - break; - default: + case UP: + from_a = from_16.x / 16.0f; + from_b = from_16.z / 16.0f; + to_a = to_16.x / 16.0f; + to_b = to_16.z / 16.0f; + break; + case DOWN: + from_a = from_16.x / 16.0f; + from_b = from_16.z / 16.0f; + to_a = to_16.x / 16.0f; + to_b = to_16.z / 16.0f; + break; + case SOUTH: + from_a = from_16.x / 16.0f; + from_b = from_16.y / 16.0f; + to_a = to_16.x / 16.0f; + to_b = to_16.y / 16.0f; + break; + case NORTH: + from_a = from_16.x / 16.0f; + from_b = from_16.y / 16.0f; + to_a = to_16.x / 16.0f; + to_b = to_16.y / 16.0f; + break; + case EAST: + from_a = from_16.y / 16.0f; + from_b = from_16.z / 16.0f; + to_a = to_16.y / 16.0f; + to_b = to_16.z / 16.0f; + break; + case WEST: + from_a = from_16.y / 16.0f; + from_b = from_16.z / 16.0f; + to_a = to_16.y / 16.0f; + to_b = to_16.z / 16.0f; + break; + default: } from_a = 1.0f - from_a; @@ -182,7 +183,7 @@ public class ModelBaker implements IModelBaker { to_a = 1.0f - to_a; to_b = 1.0f - to_b; - final float[] afloat = new float[] { // :P + final float[] afloat = new float[]{ // :P 16.0f * (quadsUV[0] + quadsUV[2] * from_a + quadsUV[4] * from_b), // 0 16.0f * (quadsUV[1] + quadsUV[3] * from_a + quadsUV[5] * from_b), // 1 @@ -267,8 +268,9 @@ public class ModelBaker implements IModelBaker { public IBakedModel bakeModel(boolean flip) { ModelRotation mr = ModelRotation.X0_Y0; - if (flip) + if (flip) { mr = ModelRotation.X0_Y180; + } for (ModelBakerFace face : faces) { final EnumFacing myFace = face.face; @@ -280,10 +282,11 @@ public class ModelBaker implements IModelBaker { BakedQuad bf = faceBakery.makeBakedQuad(face.to, face.from, bpf, face.spite, myFace, mr, null, true, true); bf = new IColoredBakedQuad.ColoredBakedQuad(bf.getVertexData(), face.colorIndex, bf.getFace()); - if (face.isEdge) + if (face.isEdge) { this.generatedModel.getFaceQuads(myFace).add(bf); - else + } else { this.generatedModel.getGeneralQuads().add(bf); + } } return clearBaker(); } diff --git a/src/main/java/forestry/core/models/baker/ModelBakerFace.java b/src/main/java/forestry/core/models/baker/ModelBakerFace.java index 256e3da4b..70100b49e 100644 --- a/src/main/java/forestry/core/models/baker/ModelBakerFace.java +++ b/src/main/java/forestry/core/models/baker/ModelBakerFace.java @@ -10,13 +10,15 @@ ******************************************************************************/ package forestry.core.models.baker; -import org.lwjgl.util.vector.Vector3f; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.util.EnumFacing; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import org.lwjgl.util.vector.Vector3f; + /** * A face of a baked model */ diff --git a/src/main/java/forestry/core/models/baker/ModelBakerModel.java b/src/main/java/forestry/core/models/baker/ModelBakerModel.java index 93a6882bf..2c26b867b 100644 --- a/src/main/java/forestry/core/models/baker/ModelBakerModel.java +++ b/src/main/java/forestry/core/models/baker/ModelBakerModel.java @@ -87,15 +87,15 @@ public class ModelBakerModel implements IBakedModel { } protected static float[] getRotation() { - return new float[] { -80, -45, 170 }; + return new float[]{-80, -45, 170}; } protected static float[] getTranslation() { - return new float[] { 0, 1.5F, -2.75F }; + return new float[]{0, 1.5F, -2.75F}; } protected static float[] getScale() { - return new float[] { 0.375F, 0.375F, 0.375F }; + return new float[]{0.375F, 0.375F, 0.375F}; } @Override diff --git a/src/main/java/forestry/core/multiblock/MultiblockClientTickHandler.java b/src/main/java/forestry/core/multiblock/MultiblockClientTickHandler.java index cfb4de1a3..5ad7da197 100644 --- a/src/main/java/forestry/core/multiblock/MultiblockClientTickHandler.java +++ b/src/main/java/forestry/core/multiblock/MultiblockClientTickHandler.java @@ -1,6 +1,7 @@ package forestry.core.multiblock; import net.minecraft.client.Minecraft; + import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; diff --git a/src/main/java/forestry/core/network/DataInputStreamForestry.java b/src/main/java/forestry/core/network/DataInputStreamForestry.java index 44036c356..b3a08f7a6 100644 --- a/src/main/java/forestry/core/network/DataInputStreamForestry.java +++ b/src/main/java/forestry/core/network/DataInputStreamForestry.java @@ -7,7 +7,6 @@ import java.io.InvalidObjectException; import java.util.Collection; import java.util.List; -import forestry.core.utils.ItemStackUtil; import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -19,6 +18,8 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; +import forestry.core.utils.ItemStackUtil; + public class DataInputStreamForestry extends DataInputStream { public DataInputStreamForestry(InputStream in) { @@ -139,13 +140,13 @@ public class DataInputStreamForestry extends DataInputStream { public FluidStack readFluidStack() throws IOException { int amount = readVarInt(); - if(amount > 0){ + if (amount > 0) { String fluidName = readUTF(); Fluid fluid = FluidRegistry.getFluid(fluidName); if (fluid == null) { return null; } - + return new FluidStack(fluid, amount); } return null; diff --git a/src/main/java/forestry/core/network/DataOutputStreamForestry.java b/src/main/java/forestry/core/network/DataOutputStreamForestry.java index 51421fd17..e78a2c465 100644 --- a/src/main/java/forestry/core/network/DataOutputStreamForestry.java +++ b/src/main/java/forestry/core/network/DataOutputStreamForestry.java @@ -6,7 +6,6 @@ import java.io.OutputStream; import java.util.Collection; import java.util.List; -import forestry.core.utils.ItemStackUtil; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompressedStreamTools; @@ -14,6 +13,8 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraftforge.fluids.FluidStack; +import forestry.core.utils.ItemStackUtil; + 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 460b99f1f..e7c9a8e1d 100755 --- a/src/main/java/forestry/core/network/ForestryPacket.java +++ b/src/main/java/forestry/core/network/ForestryPacket.java @@ -12,10 +12,12 @@ package forestry.core.network; import java.io.IOException; +import net.minecraft.network.PacketBuffer; + +import net.minecraftforge.fml.common.network.internal.FMLProxyPacket; + import io.netty.buffer.ByteBufOutputStream; import io.netty.buffer.Unpooled; -import net.minecraft.network.PacketBuffer; -import net.minecraftforge.fml.common.network.internal.FMLProxyPacket; public abstract class ForestryPacket implements IForestryPacket { private final IPacketId id = getPacketId(); diff --git a/src/main/java/forestry/core/network/PacketHandler.java b/src/main/java/forestry/core/network/PacketHandler.java index 34d5ae8c8..7cd602102 100644 --- a/src/main/java/forestry/core/network/PacketHandler.java +++ b/src/main/java/forestry/core/network/PacketHandler.java @@ -15,12 +15,14 @@ import java.io.InputStream; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.network.NetHandlerPlayServer; + import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.network.FMLEventChannel; import net.minecraftforge.fml.common.network.FMLNetworkEvent.ClientCustomPacketEvent; import net.minecraftforge.fml.common.network.FMLNetworkEvent.ServerCustomPacketEvent; import net.minecraftforge.fml.common.network.NetworkRegistry; import net.minecraftforge.fml.common.network.internal.FMLProxyPacket; + import forestry.core.proxy.Proxies; import io.netty.buffer.ByteBufInputStream; diff --git a/src/main/java/forestry/core/network/packets/PacketDummy.java b/src/main/java/forestry/core/network/packets/PacketDummy.java index 5397ce9f7..71f47fa4e 100644 --- a/src/main/java/forestry/core/network/packets/PacketDummy.java +++ b/src/main/java/forestry/core/network/packets/PacketDummy.java @@ -12,9 +12,10 @@ package forestry.core.network.packets; import java.io.IOException; +import net.minecraftforge.fml.common.network.internal.FMLProxyPacket; + import forestry.core.network.DataInputStreamForestry; import forestry.core.network.IForestryPacket; -import net.minecraftforge.fml.common.network.internal.FMLProxyPacket; public abstract class PacketDummy implements IForestryPacket { protected PacketDummy() { diff --git a/src/main/java/forestry/core/network/packets/PacketFXSignal.java b/src/main/java/forestry/core/network/packets/PacketFXSignal.java index 258081018..691eedd5d 100644 --- a/src/main/java/forestry/core/network/packets/PacketFXSignal.java +++ b/src/main/java/forestry/core/network/packets/PacketFXSignal.java @@ -15,6 +15,7 @@ import java.io.IOException; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.util.BlockPos; + import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; import forestry.core.network.IForestryPacketClient; diff --git a/src/main/java/forestry/core/proxy/ProxyRender.java b/src/main/java/forestry/core/proxy/ProxyRender.java index e6716968f..139faeb1a 100644 --- a/src/main/java/forestry/core/proxy/ProxyRender.java +++ b/src/main/java/forestry/core/proxy/ProxyRender.java @@ -94,7 +94,7 @@ public class ProxyRender { public void registerModels() { } - public void registerLoaders(){ + public void registerLoaders() { } /* FX */ diff --git a/src/main/java/forestry/core/proxy/ProxyRenderClient.java b/src/main/java/forestry/core/proxy/ProxyRenderClient.java index 7915441e1..5269b5c9a 100644 --- a/src/main/java/forestry/core/proxy/ProxyRenderClient.java +++ b/src/main/java/forestry/core/proxy/ProxyRenderClient.java @@ -148,7 +148,7 @@ public class ProxyRenderClient extends ProxyRender { } @Override - public void registerLoaders(){ + public void registerLoaders() { B3DLoader.instance.addDomain(Constants.ID); OBJLoader.instance.addDomain(Constants.ID); } diff --git a/src/main/java/forestry/core/recipes/jei/ForestryTooltipCallback.java b/src/main/java/forestry/core/recipes/jei/ForestryTooltipCallback.java index 3ddbd8377..4ea379620 100644 --- a/src/main/java/forestry/core/recipes/jei/ForestryTooltipCallback.java +++ b/src/main/java/forestry/core/recipes/jei/ForestryTooltipCallback.java @@ -29,7 +29,7 @@ public class ForestryTooltipCallback implements ITooltipCallback { @Override public void onTooltip(int index, boolean input, ItemStack ingredient, List tooltip) { List tip = tooltips.get(index); - if(!tip.isEmpty()){ + if (!tip.isEmpty()) { tooltip.addAll(tip); } } diff --git a/src/main/java/forestry/core/render/MachineStateMapper.java b/src/main/java/forestry/core/render/MachineStateMapper.java index 3111cb75a..0256efba4 100644 --- a/src/main/java/forestry/core/render/MachineStateMapper.java +++ b/src/main/java/forestry/core/render/MachineStateMapper.java @@ -36,11 +36,13 @@ public class MachineStateMapper & IBlockType & IStringSerializ @Override public Map putStateModelLocations(Block block) { for (T type : machinePropertiesClass.getEnumConstants()) { - if (type.getMachineProperties() instanceof IMachinePropertiesTesr) + if (type.getMachineProperties() instanceof IMachinePropertiesTesr) { continue; + } for (EnumFacing facing : EnumFacing.values()) { - if (facing == EnumFacing.DOWN || facing == EnumFacing.UP) + if (facing == EnumFacing.DOWN || facing == EnumFacing.UP) { continue; + } IBlockState state = block.getDefaultState().withProperty(META, type).withProperty(FACE, facing); LinkedHashMap linkedhashmap = Maps.newLinkedHashMap(state.getProperties()); ResourceLocation blockLocation = Block.blockRegistry.getNameForObject(block); diff --git a/src/main/java/forestry/core/render/ParticleHelper.java b/src/main/java/forestry/core/render/ParticleHelper.java index 1364f5352..3cb867244 100644 --- a/src/main/java/forestry/core/render/ParticleHelper.java +++ b/src/main/java/forestry/core/render/ParticleHelper.java @@ -12,7 +12,6 @@ package forestry.core.render; import java.util.Random; -import forestry.core.proxy.Proxies; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.client.particle.EffectRenderer; @@ -22,9 +21,12 @@ import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumParticleTypes; import net.minecraft.util.MovingObjectPosition; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import forestry.core.proxy.Proxies; + /** * @author CovertJaguar */ diff --git a/src/main/java/forestry/core/render/RenderAnalyzer.java b/src/main/java/forestry/core/render/RenderAnalyzer.java index 97f7c0f3e..2df2be52f 100755 --- a/src/main/java/forestry/core/render/RenderAnalyzer.java +++ b/src/main/java/forestry/core/render/RenderAnalyzer.java @@ -38,9 +38,9 @@ public class RenderAnalyzer extends TileEntitySpecialRenderer { */ @Override public void renderTileEntityAt(TileAnalyzer analyzer, double x, double y, double z, float partialTicks, int destroyStage) { - if(analyzer != null){ + if (analyzer != null) { render(analyzer.getIndividualOnDisplay(), analyzer.getWorld(), analyzer.getOrientation(), x, y, z); - }else{ + } else { render(null, null, EnumFacing.WEST, x, y, z); } } diff --git a/src/main/java/forestry/core/render/RenderEscritoire.java b/src/main/java/forestry/core/render/RenderEscritoire.java index 56219425b..9e3dcba8a 100755 --- a/src/main/java/forestry/core/render/RenderEscritoire.java +++ b/src/main/java/forestry/core/render/RenderEscritoire.java @@ -38,9 +38,9 @@ public class RenderEscritoire extends TileEntitySpecialRenderer */ @Override public void renderTileEntityAt(TileEscritoire escritoire, double x, double y, double z, float partialTicks, int destroyStage) { - if(escritoire != null){ + if (escritoire != null) { render(escritoire.getStackInSlot(InventoryEscritoire.SLOT_ANALYZE), escritoire.getOrientation(), x, y, z); - }else{ + } else { render(null, EnumFacing.EAST, x, y, z); } } diff --git a/src/main/java/forestry/core/render/RenderMachine.java b/src/main/java/forestry/core/render/RenderMachine.java index 297d06bc6..f1a621e27 100755 --- a/src/main/java/forestry/core/render/RenderMachine.java +++ b/src/main/java/forestry/core/render/RenderMachine.java @@ -88,10 +88,10 @@ public class RenderMachine extends TileEntitySpecialRenderer { */ @Override public void renderTileEntityAt(TileBase tile, double x, double y, double z, float partialTicks, int destroyStage) { - if(tile != null){ + if (tile != null) { IRenderableTile generator = (IRenderableTile) tile; render(generator.getResourceTankInfo(), generator.getProductTankInfo(), generator.getOrientation(), x, y, z); - }else{ + } else { render(TankRenderInfo.EMPTY, TankRenderInfo.EMPTY, EnumFacing.SOUTH, x, y, z); } } diff --git a/src/main/java/forestry/core/render/RenderMill.java b/src/main/java/forestry/core/render/RenderMill.java index 7cb5643ad..8ae616edd 100755 --- a/src/main/java/forestry/core/render/RenderMill.java +++ b/src/main/java/forestry/core/render/RenderMill.java @@ -92,9 +92,9 @@ public class RenderMill extends TileEntitySpecialRenderer { */ @Override public void renderTileEntityAt(TileMill mill, double x, double y, double z, float partialTicks, int destroyStage) { - if(mill != null){ + if (mill != null) { render(mill.progress, mill.charge, EnumFacing.WEST, x, y, z); - }else{ + } else { byte charge = 0; render(0.0f, charge, EnumFacing.WEST, x, y, z); } diff --git a/src/main/java/forestry/core/render/RenderNaturalistChest.java b/src/main/java/forestry/core/render/RenderNaturalistChest.java index 2432baa38..2275aaffb 100644 --- a/src/main/java/forestry/core/render/RenderNaturalistChest.java +++ b/src/main/java/forestry/core/render/RenderNaturalistChest.java @@ -34,9 +34,9 @@ public class RenderNaturalistChest extends TileEntitySpecialRenderer itemRegistry = GameData.getItemRegistry(); @@ -71,10 +72,10 @@ public abstract class ItemStackUtil { } /** - * + * * @return The registry name of the item as {@link String} */ - public static String getItemNameFromRegistryAsSting(Item item){ + public static String getItemNameFromRegistryAsSting(Item item) { return getItemNameFromRegistry(item).toString(); } @@ -82,7 +83,7 @@ public abstract class ItemStackUtil { * @return The item from the item registry * @param itemName The registry name from the item as {@link String} */ - public static Item getItemFromRegistry(String itemName){ + public static Item getItemFromRegistry(String itemName) { return getItemFromRegistry(new ResourceLocation(itemName)); } @@ -90,24 +91,24 @@ public abstract class ItemStackUtil { * @return The item from the item registry * @param itemName The registry name from the item as {@link ResourceLocation} */ - public static Item getItemFromRegistry(ResourceLocation itemName){ - if(itemName == null){ + public static Item getItemFromRegistry(ResourceLocation itemName) { + if (itemName == null) { return null; } FMLControlledNamespacedRegistry itemRegistry = GameData.getItemRegistry(); int registryID = itemRegistry.getId(itemName); - if(registryID == -1){ + if (registryID == -1) { return null; } return itemRegistry.getRaw(registryID); } /** - * + * * @return The registry name of the block as {@link ResourceLocation} */ - public static ResourceLocation getBlockNameFromRegistry(Block block){ - if(block == null){ + public static ResourceLocation getBlockNameFromRegistry(Block block) { + if (block == null) { return null; } FMLControlledNamespacedRegistry blockRegistry = GameData.getBlockRegistry(); @@ -115,10 +116,10 @@ public abstract class ItemStackUtil { } /** - * + * * @return The registry name of the block as {@link String} */ - public static String getBlockNameFromRegistryAsSting(Block block){ + public static String getBlockNameFromRegistryAsSting(Block block) { return getBlockNameFromRegistry(block).toString(); } @@ -126,7 +127,7 @@ public abstract class ItemStackUtil { * @return The block from the block registry * @param itemName The registry name from the block as {@link String} */ - public static Block getBlockFromRegistry(String itemName){ + public static Block getBlockFromRegistry(String itemName) { return getBlockFromRegistry(new ResourceLocation(itemName)); } @@ -134,13 +135,13 @@ public abstract class ItemStackUtil { * @return The block from the block registry * @param itemName The registry name from the block as {@link ResourceLocation} */ - public static Block getBlockFromRegistry(ResourceLocation itemName){ - if(itemName == null){ + public static Block getBlockFromRegistry(ResourceLocation itemName) { + if (itemName == null) { return null; } FMLControlledNamespacedRegistry blockRegistry = GameData.getBlockRegistry(); int registryID = blockRegistry.getId(itemName); - if(registryID == -1){ + if (registryID == -1) { return null; } return blockRegistry.getRaw(registryID); diff --git a/src/main/java/forestry/core/utils/NBTUtil.java b/src/main/java/forestry/core/utils/NBTUtil.java index 37e2d36b3..2e398e1e4 100644 --- a/src/main/java/forestry/core/utils/NBTUtil.java +++ b/src/main/java/forestry/core/utils/NBTUtil.java @@ -28,6 +28,7 @@ import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagLong; import net.minecraft.nbt.NBTTagShort; import net.minecraft.nbt.NBTTagString; + import net.minecraftforge.fml.common.ObfuscationReflectionHelper; /** diff --git a/src/main/java/forestry/core/utils/Stack.java b/src/main/java/forestry/core/utils/Stack.java index 5cc41719c..a3b0ba9a8 100644 --- a/src/main/java/forestry/core/utils/Stack.java +++ b/src/main/java/forestry/core/utils/Stack.java @@ -17,6 +17,7 @@ import java.util.List; import net.minecraft.block.Block; import net.minecraft.item.Item; + import net.minecraftforge.oredict.OreDictionary; public class Stack { diff --git a/src/main/java/forestry/core/utils/vect/IVect.java b/src/main/java/forestry/core/utils/vect/IVect.java index ec2350b8f..3bd844409 100644 --- a/src/main/java/forestry/core/utils/vect/IVect.java +++ b/src/main/java/forestry/core/utils/vect/IVect.java @@ -10,11 +10,12 @@ ******************************************************************************/ package forestry.core.utils.vect; -import forestry.api.farming.FarmDirection; import net.minecraft.entity.Entity; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import forestry.api.farming.FarmDirection; + /** * Represents a position or dimensions. */ diff --git a/src/main/java/forestry/core/utils/vect/MutableVect.java b/src/main/java/forestry/core/utils/vect/MutableVect.java index ee3aa7713..2b74266d2 100644 --- a/src/main/java/forestry/core/utils/vect/MutableVect.java +++ b/src/main/java/forestry/core/utils/vect/MutableVect.java @@ -10,10 +10,11 @@ ******************************************************************************/ package forestry.core.utils.vect; -import forestry.api.farming.FarmDirection; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; +import forestry.api.farming.FarmDirection; + /** * Represents changeable positions or dimensions. */ diff --git a/src/main/java/forestry/core/worldgen/WorldGenerator.java b/src/main/java/forestry/core/worldgen/WorldGenerator.java index 46626d4b2..eb35b94c1 100644 --- a/src/main/java/forestry/core/worldgen/WorldGenerator.java +++ b/src/main/java/forestry/core/worldgen/WorldGenerator.java @@ -20,6 +20,7 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.terraingen.PopulateChunkEvent; import net.minecraftforge.fml.common.IWorldGenerator; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + import forestry.core.blocks.BlockResourceOre; import forestry.core.config.Config; import forestry.plugins.PluginCore; diff --git a/src/main/java/forestry/energy/EnergyManager.java b/src/main/java/forestry/energy/EnergyManager.java index 91db8f799..55713afc7 100644 --- a/src/main/java/forestry/energy/EnergyManager.java +++ b/src/main/java/forestry/energy/EnergyManager.java @@ -5,6 +5,7 @@ import java.io.IOException; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; + import forestry.api.core.ForestryAPI; import forestry.core.network.DataInputStreamForestry; import forestry.core.network.DataOutputStreamForestry; diff --git a/src/main/java/forestry/energy/inventory/InventoryEnginePeat.java b/src/main/java/forestry/energy/inventory/InventoryEnginePeat.java index 3982755d2..7b6d3bb11 100644 --- a/src/main/java/forestry/energy/inventory/InventoryEnginePeat.java +++ b/src/main/java/forestry/energy/inventory/InventoryEnginePeat.java @@ -12,6 +12,7 @@ package forestry.energy.inventory; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; + import forestry.api.fuels.FuelManager; import forestry.core.inventory.InventoryAdapterTile; import forestry.core.utils.SlotUtil; diff --git a/src/main/java/forestry/energy/proxy/ProxyEnergy.java b/src/main/java/forestry/energy/proxy/ProxyEnergy.java index 219bd0bfb..8512a296d 100755 --- a/src/main/java/forestry/energy/proxy/ProxyEnergy.java +++ b/src/main/java/forestry/energy/proxy/ProxyEnergy.java @@ -10,9 +10,10 @@ ******************************************************************************/ package forestry.energy.proxy; -import forestry.core.tiles.TileEngine; import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import forestry.core.tiles.TileEngine; + public class ProxyEnergy { public TileEntitySpecialRenderer 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 7aa25601d..be1950c4f 100644 --- a/src/main/java/forestry/energy/proxy/ProxyEnergyClient.java +++ b/src/main/java/forestry/energy/proxy/ProxyEnergyClient.java @@ -10,9 +10,10 @@ ******************************************************************************/ package forestry.energy.proxy; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; + import forestry.core.tiles.TileEngine; import forestry.energy.render.RenderEngine; -import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; public class ProxyEnergyClient extends ProxyEnergy { diff --git a/src/main/java/forestry/energy/render/RenderEngine.java b/src/main/java/forestry/energy/render/RenderEngine.java index 6fd381c91..647cc813c 100755 --- a/src/main/java/forestry/energy/render/RenderEngine.java +++ b/src/main/java/forestry/energy/render/RenderEngine.java @@ -92,14 +92,14 @@ public class RenderEngine extends TileEntitySpecialRenderer { @Override public void renderTileEntityAt(TileEngine engine, double x, double y, double z, float partialTicks, int destroyStage) { - if(engine != null){ + if (engine != null) { if (engine instanceof TileEngine) { TileEngine tileEngine = engine; render(tileEngine.getTemperatureState(), tileEngine.progress, tileEngine.getOrientation(), x, y, z); } else { Log.severe("Tried to render a tile entity that is not an engine: " + engine); } - }else{ + } else { render(TemperatureState.COOL, 0.25F, EnumFacing.UP, x, y, z); } } diff --git a/src/main/java/forestry/energy/tiles/TileEngineBiogas.java b/src/main/java/forestry/energy/tiles/TileEngineBiogas.java index 7362d87fc..6cdb4b25f 100644 --- a/src/main/java/forestry/energy/tiles/TileEngineBiogas.java +++ b/src/main/java/forestry/energy/tiles/TileEngineBiogas.java @@ -18,6 +18,7 @@ import net.minecraft.inventory.ICrafting; import net.minecraft.inventory.ISidedInventory; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; + import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; diff --git a/src/main/java/forestry/energy/tiles/TileEnginePeat.java b/src/main/java/forestry/energy/tiles/TileEnginePeat.java index 96cabf3a4..d4fffbd3a 100644 --- a/src/main/java/forestry/energy/tiles/TileEnginePeat.java +++ b/src/main/java/forestry/energy/tiles/TileEnginePeat.java @@ -23,7 +23,9 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; + import net.minecraftforge.fml.common.Optional; + import forestry.api.fuels.FuelManager; import forestry.core.config.Constants; import forestry.core.errors.EnumErrorCode; @@ -287,7 +289,7 @@ public class TileEnginePeat extends TileEngine implements ISidedInventory { super.writeToNBT(nbttagcompound); if (fuelItem != null) { - nbttagcompound.setString("EngineFuelItem", ItemStackUtil.getItemNameFromRegistryAsSting(fuelItem)); + nbttagcompound.setString("EngineFuelItem", ItemStackUtil.getItemNameFromRegistryAsSting(fuelItem)); } nbttagcompound.setInteger("EngineFuelMeta", fuelItemMeta); diff --git a/src/main/java/forestry/factory/gui/widgets/MemorizedRecipeSlot.java b/src/main/java/forestry/factory/gui/widgets/MemorizedRecipeSlot.java index 1b909c869..021191f40 100644 --- a/src/main/java/forestry/factory/gui/widgets/MemorizedRecipeSlot.java +++ b/src/main/java/forestry/factory/gui/widgets/MemorizedRecipeSlot.java @@ -13,6 +13,7 @@ package forestry.factory.gui.widgets; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.item.ItemStack; + import org.lwjgl.opengl.GL11; import forestry.core.gui.widgets.ItemStackWidgetBase; diff --git a/src/main/java/forestry/factory/inventory/InventoryBottler.java b/src/main/java/forestry/factory/inventory/InventoryBottler.java index c0941370f..1765d5490 100644 --- a/src/main/java/forestry/factory/inventory/InventoryBottler.java +++ b/src/main/java/forestry/factory/inventory/InventoryBottler.java @@ -12,6 +12,7 @@ package forestry.factory.inventory; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; + import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; diff --git a/src/main/java/forestry/factory/inventory/InventoryCarpenter.java b/src/main/java/forestry/factory/inventory/InventoryCarpenter.java index 35caecf60..64381d0a6 100644 --- a/src/main/java/forestry/factory/inventory/InventoryCarpenter.java +++ b/src/main/java/forestry/factory/inventory/InventoryCarpenter.java @@ -12,6 +12,7 @@ package forestry.factory.inventory; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; + import net.minecraftforge.fluids.Fluid; import forestry.core.fluids.FluidHelper; diff --git a/src/main/java/forestry/factory/inventory/InventoryCentrifuge.java b/src/main/java/forestry/factory/inventory/InventoryCentrifuge.java index ed551e742..6343090dc 100644 --- a/src/main/java/forestry/factory/inventory/InventoryCentrifuge.java +++ b/src/main/java/forestry/factory/inventory/InventoryCentrifuge.java @@ -12,6 +12,7 @@ package forestry.factory.inventory; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; + import forestry.core.inventory.InventoryAdapterTile; import forestry.core.utils.SlotUtil; import forestry.factory.recipes.CentrifugeRecipeManager; diff --git a/src/main/java/forestry/factory/inventory/InventoryFabricator.java b/src/main/java/forestry/factory/inventory/InventoryFabricator.java index fe3d987a0..2be7ce298 100644 --- a/src/main/java/forestry/factory/inventory/InventoryFabricator.java +++ b/src/main/java/forestry/factory/inventory/InventoryFabricator.java @@ -12,6 +12,7 @@ package forestry.factory.inventory; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; + import forestry.core.inventory.InventoryAdapterTile; import forestry.core.utils.SlotUtil; import forestry.factory.recipes.FabricatorRecipeManager; diff --git a/src/main/java/forestry/factory/inventory/InventoryFermenter.java b/src/main/java/forestry/factory/inventory/InventoryFermenter.java index 37886acf1..138ea7b67 100644 --- a/src/main/java/forestry/factory/inventory/InventoryFermenter.java +++ b/src/main/java/forestry/factory/inventory/InventoryFermenter.java @@ -12,6 +12,7 @@ package forestry.factory.inventory; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; + import net.minecraftforge.fluids.Fluid; import forestry.api.fuels.FuelManager; diff --git a/src/main/java/forestry/factory/inventory/InventoryMoistener.java b/src/main/java/forestry/factory/inventory/InventoryMoistener.java index f2ae3c607..20d9924d9 100644 --- a/src/main/java/forestry/factory/inventory/InventoryMoistener.java +++ b/src/main/java/forestry/factory/inventory/InventoryMoistener.java @@ -12,6 +12,7 @@ package forestry.factory.inventory; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; + import net.minecraftforge.fluids.Fluid; import forestry.api.fuels.FuelManager; diff --git a/src/main/java/forestry/factory/inventory/InventoryRaintank.java b/src/main/java/forestry/factory/inventory/InventoryRaintank.java index 4a201c872..ed129b2bd 100644 --- a/src/main/java/forestry/factory/inventory/InventoryRaintank.java +++ b/src/main/java/forestry/factory/inventory/InventoryRaintank.java @@ -12,6 +12,7 @@ package forestry.factory.inventory; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; + import forestry.core.fluids.FluidHelper; import forestry.core.fluids.Fluids; import forestry.core.inventory.InventoryAdapterTile; diff --git a/src/main/java/forestry/factory/inventory/InventorySqueezer.java b/src/main/java/forestry/factory/inventory/InventorySqueezer.java index 6be3c7949..bc453531a 100644 --- a/src/main/java/forestry/factory/inventory/InventorySqueezer.java +++ b/src/main/java/forestry/factory/inventory/InventorySqueezer.java @@ -14,6 +14,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; + import net.minecraftforge.fluids.FluidStack; import forestry.core.fluids.FluidHelper; diff --git a/src/main/java/forestry/factory/inventory/InventoryStill.java b/src/main/java/forestry/factory/inventory/InventoryStill.java index 223f593b4..133075deb 100644 --- a/src/main/java/forestry/factory/inventory/InventoryStill.java +++ b/src/main/java/forestry/factory/inventory/InventoryStill.java @@ -12,6 +12,7 @@ package forestry.factory.inventory; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; + import net.minecraftforge.fluids.Fluid; import forestry.core.fluids.FluidHelper; diff --git a/src/main/java/forestry/factory/recipes/jei/FactoryJeiPlugin.java b/src/main/java/forestry/factory/recipes/jei/FactoryJeiPlugin.java index 5d2408819..2b2269228 100644 --- a/src/main/java/forestry/factory/recipes/jei/FactoryJeiPlugin.java +++ b/src/main/java/forestry/factory/recipes/jei/FactoryJeiPlugin.java @@ -96,7 +96,7 @@ public class FactoryJeiPlugin extends BlankModPlugin { @Nullable @Override public List getGuiExtraAreas(GuiForestry guiContainer) { - GuiForestry guiForestry = guiContainer; + GuiForestry guiForestry = (GuiForestry) guiContainer; return guiForestry.getExtraGuiAreas(); } } diff --git a/src/main/java/forestry/factory/recipes/jei/bottler/BottlerRecipeCategory.java b/src/main/java/forestry/factory/recipes/jei/bottler/BottlerRecipeCategory.java index c004e8ff2..ab8f75897 100644 --- a/src/main/java/forestry/factory/recipes/jei/bottler/BottlerRecipeCategory.java +++ b/src/main/java/forestry/factory/recipes/jei/bottler/BottlerRecipeCategory.java @@ -17,7 +17,7 @@ import mezz.jei.api.gui.IGuiItemStackGroup; import mezz.jei.api.gui.IRecipeLayout; import mezz.jei.api.recipe.IRecipeWrapper; -public class BottlerRecipeCategory extends ForestryRecipeCategory{ +public class BottlerRecipeCategory extends ForestryRecipeCategory { private static final int emptySlot = 0; private static final int outputSlot = 1; diff --git a/src/main/java/forestry/factory/recipes/jei/bottler/BottlerRecipeHandler.java b/src/main/java/forestry/factory/recipes/jei/bottler/BottlerRecipeHandler.java index 65e887d70..c2ffd91e1 100644 --- a/src/main/java/forestry/factory/recipes/jei/bottler/BottlerRecipeHandler.java +++ b/src/main/java/forestry/factory/recipes/jei/bottler/BottlerRecipeHandler.java @@ -31,10 +31,10 @@ public class BottlerRecipeHandler implements IRecipeHandler 0; diff --git a/src/main/java/forestry/factory/recipes/jei/carpenter/CarpenterRecipeMaker.java b/src/main/java/forestry/factory/recipes/jei/carpenter/CarpenterRecipeMaker.java index 8b709535d..27d9581bc 100644 --- a/src/main/java/forestry/factory/recipes/jei/carpenter/CarpenterRecipeMaker.java +++ b/src/main/java/forestry/factory/recipes/jei/carpenter/CarpenterRecipeMaker.java @@ -13,8 +13,9 @@ public class CarpenterRecipeMaker { public static List getCarpenterRecipes() { List recipes = new ArrayList<>(); - for(ICarpenterRecipe recipe : RecipeManagers.carpenterManager.recipes()) + for (ICarpenterRecipe recipe : RecipeManagers.carpenterManager.recipes()) { recipes.add(new CarpenterRecipeWrapper(recipe)); + } return recipes; } diff --git a/src/main/java/forestry/factory/recipes/jei/carpenter/CarpenterRecipeWrapper.java b/src/main/java/forestry/factory/recipes/jei/carpenter/CarpenterRecipeWrapper.java index 6fb206a17..fddfaaed9 100644 --- a/src/main/java/forestry/factory/recipes/jei/carpenter/CarpenterRecipeWrapper.java +++ b/src/main/java/forestry/factory/recipes/jei/carpenter/CarpenterRecipeWrapper.java @@ -12,7 +12,7 @@ import net.minecraftforge.fluids.FluidStack; import forestry.api.recipes.ICarpenterRecipe; import forestry.core.recipes.jei.ForestryRecipeWrapper; -public class CarpenterRecipeWrapper extends ForestryRecipeWrapper{ +public class CarpenterRecipeWrapper extends ForestryRecipeWrapper { public CarpenterRecipeWrapper(@Nonnull ICarpenterRecipe recipe) { super(recipe); diff --git a/src/main/java/forestry/factory/recipes/jei/centrifuge/CentrifugeRecipeHandler.java b/src/main/java/forestry/factory/recipes/jei/centrifuge/CentrifugeRecipeHandler.java index 2839c0546..9e68f5d4c 100644 --- a/src/main/java/forestry/factory/recipes/jei/centrifuge/CentrifugeRecipeHandler.java +++ b/src/main/java/forestry/factory/recipes/jei/centrifuge/CentrifugeRecipeHandler.java @@ -33,14 +33,14 @@ public class CentrifugeRecipeHandler implements IRecipeHandler 0; diff --git a/src/main/java/forestry/factory/recipes/jei/centrifuge/CentrifugeRecipeMaker.java b/src/main/java/forestry/factory/recipes/jei/centrifuge/CentrifugeRecipeMaker.java index ac7a27f44..31303ae83 100644 --- a/src/main/java/forestry/factory/recipes/jei/centrifuge/CentrifugeRecipeMaker.java +++ b/src/main/java/forestry/factory/recipes/jei/centrifuge/CentrifugeRecipeMaker.java @@ -13,8 +13,9 @@ public class CentrifugeRecipeMaker { public static List getCentrifugeRecipe() { List recipes = new ArrayList<>(); - for(ICentrifugeRecipe recipe : RecipeManagers.centrifugeManager.recipes()) + for (ICentrifugeRecipe recipe : RecipeManagers.centrifugeManager.recipes()) { recipes.add(new CentrifugeRecipeWrapper(recipe)); + } return recipes; } diff --git a/src/main/java/forestry/factory/recipes/jei/centrifuge/CentrifugeRecipeWrapper.java b/src/main/java/forestry/factory/recipes/jei/centrifuge/CentrifugeRecipeWrapper.java index d8dd43962..9ad07cadb 100644 --- a/src/main/java/forestry/factory/recipes/jei/centrifuge/CentrifugeRecipeWrapper.java +++ b/src/main/java/forestry/factory/recipes/jei/centrifuge/CentrifugeRecipeWrapper.java @@ -7,7 +7,7 @@ import java.util.List; import forestry.api.recipes.ICentrifugeRecipe; import forestry.core.recipes.jei.ForestryRecipeWrapper; -public class CentrifugeRecipeWrapper extends ForestryRecipeWrapper{ +public class CentrifugeRecipeWrapper extends ForestryRecipeWrapper { public CentrifugeRecipeWrapper(@Nonnull ICentrifugeRecipe recipe) { super(recipe); diff --git a/src/main/java/forestry/factory/recipes/jei/fabricator/FabricatorRecipeHandler.java b/src/main/java/forestry/factory/recipes/jei/fabricator/FabricatorRecipeHandler.java index 2427d7101..4c0e87661 100644 --- a/src/main/java/forestry/factory/recipes/jei/fabricator/FabricatorRecipeHandler.java +++ b/src/main/java/forestry/factory/recipes/jei/fabricator/FabricatorRecipeHandler.java @@ -31,17 +31,17 @@ public class FabricatorRecipeHandler implements IRecipeHandler 0; diff --git a/src/main/java/forestry/factory/recipes/jei/fabricator/FabricatorRecipeMaker.java b/src/main/java/forestry/factory/recipes/jei/fabricator/FabricatorRecipeMaker.java index 6515a8b11..b6fee042d 100644 --- a/src/main/java/forestry/factory/recipes/jei/fabricator/FabricatorRecipeMaker.java +++ b/src/main/java/forestry/factory/recipes/jei/fabricator/FabricatorRecipeMaker.java @@ -13,8 +13,9 @@ public class FabricatorRecipeMaker { public static List getFabricatorRecipes() { List recipes = new ArrayList<>(); - for(IFabricatorRecipe recipe : RecipeManagers.fabricatorManager.recipes()) + for (IFabricatorRecipe recipe : RecipeManagers.fabricatorManager.recipes()) { recipes.add(new FabricatorRecipeWrapper(recipe)); + } return recipes; } diff --git a/src/main/java/forestry/factory/recipes/jei/fabricator/FabricatorRecipeWrapper.java b/src/main/java/forestry/factory/recipes/jei/fabricator/FabricatorRecipeWrapper.java index 619ff8ee0..0576ab440 100644 --- a/src/main/java/forestry/factory/recipes/jei/fabricator/FabricatorRecipeWrapper.java +++ b/src/main/java/forestry/factory/recipes/jei/fabricator/FabricatorRecipeWrapper.java @@ -12,7 +12,7 @@ import net.minecraftforge.fluids.FluidStack; import forestry.api.recipes.IFabricatorRecipe; import forestry.core.recipes.jei.ForestryRecipeWrapper; -public class FabricatorRecipeWrapper extends ForestryRecipeWrapper{ +public class FabricatorRecipeWrapper extends ForestryRecipeWrapper { public FabricatorRecipeWrapper(@Nonnull IFabricatorRecipe recipe) { super(recipe); diff --git a/src/main/java/forestry/factory/recipes/jei/fermenter/FermenterRecipeHandler.java b/src/main/java/forestry/factory/recipes/jei/fermenter/FermenterRecipeHandler.java index 1604a62fc..b4dab17d8 100644 --- a/src/main/java/forestry/factory/recipes/jei/fermenter/FermenterRecipeHandler.java +++ b/src/main/java/forestry/factory/recipes/jei/fermenter/FermenterRecipeHandler.java @@ -31,16 +31,16 @@ public class FermenterRecipeHandler implements IRecipeHandler getFermenterRecipes() { List recipes = new ArrayList<>(); - for(IFermenterRecipe recipe : RecipeManagers.fermenterManager.recipes()){ + for (IFermenterRecipe recipe : RecipeManagers.fermenterManager.recipes()) { if (recipe.getResource() != null && recipe.getResource().getItem() instanceof IVariableFermentable) { for (ItemStack stack : JEIUtils.getItemVariations(recipe.getResource())) { recipes.add(new FermenterRecipeWrapper(recipe, stack)); } - }else{ + } else { recipes.add(new FermenterRecipeWrapper(recipe, recipe.getResource())); } } diff --git a/src/main/java/forestry/factory/recipes/jei/fermenter/FermenterRecipeWrapper.java b/src/main/java/forestry/factory/recipes/jei/fermenter/FermenterRecipeWrapper.java index add436843..2ddb26e75 100644 --- a/src/main/java/forestry/factory/recipes/jei/fermenter/FermenterRecipeWrapper.java +++ b/src/main/java/forestry/factory/recipes/jei/fermenter/FermenterRecipeWrapper.java @@ -15,7 +15,7 @@ import forestry.api.recipes.IFermenterRecipe; import forestry.api.recipes.IVariableFermentable; import forestry.core.recipes.jei.ForestryRecipeWrapper; -public class FermenterRecipeWrapper extends ForestryRecipeWrapper{ +public class FermenterRecipeWrapper extends ForestryRecipeWrapper { @Nonnull private final ItemStack fermentable; diff --git a/src/main/java/forestry/factory/recipes/jei/moistener/MoistenerRecipeHandler.java b/src/main/java/forestry/factory/recipes/jei/moistener/MoistenerRecipeHandler.java index 13e142e6e..64af058b0 100644 --- a/src/main/java/forestry/factory/recipes/jei/moistener/MoistenerRecipeHandler.java +++ b/src/main/java/forestry/factory/recipes/jei/moistener/MoistenerRecipeHandler.java @@ -31,16 +31,16 @@ public class MoistenerRecipeHandler implements IRecipeHandler{ +public class MoistenerRecipeWrapper extends ForestryRecipeWrapper { @Nonnull private final MoistenerFuel fuel; @@ -25,8 +25,9 @@ public class MoistenerRecipeWrapper extends ForestryRecipeWrapper getInputs() { List inputs = new ArrayList<>(); inputs.add(getRecipe().getResource()); - if(fuel.item != null) + if (fuel.item != null) { inputs.add(fuel.item); + } return inputs; } @@ -35,8 +36,9 @@ public class MoistenerRecipeWrapper extends ForestryRecipeWrapper getOutputs() { List outputs = new ArrayList<>(); outputs.add(getRecipe().getProduct()); - if(fuel.product != null) + if (fuel.product != null) { outputs.add(fuel.product); + } return outputs; } diff --git a/src/main/java/forestry/factory/recipes/jei/squeezer/SqueezerRecipeHandler.java b/src/main/java/forestry/factory/recipes/jei/squeezer/SqueezerRecipeHandler.java index 25735293a..01931cabf 100644 --- a/src/main/java/forestry/factory/recipes/jei/squeezer/SqueezerRecipeHandler.java +++ b/src/main/java/forestry/factory/recipes/jei/squeezer/SqueezerRecipeHandler.java @@ -41,19 +41,19 @@ public class SqueezerRecipeHandler implements I @Override public boolean isRecipeValid(@Nonnull R wrapper) { - if(wrapper.getFluidOutputs() == null || wrapper.getFluidOutputs().isEmpty()){ + if (wrapper.getFluidOutputs() == null || wrapper.getFluidOutputs().isEmpty()) { return false; } - if(wrapper.getInputs() == null || wrapper.getInputs().isEmpty()){ + if (wrapper.getInputs() == null || wrapper.getInputs().isEmpty()) { return false; } - if(wrapper.getOutputs() == null || wrapper.getOutputs().isEmpty()){ + if (wrapper.getOutputs() == null || wrapper.getOutputs().isEmpty()) { return false; } - if(wrapper.getRecipe() instanceof ISqueezerContainerRecipe){ + if (wrapper.getRecipe() instanceof ISqueezerContainerRecipe) { ISqueezerContainerRecipe recipe = (ISqueezerContainerRecipe) wrapper.getRecipe(); return recipe.getProcessingTime() > 0 && recipe.getRemnantsChance() > 0; - }else{ + } else { ISqueezerRecipe recipe = (ISqueezerRecipe) wrapper.getRecipe(); return recipe.getProcessingTime() > 0 && recipe.getRemnantsChance() > 0; } diff --git a/src/main/java/forestry/factory/recipes/jei/squeezer/SqueezerRecipeMaker.java b/src/main/java/forestry/factory/recipes/jei/squeezer/SqueezerRecipeMaker.java index 06def2215..07d3dbecf 100644 --- a/src/main/java/forestry/factory/recipes/jei/squeezer/SqueezerRecipeMaker.java +++ b/src/main/java/forestry/factory/recipes/jei/squeezer/SqueezerRecipeMaker.java @@ -3,12 +3,13 @@ package forestry.factory.recipes.jei.squeezer; import java.util.ArrayList; import java.util.List; +import net.minecraftforge.fluids.FluidContainerRegistry; +import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; + import forestry.api.recipes.ISqueezerRecipe; import forestry.api.recipes.RecipeManagers; import forestry.factory.recipes.ISqueezerContainerRecipe; import forestry.factory.recipes.SqueezerRecipeManager; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; public class SqueezerRecipeMaker { @@ -17,7 +18,7 @@ public class SqueezerRecipeMaker { public static List getSqueezerRecipes() { List recipes = new ArrayList<>(); - for(ISqueezerRecipe recipe : RecipeManagers.squeezerManager.recipes()){ + for (ISqueezerRecipe recipe : RecipeManagers.squeezerManager.recipes()) { recipes.add(new SqueezerRecipeWrapper(recipe)); } return recipes; @@ -25,7 +26,7 @@ public class SqueezerRecipeMaker { public static List getSqueezerContainerRecipes() { List recipes = new ArrayList<>(); - for(FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()){ + for (FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) { ISqueezerContainerRecipe containerRecipe = SqueezerRecipeManager.findMatchingContainerRecipe(data.filledContainer); if (containerRecipe != null) { recipes.add(new SqueezerContainerRecipeWrapper(containerRecipe, data.filledContainer)); diff --git a/src/main/java/forestry/factory/recipes/jei/still/StillRecipeHandler.java b/src/main/java/forestry/factory/recipes/jei/still/StillRecipeHandler.java index 372422ed1..7d8aa7caa 100644 --- a/src/main/java/forestry/factory/recipes/jei/still/StillRecipeHandler.java +++ b/src/main/java/forestry/factory/recipes/jei/still/StillRecipeHandler.java @@ -31,10 +31,10 @@ public class StillRecipeHandler implements IRecipeHandler { @Override public boolean isRecipeValid(@Nonnull StillRecipeWrapper wrapper) { IStillRecipe recipe = wrapper.getRecipe(); - if(recipe.getInput() == null){ + if (recipe.getInput() == null) { return false; } - if(recipe.getOutput() == null){ + if (recipe.getOutput() == null) { return false; } return true; diff --git a/src/main/java/forestry/factory/recipes/jei/still/StillRecipeMaker.java b/src/main/java/forestry/factory/recipes/jei/still/StillRecipeMaker.java index 7072b0823..ea617e09e 100644 --- a/src/main/java/forestry/factory/recipes/jei/still/StillRecipeMaker.java +++ b/src/main/java/forestry/factory/recipes/jei/still/StillRecipeMaker.java @@ -13,8 +13,9 @@ public class StillRecipeMaker { public static List getStillRecipes() { List recipes = new ArrayList<>(); - for(IStillRecipe recipe : RecipeManagers.stillManager.recipes()) + for (IStillRecipe recipe : RecipeManagers.stillManager.recipes()) { recipes.add(new StillRecipeWrapper(recipe)); + } return recipes; } diff --git a/src/main/java/forestry/factory/recipes/jei/still/StillRecipeWrapper.java b/src/main/java/forestry/factory/recipes/jei/still/StillRecipeWrapper.java index a37853ed6..cef8730ac 100644 --- a/src/main/java/forestry/factory/recipes/jei/still/StillRecipeWrapper.java +++ b/src/main/java/forestry/factory/recipes/jei/still/StillRecipeWrapper.java @@ -9,7 +9,7 @@ import net.minecraftforge.fluids.FluidStack; import forestry.api.recipes.IStillRecipe; import forestry.core.recipes.jei.ForestryRecipeWrapper; -public class StillRecipeWrapper extends ForestryRecipeWrapper{ +public class StillRecipeWrapper extends ForestryRecipeWrapper { public StillRecipeWrapper(@Nonnull IStillRecipe recipe) { super(recipe); diff --git a/src/main/java/forestry/factory/tiles/TileBottler.java b/src/main/java/forestry/factory/tiles/TileBottler.java index 08280cf19..7ca70f612 100644 --- a/src/main/java/forestry/factory/tiles/TileBottler.java +++ b/src/main/java/forestry/factory/tiles/TileBottler.java @@ -20,6 +20,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; + import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; diff --git a/src/main/java/forestry/factory/tiles/TileCarpenter.java b/src/main/java/forestry/factory/tiles/TileCarpenter.java index 4f5ccf4c5..06befe4e3 100644 --- a/src/main/java/forestry/factory/tiles/TileCarpenter.java +++ b/src/main/java/forestry/factory/tiles/TileCarpenter.java @@ -20,6 +20,7 @@ import net.minecraft.inventory.InventoryCraftResult; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; + import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; diff --git a/src/main/java/forestry/factory/tiles/TileFabricator.java b/src/main/java/forestry/factory/tiles/TileFabricator.java index 050812873..81445d209 100644 --- a/src/main/java/forestry/factory/tiles/TileFabricator.java +++ b/src/main/java/forestry/factory/tiles/TileFabricator.java @@ -21,6 +21,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; + import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; diff --git a/src/main/java/forestry/factory/tiles/TileFermenter.java b/src/main/java/forestry/factory/tiles/TileFermenter.java index c521bbb7f..a9e494591 100644 --- a/src/main/java/forestry/factory/tiles/TileFermenter.java +++ b/src/main/java/forestry/factory/tiles/TileFermenter.java @@ -22,6 +22,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; + import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; diff --git a/src/main/java/forestry/factory/tiles/TileMoistener.java b/src/main/java/forestry/factory/tiles/TileMoistener.java index d5db7a081..eece3a865 100644 --- a/src/main/java/forestry/factory/tiles/TileMoistener.java +++ b/src/main/java/forestry/factory/tiles/TileMoistener.java @@ -20,6 +20,7 @@ import net.minecraft.inventory.ISidedInventory; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; + import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; diff --git a/src/main/java/forestry/factory/tiles/TileStill.java b/src/main/java/forestry/factory/tiles/TileStill.java index 4b186cedd..98a3257b9 100644 --- a/src/main/java/forestry/factory/tiles/TileStill.java +++ b/src/main/java/forestry/factory/tiles/TileStill.java @@ -16,10 +16,12 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.ISidedInventory; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumFacing; + 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; diff --git a/src/main/java/forestry/factory/triggers/TriggerLowFuel.java b/src/main/java/forestry/factory/triggers/TriggerLowFuel.java index f42408649..43e37ada5 100644 --- a/src/main/java/forestry/factory/triggers/TriggerLowFuel.java +++ b/src/main/java/forestry/factory/triggers/TriggerLowFuel.java @@ -12,6 +12,7 @@ package forestry.factory.triggers; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; + import forestry.core.tiles.TileEngine; import forestry.core.tiles.TilePowered; import forestry.core.triggers.Trigger; diff --git a/src/main/java/forestry/factory/triggers/TriggerLowResource.java b/src/main/java/forestry/factory/triggers/TriggerLowResource.java index 9a213a8b0..5ff5d57cc 100644 --- a/src/main/java/forestry/factory/triggers/TriggerLowResource.java +++ b/src/main/java/forestry/factory/triggers/TriggerLowResource.java @@ -12,6 +12,7 @@ package forestry.factory.triggers; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; + import forestry.core.tiles.TilePowered; import forestry.core.triggers.Trigger; diff --git a/src/main/java/forestry/farming/blocks/BlockFarm.java b/src/main/java/forestry/farming/blocks/BlockFarm.java index de4d42b85..1cf1ae89a 100644 --- a/src/main/java/forestry/farming/blocks/BlockFarm.java +++ b/src/main/java/forestry/farming/blocks/BlockFarm.java @@ -92,8 +92,8 @@ public class BlockFarm extends BlockStructure { @Override protected BlockState createBlockState() { - return new ExtendedBlockState(this, new IProperty[] { META }, - new IUnlistedProperty[] { UnlistedBlockPos.POS, UnlistedBlockAccess.BLOCKACCESS }); + return new ExtendedBlockState(this, new IProperty[]{META}, + new IUnlistedProperty[]{UnlistedBlockPos.POS, UnlistedBlockAccess.BLOCKACCESS}); } @Override diff --git a/src/main/java/forestry/farming/blocks/BlockMushroom.java b/src/main/java/forestry/farming/blocks/BlockMushroom.java index 9646962fb..138d5cdf1 100644 --- a/src/main/java/forestry/farming/blocks/BlockMushroom.java +++ b/src/main/java/forestry/farming/blocks/BlockMushroom.java @@ -31,10 +31,12 @@ import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; import net.minecraft.world.gen.feature.WorldGenBigMushroom; import net.minecraft.world.gen.feature.WorldGenerator; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; -import forestry.api.core.IModelManager; + import forestry.api.core.IItemModelRegister; +import forestry.api.core.IModelManager; import forestry.core.blocks.IItemTyped; import forestry.core.config.Constants; import forestry.core.utils.BlockUtil; @@ -67,7 +69,7 @@ public class BlockMushroom extends BlockBush implements IItemTyped, IItemModelRe @Override protected BlockState createBlockState() { - return new BlockState(this, new IProperty[] { MUSHROOM }); + return new BlockState(this, new IProperty[]{MUSHROOM}); } @Override diff --git a/src/main/java/forestry/farming/blocks/EnumFarmBlockType.java b/src/main/java/forestry/farming/blocks/EnumFarmBlockType.java index 8c0611c3f..ba49f8fb8 100644 --- a/src/main/java/forestry/farming/blocks/EnumFarmBlockType.java +++ b/src/main/java/forestry/farming/blocks/EnumFarmBlockType.java @@ -4,12 +4,14 @@ import java.util.Arrays; import java.util.List; import java.util.Locale; -import forestry.core.render.TextureManager; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.util.IStringSerializable; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import forestry.core.render.TextureManager; + public enum EnumFarmBlockType implements IStringSerializable { PLAIN, BAND, diff --git a/src/main/java/forestry/farming/gui/FarmLedger.java b/src/main/java/forestry/farming/gui/FarmLedger.java index cf1489985..254adb27f 100644 --- a/src/main/java/forestry/farming/gui/FarmLedger.java +++ b/src/main/java/forestry/farming/gui/FarmLedger.java @@ -14,6 +14,7 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.resources.model.IBakedModel; import net.minecraft.init.Items; import net.minecraft.item.ItemStack; + import forestry.core.gui.ledgers.Ledger; import forestry.core.gui.ledgers.LedgerManager; import forestry.core.proxy.Proxies; diff --git a/src/main/java/forestry/farming/gui/widgets/FarmLogicSlot.java b/src/main/java/forestry/farming/gui/widgets/FarmLogicSlot.java index eb6d25ae7..da36ff0fe 100644 --- a/src/main/java/forestry/farming/gui/widgets/FarmLogicSlot.java +++ b/src/main/java/forestry/farming/gui/widgets/FarmLogicSlot.java @@ -10,6 +10,9 @@ ******************************************************************************/ package forestry.farming.gui.widgets; +import net.minecraft.client.renderer.entity.RenderItem; +import net.minecraft.item.ItemStack; + import forestry.api.farming.FarmDirection; import forestry.api.farming.IFarmLogic; import forestry.core.gui.tooltips.ToolTip; @@ -17,8 +20,6 @@ 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.client.renderer.entity.RenderItem; -import net.minecraft.item.ItemStack; public class FarmLogicSlot extends Widget { diff --git a/src/main/java/forestry/farming/items/ItemBlockFarm.java b/src/main/java/forestry/farming/items/ItemBlockFarm.java index f0c6254a2..f1344fc04 100644 --- a/src/main/java/forestry/farming/items/ItemBlockFarm.java +++ b/src/main/java/forestry/farming/items/ItemBlockFarm.java @@ -12,12 +12,13 @@ package forestry.farming.items; import java.util.List; -import forestry.farming.models.EnumFarmBlockTexture; import net.minecraft.block.Block; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; +import forestry.farming.models.EnumFarmBlockTexture; + public class ItemBlockFarm extends ItemBlock { public ItemBlockFarm(Block block) { diff --git a/src/main/java/forestry/farming/logic/FarmLogic.java b/src/main/java/forestry/farming/logic/FarmLogic.java index 4a779cdd2..a399bc6c6 100755 --- a/src/main/java/forestry/farming/logic/FarmLogic.java +++ b/src/main/java/forestry/farming/logic/FarmLogic.java @@ -24,8 +24,10 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.BlockPos; import net.minecraft.util.ResourceLocation; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.farming.FarmDirection; import forestry.api.farming.IFarmHousing; import forestry.api.farming.IFarmLogic; diff --git a/src/main/java/forestry/farming/logic/FarmLogicArboreal.java b/src/main/java/forestry/farming/logic/FarmLogicArboreal.java index e7587b864..9e41a40b7 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicArboreal.java +++ b/src/main/java/forestry/farming/logic/FarmLogicArboreal.java @@ -24,8 +24,10 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.farming.FarmDirection; import forestry.api.farming.Farmables; import forestry.api.farming.ICrop; diff --git a/src/main/java/forestry/farming/logic/FarmLogicCereal.java b/src/main/java/forestry/farming/logic/FarmLogicCereal.java index aa862e31a..fc63cc1cb 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicCereal.java +++ b/src/main/java/forestry/farming/logic/FarmLogicCereal.java @@ -12,8 +12,10 @@ package forestry.farming.logic; import net.minecraft.init.Items; import net.minecraft.item.Item; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.farming.Farmables; import forestry.api.farming.IFarmHousing; diff --git a/src/main/java/forestry/farming/logic/FarmLogicCocoa.java b/src/main/java/forestry/farming/logic/FarmLogicCocoa.java index bb27664ae..7bf50f5d0 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicCocoa.java +++ b/src/main/java/forestry/farming/logic/FarmLogicCocoa.java @@ -25,8 +25,10 @@ import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.farming.FarmDirection; import forestry.api.farming.ICrop; import forestry.api.farming.IFarmHousing; diff --git a/src/main/java/forestry/farming/logic/FarmLogicEnder.java b/src/main/java/forestry/farming/logic/FarmLogicEnder.java index bff10dd5d..dc9d3f8ec 100644 --- a/src/main/java/forestry/farming/logic/FarmLogicEnder.java +++ b/src/main/java/forestry/farming/logic/FarmLogicEnder.java @@ -19,8 +19,10 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.farming.FarmDirection; import forestry.api.farming.Farmables; import forestry.api.farming.ICrop; diff --git a/src/main/java/forestry/farming/logic/FarmLogicGourd.java b/src/main/java/forestry/farming/logic/FarmLogicGourd.java index edbf55e43..0718bd2db 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicGourd.java +++ b/src/main/java/forestry/farming/logic/FarmLogicGourd.java @@ -18,8 +18,10 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.farming.FarmDirection; import forestry.api.farming.Farmables; import forestry.api.farming.ICrop; diff --git a/src/main/java/forestry/farming/logic/FarmLogicInfernal.java b/src/main/java/forestry/farming/logic/FarmLogicInfernal.java index 970e1d7ba..657dc8dbe 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicInfernal.java +++ b/src/main/java/forestry/farming/logic/FarmLogicInfernal.java @@ -19,8 +19,10 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.farming.FarmDirection; import forestry.api.farming.Farmables; import forestry.api.farming.ICrop; diff --git a/src/main/java/forestry/farming/logic/FarmLogicOrchard.java b/src/main/java/forestry/farming/logic/FarmLogicOrchard.java index e73c13bf5..a44fd8e20 100644 --- a/src/main/java/forestry/farming/logic/FarmLogicOrchard.java +++ b/src/main/java/forestry/farming/logic/FarmLogicOrchard.java @@ -26,8 +26,10 @@ import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.farming.FarmDirection; import forestry.api.farming.Farmables; import forestry.api.farming.ICrop; @@ -49,22 +51,22 @@ public class FarmLogicOrchard extends FarmLogic { this.farmables = Farmables.farmables.get("farmOrchard"); ImmutableList.Builder traversalBlocksBuilder = ImmutableList.builder(); -// if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.AGRICRAFT) || ForestryAPI.enabledPlugins.contains(ForestryPluginUids.INDUSTRIALCRAFT)) { -// traversalBlocksBuilder.add(Blocks.farmland); -// } -// if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.INDUSTRIALCRAFT)) { -// traversalBlocksBuilder.add(Blocks.dirt); -// } -// if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.PLANTMEGAPACK)) { -// traversalBlocksBuilder.add(Blocks.water); -// } -// -// { -// Block grapeVine = GameRegistry.findBlock("Growthcraft|Grapes", "grc.grapeVine1"); -// if (grapeVine != null) { -// traversalBlocksBuilder.add(grapeVine); -// } -// } + // if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.AGRICRAFT) || ForestryAPI.enabledPlugins.contains(ForestryPluginUids.INDUSTRIALCRAFT)) { + // traversalBlocksBuilder.add(Blocks.farmland); + // } + // if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.INDUSTRIALCRAFT)) { + // traversalBlocksBuilder.add(Blocks.dirt); + // } + // if (ForestryAPI.enabledPlugins.contains(ForestryPluginUids.PLANTMEGAPACK)) { + // traversalBlocksBuilder.add(Blocks.water); + // } + // + // { + // Block grapeVine = GameRegistry.findBlock("Growthcraft|Grapes", "grc.grapeVine1"); + // if (grapeVine != null) { + // traversalBlocksBuilder.add(grapeVine); + // } + // } traversalBlocksBuilder.build(); this.traversalBlocks = traversalBlocksBuilder.build(); diff --git a/src/main/java/forestry/farming/logic/FarmLogicPeat.java b/src/main/java/forestry/farming/logic/FarmLogicPeat.java index 2f37cece1..a0ad81627 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicPeat.java +++ b/src/main/java/forestry/farming/logic/FarmLogicPeat.java @@ -18,8 +18,10 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.farming.FarmDirection; import forestry.api.farming.ICrop; import forestry.api.farming.IFarmHousing; diff --git a/src/main/java/forestry/farming/logic/FarmLogicReeds.java b/src/main/java/forestry/farming/logic/FarmLogicReeds.java index fc49dbdd8..04439a3b5 100644 --- a/src/main/java/forestry/farming/logic/FarmLogicReeds.java +++ b/src/main/java/forestry/farming/logic/FarmLogicReeds.java @@ -19,8 +19,10 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.farming.FarmDirection; import forestry.api.farming.Farmables; import forestry.api.farming.ICrop; diff --git a/src/main/java/forestry/farming/logic/FarmLogicShroom.java b/src/main/java/forestry/farming/logic/FarmLogicShroom.java index c02c46508..1e5b286db 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicShroom.java +++ b/src/main/java/forestry/farming/logic/FarmLogicShroom.java @@ -16,8 +16,10 @@ import java.util.Collection; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.farming.Farmables; import forestry.api.farming.IFarmHousing; diff --git a/src/main/java/forestry/farming/logic/FarmLogicSucculent.java b/src/main/java/forestry/farming/logic/FarmLogicSucculent.java index b3328562a..ed6af9b7a 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicSucculent.java +++ b/src/main/java/forestry/farming/logic/FarmLogicSucculent.java @@ -19,8 +19,10 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.farming.FarmDirection; import forestry.api.farming.Farmables; import forestry.api.farming.ICrop; diff --git a/src/main/java/forestry/farming/logic/FarmLogicVegetable.java b/src/main/java/forestry/farming/logic/FarmLogicVegetable.java index ad4a3fd7b..c4a3d708a 100755 --- a/src/main/java/forestry/farming/logic/FarmLogicVegetable.java +++ b/src/main/java/forestry/farming/logic/FarmLogicVegetable.java @@ -12,8 +12,10 @@ package forestry.farming.logic; import net.minecraft.init.Items; import net.minecraft.item.Item; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.farming.Farmables; import forestry.api.farming.IFarmHousing; diff --git a/src/main/java/forestry/farming/logic/FarmableGenericSapling.java b/src/main/java/forestry/farming/logic/FarmableGenericSapling.java index 095b467b5..616e46714 100755 --- a/src/main/java/forestry/farming/logic/FarmableGenericSapling.java +++ b/src/main/java/forestry/farming/logic/FarmableGenericSapling.java @@ -57,7 +57,7 @@ public class FarmableGenericSapling implements IFarmable { @Override public ICrop getCropAt(World world, BlockPos pos) { Block block = BlockUtil.getBlock(world, pos); - if (!block.isWood(world,pos)) { + if (!block.isWood(world, pos)) { return null; } diff --git a/src/main/java/forestry/farming/models/EnumFarmBlockTexture.java b/src/main/java/forestry/farming/models/EnumFarmBlockTexture.java index 2ed54a063..aa68233e3 100644 --- a/src/main/java/forestry/farming/models/EnumFarmBlockTexture.java +++ b/src/main/java/forestry/farming/models/EnumFarmBlockTexture.java @@ -14,8 +14,10 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.core.render.TextureManager; public enum EnumFarmBlockTexture { @@ -44,46 +46,51 @@ public enum EnumFarmBlockTexture { public static TextureAtlasSprite getSprite(EnumFarmBlockTexture texture, int side) { TextureManager manager = TextureManager.getInstance(); switch (texture) { - case BRICK: - return manager.getSprite("minecraft", "blocks/brick"); - case BRICK_STONE: - return manager.getSprite("minecraft", "blocks/stonebrick"); - case BRICK_CHISELED: - return manager.getSprite("minecraft", "blocks/stonebrick_carved"); - case BRICK_CRACKED: - return manager.getSprite("minecraft", "blocks/stonebrick_cracked"); - case BRICK_MOSSY: - return manager.getSprite("minecraft", "blocks/stonebrick_mossy"); - case BRICK_NETHER: - return manager.getSprite("minecraft", "blocks/nether_brick"); - case SANDSTONE_CHISELED: - if (side == 0) - return manager.getSprite("minecraft", "blocks/sandstone_bottom"); - else if (side == 1) - return manager.getSprite("minecraft", "blocks/sandstone_top"); - return manager.getSprite("minecraft", "blocks/sandstone_carved"); - case SANDSTONE_SMOOTH: - if (side == 0) - return manager.getSprite("minecraft", "blocks/sandstone_bottom"); - else if (side == 1) - return manager.getSprite("minecraft", "blocks/sandstone_top"); - return manager.getSprite("minecraft", "blocks/sandstone_smooth"); - case QUARTZ: - if (side == 0) - return manager.getSprite("minecraft", "blocks/quartz_block_bottom"); - else if (side == 1) - return manager.getSprite("minecraft", "blocks/quartz_block_top"); - return manager.getSprite("minecraft", "blocks/quartz_block_side"); - case QUARTZ_CHISELED: - if (side == 0 || side == 1) - return manager.getSprite("minecraft", "blocks/quartz_block_chiseled_top"); - return manager.getSprite("minecraft", "blocks/quartz_block_chiseled"); - case QUARTZ_LINES: - if (side == 0 || side == 1) - return manager.getSprite("minecraft", "blocks/quartz_block_lines_top"); - return manager.getSprite("minecraft", "blocks/quartz_block_lines"); - default: - return null; + case BRICK: + return manager.getSprite("minecraft", "blocks/brick"); + case BRICK_STONE: + return manager.getSprite("minecraft", "blocks/stonebrick"); + case BRICK_CHISELED: + return manager.getSprite("minecraft", "blocks/stonebrick_carved"); + case BRICK_CRACKED: + return manager.getSprite("minecraft", "blocks/stonebrick_cracked"); + case BRICK_MOSSY: + return manager.getSprite("minecraft", "blocks/stonebrick_mossy"); + case BRICK_NETHER: + return manager.getSprite("minecraft", "blocks/nether_brick"); + case SANDSTONE_CHISELED: + if (side == 0) { + return manager.getSprite("minecraft", "blocks/sandstone_bottom"); + } else if (side == 1) { + return manager.getSprite("minecraft", "blocks/sandstone_top"); + } + return manager.getSprite("minecraft", "blocks/sandstone_carved"); + case SANDSTONE_SMOOTH: + if (side == 0) { + return manager.getSprite("minecraft", "blocks/sandstone_bottom"); + } else if (side == 1) { + return manager.getSprite("minecraft", "blocks/sandstone_top"); + } + return manager.getSprite("minecraft", "blocks/sandstone_smooth"); + case QUARTZ: + if (side == 0) { + return manager.getSprite("minecraft", "blocks/quartz_block_bottom"); + } else if (side == 1) { + return manager.getSprite("minecraft", "blocks/quartz_block_top"); + } + return manager.getSprite("minecraft", "blocks/quartz_block_side"); + case QUARTZ_CHISELED: + if (side == 0 || side == 1) { + return manager.getSprite("minecraft", "blocks/quartz_block_chiseled_top"); + } + return manager.getSprite("minecraft", "blocks/quartz_block_chiseled"); + case QUARTZ_LINES: + if (side == 0 || side == 1) { + return manager.getSprite("minecraft", "blocks/quartz_block_lines_top"); + } + return manager.getSprite("minecraft", "blocks/quartz_block_lines"); + default: + return null; } } diff --git a/src/main/java/forestry/farming/multiblock/InventoryFarm.java b/src/main/java/forestry/farming/multiblock/InventoryFarm.java index 1ed6895e0..505757c01 100644 --- a/src/main/java/forestry/farming/multiblock/InventoryFarm.java +++ b/src/main/java/forestry/farming/multiblock/InventoryFarm.java @@ -18,6 +18,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; + import net.minecraftforge.fluids.Fluid; import forestry.api.farming.FarmDirection; diff --git a/src/main/java/forestry/farming/proxy/ProxyFarmingClient.java b/src/main/java/forestry/farming/proxy/ProxyFarmingClient.java index b080dd8cf..387a62b29 100644 --- a/src/main/java/forestry/farming/proxy/ProxyFarmingClient.java +++ b/src/main/java/forestry/farming/proxy/ProxyFarmingClient.java @@ -11,6 +11,7 @@ package forestry.farming.proxy; import net.minecraft.client.resources.model.ModelResourceLocation; + import forestry.core.models.BlockModelIndex; import forestry.core.proxy.Proxies; import forestry.farming.models.ModelFarmBlock; diff --git a/src/main/java/forestry/farming/tiles/TileFarm.java b/src/main/java/forestry/farming/tiles/TileFarm.java index e7a3dd0c4..b0126f9d2 100644 --- a/src/main/java/forestry/farming/tiles/TileFarm.java +++ b/src/main/java/forestry/farming/tiles/TileFarm.java @@ -17,6 +17,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.BlockPos; + import forestry.api.circuits.ICircuitSocketType; import forestry.api.core.IErrorLogic; import forestry.api.core.IErrorLogicSource; diff --git a/src/main/java/forestry/farming/tiles/TileFarmControl.java b/src/main/java/forestry/farming/tiles/TileFarmControl.java index 34b46f86d..611ea7549 100644 --- a/src/main/java/forestry/farming/tiles/TileFarmControl.java +++ b/src/main/java/forestry/farming/tiles/TileFarmControl.java @@ -50,7 +50,7 @@ public class TileFarmControl extends TileFarm implements IFarmComponent.Listener EnumFacing dir = direction.getOpposite(); World world = tile.getWorld(); - return world.getRedstonePower(side, dir) > 0 || world.getStrongPower(side,dir) > 0; + return world.getRedstonePower(side, dir) > 0 || world.getStrongPower(side, dir) > 0; } } diff --git a/src/main/java/forestry/farming/tiles/TileFarmHatch.java b/src/main/java/forestry/farming/tiles/TileFarmHatch.java index 02c31c2d4..ccdaab558 100644 --- a/src/main/java/forestry/farming/tiles/TileFarmHatch.java +++ b/src/main/java/forestry/farming/tiles/TileFarmHatch.java @@ -17,7 +17,9 @@ import net.minecraft.inventory.IInventory; import net.minecraft.inventory.ISidedInventory; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; + import net.minecraftforge.fml.common.Optional; + import forestry.api.multiblock.IFarmComponent; import forestry.core.inventory.AdjacentInventoryCache; import forestry.core.tiles.AdjacentTileCache; diff --git a/src/main/java/forestry/farming/tiles/TileFarmPlain.java b/src/main/java/forestry/farming/tiles/TileFarmPlain.java index b9a7e2962..f99d5b7b6 100644 --- a/src/main/java/forestry/farming/tiles/TileFarmPlain.java +++ b/src/main/java/forestry/farming/tiles/TileFarmPlain.java @@ -10,9 +10,10 @@ ******************************************************************************/ package forestry.farming.tiles; -import forestry.api.multiblock.IMultiblockController; import net.minecraft.util.BlockPos; +import forestry.api.multiblock.IMultiblockController; + public class TileFarmPlain extends TileFarm { @Override public void onMachineAssembled(IMultiblockController multiblockController, BlockPos minCoord, BlockPos maxCoord) { diff --git a/src/main/java/forestry/farming/tiles/TileFarmValve.java b/src/main/java/forestry/farming/tiles/TileFarmValve.java index ced1c1a44..53760313e 100644 --- a/src/main/java/forestry/farming/tiles/TileFarmValve.java +++ b/src/main/java/forestry/farming/tiles/TileFarmValve.java @@ -11,6 +11,7 @@ package forestry.farming.tiles; import net.minecraft.util.EnumFacing; + import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; diff --git a/src/main/java/forestry/farming/triggers/TriggerLowFertilizer.java b/src/main/java/forestry/farming/triggers/TriggerLowFertilizer.java index 6a44a3973..fe1075090 100755 --- a/src/main/java/forestry/farming/triggers/TriggerLowFertilizer.java +++ b/src/main/java/forestry/farming/triggers/TriggerLowFertilizer.java @@ -13,6 +13,7 @@ package forestry.farming.triggers; import net.minecraft.inventory.IInventory; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; + import forestry.core.triggers.Trigger; import forestry.core.utils.InventoryUtil; import forestry.farming.tiles.TileFarmHatch; diff --git a/src/main/java/forestry/farming/triggers/TriggerLowGermlings.java b/src/main/java/forestry/farming/triggers/TriggerLowGermlings.java index 3dd406802..b18d3622f 100644 --- a/src/main/java/forestry/farming/triggers/TriggerLowGermlings.java +++ b/src/main/java/forestry/farming/triggers/TriggerLowGermlings.java @@ -13,6 +13,7 @@ package forestry.farming.triggers; import net.minecraft.inventory.IInventory; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; + import forestry.core.triggers.Trigger; import forestry.core.utils.InventoryUtil; import forestry.farming.tiles.TileFarmHatch; diff --git a/src/main/java/forestry/farming/triggers/TriggerLowLiquid.java b/src/main/java/forestry/farming/triggers/TriggerLowLiquid.java index 0d3e48df8..c726a1f23 100755 --- a/src/main/java/forestry/farming/triggers/TriggerLowLiquid.java +++ b/src/main/java/forestry/farming/triggers/TriggerLowLiquid.java @@ -12,6 +12,7 @@ package forestry.farming.triggers; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; + import net.minecraftforge.fluids.IFluidTank; import forestry.core.fluids.ITankManager; diff --git a/src/main/java/forestry/farming/triggers/TriggerLowSoil.java b/src/main/java/forestry/farming/triggers/TriggerLowSoil.java index 18699eb53..c269944d3 100755 --- a/src/main/java/forestry/farming/triggers/TriggerLowSoil.java +++ b/src/main/java/forestry/farming/triggers/TriggerLowSoil.java @@ -14,6 +14,7 @@ import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; + import forestry.api.farming.IFarmInventory; import forestry.api.multiblock.IFarmController; import forestry.core.triggers.Trigger; diff --git a/src/main/java/forestry/food/items/EnumBeverage.java b/src/main/java/forestry/food/items/EnumBeverage.java index 214134bf7..5ba17cd9c 100644 --- a/src/main/java/forestry/food/items/EnumBeverage.java +++ b/src/main/java/forestry/food/items/EnumBeverage.java @@ -12,11 +12,13 @@ package forestry.food.items; import java.awt.Color; -import forestry.api.core.IModelManager; import net.minecraft.item.Item; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import forestry.api.core.IModelManager; + 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); diff --git a/src/main/java/forestry/food/items/ItemBeverage.java b/src/main/java/forestry/food/items/ItemBeverage.java index 13b2ddcc4..79e3a6a9d 100755 --- a/src/main/java/forestry/food/items/ItemBeverage.java +++ b/src/main/java/forestry/food/items/ItemBeverage.java @@ -18,8 +18,10 @@ import net.minecraft.item.EnumAction; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.core.IModelManager; import forestry.api.food.IBeverageEffect; import forestry.core.config.Config; diff --git a/src/main/java/forestry/lepidopterology/entities/AIButterflyRest.java b/src/main/java/forestry/lepidopterology/entities/AIButterflyRest.java index 41cc0d180..dc3274cf1 100755 --- a/src/main/java/forestry/lepidopterology/entities/AIButterflyRest.java +++ b/src/main/java/forestry/lepidopterology/entities/AIButterflyRest.java @@ -17,6 +17,7 @@ import net.minecraft.block.BlockWall; import net.minecraft.block.IGrowable; import net.minecraft.block.material.Material; import net.minecraft.util.BlockPos; + import net.minecraftforge.common.IPlantable; public class AIButterflyRest extends AIButterflyBase { diff --git a/src/main/java/forestry/lepidopterology/entities/EntityButterfly.java b/src/main/java/forestry/lepidopterology/entities/EntityButterfly.java index e71eb43cf..d5d546a78 100755 --- a/src/main/java/forestry/lepidopterology/entities/EntityButterfly.java +++ b/src/main/java/forestry/lepidopterology/entities/EntityButterfly.java @@ -36,6 +36,7 @@ import net.minecraft.world.chunk.Chunk; import net.minecraftforge.common.IPlantable; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.arboriculture.EnumGermlingType; import forestry.api.arboriculture.TreeManager; import forestry.api.core.IToolScoop; diff --git a/src/main/java/forestry/lepidopterology/genetics/AlleleButterflySpecies.java b/src/main/java/forestry/lepidopterology/genetics/AlleleButterflySpecies.java index d7ffffb44..6d45d005a 100755 --- a/src/main/java/forestry/lepidopterology/genetics/AlleleButterflySpecies.java +++ b/src/main/java/forestry/lepidopterology/genetics/AlleleButterflySpecies.java @@ -24,6 +24,7 @@ import net.minecraft.world.World; import com.mojang.authlib.GameProfile; import net.minecraftforge.common.BiomeDictionary; + import forestry.api.core.IModelProvider; import forestry.api.core.ISpriteProvider; import forestry.api.genetics.IClassification; diff --git a/src/main/java/forestry/lepidopterology/items/ItemButterflyGE.java b/src/main/java/forestry/lepidopterology/items/ItemButterflyGE.java index 35f40b59d..aa4d4ebb0 100755 --- a/src/main/java/forestry/lepidopterology/items/ItemButterflyGE.java +++ b/src/main/java/forestry/lepidopterology/items/ItemButterflyGE.java @@ -22,8 +22,10 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.BlockPos; import net.minecraft.util.EnumFacing; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.core.IModelManager; import forestry.api.core.Tabs; import forestry.api.genetics.AlleleManager; @@ -169,14 +171,14 @@ public class ItemButterflyGE extends ItemGE { @Override public void registerModel(Item item, IModelManager manager) { switch (this.type) { - case CATERPILLAR: - manager.registerItemModel(item, 0, "caterpillar"); - break; - case BUTTERFLY: - manager.registerItemModel(item, 0, "butterflyGE"); - break; - default: - manager.registerItemModel(item, 0, "liquids/jar"); + case CATERPILLAR: + manager.registerItemModel(item, 0, "caterpillar"); + break; + case BUTTERFLY: + manager.registerItemModel(item, 0, "butterflyGE"); + break; + default: + manager.registerItemModel(item, 0, "liquids/jar"); } } diff --git a/src/main/java/forestry/lepidopterology/recipes/MatingRecipe.java b/src/main/java/forestry/lepidopterology/recipes/MatingRecipe.java index e5552790d..4fcaec44e 100644 --- a/src/main/java/forestry/lepidopterology/recipes/MatingRecipe.java +++ b/src/main/java/forestry/lepidopterology/recipes/MatingRecipe.java @@ -84,14 +84,13 @@ public class MatingRecipe implements IRecipe { @Override public ItemStack[] getRemainingItems(InventoryCrafting inv) { - ItemStack[] aitemstack = new ItemStack[inv.getSizeInventory()]; + ItemStack[] aitemstack = new ItemStack[inv.getSizeInventory()]; - for (int i = 0; i < aitemstack.length; ++i) - { - ItemStack itemstack = inv.getStackInSlot(i); - aitemstack[i] = net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack); - } - return aitemstack; + for (int i = 0; i < aitemstack.length; ++i) { + ItemStack itemstack = inv.getStackInSlot(i); + aitemstack[i] = net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack); + } + return aitemstack; } } diff --git a/src/main/java/forestry/lepidopterology/render/ModelButterflyItem.java b/src/main/java/forestry/lepidopterology/render/ModelButterflyItem.java index b4b78ef1e..84a4ff5ed 100644 --- a/src/main/java/forestry/lepidopterology/render/ModelButterflyItem.java +++ b/src/main/java/forestry/lepidopterology/render/ModelButterflyItem.java @@ -83,7 +83,7 @@ public class ModelButterflyItem implements ISmartItemModel { @Override public IBakedModel handleItemState(ItemStack item) { - if(modelButterfly == null){ + if (modelButterfly == null) { try { modelButterfly = (IRetexturableModel) ModelLoaderRegistry.getModel(location); } catch (IOException e) { @@ -107,7 +107,7 @@ public class ModelButterflyItem implements ISmartItemModel { textures.put("#ButterflyGE", butterfly.getGenome().getSecondary().getEntityTexture().replace(".png", "").replace("textures/", "")); textures.put("Butterfly2texture", butterfly.getGenome().getSecondary().getEntityTexture().replace(".png", "").replace("textures/", "")); modelButterfly = (IRetexturableModel) modelButterfly.retexture(textures.build()); - return new TRSRBakedModel(modelButterfly.bake(ModelRotation.X0_Y0, DefaultVertexFormats.ITEM, textureGetter), -0.5F, -1.5F, 1.5F, 0, (float)Math.PI * 2, 0, 1F); + return new TRSRBakedModel(modelButterfly.bake(ModelRotation.X0_Y0, DefaultVertexFormats.ITEM, textureGetter), -0.5F, -1.5F, 1.5F, 0, (float) Math.PI * 2, 0, 1F); } public static float getIrregularWingYaw(long flapping, float flap) { diff --git a/src/main/java/forestry/lepidopterology/render/TextureAtlasButterfly.java b/src/main/java/forestry/lepidopterology/render/TextureAtlasButterfly.java index 9d07e9907..c36fba434 100644 --- a/src/main/java/forestry/lepidopterology/render/TextureAtlasButterfly.java +++ b/src/main/java/forestry/lepidopterology/render/TextureAtlasButterfly.java @@ -10,14 +10,15 @@ ******************************************************************************/ package forestry.lepidopterology.render; +import com.google.common.collect.Lists; + import java.awt.image.BufferedImage; import java.io.IOException; -import com.google.common.collect.Lists; import net.minecraft.client.renderer.texture.TextureAtlasSprite; import net.minecraft.client.resources.data.AnimationMetadataSection; -public class TextureAtlasButterfly extends TextureAtlasSprite{ +public class TextureAtlasButterfly extends TextureAtlasSprite { public TextureAtlasButterfly(String spriteName) { super(spriteName); @@ -25,41 +26,37 @@ public class TextureAtlasButterfly extends TextureAtlasSprite{ @Override public void loadSprite(BufferedImage[] images, AnimationMetadataSection meta) throws IOException { - this.resetSprite(); - int i = images[0].getWidth(); - int j = images[0].getHeight(); - this.width = i; - this.height = j; - int[][] aint = new int[images.length][]; + this.resetSprite(); + int i = images[0].getWidth(); + int j = images[0].getHeight(); + this.width = i; + this.height = j; + int[][] aint = new int[images.length][]; - for (int k = 0; k < images.length; ++k) - { - BufferedImage bufferedimage = images[k]; + for (int k = 0; k < images.length; ++k) { + BufferedImage bufferedimage = images[k]; - if (bufferedimage != null) - { - if (k > 0 && (bufferedimage.getWidth() != i >> k || bufferedimage.getHeight() != j >> k)) - { - throw new RuntimeException(String.format("Unable to load miplevel: %d, image is size: %dx%d, expected %dx%d", new Object[] {Integer.valueOf(k), Integer.valueOf(bufferedimage.getWidth()), Integer.valueOf(bufferedimage.getHeight()), Integer.valueOf(i >> k), Integer.valueOf(j >> k)})); - } + if (bufferedimage != null) { + if (k > 0 && (bufferedimage.getWidth() != i >> k || bufferedimage.getHeight() != j >> k)) { + throw new RuntimeException(String.format("Unable to load miplevel: %d, image is size: %dx%d, expected %dx%d", new Object[]{Integer.valueOf(k), Integer.valueOf(bufferedimage.getWidth()), Integer.valueOf(bufferedimage.getHeight()), Integer.valueOf(i >> k), Integer.valueOf(j >> k)})); + } - aint[k] = new int[bufferedimage.getWidth() * bufferedimage.getHeight()]; - bufferedimage.getRGB(0, 0, bufferedimage.getWidth(), bufferedimage.getHeight(), aint[k], 0, bufferedimage.getWidth()); - } - } - this.framesTextureData.add(aint); + aint[k] = new int[bufferedimage.getWidth() * bufferedimage.getHeight()]; + bufferedimage.getRGB(0, 0, bufferedimage.getWidth(), bufferedimage.getHeight(), aint[k], 0, bufferedimage.getWidth()); + } + } + this.framesTextureData.add(aint); } - private void resetSprite() - { - this.setFramesTextureData(Lists.newArrayList()); - this.frameCounter = 0; - this.tickCounter = 0; - } - - @Override - public boolean hasAnimationMetadata() { - return false; - } + private void resetSprite() { + this.setFramesTextureData(Lists.newArrayList()); + this.frameCounter = 0; + this.tickCounter = 0; + } + + @Override + public boolean hasAnimationMetadata() { + return false; + } } diff --git a/src/main/java/forestry/mail/EventHandlerMailAlert.java b/src/main/java/forestry/mail/EventHandlerMailAlert.java index 80d74c480..1144284fb 100644 --- a/src/main/java/forestry/mail/EventHandlerMailAlert.java +++ b/src/main/java/forestry/mail/EventHandlerMailAlert.java @@ -12,10 +12,12 @@ package forestry.mail; import net.minecraft.client.Minecraft; import net.minecraft.entity.player.EntityPlayer; + import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.PlayerEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; import net.minecraftforge.fml.common.gameevent.TickEvent.Phase; + import forestry.core.proxy.Proxies; import forestry.mail.gui.GuiMailboxInfo; import forestry.mail.network.packets.PacketPOBoxInfoUpdate; diff --git a/src/main/java/forestry/mail/Letter.java b/src/main/java/forestry/mail/Letter.java index 232655487..9f57f77d0 100755 --- a/src/main/java/forestry/mail/Letter.java +++ b/src/main/java/forestry/mail/Letter.java @@ -18,6 +18,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.IChatComponent; + import forestry.api.mail.ILetter; import forestry.api.mail.IMailAddress; import forestry.api.mail.IStamps; diff --git a/src/main/java/forestry/mail/LetterProperties.java b/src/main/java/forestry/mail/LetterProperties.java index b197a0536..484c39627 100644 --- a/src/main/java/forestry/mail/LetterProperties.java +++ b/src/main/java/forestry/mail/LetterProperties.java @@ -18,8 +18,10 @@ import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.core.IModelManager; import forestry.api.mail.ILetter; import forestry.plugins.PluginMail; diff --git a/src/main/java/forestry/mail/PostalCarrier.java b/src/main/java/forestry/mail/PostalCarrier.java index fdb48374b..67023797f 100755 --- a/src/main/java/forestry/mail/PostalCarrier.java +++ b/src/main/java/forestry/mail/PostalCarrier.java @@ -15,8 +15,10 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.ItemStack; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.mail.EnumAddressee; import forestry.api.mail.IMailAddress; import forestry.api.mail.IPostOffice; diff --git a/src/main/java/forestry/mail/inventory/InventoryTradeStation.java b/src/main/java/forestry/mail/inventory/InventoryTradeStation.java index 95c0eb8dc..56d311960 100644 --- a/src/main/java/forestry/mail/inventory/InventoryTradeStation.java +++ b/src/main/java/forestry/mail/inventory/InventoryTradeStation.java @@ -16,6 +16,7 @@ import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumFacing; + import forestry.api.mail.IStamps; import forestry.core.inventory.InventoryAdapter; import forestry.core.utils.ItemStackUtil; diff --git a/src/main/java/forestry/mail/items/ItemLetter.java b/src/main/java/forestry/mail/items/ItemLetter.java index 7faedf798..22b2796d8 100755 --- a/src/main/java/forestry/mail/items/ItemLetter.java +++ b/src/main/java/forestry/mail/items/ItemLetter.java @@ -19,8 +19,10 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.ChatComponentTranslation; import net.minecraft.world.World; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.core.IModelManager; import forestry.api.mail.ILetter; import forestry.core.items.ItemWithGui; diff --git a/src/main/java/forestry/mail/triggers/TriggerBuffer.java b/src/main/java/forestry/mail/triggers/TriggerBuffer.java index 59d336bfd..6e149c5db 100755 --- a/src/main/java/forestry/mail/triggers/TriggerBuffer.java +++ b/src/main/java/forestry/mail/triggers/TriggerBuffer.java @@ -12,6 +12,7 @@ package forestry.mail.triggers; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; + import forestry.core.triggers.Trigger; import forestry.mail.tiles.TileTrader; diff --git a/src/main/java/forestry/mail/triggers/TriggerHasMail.java b/src/main/java/forestry/mail/triggers/TriggerHasMail.java index f4b794874..c1e5186d1 100755 --- a/src/main/java/forestry/mail/triggers/TriggerHasMail.java +++ b/src/main/java/forestry/mail/triggers/TriggerHasMail.java @@ -12,6 +12,7 @@ package forestry.mail.triggers; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; + import forestry.core.triggers.Trigger; import forestry.mail.tiles.IMailContainer; diff --git a/src/main/java/forestry/mail/triggers/TriggerLowInput.java b/src/main/java/forestry/mail/triggers/TriggerLowInput.java index 4f7a0290a..b185dea60 100755 --- a/src/main/java/forestry/mail/triggers/TriggerLowInput.java +++ b/src/main/java/forestry/mail/triggers/TriggerLowInput.java @@ -12,6 +12,7 @@ package forestry.mail.triggers; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; + import forestry.core.triggers.Trigger; import forestry.mail.tiles.TileTrader; diff --git a/src/main/java/forestry/mail/triggers/TriggerLowPaper.java b/src/main/java/forestry/mail/triggers/TriggerLowPaper.java index 43e662496..665186949 100755 --- a/src/main/java/forestry/mail/triggers/TriggerLowPaper.java +++ b/src/main/java/forestry/mail/triggers/TriggerLowPaper.java @@ -12,6 +12,7 @@ package forestry.mail.triggers; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; + import forestry.core.triggers.Trigger; import forestry.mail.tiles.TileTrader; diff --git a/src/main/java/forestry/mail/triggers/TriggerLowStamps.java b/src/main/java/forestry/mail/triggers/TriggerLowStamps.java index e59e9eca3..22c6b1bbf 100755 --- a/src/main/java/forestry/mail/triggers/TriggerLowStamps.java +++ b/src/main/java/forestry/mail/triggers/TriggerLowStamps.java @@ -12,6 +12,7 @@ package forestry.mail.triggers; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; + import forestry.core.triggers.Trigger; import forestry.mail.tiles.TileTrader; diff --git a/src/main/java/forestry/plugins/PluginFactory.java b/src/main/java/forestry/plugins/PluginFactory.java index 7fc6e8d24..f8c9f421e 100644 --- a/src/main/java/forestry/plugins/PluginFactory.java +++ b/src/main/java/forestry/plugins/PluginFactory.java @@ -287,10 +287,10 @@ public class PluginFactory extends BlankForestryPlugin { 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.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.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(50, Fluids.SEEDOIL.getFluid(250), null, PluginCore.items.impregnatedCasing.getItemStack(), diff --git a/src/main/java/forestry/plugins/PluginFluids.java b/src/main/java/forestry/plugins/PluginFluids.java index d0a7a6876..e057184db 100644 --- a/src/main/java/forestry/plugins/PluginFluids.java +++ b/src/main/java/forestry/plugins/PluginFluids.java @@ -56,7 +56,7 @@ public class PluginFluids extends BlankForestryPlugin { if (forestryFluid.getFluid() == null && Config.isFluidEnabled(forestryFluid)) { String fluidName = forestryFluid.getTag(); if (!FluidRegistry.isFluidRegistered(fluidName)) { - Fluid fluid = new Fluid(fluidName, + Fluid fluid = new Fluid(fluidName, forestryFluid.getResources()[0], forestryFluid.flowTextureExists() ? forestryFluid.getResources()[1] : forestryFluid.getResources()[0]).setDensity(forestryFluid.getDensity()).setViscosity(forestryFluid.getViscosity()).setTemperature(forestryFluid.getTemperature()); FluidRegistry.registerFluid(fluid); diff --git a/src/main/java/forestry/plugins/compat/PluginBiomesOPlenty.java b/src/main/java/forestry/plugins/compat/PluginBiomesOPlenty.java index c6b542007..966207468 100644 --- a/src/main/java/forestry/plugins/compat/PluginBiomesOPlenty.java +++ b/src/main/java/forestry/plugins/compat/PluginBiomesOPlenty.java @@ -146,7 +146,7 @@ public class PluginBiomesOPlenty extends BlankForestryPlugin { 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)); } } @@ -162,35 +162,35 @@ public class PluginBiomesOPlenty extends BlankForestryPlugin { private static void addFlowers() { Block flowers = GameRegistry.findBlock(BoP, "flowers"); if (flowers != null) { - FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 0, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //Clover - FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 1, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow, FlowerManager.FlowerTypeMushrooms); //Swampflower -// FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 2, 1.0, FlowerManager.FlowerTypeNether); //Deathbloom - FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 3, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //GlowFlower - FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 4, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //Blue Hydrangea - FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 5, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow, FlowerManager.FlowerTypeJungle); //Orange Cosmos - FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 6, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //Pink Daffodil - FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 7, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //WildFlower - FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 8, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //Violet - FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 9, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); // White Anemone - FlowerManager.flowerRegistry.registerPlantableFlower(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, 15, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); // Dandelion Puff + FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 0, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //Clover + FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 1, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow, FlowerManager.FlowerTypeMushrooms); //Swampflower + // FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 2, 1.0, FlowerManager.FlowerTypeNether); //Deathbloom + FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 3, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //GlowFlower + FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 4, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //Blue Hydrangea + FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 5, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow, FlowerManager.FlowerTypeJungle); //Orange Cosmos + FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 6, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //Pink Daffodil + FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 7, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //WildFlower + FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 8, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //Violet + FlowerManager.flowerRegistry.registerPlantableFlower(flowers, 9, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); // White Anemone + FlowerManager.flowerRegistry.registerPlantableFlower(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, 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 - 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, 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, 7, 1.0, FlowerManager.FlowerTypeVanilla, FlowerManager.FlowerTypeSnow); //Icy Iris - FlowerManager.flowerRegistry.registerPlantableFlower(flowers2, 8, 1.0, FlowerManager.FlowerTypeVanilla); // Rose + 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 cactus Block mushrooms = GameRegistry.findBlock(BoP, "mushrooms"); diff --git a/src/main/java/forestry/storage/CrateRegistry.java b/src/main/java/forestry/storage/CrateRegistry.java index 733e521cf..c43a2676f 100644 --- a/src/main/java/forestry/storage/CrateRegistry.java +++ b/src/main/java/forestry/storage/CrateRegistry.java @@ -14,7 +14,9 @@ import net.minecraft.block.Block; import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; + import net.minecraftforge.fml.common.registry.GameRegistry; + import forestry.api.storage.ICrateRegistry; import forestry.core.items.ItemCrated; import forestry.core.models.ModelCrate; @@ -40,7 +42,7 @@ public class CrateRegistry implements ICrateRegistry { ItemCrated crate = new ItemCrated(stack, useOreDict); crate.setUnlocalizedName(uid); GameRegistry.registerItem(crate, StringUtil.cleanItemName(crate)); - Proxies.render.registerModel(new ModelIndex(new ModelResourceLocation("forestry:crate-filled", StringUtil.cleanItemName(crate)), new ModelCrate())); + Proxies.render.registerModel(new ModelIndex(new ModelResourceLocation("forestry:crate-filled", StringUtil.cleanItemName(crate)), new ModelCrate())); PluginStorage.registerCrate(crate); } diff --git a/src/main/java/forestry/storage/ResupplyHandler.java b/src/main/java/forestry/storage/ResupplyHandler.java index da842d46f..420086e43 100755 --- a/src/main/java/forestry/storage/ResupplyHandler.java +++ b/src/main/java/forestry/storage/ResupplyHandler.java @@ -20,6 +20,7 @@ import net.minecraft.item.ItemStack; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.eventhandler.Event; + import forestry.api.storage.BackpackResupplyEvent; import forestry.core.IResupplyHandler; import forestry.core.inventory.ItemInventory; diff --git a/src/main/java/forestry/storage/items/ItemBackpack.java b/src/main/java/forestry/storage/items/ItemBackpack.java index 0bad7f7b1..a490481bc 100755 --- a/src/main/java/forestry/storage/items/ItemBackpack.java +++ b/src/main/java/forestry/storage/items/ItemBackpack.java @@ -29,6 +29,7 @@ import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.common.eventhandler.Event; import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.core.IModelManager; import forestry.api.storage.BackpackStowEvent; import forestry.api.storage.EnumBackpackType;