mirror of
https://github.com/GTNewHorizons/ForestryMC.git
synced 2026-11-16 18:44:45 +00:00
* Updated for BC 6.0.x compatibility * Re-implemented the Pipes plugin * Converted to vanilla assets lang system * Converted to standard gradle file structure * General warnings cleanup
62 lines
1.9 KiB
Java
Executable File
62 lines
1.9 KiB
Java
Executable File
/*******************************************************************************
|
|
* Copyright (c) 2011-2014 SirSengir.
|
|
* All rights reserved. This program and the accompanying materials
|
|
* are made available under the terms of the GNU Lesser Public License v3
|
|
* which accompanies this distribution, and is available at
|
|
* http://www.gnu.org/licenses/lgpl-3.0.txt
|
|
*
|
|
* Various Contributors including, but not limited to:
|
|
* SirSengir (original work), CovertJaguar, Player, Binnie, MysteriousAges
|
|
******************************************************************************/
|
|
package forestry.apiculture;
|
|
|
|
import java.util.EnumSet;
|
|
|
|
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.genetics.IFlowerProvider;
|
|
import forestry.api.genetics.IIndividual;
|
|
import forestry.api.genetics.IPollinatable;
|
|
import forestry.core.utils.StringUtil;
|
|
|
|
public class FlowerProviderEnd implements IFlowerProvider {
|
|
|
|
@Override
|
|
public boolean isAcceptedFlower(World world, IIndividual individual, int x, int y, int z) {
|
|
Block block = world.getBlock(x, y, z);
|
|
return block == Blocks.dragon_egg;
|
|
}
|
|
|
|
@Override
|
|
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
|
|
EnumSet<EnumPlantType> types = pollinatable.getPlantType();
|
|
return types.size() > 1 || !types.contains(EnumPlantType.Nether);
|
|
}
|
|
|
|
@Override
|
|
public boolean growFlower(World world, IIndividual individual, int x, int y, int z) {
|
|
return true;
|
|
}
|
|
|
|
@Override
|
|
public String getDescription() {
|
|
return StringUtil.localize("flowers.end");
|
|
}
|
|
|
|
@Override
|
|
public ItemStack[] affectProducts(World world, IIndividual individual, int x, int y, int z, ItemStack[] products) {
|
|
return products;
|
|
}
|
|
|
|
@Override
|
|
public ItemStack[] getItemStacks() {
|
|
return new ItemStack[] { new ItemStack(Blocks.dragon_egg) };
|
|
}
|
|
|
|
}
|