diff --git a/src/main/java/forestry/api/apiculture/IBee.java b/src/main/java/forestry/api/apiculture/IBee.java index ba70aa041..c5e119302 100644 --- a/src/main/java/forestry/api/apiculture/IBee.java +++ b/src/main/java/forestry/api/apiculture/IBee.java @@ -9,18 +9,20 @@ import javax.annotation.Nullable; import java.util.List; import java.util.Set; -import forestry.api.core.IErrorState; -import forestry.api.genetics.IEffectData; -import forestry.api.genetics.IIndividual; -import forestry.api.genetics.IIndividualLiving; import net.minecraft.block.state.IBlockState; import net.minecraft.item.ItemStack; import net.minecraft.util.NonNullList; import net.minecraft.util.math.BlockPos; import net.minecraft.world.biome.Biome; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import forestry.api.core.IErrorState; +import forestry.api.genetics.IEffectData; +import forestry.api.genetics.IIndividual; +import forestry.api.genetics.IIndividualLiving; + /** * Other implementations than Forestry's default one are not supported. * @@ -95,7 +97,8 @@ public interface IBee extends IIndividualLiving { /** * Plants a random flower from the given list near the housing - * @param housing the location the bee is living + * + * @param housing the location the bee is living * @param potentialFlowers the flowers to choose from * @return the position of the planted flower, or null of none were planted * @since Forestry 5.5.4 diff --git a/src/main/java/forestry/api/apiculture/IBeekeepingLogic.java b/src/main/java/forestry/api/apiculture/IBeekeepingLogic.java index b8cf860f8..8a1983236 100644 --- a/src/main/java/forestry/api/apiculture/IBeekeepingLogic.java +++ b/src/main/java/forestry/api/apiculture/IBeekeepingLogic.java @@ -8,16 +8,18 @@ package forestry.api.apiculture; import java.io.IOException; import java.util.List; -import forestry.api.core.INbtReadable; -import forestry.api.core.INbtWritable; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.PacketBuffer; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.math.BlockPos; + import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.SideOnly; +import forestry.api.core.INbtReadable; +import forestry.api.core.INbtWritable; + /** * Stores beekeeping logic for bee housings. * Get one with BeeManager.beeRoot.createBeekeepingLogic(IBeeHousing housing) diff --git a/src/main/java/forestry/api/genetics/IFlowerGrowthHelper.java b/src/main/java/forestry/api/genetics/IFlowerGrowthHelper.java index 4ce74b564..393ee757b 100644 --- a/src/main/java/forestry/api/genetics/IFlowerGrowthHelper.java +++ b/src/main/java/forestry/api/genetics/IFlowerGrowthHelper.java @@ -23,9 +23,10 @@ public interface IFlowerGrowthHelper { /** * Plants a random flower from flowerType at the specified position. - * @param flowerType the flower type that can be planted - * @param world the world to plant flowers in - * @param pos the position to plant the flowers + * + * @param flowerType the flower type that can be planted + * @param world the world to plant flowers in + * @param pos the position to plant the flowers * @param potentialFlowers the potential flowers that can be planted * @return true if a flower was planted, false otherwise * @since Forestry 5.5.4 diff --git a/src/main/java/forestry/api/genetics/IFlowerRegistry.java b/src/main/java/forestry/api/genetics/IFlowerRegistry.java index 5fd133285..4cbdb4c36 100644 --- a/src/main/java/forestry/api/genetics/IFlowerRegistry.java +++ b/src/main/java/forestry/api/genetics/IFlowerRegistry.java @@ -9,14 +9,15 @@ import java.util.Collection; import java.util.Iterator; import java.util.List; -import forestry.api.apiculture.IBee; -import forestry.api.apiculture.IBeeHousing; -import forestry.api.core.IBlockPosPredicate; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import forestry.api.apiculture.IBee; +import forestry.api.apiculture.IBeeHousing; +import forestry.api.core.IBlockPosPredicate; + // See {@link forestry.api.apiculture.FlowerManager}.FlowerType___ for basic Forestry flower types. // Each IFlowerProvider has one flower type, and multiple IFlowerProviders may share one type. // "Acceptable flowers" allow nearby bees to do work. @@ -101,6 +102,7 @@ public interface IFlowerRegistry { /** * Calls the appropriate IFlowerGrowthRule to grow a flower at a specified position. + * * @deprecated since Forestry 5.5.4. Use {@link #growFlower(String, World, IIndividual, BlockPos, Collection)} */ @Deprecated diff --git a/src/main/java/forestry/apiculture/BeekeepingLogic.java b/src/main/java/forestry/apiculture/BeekeepingLogic.java index a679e05da..0f16e1a92 100644 --- a/src/main/java/forestry/apiculture/BeekeepingLogic.java +++ b/src/main/java/forestry/apiculture/BeekeepingLogic.java @@ -10,6 +10,8 @@ ******************************************************************************/ package forestry.apiculture; +import com.google.common.base.Preconditions; + import javax.annotation.Nullable; import java.io.IOException; import java.util.ArrayList; @@ -19,7 +21,21 @@ import java.util.List; import java.util.Set; import java.util.Stack; -import com.google.common.base.Preconditions; +import net.minecraft.block.state.IBlockState; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.Entity; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.PacketBuffer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.util.math.BlockPos; +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.IApiaristTracker; @@ -40,19 +56,6 @@ import forestry.core.config.Constants; import forestry.core.errors.EnumErrorCode; import forestry.core.utils.Log; import forestry.core.utils.NetworkUtil; -import net.minecraft.block.state.IBlockState; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.Entity; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.network.PacketBuffer; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; public class BeekeepingLogic implements IBeekeepingLogic { diff --git a/src/main/java/forestry/apiculture/HasFlowersCache.java b/src/main/java/forestry/apiculture/HasFlowersCache.java index c46c45db2..da9caf778 100644 --- a/src/main/java/forestry/apiculture/HasFlowersCache.java +++ b/src/main/java/forestry/apiculture/HasFlowersCache.java @@ -17,15 +17,6 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; -import forestry.api.apiculture.FlowerManager; -import forestry.api.apiculture.IBee; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeHousing; -import forestry.api.core.INbtReadable; -import forestry.api.core.INbtWritable; -import forestry.api.core.IBlockPosPredicate; -import forestry.api.genetics.IFlowerProvider; -import forestry.core.utils.TickHelper; import net.minecraft.block.state.IBlockState; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.network.PacketBuffer; @@ -33,6 +24,16 @@ import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Vec3i; import net.minecraft.world.World; +import forestry.api.apiculture.FlowerManager; +import forestry.api.apiculture.IBee; +import forestry.api.apiculture.IBeeGenome; +import forestry.api.apiculture.IBeeHousing; +import forestry.api.core.IBlockPosPredicate; +import forestry.api.core.INbtReadable; +import forestry.api.core.INbtWritable; +import forestry.api.genetics.IFlowerProvider; +import forestry.core.utils.TickHelper; + public class HasFlowersCache implements INbtWritable, INbtReadable { private static final String NBT_KEY = "hasFlowerCache"; private static final String NBT_KEY_FLOWERS = "flowers"; @@ -117,7 +118,7 @@ public class HasFlowersCache implements INbtWritable, INbtReadable { IBeeGenome genome = queen.getGenome(); String flowerType = genome.getFlowerProvider().getFlowerType(); if (!this.flowerData.flowerType.equals(flowerType) - || !this.flowerData.territory.equals(genome.getTerritory())) { + || !this.flowerData.territory.equals(genome.getTerritory())) { flowerData = new FlowerData(queen, housing); flowerCoords.clear(); flowers.clear(); diff --git a/src/main/java/forestry/apiculture/WorldgenBeekeepingLogic.java b/src/main/java/forestry/apiculture/WorldgenBeekeepingLogic.java index f83a5fde8..327142ab6 100644 --- a/src/main/java/forestry/apiculture/WorldgenBeekeepingLogic.java +++ b/src/main/java/forestry/apiculture/WorldgenBeekeepingLogic.java @@ -13,6 +13,16 @@ package forestry.apiculture; import java.io.IOException; import java.util.List; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.PacketBuffer; +import net.minecraft.util.math.BlockPos; +import net.minecraft.world.World; + +import net.minecraftforge.fml.relauncher.Side; +import net.minecraftforge.fml.relauncher.SideOnly; + import forestry.api.apiculture.IBee; import forestry.api.apiculture.IBeekeepingLogic; import forestry.api.genetics.IEffectData; @@ -20,14 +30,6 @@ import forestry.apiculture.network.packets.PacketBeeLogicActive; import forestry.apiculture.tiles.TileHive; import forestry.core.utils.NetworkUtil; import forestry.core.utils.TickHelper; -import net.minecraft.client.Minecraft; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.PacketBuffer; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; -import net.minecraftforge.fml.relauncher.Side; -import net.minecraftforge.fml.relauncher.SideOnly; public class WorldgenBeekeepingLogic implements IBeekeepingLogic { private final TileHive housing; diff --git a/src/main/java/forestry/apiculture/flowers/FlowerRegistry.java b/src/main/java/forestry/apiculture/flowers/FlowerRegistry.java index 22dfcbe1d..858f31534 100644 --- a/src/main/java/forestry/apiculture/flowers/FlowerRegistry.java +++ b/src/main/java/forestry/apiculture/flowers/FlowerRegistry.java @@ -10,6 +10,10 @@ ******************************************************************************/ package forestry.apiculture.flowers; +import com.google.common.base.Preconditions; +import com.google.common.collect.ArrayListMultimap; +import com.google.common.collect.HashMultimap; + import javax.annotation.Nullable; import java.util.ArrayList; import java.util.Collection; @@ -21,9 +25,13 @@ import java.util.Map; import java.util.Random; import java.util.Set; -import com.google.common.base.Preconditions; -import com.google.common.collect.ArrayListMultimap; -import com.google.common.collect.HashMultimap; +import net.minecraft.block.Block; +import net.minecraft.block.state.IBlockState; +import net.minecraft.init.Blocks; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.Vec3i; +import net.minecraft.world.World; + import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.FlowerManager; import forestry.api.apiculture.IBee; @@ -39,12 +47,6 @@ import forestry.api.genetics.IIndividual; import forestry.core.utils.BlockStateSet; import forestry.core.utils.VectUtil; import forestry.core.utils.WeightedCollection; -import net.minecraft.block.Block; -import net.minecraft.block.state.IBlockState; -import net.minecraft.init.Blocks; -import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3i; -import net.minecraft.world.World; public final class FlowerRegistry implements IFlowerRegistry, IFlowerGrowthHelper { private final HashMultimap registeredRules; diff --git a/src/main/java/forestry/apiculture/flowers/GrowthRuleDirtGrass.java b/src/main/java/forestry/apiculture/flowers/GrowthRuleDirtGrass.java index 2017506a7..c808ea297 100644 --- a/src/main/java/forestry/apiculture/flowers/GrowthRuleDirtGrass.java +++ b/src/main/java/forestry/apiculture/flowers/GrowthRuleDirtGrass.java @@ -12,27 +12,28 @@ package forestry.apiculture.flowers; import java.util.Collection; -import forestry.api.genetics.IFlowerGrowthHelper; -import forestry.api.genetics.IFlowerGrowthRule; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import forestry.api.genetics.IFlowerGrowthHelper; +import forestry.api.genetics.IFlowerGrowthRule; + public class GrowthRuleDirtGrass implements IFlowerGrowthRule { @Override @Deprecated public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, BlockPos pos) { return isValidSpot(world, pos) && - helper.plantRandomFlower(flowerType, world, pos); + helper.plantRandomFlower(flowerType, world, pos); } @Override public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, BlockPos pos, Collection potentialFlowers) { return isValidSpot(world, pos) && - helper.plantRandomFlower(flowerType, world, pos, potentialFlowers); + helper.plantRandomFlower(flowerType, world, pos, potentialFlowers); } private boolean isValidSpot(World world, BlockPos pos) { diff --git a/src/main/java/forestry/apiculture/flowers/GrowthRuleFertilize.java b/src/main/java/forestry/apiculture/flowers/GrowthRuleFertilize.java index 83fefbeec..21b0787af 100644 --- a/src/main/java/forestry/apiculture/flowers/GrowthRuleFertilize.java +++ b/src/main/java/forestry/apiculture/flowers/GrowthRuleFertilize.java @@ -14,13 +14,14 @@ import java.util.Arrays; import java.util.Collection; import java.util.List; -import forestry.api.genetics.IFlowerGrowthHelper; -import forestry.api.genetics.IFlowerGrowthRule; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import forestry.api.genetics.IFlowerGrowthHelper; +import forestry.api.genetics.IFlowerGrowthRule; + public class GrowthRuleFertilize implements IFlowerGrowthRule { private final List allowedItems; diff --git a/src/main/java/forestry/apiculture/flowers/GrowthRuleMycelium.java b/src/main/java/forestry/apiculture/flowers/GrowthRuleMycelium.java index 373f99fba..ed7b6a599 100644 --- a/src/main/java/forestry/apiculture/flowers/GrowthRuleMycelium.java +++ b/src/main/java/forestry/apiculture/flowers/GrowthRuleMycelium.java @@ -12,27 +12,28 @@ package forestry.apiculture.flowers; import java.util.Collection; -import forestry.api.genetics.IFlowerGrowthHelper; -import forestry.api.genetics.IFlowerGrowthRule; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import forestry.api.genetics.IFlowerGrowthHelper; +import forestry.api.genetics.IFlowerGrowthRule; + public class GrowthRuleMycelium implements IFlowerGrowthRule { @Override @Deprecated public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, BlockPos pos) { return isValidSpot(world, pos) && - helper.plantRandomFlower(flowerType, world, pos); + helper.plantRandomFlower(flowerType, world, pos); } @Override public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, BlockPos pos, Collection potentialFlowers) { return isValidSpot(world, pos) && - helper.plantRandomFlower(flowerType, world, pos, potentialFlowers); + helper.plantRandomFlower(flowerType, world, pos, potentialFlowers); } private boolean isValidSpot(World world, BlockPos pos) { diff --git a/src/main/java/forestry/apiculture/flowers/GrowthRuleNone.java b/src/main/java/forestry/apiculture/flowers/GrowthRuleNone.java index 0ebf1394c..552408b23 100644 --- a/src/main/java/forestry/apiculture/flowers/GrowthRuleNone.java +++ b/src/main/java/forestry/apiculture/flowers/GrowthRuleNone.java @@ -12,12 +12,13 @@ package forestry.apiculture.flowers; import java.util.Collection; -import forestry.api.genetics.IFlowerGrowthHelper; -import forestry.api.genetics.IFlowerGrowthRule; import net.minecraft.block.state.IBlockState; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import forestry.api.genetics.IFlowerGrowthHelper; +import forestry.api.genetics.IFlowerGrowthRule; + public class GrowthRuleNone implements IFlowerGrowthRule { @Override diff --git a/src/main/java/forestry/apiculture/flowers/GrowthRuleSnow.java b/src/main/java/forestry/apiculture/flowers/GrowthRuleSnow.java index 07156804f..2bc6485ae 100644 --- a/src/main/java/forestry/apiculture/flowers/GrowthRuleSnow.java +++ b/src/main/java/forestry/apiculture/flowers/GrowthRuleSnow.java @@ -12,27 +12,28 @@ package forestry.apiculture.flowers; import java.util.Collection; -import forestry.api.genetics.IFlowerGrowthHelper; -import forestry.api.genetics.IFlowerGrowthRule; import net.minecraft.block.Block; import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; +import forestry.api.genetics.IFlowerGrowthHelper; +import forestry.api.genetics.IFlowerGrowthRule; + public class GrowthRuleSnow implements IFlowerGrowthRule { @Override @Deprecated public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, BlockPos pos) { return isValidSpot(world, pos) && - helper.plantRandomFlower(flowerType, world, pos); + helper.plantRandomFlower(flowerType, world, pos); } @Override public boolean growFlower(IFlowerGrowthHelper helper, String flowerType, World world, BlockPos pos, Collection potentialFlowers) { return isValidSpot(world, pos) && - helper.plantRandomFlower(flowerType, world, pos, potentialFlowers); + helper.plantRandomFlower(flowerType, world, pos, potentialFlowers); } private boolean isValidSpot(World world, BlockPos pos) { diff --git a/src/main/java/forestry/apiculture/worldgen/VillageApiaristHouse.java b/src/main/java/forestry/apiculture/worldgen/VillageApiaristHouse.java index 179bd0b9a..6b291ef9e 100755 --- a/src/main/java/forestry/apiculture/worldgen/VillageApiaristHouse.java +++ b/src/main/java/forestry/apiculture/worldgen/VillageApiaristHouse.java @@ -33,9 +33,10 @@ import net.minecraft.world.gen.structure.StructureBoundingBox; import net.minecraft.world.gen.structure.StructureComponent; import net.minecraft.world.gen.structure.StructureVillagePieces; +import net.minecraftforge.registries.ForgeRegistry; + import net.minecraftforge.fml.common.registry.ForgeRegistries; import net.minecraftforge.fml.common.registry.VillagerRegistry; -import net.minecraftforge.registries.ForgeRegistry; import forestry.api.apiculture.BeeManager; import forestry.api.apiculture.EnumBeeType; diff --git a/src/main/java/forestry/core/utils/WeightedCollection.java b/src/main/java/forestry/core/utils/WeightedCollection.java index c7a48510c..9e21e5365 100644 --- a/src/main/java/forestry/core/utils/WeightedCollection.java +++ b/src/main/java/forestry/core/utils/WeightedCollection.java @@ -1,5 +1,7 @@ package forestry.core.utils; +import com.google.common.base.Preconditions; + import javax.annotation.Nullable; import java.util.Collections; import java.util.Map; @@ -8,8 +10,6 @@ import java.util.Random; import java.util.Set; import java.util.TreeMap; -import com.google.common.base.Preconditions; - public class WeightedCollection { private final NavigableMap map = new TreeMap<>(); private double total = 0; diff --git a/src/main/java/forestry/core/worldgen/WorldGenerator.java b/src/main/java/forestry/core/worldgen/WorldGenerator.java index 537dadda7..e859c1287 100755 --- a/src/main/java/forestry/core/worldgen/WorldGenerator.java +++ b/src/main/java/forestry/core/worldgen/WorldGenerator.java @@ -23,6 +23,7 @@ import net.minecraft.world.gen.feature.WorldGenMinable; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.terraingen.DecorateBiomeEvent; import net.minecraftforge.event.terraingen.PopulateChunkEvent; + import net.minecraftforge.fml.common.IWorldGenerator; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;