Use generics for Chromosome type, begin unifying code

This commit is contained in:
mezz committed 2016-02-27 00:14:22 -08:00
1 parent a8270ef365
commit 43e41034f6
217 files changed
+3148 -2417

No files matched your search

@@ -10,6 +10,7 @@
******************************************************************************/
package forestry.apiculture.flowers;
import javax.annotation.Nonnull;
import java.util.EnumSet;
import net.minecraft.item.ItemStack;
@@ -25,22 +26,24 @@ import forestry.api.genetics.IPollinatable;
import forestry.core.utils.StringUtil;
public class FlowerProvider implements IFlowerProvider {
@Nonnull
private final String flowerType;
@Nonnull
private final String description;
public FlowerProvider(String flowerType, String description) {
public FlowerProvider(@Nonnull String flowerType, @Nonnull String description) {
this.flowerType = flowerType;
this.description = description;
}
@Nonnull
@Override
public String getFlowerType() {
return flowerType;
}
@Override
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
public boolean isAcceptedPollinatable(@Nonnull World world, @Nonnull IPollinatable pollinatable) {
EnumSet<EnumPlantType> plantTypes = pollinatable.getPlantType();
@@ -54,11 +57,13 @@ public class FlowerProvider implements IFlowerProvider {
}
}
@Nonnull
@Override
public String getDescription() {
return StringUtil.localize(this.description);
}
@Nonnull
@Override
public ItemStack[] affectProducts(World world, IIndividual individual, BlockPos pos, ItemStack[] products) {
return products;