mirror of
https://github.com/GTNewHorizons/MagicBees.git
synced 2026-11-18 19:39:06 +00:00
Upgraded to 1.7.2. List of currently-known issues are in CURRENT_ISSUES.txt file.
This commit is contained in:
1 parent
02655f092e
commit
02659b2816
227 files changed
+1350
-1222
No files matched your search
@@ -0,0 +1,57 @@
|
||||
package magicbees.bees;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import magicbees.main.utils.LocalizationManager;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.genetics.IFlowerProvider;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IPollinatable;
|
||||
|
||||
public class FlowerProviderBookshelf implements IFlowerProvider
|
||||
{
|
||||
|
||||
public boolean isAcceptedFlower(World world, IIndividual genome, int x, int i, int j)
|
||||
{
|
||||
boolean flag = false;
|
||||
if (world.getBlock(x, i, j) == Blocks.bookshelf)
|
||||
{
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
public boolean growFlower(World world, IIndividual genome, int x, int i, int j)
|
||||
{
|
||||
// Always return true so the system thinks we grew a flower.
|
||||
// Bees can't grow bookshelves! Are you crazy?!
|
||||
return true;
|
||||
}
|
||||
|
||||
public ItemStack[] affectProducts(World world, IIndividual genome, int x, int i, int j, ItemStack products[])
|
||||
{
|
||||
return products;
|
||||
}
|
||||
|
||||
public ItemStack[] getItemStacks()
|
||||
{
|
||||
return new ItemStack[] { new ItemStack(Blocks.bookshelf) };
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable)
|
||||
{
|
||||
EnumSet<EnumPlantType> types = pollinatable.getPlantType();
|
||||
return types.size() > 0 && !types.contains(EnumPlantType.Nether) && !types.contains(EnumPlantType.Water) ;
|
||||
}
|
||||
|
||||
public String getDescription()
|
||||
{
|
||||
return LocalizationManager.getLocalizedString("flowerProvider.book");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user