Fix #1186 Begin farm cleanup and testing

This commit is contained in:
mezz committed 2016-05-22 03:31:02 -07:00
1 parent 1707573f7d
commit afbde2d735
64 files changed
+1055 -1424

No files matched your search

@@ -5,8 +5,10 @@
******************************************************************************/
package forestry.api.farming;
import java.util.Collection;
import java.util.HashMap;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
import javax.annotation.Nonnull;
public class Farmables {
/**
@@ -14,6 +16,7 @@ public class Farmables {
*
* Identifiers: farmArboreal farmWheat farmGourd farmInfernal farmPoales farmSucculentes farmVegetables farmShroom
*/
public static HashMap<String, Collection<IFarmable>> farmables = new HashMap<>();
@Nonnull
public static final Multimap<String, IFarmable> farmables = HashMultimap.create();
}
@@ -21,9 +21,6 @@ public interface IFarmHousing extends IErrorLogicSource {
Vec3i getOffset();
/** Must not be named "getWorld" to avoid SpecialSource issue https://github.com/md-5/SpecialSource/issues/12 */
World getWorldObj();
/**
* @return true if any work was done, false otherwise.
*/
@@ -8,8 +8,9 @@ package forestry.api.farming;
import java.util.Collection;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -24,11 +25,11 @@ public interface IFarmLogic {
boolean isAcceptedGermling(ItemStack itemstack);
Collection<ItemStack> collect();
Collection<ItemStack> collect(World world, IFarmHousing farmHousing);
boolean cultivate(BlockPos pos, FarmDirection direction, int extent);
boolean cultivate(World world, IFarmHousing farmHousing, BlockPos pos, FarmDirection direction, int extent);
Collection<ICrop> harvest(BlockPos pos, FarmDirection direction, int extent);
Collection<ICrop> harvest(World world, BlockPos pos, FarmDirection direction, int extent);
IFarmLogic setManual(boolean manual);
@@ -5,6 +5,9 @@
******************************************************************************/
package forestry.api.farming;
import javax.annotation.Nullable;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.BlockPos;
@@ -23,7 +26,8 @@ public interface IFarmable {
/**
* @return {@link ICrop} if the block at the given location is a harvestable and mature crop, null otherwise.
*/
ICrop getCropAt(World world, BlockPos pos);
@Nullable
ICrop getCropAt(World world, BlockPos pos, IBlockState blockState);
/**
* @return true if the item is a valid germling (plantable sapling, seed, etc.) for this type.