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:
MysteriousAges committed 2015-04-21 14:31:34 -07:00
1 parent eeb6cb356d
commit 7afda32063
23 files changed
+604 -690

No files matched your search

@@ -0,0 +1,53 @@
package magicbees.bees.allele.effect;
import java.util.ArrayList;
import cpw.mods.fml.common.FMLLog;
import magicbees.api.MagicBeesAPI;
import magicbees.api.bees.ITransmutationEffectController;
import magicbees.api.bees.ITransmutationEffectLogic;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraft.world.biome.BiomeGenBase;
public class TransmutationEffectController implements ITransmutationEffectController {
private ArrayList<ITransmutationEffectLogic> logicObjects;
static TransmutationEffectController instance;
public TransmutationEffectController() {
logicObjects = new ArrayList<ITransmutationEffectLogic>();
logicObjects.add(new TransmutationEffectRailcraft());
logicObjects.add(new TransmutationEffectVanilla());
MagicBeesAPI.transmutationEffectController = instance = this;
}
public void attemptTransmutations(World world, BiomeGenBase biome, ItemStack sourceBlock, int x, int y, int z) {
boolean done;
ITransmutationEffectLogic logic;
for (int i = 0; i < logicObjects.size(); i++) {
logic = logicObjects.get(i);
try {
done = logic.tryTransmutation(world, biome, sourceBlock, x, y, z);
} catch (Exception e) {
done = false;
FMLLog.warning("Magic Bees encountered an issue with an ITransmutationEffectLogic provider %s. Debug information follows.", logic.getClass()
.getName());
FMLLog.info(e.getMessage());
}
if (done) {
logicObjects.remove(i);
logicObjects.add(logic);
break;
}
}
}
@Override
public void addEffectLogic(ITransmutationEffectLogic logic) {
if (logic != null && !logicObjects.contains(logic)) {
logicObjects.add(logic);
}
}
}