mirror of
https://github.com/GTNewHorizons/MagicBees.git
synced 2026-11-21 12:42:20 +00:00
Breaking effect alleles and flower providers into their own namespace.
Cleaned up effect & flower provider alleles. Added basic genome template for Botanical, Blossoming, Floral bees. Added FlowerProviderBotania to grow Mystical Flowers.
This commit is contained in:
1 parent
eeb6cb356d
commit
7afda32063
23 files changed
+604
-690
No files matched your search
@@ -0,0 +1,47 @@
|
||||
package magicbees.bees.allele.flowerProvider;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import magicbees.main.utils.LocalizationManager;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
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