mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-21 20:52:22 +00:00
port to forestry 4.2
This commit is contained in:
1 parent
dbc5c1a564
commit
f969f63b66
3697 files changed
+78372
No files matched your search
@@ -0,0 +1,125 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.network.BinniePacketHandler;
|
||||
import binnie.core.proxy.IProxyCore;
|
||||
import binnie.extrabees.config.ConfigurationMachines;
|
||||
import binnie.extrabees.config.ConfigurationMain;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import binnie.core.gui.IBinnieGUID;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
|
||||
import binnie.extrabees.apiary.ModuleApiary;
|
||||
import binnie.extrabees.liquids.ModuleLiquids;
|
||||
import binnie.extrabees.worldgen.ModuleGeneration;
|
||||
import binnie.extrabees.genetics.ModuleGenetics;
|
||||
import binnie.extrabees.products.ModuleProducts;
|
||||
import binnie.extrabees.core.ModuleCore;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
|
||||
import binnie.extrabees.proxy.ExtraBeesProxy;
|
||||
|
||||
import cpw.mods.fml.common.Mod;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
|
||||
@Mod(modid = "ExtraBees", name = "Extra Bees", useMetadata = true, dependencies = "after:BinnieCore")
|
||||
public class ExtraBees extends AbstractMod
|
||||
{
|
||||
@Mod.Instance("ExtraBees")
|
||||
public static ExtraBees instance;
|
||||
@SidedProxy(clientSide = "binnie.extrabees.proxy.ExtraBeesProxyClient", serverSide = "binnie.extrabees.proxy.ExtraBeesProxyServer")
|
||||
public static ExtraBeesProxy proxy;
|
||||
public static Block hive;
|
||||
public static Material materialBeehive;
|
||||
public static Block ectoplasm;
|
||||
public static Block apiaristMachine;
|
||||
public static Block geneticMachine;
|
||||
public static Block advGeneticMachine;
|
||||
public static Item comb;
|
||||
public static Item propolis;
|
||||
public static Item honeyDrop;
|
||||
public static Item honeyCrystal;
|
||||
public static Item honeyCrystalEmpty;
|
||||
public static Item dictionary;
|
||||
public static Item itemMisc;
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preInit(final FMLPreInitializationEvent evt) {
|
||||
this.addModule(new ModuleCore());
|
||||
this.addModule(new ModuleProducts());
|
||||
this.addModule(new ModuleGenetics());
|
||||
this.addModule(new ModuleGeneration());
|
||||
this.addModule(new ModuleLiquids());
|
||||
this.addModule(new ModuleApiary());
|
||||
this.preInit();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void init(final FMLInitializationEvent evt) {
|
||||
this.init();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void postInit(final FMLPostInitializationEvent evt) {
|
||||
this.postInit();
|
||||
}
|
||||
|
||||
public ExtraBees() {
|
||||
ExtraBees.instance = this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBinnieGUID[] getGUIDs() {
|
||||
return ExtraBeeGUID.values();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<?>[] getConfigs() {
|
||||
return new Class[] { ConfigurationMain.class, ConfigurationMachines.class };
|
||||
}
|
||||
|
||||
@Override
|
||||
public IProxyCore getProxy() {
|
||||
return ExtraBees.proxy;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getChannel() {
|
||||
return "EB";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getModID() {
|
||||
return "extrabees";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Class<? extends BinniePacketHandler> getPacketHandler() {
|
||||
return PacketHandler.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return BinnieCore.isExtraBeesActive();
|
||||
}
|
||||
|
||||
public static class PacketHandler extends BinniePacketHandler
|
||||
{
|
||||
public PacketHandler() {
|
||||
super(ExtraBees.instance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary;
|
||||
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import binnie.core.machines.Machine;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import binnie.core.machines.MachineComponent;
|
||||
|
||||
public class ComponentBeeModifier extends MachineComponent implements IBeeModifier, IBeeListener
|
||||
{
|
||||
public ComponentBeeModifier(final Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onQueenChange(final ItemStack queen) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wearOutEquipment(final int amount) {
|
||||
}
|
||||
|
||||
public void onPostQueenDeath(final IBee queen) {
|
||||
}
|
||||
|
||||
public boolean onEggLaid(final IBee queen) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(final IBeeGenome genome, final float currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPollenRetrieved(IIndividual individual) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onQueenDeath() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import binnie.core.machines.component.IInteraction;
|
||||
import binnie.core.machines.MachineComponent;
|
||||
|
||||
public class ComponentExtraBeeGUI extends MachineComponent implements IInteraction.RightClick
|
||||
{
|
||||
ExtraBeeGUID id;
|
||||
|
||||
public ComponentExtraBeeGUI(final Machine machine, final ExtraBeeGUID id) {
|
||||
super(machine);
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRightClick(final World world, final EntityPlayer player, final int x, final int y, final int z) {
|
||||
ExtraBees.proxy.openGui(this.id, player, x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,143 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.genetics.EnumBeeBooleanModifier;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
|
||||
import binnie.core.Mods;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import binnie.core.genetics.EnumBeeModifier;
|
||||
import binnie.core.genetics.BeeModifierLogic;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import forestry.api.apiculture.IHiveFrame;
|
||||
|
||||
public enum EnumHiveFrame implements IHiveFrame, IBeeModifier
|
||||
{
|
||||
Cocoa,
|
||||
Cage,
|
||||
Soul,
|
||||
Clay,
|
||||
Debug;
|
||||
|
||||
Item item;
|
||||
int maxDamage;
|
||||
BeeModifierLogic logic;
|
||||
|
||||
public static void init() {
|
||||
EnumHiveFrame.Cocoa.logic.setModifier(EnumBeeModifier.Lifespan, 0.75f, 0.25f);
|
||||
EnumHiveFrame.Cocoa.logic.setModifier(EnumBeeModifier.Production, 1.5f, 5.0f);
|
||||
EnumHiveFrame.Cage.logic.setModifier(EnumBeeModifier.Territory, 0.5f, 0.1f);
|
||||
EnumHiveFrame.Cage.logic.setModifier(EnumBeeModifier.Lifespan, 0.75f, 0.5f);
|
||||
EnumHiveFrame.Cage.logic.setModifier(EnumBeeModifier.Production, 0.75f, 0.5f);
|
||||
EnumHiveFrame.Soul.logic.setModifier(EnumBeeModifier.Mutation, 1.5f, 5.0f);
|
||||
EnumHiveFrame.Soul.logic.setModifier(EnumBeeModifier.Lifespan, 0.75f, 0.5f);
|
||||
EnumHiveFrame.Soul.logic.setModifier(EnumBeeModifier.Production, 0.25f, 0.1f);
|
||||
EnumHiveFrame.Soul.setMaxDamage(80);
|
||||
EnumHiveFrame.Clay.logic.setModifier(EnumBeeModifier.Lifespan, 1.5f, 5.0f);
|
||||
EnumHiveFrame.Clay.logic.setModifier(EnumBeeModifier.Mutation, 0.5f, 0.2f);
|
||||
EnumHiveFrame.Clay.logic.setModifier(EnumBeeModifier.Production, 0.75f, 0.2f);
|
||||
EnumHiveFrame.Debug.logic.setModifier(EnumBeeModifier.Lifespan, 1.0E-4f, 1.0E-4f);
|
||||
GameRegistry.addRecipe(new ItemStack(EnumHiveFrame.Cocoa.item), new Object[] { " c ", "cFc", " c ", 'F', Mods.Forestry.stack("frameImpregnated"), 'c', new ItemStack(Items.dye, 1, 3) });
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(EnumHiveFrame.Cage.item), new Object[] { Mods.Forestry.stack("frameImpregnated"), Blocks.iron_bars });
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(EnumHiveFrame.Soul.item), new Object[] { Mods.Forestry.stack("frameImpregnated"), Blocks.soul_sand });
|
||||
GameRegistry.addRecipe(new ItemStack(EnumHiveFrame.Clay.item), new Object[] { " c ", "cFc", " c ", 'F', Mods.Forestry.stack("frameImpregnated"), 'c', Items.clay_ball });
|
||||
}
|
||||
|
||||
public int getIconIndex() {
|
||||
return 55 + this.ordinal();
|
||||
}
|
||||
|
||||
public void setMaxDamage(final int damage) {
|
||||
this.maxDamage = damage;
|
||||
}
|
||||
|
||||
private EnumHiveFrame() {
|
||||
this.maxDamage = 240;
|
||||
this.logic = new BeeModifierLogic();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack frameUsed(final IBeeHousing house, final ItemStack frame, final IBee queen, final int wear) {
|
||||
frame.setItemDamage(frame.getItemDamage() + wear);
|
||||
if (frame.getItemDamage() >= frame.getMaxDamage()) {
|
||||
return null;
|
||||
}
|
||||
return frame;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.logic.getModifier(EnumBeeModifier.Territory, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return this.logic.getModifier(EnumBeeModifier.Mutation, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return this.logic.getModifier(EnumBeeModifier.Lifespan, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.logic.getModifier(EnumBeeModifier.Production, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.logic.getModifier(EnumBeeModifier.Flowering, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.logic.getModifier(EnumBeeModifier.GeneticDecay, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return this.logic.getModifier(EnumBeeBooleanModifier.Sealed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return this.logic.getModifier(EnumBeeBooleanModifier.SelfLighted);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
return this.logic.getModifier(EnumBeeBooleanModifier.SunlightStimulated);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish() {
|
||||
return this.logic.getModifier(EnumBeeBooleanModifier.Hellish);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return ExtraBees.proxy.localise("item.frame." + this.toString().toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBeeModifier getBeeModifier() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary;
|
||||
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Item;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
|
||||
public enum IndustrialFrame implements IBeeModifier
|
||||
{
|
||||
Empty("Empty", 5, 0),
|
||||
Light("Glowstone Lighting", 2, 4),
|
||||
Rain("Rain Shielding", 2, 4),
|
||||
Sunlight("Sunlight Simulator", 4, 8),
|
||||
Soul("Low Grade Mutagen", 5, 15),
|
||||
Uranium("High Grade Mutagen", 10, 50),
|
||||
Cage("Meshed Restrainer", 3, 12),
|
||||
Freedom("Territory Extension", 3, 16),
|
||||
Honey("Honey Amplifier", 4, 12),
|
||||
Jelly("Gelatin Amplifier", 8, 36),
|
||||
Leaf("Pollinator MK I", 3, 15),
|
||||
Pollen("Pollinator MK II", 7, 25),
|
||||
Clay("Lifespan Extensor", 2, 10),
|
||||
Emerald("Eon Simulator", 7, 20),
|
||||
NetherStar("Immortality Gate", 12, 50),
|
||||
Poison("Mortality Inhibitor", 8, 18);
|
||||
|
||||
String name;
|
||||
float territoryMod;
|
||||
float mutationMod;
|
||||
float lifespanMod;
|
||||
float productionMod;
|
||||
float floweringMod;
|
||||
boolean lighted;
|
||||
boolean sunlight;
|
||||
boolean rain;
|
||||
int wearMod;
|
||||
int power;
|
||||
|
||||
private IndustrialFrame(final String name, final int wear, final int power) {
|
||||
this.territoryMod = 1.0f;
|
||||
this.mutationMod = 1.0f;
|
||||
this.lifespanMod = 1.0f;
|
||||
this.productionMod = 1.0f;
|
||||
this.floweringMod = 1.0f;
|
||||
this.lighted = false;
|
||||
this.sunlight = false;
|
||||
this.rain = false;
|
||||
this.name = name;
|
||||
this.wearMod = wear;
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
public static ItemStack getItemStack(final Item item, final IndustrialFrame frame) {
|
||||
final ItemStack stack = new ItemStack(item);
|
||||
final NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setInteger("frame", frame.ordinal());
|
||||
stack.setTagCompound(nbt);
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.territoryMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return this.mutationMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return this.lifespanMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.productionMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.floweringMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return this.rain;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return this.lighted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
return this.sunlight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public Object getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public int getWearModifier() {
|
||||
return this.wearMod;
|
||||
}
|
||||
|
||||
public int getPowerUsage() {
|
||||
return this.power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(final IBeeGenome genome, final float currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
static {
|
||||
IndustrialFrame.Light.lighted = true;
|
||||
IndustrialFrame.Rain.rain = true;
|
||||
IndustrialFrame.Sunlight.lighted = true;
|
||||
IndustrialFrame.Sunlight.sunlight = true;
|
||||
IndustrialFrame.Soul.mutationMod = 1.3f;
|
||||
IndustrialFrame.Uranium.mutationMod = 2.0f;
|
||||
IndustrialFrame.Cage.territoryMod = 0.4f;
|
||||
IndustrialFrame.Freedom.territoryMod = 1.4f;
|
||||
IndustrialFrame.Honey.productionMod = 1.4f;
|
||||
IndustrialFrame.Jelly.productionMod = 1.8f;
|
||||
IndustrialFrame.Leaf.floweringMod = 1.4f;
|
||||
IndustrialFrame.Pollen.floweringMod = 2.0f;
|
||||
IndustrialFrame.Clay.lifespanMod = 1.4f;
|
||||
IndustrialFrame.Emerald.lifespanMod = 2.0f;
|
||||
IndustrialFrame.NetherStar.lifespanMod = 20.0f;
|
||||
IndustrialFrame.Poison.lifespanMod = 0.5f;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.core.Tabs;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.apiculture.IHiveFrame;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class ItemHiveFrame extends Item implements IHiveFrame, IBeeModifier
|
||||
{
|
||||
EnumHiveFrame frame;
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(final ItemStack par1ItemStack) {
|
||||
return this.frame.getName();
|
||||
}
|
||||
|
||||
public ItemHiveFrame(final EnumHiveFrame frame) {
|
||||
this.frame = frame;
|
||||
this.setMaxDamage(frame.maxDamage);
|
||||
this.setCreativeTab(Tabs.tabApiculture);
|
||||
this.setMaxStackSize(1);
|
||||
this.setUnlocalizedName("hiveFrame");
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.frame.getTerritoryModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return this.frame.getMutationModifier(genome, mate, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return this.frame.getLifespanModifier(genome, mate, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.frame.getProductionModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack frameUsed(final IBeeHousing housing, final ItemStack frame, final IBee queen, final int wear) {
|
||||
frame.setItemDamage(frame.getItemDamage() + wear);
|
||||
if (frame.getItemDamage() >= frame.getMaxDamage()) {
|
||||
return null;
|
||||
}
|
||||
return frame;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister register) {
|
||||
this.itemIcon = ExtraBees.proxy.getIcon(register, "frame" + this.frame.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(final IBeeGenome genome, final float currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBeeModifier getBeeModifier() {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import java.util.List;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class ItemIndustrialFrame extends Item
|
||||
{
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List) {
|
||||
for (final IndustrialFrame frame : IndustrialFrame.values()) {
|
||||
final ItemStack stack = new ItemStack(this);
|
||||
final NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setInteger("frame", frame.ordinal());
|
||||
stack.setTagCompound(nbt);
|
||||
par3List.add(stack);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(final ItemStack par1ItemStack, final EntityPlayer par2EntityPlayer, final List par3List, final boolean par4) {
|
||||
super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
|
||||
final IndustrialFrame frame = getFrame(par1ItemStack);
|
||||
if (frame == null) {
|
||||
par3List.add("Invalid Contents");
|
||||
}
|
||||
else {
|
||||
par3List.add(frame.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(final ItemStack par1ItemStack) {
|
||||
return "Industrial Frame";
|
||||
}
|
||||
|
||||
public ItemIndustrialFrame() {
|
||||
this.setCreativeTab(CreativeTabs.tabMisc);
|
||||
this.setMaxDamage(400);
|
||||
this.setMaxStackSize(1);
|
||||
this.setUnlocalizedName("industrialFrame");
|
||||
}
|
||||
|
||||
public static IndustrialFrame getFrame(final ItemStack stack) {
|
||||
if (stack == null || !stack.hasTagCompound() || !stack.getTagCompound().hasKey("frame")) {
|
||||
return null;
|
||||
}
|
||||
return IndustrialFrame.values()[stack.getTagCompound().getInteger("frame")];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary;
|
||||
|
||||
import forestry.api.circuits.ICircuitLayout;
|
||||
import binnie.extrabees.apiary.machine.AlvearyStimulator;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.init.Items;
|
||||
import binnie.core.Mods;
|
||||
import binnie.extrabees.apiary.machine.AlvearyMutator;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.init.Blocks;
|
||||
import binnie.core.BinnieCore;
|
||||
import forestry.api.core.Tabs;
|
||||
import binnie.core.machines.MachineGroup;
|
||||
import binnie.extrabees.apiary.machine.AlvearyMachine;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.circuits.BinnieCircuitLayout;
|
||||
import net.minecraft.block.Block;
|
||||
import binnie.core.IInitializable;
|
||||
|
||||
public class ModuleApiary implements IInitializable
|
||||
{
|
||||
public static Block blockComponent;
|
||||
BinnieCircuitLayout stimulatorLayout;
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
final MachineGroup machineGroup = new MachineGroup(ExtraBees.instance, "alveay", "alveary", AlvearyMachine.values());
|
||||
machineGroup.setCreativeTab(Tabs.tabApiculture);
|
||||
BinnieCore.proxy.registerTileEntity(TileExtraBeeAlveary.class, "extrabees.tile.alveary", BinnieCore.proxy.createObject("binnie.core.machines.RendererMachine"));
|
||||
ModuleApiary.blockComponent = machineGroup.getBlock();
|
||||
AlvearyMutator.addMutationItem(new ItemStack(Blocks.soul_sand), 1.5f);
|
||||
AlvearyMutator.addMutationItem(Mods.IC2.stack("UranFuel"), 4.0f);
|
||||
AlvearyMutator.addMutationItem(Mods.IC2.stack("MOXFuel"), 10.0f);
|
||||
AlvearyMutator.addMutationItem(Mods.IC2.stack("Plutonium"), 8.0f);
|
||||
AlvearyMutator.addMutationItem(Mods.IC2.stack("smallPlutonium"), 5.0f);
|
||||
AlvearyMutator.addMutationItem(Mods.IC2.stack("Uran235"), 4.0f);
|
||||
AlvearyMutator.addMutationItem(Mods.IC2.stack("smallUran235"), 2.5f);
|
||||
AlvearyMutator.addMutationItem(Mods.IC2.stack("Uran238"), 2.0f);
|
||||
AlvearyMutator.addMutationItem(new ItemStack(Items.ender_pearl), 2.0f);
|
||||
AlvearyMutator.addMutationItem(new ItemStack(Items.ender_eye), 4.0f);
|
||||
for (final EnumHiveFrame frame : EnumHiveFrame.values()) {
|
||||
GameRegistry.registerItem(frame.item = new ItemHiveFrame(frame), "hiveFrame." + frame.name().toLowerCase());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
EnumHiveFrame.init();
|
||||
GameRegistry.addRecipe(AlvearyMachine.Mutator.get(1), new Object[] { "g g", " a ", "t t", 'g', Items.gold_ingot, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 5) });
|
||||
GameRegistry.addRecipe(AlvearyMachine.Frame.get(1), new Object[] { "iii", "tat", " t ", 'i', Items.iron_ingot, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4) });
|
||||
GameRegistry.addRecipe(AlvearyMachine.RainShield.get(1), new Object[] { " b ", "bab", "t t", 'b', Items.brick, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4) });
|
||||
GameRegistry.addRecipe(AlvearyMachine.Lighting.get(1), new Object[] { "iii", "iai", " t ", 'i', Items.glowstone_dust, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4) });
|
||||
GameRegistry.addRecipe(AlvearyMachine.Stimulator.get(1), new Object[] { "kik", "iai", " t ", 'i', Items.gold_nugget, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4), 'k', new ItemStack(Mods.Forestry.item("chipsets"), 1, 2) });
|
||||
GameRegistry.addRecipe(AlvearyMachine.Hatchery.get(1), new Object[] { "i i", " a ", "iti", 'i', Blocks.glass_pane, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 5) });
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(AlvearyMachine.Transmission.get(1), new Object[] { " t ", "tat", " t ", 'a', Mods.Forestry.block("alveary"), 't', "gearTin" }));
|
||||
for (final AlvearyStimulator.CircuitType type : AlvearyStimulator.CircuitType.values()) {
|
||||
type.createCircuit(this.stimulatorLayout);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
this.stimulatorLayout = new BinnieCircuitLayout(ExtraBees.instance, "Stimulator");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,536 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary;
|
||||
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.multiblock.IAlvearyComponent;
|
||||
import forestry.api.multiblock.IMultiblockComponent;
|
||||
import forestry.api.multiblock.IMultiblockController;
|
||||
import forestry.api.multiblock.IMultiblockLogicAlveary;
|
||||
import forestry.api.multiblock.MultiblockManager;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import java.util.LinkedList;
|
||||
import binnie.extrabees.apiary.machine.AlvearyMachine;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
|
||||
public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyComponent.Active, IAlvearyComponent.BeeModifier, IAlvearyComponent.BeeListener, IBeeListener, IBeeModifier
|
||||
{
|
||||
IMultiblockLogicAlveary structureLogic;
|
||||
ChunkCoordinates min;
|
||||
ChunkCoordinates max;
|
||||
|
||||
public TileExtraBeeAlveary() {
|
||||
this.structureLogic = MultiblockManager.logicFactory.createAlvearyLogic();
|
||||
}
|
||||
|
||||
public TileExtraBeeAlveary(final AlvearyMachine.AlvearyPackage alvearyPackage) {
|
||||
super(alvearyPackage);
|
||||
this.structureLogic = MultiblockManager.logicFactory.createAlvearyLogic();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChunkCoordinates getCoordinates() {
|
||||
return new ChunkCoordinates(xCoord, yCoord, zCoord);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GameProfile getOwner() {
|
||||
return getMachine().getOwner();
|
||||
}
|
||||
|
||||
public List<TileEntity> getAlvearyBlocks() {
|
||||
LinkedList<TileEntity> tiles = new LinkedList<TileEntity>();
|
||||
if (min != null && max != null) {
|
||||
for (int x = min.posX; x <= max.posX; ++x) {
|
||||
for (int z = min.posZ; z <= max.posZ; ++z) {
|
||||
for (int y = min.posY; y <= max.posY; ++y) {
|
||||
TileEntity tile = this.getWorldObj().getTileEntity(x, y, z);
|
||||
if (tile instanceof IMultiblockComponent) {
|
||||
tiles.add(tile);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return tiles;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMachineAssembled(IMultiblockController arg0, ChunkCoordinates min, ChunkCoordinates max) {
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onMachineBroken() {
|
||||
this.min = null;
|
||||
this.max = null;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMultiblockLogicAlveary getMultiblockLogic() {
|
||||
return structureLogic;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUpdate() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateClient(int arg0) {
|
||||
super.updateEntity();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateServer(int arg0) {
|
||||
super.updateEntity();
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
structureLogic.invalidate(worldObj, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
super.onChunkUnload();
|
||||
structureLogic.onChunkUnload(worldObj, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate() {
|
||||
structureLogic.validate(worldObj, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBeeModifier getBeeModifier() {
|
||||
return this.getMachine().getInterface(IBeeModifier.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBeeListener getBeeListener() {
|
||||
return this.getMachine().getInterface(IBeeListener.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return (this.getBeeModifier() == null) ? 1.0f : this.getBeeModifier().getTerritoryModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return (this.getBeeModifier() == null) ? 1.0f : this.getBeeModifier().getMutationModifier(genome, mate, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return (this.getBeeModifier() == null) ? 1.0f : this.getBeeModifier().getLifespanModifier(genome, mate, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return (this.getBeeModifier() == null) ? 1.0f : this.getBeeModifier().getProductionModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return (this.getBeeModifier() == null) ? 1.0f : this.getBeeModifier().getFloweringModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return this.getBeeModifier() != null && this.getBeeModifier().isSealed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return this.getBeeModifier() != null && this.getBeeModifier().isSelfLighted();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
return this.getBeeModifier() != null && this.getBeeModifier().isSunlightSimulated();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish() {
|
||||
return this.getBeeModifier() != null && this.getBeeModifier().isHellish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wearOutEquipment(int amount) {
|
||||
if (this.getBeeListener() != null) {
|
||||
this.getBeeListener().wearOutEquipment(amount);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onQueenDeath() {
|
||||
if (this.getBeeListener() != null) {
|
||||
this.getBeeListener().onQueenDeath();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(IBeeGenome genome, float currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onPollenRetrieved(IIndividual arg0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbtTagCompound) {
|
||||
super.writeToNBT(nbtTagCompound);
|
||||
NBTTagCompound tag = new NBTTagCompound();
|
||||
structureLogic.writeToNBT(tag);
|
||||
nbtTagCompound.setTag("structureLogic", tag);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbtTagCompound) {
|
||||
super.readFromNBT(nbtTagCompound);
|
||||
NBTTagCompound tag = nbtTagCompound.getCompoundTag("structureLogic");
|
||||
if (tag != null) {
|
||||
structureLogic.readFromNBT(tag);
|
||||
}
|
||||
}
|
||||
|
||||
// boolean init;
|
||||
// //IStructureLogic structureLogic;
|
||||
// private boolean isMaster;
|
||||
// protected int masterX;
|
||||
// protected int masterZ;
|
||||
// protected int masterY;
|
||||
// List<TileEntity> tiles;
|
||||
//
|
||||
// @Override
|
||||
// public void updateEntity() {
|
||||
// super.updateEntity();
|
||||
// if (!BinnieCore.proxy.isSimulating(this.worldObj)) {
|
||||
// return;
|
||||
// }
|
||||
// if (this.worldObj.getWorldTime() % 200L == 0L) {
|
||||
// if (!this.isIntegratedIntoStructure() || this.isMaster()) {
|
||||
// // this.validateStructure();
|
||||
// }
|
||||
// // final IMultiblockComponent master = this.getCentralTE();
|
||||
// // if (master == null) {
|
||||
// // return;
|
||||
// // }
|
||||
// // if (this.getBeeListener() != null) {
|
||||
// //
|
||||
// ((IAlvearyComponent)master).registerBeeListener(this.getBeeListener());
|
||||
// // }
|
||||
// if (this.getBeeModifier() != null) {
|
||||
// //
|
||||
// ((IAlvearyComponent)master).registerBeeModifier(this.getBeeModifier());
|
||||
// }
|
||||
// this.init = true;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void readFromNBT(final NBTTagCompound nbttagcompound) {
|
||||
// super.readFromNBT(nbttagcompound);
|
||||
// this.isMaster = nbttagcompound.getBoolean("IsMaster");
|
||||
// this.masterX = nbttagcompound.getInteger("MasterX");
|
||||
// this.masterY = nbttagcompound.getInteger("MasterY");
|
||||
// this.masterZ = nbttagcompound.getInteger("MasterZ");
|
||||
// if (this.isMaster) {
|
||||
// this.makeMaster();
|
||||
// }
|
||||
// // this.structureLogic.readFromNBT(nbttagcompound);
|
||||
// // this.updateAlvearyBlocks();
|
||||
// this.init = false;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void writeToNBT(final NBTTagCompound nbttagcompound) {
|
||||
// super.writeToNBT(nbttagcompound);
|
||||
// nbttagcompound.setBoolean("IsMaster", this.isMaster);
|
||||
// nbttagcompound.setInteger("MasterX", this.masterX);
|
||||
// nbttagcompound.setInteger("MasterY", this.masterY);
|
||||
// nbttagcompound.setInteger("MasterZ", this.masterZ);
|
||||
// //this.structureLogic.writeToNBT(nbttagcompound);
|
||||
// }
|
||||
//
|
||||
// AlvearyMachine.AlvearyPackage getAlvearyPackage() {
|
||||
// return (AlvearyMachine.AlvearyPackage)this.getMachine().getPackage();
|
||||
// }
|
||||
//
|
||||
// public TileExtraBeeAlveary() {
|
||||
// this.init = false;
|
||||
// this.masterY = -99;
|
||||
// this.tiles = new ArrayList<TileEntity>();
|
||||
// //this.structureLogic =
|
||||
// Binnie.Genetics.getBeeRoot().createAlvearyStructureLogic((IAlvearyComponent)this);
|
||||
// }
|
||||
//
|
||||
// public TileExtraBeeAlveary(final AlvearyMachine.AlvearyPackage
|
||||
// alvearyPackage) {
|
||||
// super(alvearyPackage);
|
||||
// this.init = false;
|
||||
// this.masterY = -99;
|
||||
// this.tiles = new ArrayList<TileEntity>();
|
||||
// // this.structureLogic =
|
||||
// Binnie.Genetics.getBeeRoot().createAlvearyStructureLogic((IAlvearyComponent)this);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// public void makeMaster() {
|
||||
// }
|
||||
//
|
||||
// // public void onStructureReset() {
|
||||
// // this.setCentralTE(null);
|
||||
// // this.isMaster = false;
|
||||
// // this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord,
|
||||
// this.zCoord);
|
||||
// // this.updateAlvearyBlocks();
|
||||
// // }
|
||||
// //
|
||||
// // public IMultiblockComponent getCentralTE() {
|
||||
// // if (this.worldObj == null || !this.isIntegratedIntoStructure()) {
|
||||
// // return null;
|
||||
// // }
|
||||
// // if (this.isMaster()) {
|
||||
// // return (IMultiblockComponent)this;
|
||||
// // }
|
||||
// // final TileEntity tile = this.worldObj.getTileEntity(this.masterX,
|
||||
// this.masterY, this.masterZ);
|
||||
// // if (!(tile instanceof IMultiblockComponent)) {
|
||||
// // return null;
|
||||
// // }
|
||||
// // final IMultiblockComponent master =
|
||||
// (IMultiblockComponent)this.worldObj.getTileEntity(this.masterX,
|
||||
// this.masterY, this.masterZ);
|
||||
// // if (master.isMaster()) {
|
||||
// // return master;
|
||||
// // }
|
||||
// // return null;
|
||||
// // }
|
||||
//
|
||||
// // public void validateStructure() {
|
||||
// // this.structureLogic.validateStructure();
|
||||
// // this.updateAlvearyBlocks();
|
||||
// // }
|
||||
//
|
||||
// private boolean isSameTile(final TileEntity tile) {
|
||||
// return tile.xCoord == this.xCoord && tile.yCoord == this.yCoord &&
|
||||
// tile.zCoord == this.zCoord;
|
||||
// }
|
||||
//
|
||||
// // public void setCentralTE(final TileEntity tile) {
|
||||
// // if (tile == null || tile == this || this.isSameTile(tile)) {
|
||||
// // final boolean b = false;
|
||||
// // this.masterZ = (b ? 1 : 0);
|
||||
// // this.masterX = (b ? 1 : 0);
|
||||
// // this.masterY = -99;
|
||||
// // this.updateAlvearyBlocks();
|
||||
// // return;
|
||||
// // }
|
||||
// // this.isMaster = false;
|
||||
// // this.masterX = tile.xCoord;
|
||||
// // this.masterY = tile.yCoord;
|
||||
// // this.masterZ = tile.zCoord;
|
||||
// // this.markDirty();
|
||||
// // if (this.getBeeListener() != null) {
|
||||
// // ((IAlvearyComponent)tile).registerBeeListener(this.getBeeListener());
|
||||
// // }
|
||||
// // if (this.getBeeModifier() != null) {
|
||||
// // ((IAlvearyComponent)tile).registerBeeModifier(this.getBeeModifier());
|
||||
// // }
|
||||
// // this.updateAlvearyBlocks();
|
||||
// // }
|
||||
//
|
||||
// public boolean isMaster() {
|
||||
// return this.isMaster;
|
||||
// }
|
||||
//
|
||||
// protected boolean hasMaster() {
|
||||
// return this.masterY >= 0;
|
||||
// }
|
||||
//
|
||||
// public boolean isIntegratedIntoStructure() {
|
||||
// return this.isMaster || this.masterY >= 0;
|
||||
// }
|
||||
//
|
||||
// public void registerBeeModifier(final IBeeModifier modifier) {
|
||||
// }
|
||||
//
|
||||
// public void removeBeeModifier(final IBeeModifier modifier) {
|
||||
// }
|
||||
//
|
||||
// public void addTemperatureChange(final float change, final float
|
||||
// boundaryDown, final float boundaryUp) {
|
||||
// }
|
||||
//
|
||||
// public void addHumidityChange(final float change, final float
|
||||
// boundaryDown, final float boundaryUp) {
|
||||
// }
|
||||
//
|
||||
// public boolean hasFunction() {
|
||||
// return true;
|
||||
// }
|
||||
//
|
||||
// public IBeeModifier getBeeModifier() {
|
||||
// return this.getMachine().getInterface(IBeeModifier.class);
|
||||
// }
|
||||
//
|
||||
// public IBeeListener getBeeListener() {
|
||||
// return this.getMachine().getInterface(IBeeListener.class);
|
||||
// }
|
||||
//
|
||||
// public float getTerritoryModifier(final IBeeGenome genome, final float
|
||||
// currentModifier) {
|
||||
// return (this.getBeeModifier() == null) ? 1.0f :
|
||||
// this.getBeeModifier().getTerritoryModifier(genome, currentModifier);
|
||||
// }
|
||||
//
|
||||
// public float getMutationModifier(final IBeeGenome genome, final
|
||||
// IBeeGenome mate, final float currentModifier) {
|
||||
// return (this.getBeeModifier() == null) ? 1.0f :
|
||||
// this.getBeeModifier().getMutationModifier(genome, mate, currentModifier);
|
||||
// }
|
||||
//
|
||||
// public float getLifespanModifier(final IBeeGenome genome, final
|
||||
// IBeeGenome mate, final float currentModifier) {
|
||||
// return (this.getBeeModifier() == null) ? 1.0f :
|
||||
// this.getBeeModifier().getLifespanModifier(genome, mate, currentModifier);
|
||||
// }
|
||||
//
|
||||
// public float getProductionModifier(final IBeeGenome genome, final float
|
||||
// currentModifier) {
|
||||
// return (this.getBeeModifier() == null) ? 1.0f :
|
||||
// this.getBeeModifier().getProductionModifier(genome, currentModifier);
|
||||
// }
|
||||
//
|
||||
// public float getFloweringModifier(final IBeeGenome genome, final float
|
||||
// currentModifier) {
|
||||
// return (this.getBeeModifier() == null) ? 1.0f :
|
||||
// this.getBeeModifier().getFloweringModifier(genome, currentModifier);
|
||||
// }
|
||||
//
|
||||
// public boolean isSealed() {
|
||||
// return this.getBeeModifier() != null && this.getBeeModifier().isSealed();
|
||||
// }
|
||||
//
|
||||
// public boolean isSelfLighted() {
|
||||
// return this.getBeeModifier() != null &&
|
||||
// this.getBeeModifier().isSelfLighted();
|
||||
// }
|
||||
//
|
||||
// public boolean isSunlightSimulated() {
|
||||
// return this.getBeeModifier() != null &&
|
||||
// this.getBeeModifier().isSunlightSimulated();
|
||||
// }
|
||||
//
|
||||
// public boolean isHellish() {
|
||||
// return this.getBeeModifier() != null &&
|
||||
// this.getBeeModifier().isHellish();
|
||||
// }
|
||||
//
|
||||
// public void registerBeeListener(final IBeeListener event) {
|
||||
// }
|
||||
//
|
||||
// public void removeBeeListener(final IBeeListener event) {
|
||||
// }
|
||||
//
|
||||
// // public void onQueenChange(final ItemStack queen) {
|
||||
// // if (this.getBeeListener() != null) {
|
||||
// // this.getBeeListener().onQueenChange(queen);
|
||||
// // }
|
||||
// // }
|
||||
// //
|
||||
// public void wearOutEquipment(final int amount) {
|
||||
// if (this.getBeeListener() != null) {
|
||||
// this.getBeeListener().wearOutEquipment(amount);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // public void onQueenDeath(final IBee queen) {
|
||||
// // if (this.getBeeListener() != null) {
|
||||
// // this.getBeeListener().onQueenDeath(queen);
|
||||
// // }
|
||||
// // }
|
||||
// //
|
||||
// // public void onPostQueenDeath(final IBee queen) {
|
||||
// // if (this.getBeeListener() != null) {
|
||||
// // this.getBeeListener().onPostQueenDeath(queen);
|
||||
// // }
|
||||
// // }
|
||||
//
|
||||
// public boolean onPollenRetrieved(final IBee queen, final IIndividual
|
||||
// pollen, final boolean isHandled) {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// public boolean onEggLaid(final IBee queen) {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// public float getGeneticDecay(final IBeeGenome genome, final float
|
||||
// currentModifier) {
|
||||
// return 1.0f;
|
||||
// }
|
||||
//
|
||||
// // public IBeeHousing getBeeHousing() {
|
||||
// // return (this.getCentralTE() == null) ? null :
|
||||
// ((IBeeHousing)this.getCentralTE());
|
||||
// // }
|
||||
//
|
||||
// // public List<TileEntity> getAlvearyBlocks() {
|
||||
// // this.updateAlvearyBlocks();
|
||||
// // return this.tiles;
|
||||
// // }
|
||||
//
|
||||
// // private void updateAlvearyBlocks() {
|
||||
// // this.tiles.clear();
|
||||
// // if (this.getCentralTE() != null) {
|
||||
// // final IMultiblockComponent struct = this.getCentralTE();
|
||||
// // if (!struct.isIntegratedIntoStructure()) {
|
||||
// // return;
|
||||
// // }
|
||||
// // final TileEntity central = (TileEntity)struct;
|
||||
// // for (int x = -2; x <= 2; ++x) {
|
||||
// // for (int z = -2; z <= 2; ++z) {
|
||||
// // for (int y = -2; y <= 2; ++y) {
|
||||
// // final TileEntity tile = this.getWorldObj().getTileEntity(this.xCoord +
|
||||
// x, this.yCoord + y, this.zCoord + z);
|
||||
// // if (tile != null && tile instanceof IMultiblockComponent &&
|
||||
// ((IMultiblockComponent)tile).getMultiblockLogic().getCentralTE() ==
|
||||
// struct) {
|
||||
// // this.tiles.add(tile);
|
||||
// // }
|
||||
// // }
|
||||
// // }
|
||||
// // }
|
||||
// // }
|
||||
// // }
|
||||
//
|
||||
// public ISidedInventory getStructureInventory() {
|
||||
// return this.getMachine().getInterface(ISidedInventory.class);
|
||||
// }
|
||||
//
|
||||
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.apiculture.IHiveFrame;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
import binnie.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.extrabees.apiary.ComponentExtraBeeGUI;
|
||||
import binnie.extrabees.apiary.TileExtraBeeAlveary;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
|
||||
public class AlvearyFrame
|
||||
{
|
||||
public static int slotFrame;
|
||||
|
||||
static {
|
||||
AlvearyFrame.slotFrame = 0;
|
||||
}
|
||||
|
||||
public static class PackageAlvearyFrame extends AlvearyMachine.AlvearyPackage implements IMachineInformation
|
||||
{
|
||||
public PackageAlvearyFrame() {
|
||||
super("frame", ExtraBeeTexture.AlvearyFrame.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(final Machine machine) {
|
||||
new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyFrame);
|
||||
final ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
inventory.addSlot(AlvearyFrame.slotFrame, "frame");
|
||||
inventory.getSlot(AlvearyFrame.slotFrame).setValidator(new SlotValidatorFrame());
|
||||
new ComponentFrameModifier(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class SlotValidatorFrame extends SlotValidator
|
||||
{
|
||||
public SlotValidatorFrame() {
|
||||
super(SlotValidator.IconFrame);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(final ItemStack itemStack) {
|
||||
return itemStack != null && itemStack.getItem() instanceof IHiveFrame;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return "Hive Frames";
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentFrameModifier extends ComponentBeeModifier implements IBeeModifier, IBeeListener
|
||||
{
|
||||
public ComponentFrameModifier(final Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wearOutEquipment(final int amount) {
|
||||
if (this.getHiveFrame() == null) {
|
||||
return;
|
||||
}
|
||||
final World world = this.getMachine().getTileEntity().getWorldObj();
|
||||
final int wear = Math.round(amount * 5 * Binnie.Genetics.getBeeRoot().getBeekeepingMode(world).getWearModifier());
|
||||
this.getInventory().setInventorySlotContents(AlvearyFrame.slotFrame, this.getHiveFrame().frameUsed(((TileExtraBeeAlveary) this.getMachine().getTileEntity()).getMultiblockLogic().getController(), this.getInventory().getStackInSlot(AlvearyFrame.slotFrame), (IBee) null, wear));
|
||||
}
|
||||
|
||||
public IHiveFrame getHiveFrame() {
|
||||
if (this.getInventory().getStackInSlot(AlvearyFrame.slotFrame) != null) {
|
||||
return (IHiveFrame) this.getInventory().getStackInSlot(AlvearyFrame.slotFrame).getItem();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return (this.getHiveFrame() == null) ? 1.0f : this.getHiveFrame().getBeeModifier().getTerritoryModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return (this.getHiveFrame() == null) ? 1.0f : this.getHiveFrame().getBeeModifier().getMutationModifier(genome, mate, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return (this.getHiveFrame() == null) ? 1.0f : this.getHiveFrame().getBeeModifier().getLifespanModifier(genome, mate, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return (this.getHiveFrame() == null) ? 1.0f : this.getHiveFrame().getBeeModifier().getProductionModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return (this.getHiveFrame() == null) ? 1.0f : this.getHiveFrame().getBeeModifier().getFloweringModifier(genome, currentModifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.InventorySlot;
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
import binnie.core.machines.transfer.TransferRequest;
|
||||
import binnie.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.extrabees.apiary.ComponentExtraBeeGUI;
|
||||
import binnie.extrabees.apiary.TileExtraBeeAlveary;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
|
||||
public class AlvearyHatchery
|
||||
{
|
||||
public static int[] slotLarvae;
|
||||
|
||||
static {
|
||||
AlvearyHatchery.slotLarvae = new int[] { 0, 1, 2, 3, 4 };
|
||||
}
|
||||
|
||||
public static class PackageAlvearyHatchery extends AlvearyMachine.AlvearyPackage implements IMachineInformation
|
||||
{
|
||||
public PackageAlvearyHatchery() {
|
||||
super("hatchery", ExtraBeeTexture.AlvearyHatchery.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(final Machine machine) {
|
||||
new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyHatchery);
|
||||
final ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
for (final InventorySlot slot : inventory.addSlotArray(AlvearyHatchery.slotLarvae, "hatchery")) {
|
||||
slot.setValidator(new SlotValidatorLarvae());
|
||||
}
|
||||
new ComponentFrameModifier(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class SlotValidatorLarvae extends SlotValidator
|
||||
{
|
||||
public SlotValidatorLarvae() {
|
||||
super(SlotValidator.IconBee);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(final ItemStack itemStack) {
|
||||
return Binnie.Genetics.getBeeRoot().isMember(itemStack) && Binnie.Genetics.getBeeRoot().getType(itemStack) == EnumBeeType.LARVAE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return "Larvae";
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentFrameModifier extends ComponentBeeModifier implements IBeeModifier, IBeeListener
|
||||
{
|
||||
public ComponentFrameModifier(final Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
if (new Random().nextInt(2400) == 0) {
|
||||
final TileEntity tile = this.getMachine().getTileEntity();
|
||||
if (tile instanceof TileExtraBeeAlveary) {
|
||||
final IBeeHousing house = ((TileExtraBeeAlveary) tile).getMultiblockLogic().getController();
|
||||
if (house != null && !house.getErrorLogic().hasErrors()) {
|
||||
final ItemStack queenStack = house.getBeeInventory().getQueen();
|
||||
final IBee queen = (queenStack == null) ? null : Binnie.Genetics.getBeeRoot().getMember(queenStack);
|
||||
if (queen != null) {
|
||||
final ItemStack larvae = Binnie.Genetics.getBeeRoot().getMemberStack(Binnie.Genetics.getBeeRoot().getBee(this.getMachine().getWorld(), queen.getGenome()), EnumBeeType.LARVAE.ordinal());
|
||||
new TransferRequest(larvae, this.getInventory()).transfer(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import binnie.craftgui.minecraft.IMachineInformation;
|
||||
|
||||
public class AlvearyLighting
|
||||
{
|
||||
public static class PackageAlvearyLighting extends AlvearyMachine.AlvearyPackage implements IMachineInformation
|
||||
{
|
||||
public PackageAlvearyLighting() {
|
||||
super("lighting", ExtraBeeTexture.AlvearyLighting.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(final Machine machine) {
|
||||
new ComponentLighting(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentLighting extends ComponentBeeModifier implements IBeeModifier, IBeeListener
|
||||
{
|
||||
public ComponentLighting(final Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
import binnie.core.machines.MachineRendererBlock;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import binnie.extrabees.apiary.TileExtraBeeAlveary;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.resource.BinnieResource;
|
||||
import binnie.extrabees.apiary.ModuleApiary;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import binnie.core.machines.MachinePackage;
|
||||
import binnie.core.machines.IMachineType;
|
||||
|
||||
public enum AlvearyMachine implements IMachineType
|
||||
{
|
||||
Mutator(AlvearyMutator.PackageAlvearyMutator.class),
|
||||
Frame(AlvearyFrame.PackageAlvearyFrame.class),
|
||||
RainShield(AlvearyRainShield.PackageAlvearyRainShield.class),
|
||||
Lighting(AlvearyLighting.PackageAlvearyLighting.class),
|
||||
Stimulator(AlvearyStimulator.PackageAlvearyStimulator.class),
|
||||
Hatchery(AlvearyHatchery.PackageAlvearyHatchery.class),
|
||||
Transmission(AlvearyTransmission.PackageAlvearyTransmission.class);
|
||||
|
||||
Class<? extends MachinePackage> clss;
|
||||
|
||||
private AlvearyMachine(final Class<? extends MachinePackage> clss) {
|
||||
this.clss = clss;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends MachinePackage> getPackageClass() {
|
||||
return this.clss;
|
||||
}
|
||||
|
||||
public ItemStack get(final int size) {
|
||||
return new ItemStack(ModuleApiary.blockComponent, size, this.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public abstract static class AlvearyPackage extends MachinePackage
|
||||
{
|
||||
BinnieResource machineTexture;
|
||||
|
||||
public AlvearyPackage(final String id, final BinnieResource machineTexture, final boolean powered) {
|
||||
super(id, powered);
|
||||
this.machineTexture = machineTexture;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(final Machine machine) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createTileEntity() {
|
||||
return new TileExtraBeeAlveary(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void register() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderMachine(final Machine machine, final double x, final double y, final double z, final float var8, final RenderBlocks renderer) {
|
||||
MachineRendererBlock.instance.renderMachine(this.machineTexture, x, y, z, var8);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,118 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
import binnie.core.machines.inventory.ValidatorIcon;
|
||||
import binnie.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.extrabees.apiary.ComponentExtraBeeGUI;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
|
||||
public class AlvearyMutator
|
||||
{
|
||||
public static int slotMutator;
|
||||
static Map<ItemStack, Float> mutations;
|
||||
|
||||
public static boolean isMutationItem(final ItemStack item) {
|
||||
return getMutationMult(item) > 0.0f;
|
||||
}
|
||||
|
||||
public static float getMutationMult(final ItemStack item) {
|
||||
if (item == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
for (final ItemStack comp : AlvearyMutator.mutations.keySet()) {
|
||||
if (ItemStack.areItemStackTagsEqual(item, comp) && item.isItemEqual(comp)) {
|
||||
return AlvearyMutator.mutations.get(comp);
|
||||
}
|
||||
}
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
public static void addMutationItem(final ItemStack item, final float chance) {
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
AlvearyMutator.mutations.put(item, chance);
|
||||
}
|
||||
|
||||
public static Collection<ItemStack> getMutagens() {
|
||||
return AlvearyMutator.mutations.keySet();
|
||||
}
|
||||
|
||||
static {
|
||||
AlvearyMutator.slotMutator = 0;
|
||||
AlvearyMutator.mutations = new HashMap<ItemStack, Float>();
|
||||
}
|
||||
|
||||
public static class PackageAlvearyMutator extends AlvearyMachine.AlvearyPackage implements IMachineInformation
|
||||
{
|
||||
public PackageAlvearyMutator() {
|
||||
super("mutator", ExtraBeeTexture.AlvearyMutator.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(final Machine machine) {
|
||||
new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyMutator);
|
||||
final ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
inventory.addSlot(AlvearyMutator.slotMutator, "mutator");
|
||||
inventory.getSlot(AlvearyMutator.slotMutator).setValidator(new SlotValidatorMutator());
|
||||
new ComponentMutatorModifier(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class SlotValidatorMutator extends SlotValidator
|
||||
{
|
||||
public SlotValidatorMutator() {
|
||||
super(new ValidatorIcon(ExtraBees.instance, "validator/mutator.0", "validator/mutator.1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(final ItemStack itemStack) {
|
||||
return AlvearyMutator.isMutationItem(itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return "Mutagenic Agents";
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentMutatorModifier extends ComponentBeeModifier implements IBeeModifier, IBeeListener
|
||||
{
|
||||
public ComponentMutatorModifier(final Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
if (this.getUtil().isSlotEmpty(AlvearyMutator.slotMutator)) {
|
||||
return 1.0f;
|
||||
}
|
||||
final float mult = AlvearyMutator.getMutationMult(this.getUtil().getStack(AlvearyMutator.slotMutator));
|
||||
return Math.min(mult, 15.0f / currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostQueenDeath(final IBee queen) {
|
||||
this.getUtil().decreaseStack(AlvearyMutator.slotMutator, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import binnie.craftgui.minecraft.IMachineInformation;
|
||||
|
||||
public class AlvearyRainShield
|
||||
{
|
||||
public static class PackageAlvearyRainShield extends AlvearyMachine.AlvearyPackage implements IMachineInformation
|
||||
{
|
||||
public PackageAlvearyRainShield() {
|
||||
super("rainShield", ExtraBeeTexture.AlvearyRainShield.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(final Machine machine) {
|
||||
new ComponentRainShield(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentRainShield extends ComponentBeeModifier implements IBeeModifier, IBeeListener
|
||||
{
|
||||
public ComponentRainShield(final Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,421 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.circuits.ChipsetManager;
|
||||
import forestry.api.circuits.ICircuit;
|
||||
import forestry.api.circuits.ICircuitBoard;
|
||||
import forestry.api.circuits.ICircuitLayout;
|
||||
import binnie.core.Mods;
|
||||
import binnie.core.circuits.BinnieCircuit;
|
||||
import binnie.core.genetics.BeeModifierLogic;
|
||||
import binnie.core.genetics.EnumBeeBooleanModifier;
|
||||
import binnie.core.genetics.EnumBeeModifier;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
import binnie.core.machines.power.ComponentPowerReceptor;
|
||||
import binnie.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.extrabees.apiary.ComponentExtraBeeGUI;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
|
||||
public class AlvearyStimulator
|
||||
{
|
||||
public static int slotCircuit;
|
||||
|
||||
static {
|
||||
AlvearyStimulator.slotCircuit = 0;
|
||||
}
|
||||
|
||||
public static class PackageAlvearyStimulator extends AlvearyMachine.AlvearyPackage implements IMachineInformation
|
||||
{
|
||||
public PackageAlvearyStimulator() {
|
||||
super("stimulator", ExtraBeeTexture.AlvearyStimulator.getTexture(), true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(final Machine machine) {
|
||||
new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyStimulator);
|
||||
final ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
inventory.addSlot(AlvearyStimulator.slotCircuit, "circuit");
|
||||
inventory.getSlot(AlvearyStimulator.slotCircuit).setValidator(new SlotValidatorCircuit());
|
||||
final ComponentPowerReceptor power = new ComponentPowerReceptor(machine);
|
||||
new ComponentStimulatorModifier(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class SlotValidatorCircuit extends SlotValidator
|
||||
{
|
||||
public SlotValidatorCircuit() {
|
||||
super(SlotValidator.IconCircuit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(final ItemStack itemStack) {
|
||||
return itemStack != null && ChipsetManager.circuitRegistry.isChipset(itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return "Forestry Circuits";
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentStimulatorModifier extends ComponentBeeModifier implements IBeeModifier, IBeeListener
|
||||
{
|
||||
float powerUsage;
|
||||
boolean powered;
|
||||
StimulatorCircuit[] modifiers;
|
||||
|
||||
public ComponentStimulatorModifier(final Machine machine) {
|
||||
super(machine);
|
||||
this.powerUsage = 0.0f;
|
||||
this.powered = false;
|
||||
this.modifiers = new StimulatorCircuit[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
this.modifiers = this.getCircuits();
|
||||
this.powerUsage = 0.0f;
|
||||
for (final StimulatorCircuit beeMod : this.modifiers) {
|
||||
this.powerUsage += beeMod.getPowerUsage();
|
||||
}
|
||||
this.powered = this.getUtil().hasEnergyMJ(this.powerUsage);
|
||||
}
|
||||
|
||||
public ICircuitBoard getHiveFrame() {
|
||||
if (!this.getUtil().isSlotEmpty(AlvearyStimulator.slotCircuit)) {
|
||||
return ChipsetManager.circuitRegistry.getCircuitboard(this.getUtil().getStack(AlvearyStimulator.slotCircuit));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public StimulatorCircuit[] getCircuits() {
|
||||
final ICircuitBoard board = this.getHiveFrame();
|
||||
if (board == null) {
|
||||
return new StimulatorCircuit[0];
|
||||
}
|
||||
final ICircuit[] circuits = board.getCircuits();
|
||||
final List<IBeeModifier> mod = new ArrayList<IBeeModifier>();
|
||||
for (final ICircuit circuit : circuits) {
|
||||
if (circuit instanceof StimulatorCircuit) {
|
||||
mod.add((IBeeModifier) circuit);
|
||||
}
|
||||
}
|
||||
return mod.toArray(new StimulatorCircuit[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
float mod = 1.0f;
|
||||
if (!this.powered) {
|
||||
return mod;
|
||||
}
|
||||
for (final IBeeModifier beeMod : this.modifiers) {
|
||||
mod *= beeMod.getTerritoryModifier(genome, mod);
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
float mod = 1.0f;
|
||||
if (!this.powered) {
|
||||
return mod;
|
||||
}
|
||||
for (final IBeeModifier beeMod : this.modifiers) {
|
||||
mod *= beeMod.getMutationModifier(genome, mate, mod);
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
float mod = 1.0f;
|
||||
if (!this.powered) {
|
||||
return mod;
|
||||
}
|
||||
for (final IBeeModifier beeMod : this.modifiers) {
|
||||
mod *= beeMod.getLifespanModifier(genome, mate, mod);
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
float mod = 1.0f;
|
||||
if (!this.powered) {
|
||||
return mod;
|
||||
}
|
||||
for (final IBeeModifier beeMod : this.modifiers) {
|
||||
mod *= beeMod.getProductionModifier(genome, mod);
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
float mod = 1.0f;
|
||||
if (!this.powered) {
|
||||
return mod;
|
||||
}
|
||||
for (final IBeeModifier beeMod : this.modifiers) {
|
||||
mod *= beeMod.getFloweringModifier(genome, mod);
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(final IBeeGenome genome, final float currentModifier) {
|
||||
float mod = 1.0f;
|
||||
if (!this.powered) {
|
||||
return mod;
|
||||
}
|
||||
for (final IBeeModifier beeMod : this.modifiers) {
|
||||
mod *= beeMod.getGeneticDecay(genome, mod);
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
if (!this.powered) {
|
||||
return false;
|
||||
}
|
||||
for (final IBeeModifier beeMod : this.modifiers) {
|
||||
if (beeMod.isSealed()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
if (!this.powered) {
|
||||
return false;
|
||||
}
|
||||
for (final IBeeModifier beeMod : this.modifiers) {
|
||||
if (beeMod.isSelfLighted()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
if (!this.powered) {
|
||||
return false;
|
||||
}
|
||||
for (final IBeeModifier beeMod : this.modifiers) {
|
||||
if (beeMod.isSunlightSimulated()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish() {
|
||||
if (!this.powered) {
|
||||
return false;
|
||||
}
|
||||
for (final IBeeModifier beeMod : this.modifiers) {
|
||||
if (beeMod.isHellish()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wearOutEquipment(final int amount) {
|
||||
this.getUtil().useEnergyMJ(this.powerUsage);
|
||||
}
|
||||
}
|
||||
|
||||
public static class StimulatorCircuit extends BinnieCircuit implements IBeeModifier
|
||||
{
|
||||
CircuitType type;
|
||||
|
||||
public StimulatorCircuit(final CircuitType type, final ICircuitLayout layout) {
|
||||
super("stimulator." + type.toString().toLowerCase(), 4, layout, Mods.Forestry.item("thermionicTubes"), type.recipe);
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getPowerUsage() {
|
||||
return this.type.power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.type.getTerritoryModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return this.type.getMutationModifier(genome, mate, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return this.type.getLifespanModifier(genome, mate, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.type.getProductionModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.type.getFloweringModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return this.type.isSealed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return this.type.isSelfLighted();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
return this.type.isSunlightSimulated();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish() {
|
||||
return this.type.isHellish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.type.getGeneticDecay(genome, currentModifier);
|
||||
}
|
||||
}
|
||||
|
||||
public enum CircuitType implements IBeeModifier
|
||||
{
|
||||
LowVoltage(3, 10),
|
||||
HighVoltage(5, 20),
|
||||
Plant(10, 10),
|
||||
Death(6, 10),
|
||||
Life(11, 10),
|
||||
Nether(7, 15),
|
||||
Mutation(4, 15),
|
||||
Inhibitor(1, 10),
|
||||
Territory(2, 10);
|
||||
|
||||
public int recipe;
|
||||
public int power;
|
||||
BeeModifierLogic logic;
|
||||
|
||||
private CircuitType(final int recipe, final int power) {
|
||||
this.logic = new BeeModifierLogic();
|
||||
this.recipe = recipe;
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
public void createCircuit(final ICircuitLayout layout) {
|
||||
final StimulatorCircuit circuit = new StimulatorCircuit(this, layout);
|
||||
for (final EnumBeeModifier modifier : EnumBeeModifier.values()) {
|
||||
final float mod = this.logic.getModifier(modifier, 1.0f);
|
||||
if (mod != 1.0f) {
|
||||
if (mod > 1.0f) {
|
||||
final int increase = (int) ((mod - 1.0f) * 100.0f);
|
||||
circuit.addTooltipString("Increases " + modifier.getName() + " by " + increase + "%");
|
||||
}
|
||||
else {
|
||||
final int decrease = (int) ((1.0f - mod) * 100.0f);
|
||||
circuit.addTooltipString("Decreases " + modifier.getName() + " by " + decrease + "%");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.logic.getModifier(EnumBeeModifier.Territory, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return this.logic.getModifier(EnumBeeModifier.Mutation, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return this.logic.getModifier(EnumBeeModifier.Lifespan, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.logic.getModifier(EnumBeeModifier.Production, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.logic.getModifier(EnumBeeModifier.Flowering, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.logic.getModifier(EnumBeeModifier.GeneticDecay, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return this.logic.getModifier(EnumBeeBooleanModifier.Sealed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return this.logic.getModifier(EnumBeeBooleanModifier.SelfLighted);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
return this.logic.getModifier(EnumBeeBooleanModifier.SunlightStimulated);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish() {
|
||||
return this.logic.getModifier(EnumBeeBooleanModifier.Hellish);
|
||||
}
|
||||
|
||||
static {
|
||||
CircuitType.LowVoltage.logic.setModifier(EnumBeeModifier.Production, 1.5f, 5.0f);
|
||||
CircuitType.HighVoltage.logic.setModifier(EnumBeeModifier.Production, 2.5f, 10.0f);
|
||||
CircuitType.Plant.logic.setModifier(EnumBeeModifier.Flowering, 1.5f, 5.0f);
|
||||
CircuitType.Death.logic.setModifier(EnumBeeModifier.Lifespan, 0.8f, 0.2f);
|
||||
CircuitType.Life.logic.setModifier(EnumBeeModifier.Lifespan, 1.5f, 5.0f);
|
||||
CircuitType.Nether.logic.setModifier(EnumBeeBooleanModifier.Hellish);
|
||||
CircuitType.Mutation.logic.setModifier(EnumBeeModifier.Mutation, 1.5f, 5.0f);
|
||||
CircuitType.Inhibitor.logic.setModifier(EnumBeeModifier.Territory, 0.4f, 0.1f);
|
||||
CircuitType.Inhibitor.logic.setModifier(EnumBeeModifier.Production, 0.9f, 0.5f);
|
||||
CircuitType.Territory.logic.setModifier(EnumBeeModifier.Territory, 1.5f, 5.0f);
|
||||
for (final CircuitType type : values()) {
|
||||
type.logic.setModifier(EnumBeeModifier.GeneticDecay, 1.5f, 10.0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cofh.api.energy.IEnergyHandler;
|
||||
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.power.ComponentPowerReceptor;
|
||||
import binnie.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.extrabees.apiary.TileExtraBeeAlveary;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
|
||||
public class AlvearyTransmission
|
||||
{
|
||||
public static class PackageAlvearyTransmission extends AlvearyMachine.AlvearyPackage implements IMachineInformation
|
||||
{
|
||||
public PackageAlvearyTransmission() {
|
||||
super("transmission", ExtraBeeTexture.AlvearyTransmission.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(final Machine machine) {
|
||||
new ComponentPowerReceptor(machine, 1000);
|
||||
new ComponentTransmission(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentTransmission extends ComponentBeeModifier implements IBeeModifier, IBeeListener
|
||||
{
|
||||
public ComponentTransmission(final Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
int energy = this.getUtil().getPoweredMachine().getEnergyStored(ForgeDirection.NORTH);
|
||||
if (energy == 0) {
|
||||
return;
|
||||
}
|
||||
final TileExtraBeeAlveary tile = (TileExtraBeeAlveary) this.getMachine().getTileEntity();
|
||||
final List<IEnergyHandler> handlers = new ArrayList<IEnergyHandler>();
|
||||
for (final TileEntity alvearyTile : tile.getAlvearyBlocks()) {
|
||||
if (alvearyTile instanceof IEnergyHandler && alvearyTile != tile) {
|
||||
handlers.add((IEnergyHandler) alvearyTile);
|
||||
}
|
||||
}
|
||||
if (handlers.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
final int maxOutput = 500;
|
||||
int output = energy / handlers.size();
|
||||
if (output > maxOutput) {
|
||||
output = maxOutput;
|
||||
}
|
||||
if (output < 1) {
|
||||
output = 1;
|
||||
}
|
||||
for (final IEnergyHandler handler : handlers) {
|
||||
final int recieved = handler.receiveEnergy(ForgeDirection.NORTH, output, false);
|
||||
this.getUtil().getPoweredMachine().receiveEnergy(ForgeDirection.NORTH, -recieved, false);
|
||||
energy = this.getUtil().getPoweredMachine().getEnergyStored(ForgeDirection.NORTH);
|
||||
if (energy <= 0) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.config;
|
||||
|
||||
import binnie.core.mod.config.PropDouble;
|
||||
import binnie.core.mod.config.PropPercentage;
|
||||
import binnie.core.mod.config.ConfigProperty;
|
||||
import binnie.core.mod.config.ConfigFile;
|
||||
|
||||
@ConfigFile(filename = "/config/forestry/extrabees/machines.conf")
|
||||
public class ConfigurationMachines
|
||||
{
|
||||
@ConfigProperty(key = "isolatorConsumptionChance", comment = { "Percentage chance of Isolator consuming bee, in x%." })
|
||||
@PropPercentage
|
||||
public static int isolatorConsumptionChance;
|
||||
@ConfigProperty(key = "geneticErrorModifier", comment = { "Modifier that changes how severe splicer/inoculator erros are.", "0 would result in no errors, even for awful serums.", "2.0 would result in twice as severe errors" })
|
||||
@PropDouble
|
||||
public static double geneticErrorModifier;
|
||||
|
||||
static {
|
||||
ConfigurationMachines.isolatorConsumptionChance = 30;
|
||||
ConfigurationMachines.geneticErrorModifier = 1.0;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.config;
|
||||
|
||||
import binnie.core.mod.config.PropInteger;
|
||||
import binnie.core.mod.config.PropBoolean;
|
||||
import binnie.core.mod.config.ConfigProperty;
|
||||
import binnie.core.mod.config.ConfigFile;
|
||||
|
||||
@ConfigFile(filename = "/config/forestry/extrabees/main.conf")
|
||||
public class ConfigurationMain
|
||||
{
|
||||
@ConfigProperty(key = "canQuarryMineHives")
|
||||
@PropBoolean
|
||||
public static boolean canQuarryMineHives;
|
||||
@ConfigProperty(key = "waterHiveRate")
|
||||
@PropInteger
|
||||
public static int waterHiveRate;
|
||||
@ConfigProperty(key = "rockHiveRate")
|
||||
@PropInteger
|
||||
public static int rockHiveRate;
|
||||
@ConfigProperty(key = "netherHiveRate")
|
||||
@PropInteger
|
||||
public static int netherHiveRate;
|
||||
@ConfigProperty(key = "marbleHiveRate")
|
||||
@PropInteger
|
||||
public static int marbleHiveRate;
|
||||
|
||||
static {
|
||||
ConfigurationMain.canQuarryMineHives = true;
|
||||
ConfigurationMain.waterHiveRate = 1;
|
||||
ConfigurationMain.rockHiveRate = 2;
|
||||
ConfigurationMain.netherHiveRate = 2;
|
||||
ConfigurationMain.marbleHiveRate = 2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.core;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import binnie.extrabees.gui.WindowAlvearyHatchery;
|
||||
import binnie.extrabees.gui.WindowAlvearyStimulator;
|
||||
import binnie.extrabees.gui.WindowAlvearyFrame;
|
||||
import binnie.extrabees.gui.WindowAlvearyMutator;
|
||||
import binnie.extrabees.gui.database.WindowApiaristDatabase;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import binnie.core.gui.IBinnieGUID;
|
||||
|
||||
public enum ExtraBeeGUID implements IBinnieGUID
|
||||
{
|
||||
Database,
|
||||
DatabaseNEI,
|
||||
AlvearyMutator,
|
||||
AlvearyFrame,
|
||||
AlvearyStimulator,
|
||||
PunnettSquare,
|
||||
AlvearyHatchery;
|
||||
|
||||
@Override
|
||||
public Window getWindow(final EntityPlayer player, final World world, final int x, final int y, final int z, final Side side) {
|
||||
Window window = null;
|
||||
final TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
IInventory object = null;
|
||||
if (tileEntity instanceof IInventory) {
|
||||
object = (IInventory) tileEntity;
|
||||
}
|
||||
switch (this) {
|
||||
case Database:
|
||||
case DatabaseNEI: {
|
||||
window = WindowApiaristDatabase.create(player, side, this != ExtraBeeGUID.Database);
|
||||
break;
|
||||
}
|
||||
case AlvearyMutator: {
|
||||
window = WindowAlvearyMutator.create(player, object, side);
|
||||
break;
|
||||
}
|
||||
case AlvearyFrame: {
|
||||
window = WindowAlvearyFrame.create(player, object, side);
|
||||
break;
|
||||
}
|
||||
case AlvearyStimulator: {
|
||||
window = WindowAlvearyStimulator.create(player, object, side);
|
||||
break;
|
||||
}
|
||||
case AlvearyHatchery: {
|
||||
window = WindowAlvearyHatchery.create(player, object, side);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return window;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.core;
|
||||
|
||||
import java.util.List;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import binnie.core.Mods;
|
||||
import binnie.Binnie;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraft.util.IIcon;
|
||||
import binnie.core.item.IItemMisc;
|
||||
|
||||
public enum ExtraBeeItems implements IItemMisc
|
||||
{
|
||||
ScentedGear("Scented Gear", "scentedGear"),
|
||||
DiamondShard("Diamond Fragment", "diamondShard"),
|
||||
EmeraldShard("Emerald Fragment", "emeraldShard"),
|
||||
RubyShard("Ruby Fragment", "rubyShard"),
|
||||
SapphireShard("Sapphire Fragment", "sapphireShard"),
|
||||
LapisShard("Lapis Fragment", "lapisShard"),
|
||||
IronDust("Iron Grains", "ironDust"),
|
||||
GoldDust("Gold Grains", "goldDust"),
|
||||
SilverDust("Silver Grains", "silverDust"),
|
||||
PlatinumDust("Platinum Grains", "platinumDust"),
|
||||
CopperDust("Copper Grains", "copperDust"),
|
||||
TinDust("Tin Grains", "tinDust"),
|
||||
NickelDust("Nickel Grains", "nickelDust"),
|
||||
LeadDust("Lead Grains", "leadDust"),
|
||||
ZincDust("Zinc Grains", "zincDust"),
|
||||
TitaniumDust("Titanium Grains", "titaniumDust"),
|
||||
TungstenDust("Tungsten Grains", "tungstenDust"),
|
||||
UraniumDust("Radioactive Fragments", "radioactiveDust"),
|
||||
CoalDust("Coal Grains", "coalDust"),
|
||||
RedDye("Red Dye", "dyeRed"),
|
||||
YellowDye("Yellow Dye", "dyeYellow"),
|
||||
BlueDye("Blue Dye", "dyeBlue"),
|
||||
GreenDye("Green Dye", "dyeGreen"),
|
||||
WhiteDye("White Dye", "dyeWhite"),
|
||||
BlackDye("Black Dye", "dyeBlack"),
|
||||
BrownDye("Brown Dye", "dyeBrown"),
|
||||
ClayDust("Clay Dust", "clayDust"),
|
||||
YelloriumDust("Yellorium Grains", "yelloriumDust"),
|
||||
BlutoniumDust("Blutonium Grains", "blutoniumDust"),
|
||||
CyaniteDust("Cyanite Grains", "cyaniteDust");
|
||||
|
||||
String name;
|
||||
String iconPath;
|
||||
IIcon icon;
|
||||
String metalString;
|
||||
String gemString;
|
||||
|
||||
public static void init() {
|
||||
OreDictionary.registerOre("dyeRed", ExtraBeeItems.RedDye.get(1));
|
||||
OreDictionary.registerOre("dyeYellow", ExtraBeeItems.YellowDye.get(1));
|
||||
OreDictionary.registerOre("dyeBlue", ExtraBeeItems.BlueDye.get(1));
|
||||
OreDictionary.registerOre("dyeGreen", ExtraBeeItems.GreenDye.get(1));
|
||||
OreDictionary.registerOre("dyeBlack", ExtraBeeItems.BlackDye.get(1));
|
||||
OreDictionary.registerOre("dyeWhite", ExtraBeeItems.WhiteDye.get(1));
|
||||
OreDictionary.registerOre("dyeBrown", ExtraBeeItems.BrownDye.get(1));
|
||||
}
|
||||
|
||||
public static void postInit() {
|
||||
final ItemStack lapisShard = ExtraBeeItems.LapisShard.get(1);
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Items.dye, 1, 4), new Object[] { lapisShard, lapisShard, lapisShard, lapisShard });
|
||||
for (final ExtraBeeItems item : values()) {
|
||||
if (item.metalString != null) {
|
||||
ItemStack dust = null;
|
||||
ItemStack ingot = null;
|
||||
if (!OreDictionary.getOres("ingot" + item.metalString).isEmpty()) {
|
||||
ingot = OreDictionary.getOres("ingot" + item.metalString).get(0).copy();
|
||||
}
|
||||
if (!OreDictionary.getOres("dust" + item.metalString).isEmpty()) {
|
||||
dust = OreDictionary.getOres("dust" + item.metalString).get(0).copy();
|
||||
}
|
||||
final ItemStack input = item.get(1);
|
||||
if (dust != null) {
|
||||
GameRegistry.addShapelessRecipe(dust, new Object[] { input, input, input, input });
|
||||
}
|
||||
else if (ingot != null) {
|
||||
GameRegistry.addShapelessRecipe(ingot, new Object[] { input, input, input, input, input, input, input, input, input });
|
||||
}
|
||||
else if (item == ExtraBeeItems.CoalDust) {
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Items.coal), new Object[] { input, input, input, input });
|
||||
}
|
||||
}
|
||||
else if (item.gemString != null) {
|
||||
ItemStack gem = null;
|
||||
if (!OreDictionary.getOres("gem" + item.gemString).isEmpty()) {
|
||||
gem = OreDictionary.getOres("gem" + item.gemString).get(0);
|
||||
}
|
||||
final ItemStack input2 = item.get(1);
|
||||
if (gem != null) {
|
||||
GameRegistry.addShapelessRecipe(gem.copy(), new Object[] { input2, input2, input2, input2, input2, input2, input2, input2, input2 });
|
||||
}
|
||||
}
|
||||
}
|
||||
Item woodGear = null;
|
||||
try {
|
||||
woodGear = (Item) Class.forName("buildcraft.BuildCraftCore").getField("woodenGearItem").get(null);
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
ItemStack gear = new ItemStack(Blocks.planks, 1);
|
||||
if (woodGear != null) {
|
||||
gear = new ItemStack(woodGear, 1);
|
||||
}
|
||||
RecipeManagers.carpenterManager.addRecipe(100, Binnie.Liquid.getLiquidStack("for.honey", 500), (ItemStack) null, ExtraBeeItems.ScentedGear.get(1), new Object[] { " j ", "bgb", " p ", 'j', Mods.Forestry.item("royalJelly"), 'b', Mods.Forestry.item("beeswax"), 'p', Mods.Forestry.item("pollen"), 'g', gear });
|
||||
}
|
||||
|
||||
private ExtraBeeItems(final String name, final String iconPath) {
|
||||
this.metalString = null;
|
||||
this.gemString = null;
|
||||
this.name = name;
|
||||
this.iconPath = iconPath;
|
||||
}
|
||||
|
||||
private void setGem(final String string) {
|
||||
this.gemString = string;
|
||||
}
|
||||
|
||||
private void setMetal(final String string) {
|
||||
this.metalString = string;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
if (this.metalString != null) {
|
||||
return !OreDictionary.getOres("ingot" + this.metalString).isEmpty() || !OreDictionary.getOres("dust" + this.metalString).isEmpty() || this == ExtraBeeItems.CoalDust;
|
||||
}
|
||||
return this.gemString == null || !OreDictionary.getOres("gem" + this.gemString).isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(final ItemStack stack) {
|
||||
return this.icon;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(final IIconRegister register) {
|
||||
this.icon = ExtraBees.proxy.getIcon(register, "misc/" + this.iconPath);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(final List par3List) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName(final ItemStack stack) {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack get(final int i) {
|
||||
return new ItemStack(ExtraBees.itemMisc, i, this.ordinal());
|
||||
}
|
||||
|
||||
static {
|
||||
ExtraBeeItems.TinDust.setMetal("Tin");
|
||||
ExtraBeeItems.ZincDust.setMetal("Zinc");
|
||||
ExtraBeeItems.CopperDust.setMetal("Copper");
|
||||
ExtraBeeItems.IronDust.setMetal("Iron");
|
||||
ExtraBeeItems.NickelDust.setMetal("Nickel");
|
||||
ExtraBeeItems.LeadDust.setMetal("Lead");
|
||||
ExtraBeeItems.SilverDust.setMetal("Silver");
|
||||
ExtraBeeItems.GoldDust.setMetal("Gold");
|
||||
ExtraBeeItems.PlatinumDust.setMetal("Platinum");
|
||||
ExtraBeeItems.TungstenDust.setMetal("Tungsten");
|
||||
ExtraBeeItems.TitaniumDust.setMetal("Titanium");
|
||||
ExtraBeeItems.CoalDust.setMetal("Coal");
|
||||
ExtraBeeItems.YelloriumDust.setMetal("Yellorium");
|
||||
ExtraBeeItems.BlutoniumDust.setMetal("Blutonium");
|
||||
ExtraBeeItems.CyaniteDust.setMetal("Cyanite");
|
||||
ExtraBeeItems.DiamondShard.setGem("Diamond");
|
||||
ExtraBeeItems.EmeraldShard.setGem("Emerald");
|
||||
ExtraBeeItems.RubyShard.setGem("Ruby");
|
||||
ExtraBeeItems.SapphireShard.setGem("Sapphire");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.core;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.resource.BinnieResource;
|
||||
import binnie.core.resource.ResourceType;
|
||||
import binnie.core.resource.IBinnieTexture;
|
||||
|
||||
public enum ExtraBeeTexture implements IBinnieTexture
|
||||
{
|
||||
AlvearyMutator(ResourceType.Tile, "alveary/AlvearyMutator"),
|
||||
AlvearyNovaBlock(ResourceType.Tile, "alveary/AlvearyNovaBlock"),
|
||||
AlvearyFrame(ResourceType.Tile, "alveary/AlvearyFrame"),
|
||||
AlvearyLighting(ResourceType.Tile, "alveary/AlvearyLighting"),
|
||||
AlvearyRainShield(ResourceType.Tile, "alveary/AlvearyRainShield"),
|
||||
AlvearyStimulator(ResourceType.Tile, "alveary/AlvearyStimulator"),
|
||||
AlvearyHatchery(ResourceType.Tile, "alveary/AlvearyHatchery"),
|
||||
FX(ResourceType.FX, "fx"),
|
||||
GUIPunnett(ResourceType.GUI, "punnett"),
|
||||
GUIProgress(ResourceType.GUI, "processes"),
|
||||
GUIProgress2(ResourceType.GUI, "processes2"),
|
||||
AlvearyTransmission(ResourceType.Tile, "alveary/AlvearyTransmission");
|
||||
|
||||
String texture;
|
||||
ResourceType type;
|
||||
|
||||
private ExtraBeeTexture(final ResourceType base, final String texture) {
|
||||
this.texture = texture;
|
||||
this.type = base;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BinnieResource getTexture() {
|
||||
return Binnie.Resource.getPNG(ExtraBees.instance, this.type, this.texture);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.core;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import forestry.api.core.Tabs;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.IInitializable;
|
||||
|
||||
public class ModuleCore implements IInitializable
|
||||
{
|
||||
@Override
|
||||
public void preInit() {
|
||||
ExtraBees.itemMisc = Binnie.Item.registerMiscItems(ExtraBeeItems.values(), Tabs.tabApiculture);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
ExtraBeeItems.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
ExtraBeeItems.postInit();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,351 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.genetics;
|
||||
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.apiculture.IBeeRoot;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.genetics.IGenome;
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
|
||||
import forestry.api.genetics.IMutation;
|
||||
import binnie.Binnie;
|
||||
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
|
||||
import binnie.core.genetics.ForestryAllele;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import forestry.api.apiculture.IBeeMutation;
|
||||
|
||||
public class ExtraBeeMutation implements IBeeMutation
|
||||
{
|
||||
public static List<IBeeMutation> mutations;
|
||||
MutationRequirement req;
|
||||
IAlleleBeeSpecies species0;
|
||||
IAlleleBeeSpecies species1;
|
||||
IAllele[] template;
|
||||
int chance;
|
||||
|
||||
public static void doInit() {
|
||||
final IAlleleBeeSpecies[] vanilla = new IAlleleBeeSpecies[0];
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Meadows.getAllele(), ForestryAllele.BeeSpecies.Frugal.getAllele(), ExtraBeesSpecies.ARID, 10);
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Forest.getAllele(), ForestryAllele.BeeSpecies.Frugal.getAllele(), ExtraBeesSpecies.ARID, 10);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.ARID, ForestryAllele.BeeSpecies.Common.getAllele(), ExtraBeesSpecies.BARREN, 8);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.ARID, ExtraBeesSpecies.BARREN, ExtraBeesSpecies.DESOLATE, 8);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.BARREN, ForestryAllele.BeeSpecies.Forest.getAllele(), ExtraBeesSpecies.GNAWING, 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.DESOLATE, ForestryAllele.BeeSpecies.Meadows.getAllele(), ExtraBeesSpecies.ROTTEN, 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.DESOLATE, ForestryAllele.BeeSpecies.Forest.getAllele(), ExtraBeesSpecies.BONE, 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.DESOLATE, ForestryAllele.BeeSpecies.Modest.getAllele(), ExtraBeesSpecies.CREEPER, 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.BARREN, ForestryAllele.BeeSpecies.Marshy.getAllele(), ExtraBeesSpecies.DECOMPOSING, 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.ROCK, ForestryAllele.BeeSpecies.Diligent.getAllele(), ExtraBeesSpecies.STONE, 12);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.STONE, ForestryAllele.BeeSpecies.Unweary.getAllele(), ExtraBeesSpecies.GRANITE, 10);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.GRANITE, ForestryAllele.BeeSpecies.Industrious.getAllele(), ExtraBeesSpecies.MINERAL, 6);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Meadows.getAllele(), ExtraBeesSpecies.IRON, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Forest.getAllele(), ExtraBeesSpecies.IRON, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Wintry.getAllele(), ExtraBeesSpecies.COPPER, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Modest.getAllele(), ExtraBeesSpecies.COPPER, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Marshy.getAllele(), ExtraBeesSpecies.TIN, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Tropical.getAllele(), ExtraBeesSpecies.TIN, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Meadows.getAllele(), ExtraBeesSpecies.LEAD, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Modest.getAllele(), ExtraBeesSpecies.LEAD, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Wintry.getAllele(), ExtraBeesSpecies.ZINC, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Tropical.getAllele(), ExtraBeesSpecies.ZINC, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Forest.getAllele(), ExtraBeesSpecies.NICKEL, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Marshy.getAllele(), ExtraBeesSpecies.NICKEL, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Cultivated.getAllele(), ExtraBeesSpecies.TITANIUM, 3);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Common.getAllele(), ExtraBeesSpecies.TUNGSTATE, 3);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.ZINC, ForestryAllele.BeeSpecies.Majestic.getAllele(), ExtraBeesSpecies.SILVER, 2);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.TIN, ForestryAllele.BeeSpecies.Majestic.getAllele(), ExtraBeesSpecies.SILVER, 2);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.LEAD, ForestryAllele.BeeSpecies.Majestic.getAllele(), ExtraBeesSpecies.SILVER, 2);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.TITANIUM, ForestryAllele.BeeSpecies.Majestic.getAllele(), ExtraBeesSpecies.SILVER, 3);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.IRON, ForestryAllele.BeeSpecies.Majestic.getAllele(), ExtraBeesSpecies.GOLD, 2);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.COPPER, ForestryAllele.BeeSpecies.Majestic.getAllele(), ExtraBeesSpecies.GOLD, 2);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.NICKEL, ForestryAllele.BeeSpecies.Majestic.getAllele(), ExtraBeesSpecies.GOLD, 2);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.TUNGSTATE, ForestryAllele.BeeSpecies.Majestic.getAllele(), ExtraBeesSpecies.GOLD, 3);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.GOLD, ExtraBeesSpecies.SILVER, ExtraBeesSpecies.PLATINUM, 2);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.MINERAL, ForestryAllele.BeeSpecies.Imperial.getAllele(), ExtraBeesSpecies.LAPIS, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.LAPIS, ForestryAllele.BeeSpecies.Forest.getAllele(), ExtraBeesSpecies.EMERALD, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.LAPIS, ForestryAllele.BeeSpecies.Modest.getAllele(), ExtraBeesSpecies.RUBY, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.LAPIS, ExtraBeesSpecies.WATER, ExtraBeesSpecies.SAPPHIRE, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.LAPIS, ForestryAllele.BeeSpecies.Cultivated.getAllele(), ExtraBeesSpecies.DIAMOND, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.PREHISTORIC, ExtraBeesSpecies.MINERAL, ExtraBeesSpecies.UNSTABLE, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.UNSTABLE, ExtraBeesSpecies.IRON, ExtraBeesSpecies.NUCLEAR, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.UNSTABLE, ExtraBeesSpecies.COPPER, ExtraBeesSpecies.NUCLEAR, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.UNSTABLE, ExtraBeesSpecies.TIN, ExtraBeesSpecies.NUCLEAR, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.UNSTABLE, ExtraBeesSpecies.ZINC, ExtraBeesSpecies.NUCLEAR, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.UNSTABLE, ExtraBeesSpecies.NICKEL, ExtraBeesSpecies.NUCLEAR, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.UNSTABLE, ExtraBeesSpecies.LEAD, ExtraBeesSpecies.NUCLEAR, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.NUCLEAR, ExtraBeesSpecies.GOLD, ExtraBeesSpecies.RADIOACTIVE, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.NUCLEAR, ExtraBeesSpecies.SILVER, ExtraBeesSpecies.RADIOACTIVE, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.NUCLEAR, ForestryAllele.BeeSpecies.Frugal.getAllele(), ExtraBeesSpecies.YELLORIUM, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.NUCLEAR, ExtraBeesSpecies.YELLORIUM, ExtraBeesSpecies.CYANITE, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.YELLORIUM, ExtraBeesSpecies.CYANITE, ExtraBeesSpecies.BLUTONIUM, 5);
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Noble.getAllele(), ForestryAllele.BeeSpecies.Diligent.getAllele(), ExtraBeesSpecies.ANCIENT, 10);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.ANCIENT, ForestryAllele.BeeSpecies.Secluded.getAllele(), ExtraBeesSpecies.PRIMEVAL, 8);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.PRIMEVAL, ExtraBeesSpecies.ANCIENT, ExtraBeesSpecies.PREHISTORIC, 8);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.PREHISTORIC, ForestryAllele.BeeSpecies.Imperial.getAllele(), ExtraBeesSpecies.RELIC, 8);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.PRIMEVAL, ExtraBeesSpecies.GROWING, ExtraBeesSpecies.COAL, 8);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.PRIMEVAL, ForestryAllele.BeeSpecies.Rural.getAllele(), ExtraBeesSpecies.COAL, 8);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.PRIMEVAL, ForestryAllele.BeeSpecies.Miry.getAllele(), ExtraBeesSpecies.RESIN, 8);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.PRIMEVAL, ExtraBeesSpecies.OCEAN, ExtraBeesSpecies.OIL, 8);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.PRIMEVAL, ForestryAllele.BeeSpecies.Frugal.getAllele(), ExtraBeesSpecies.OIL, 8);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.OIL, ForestryAllele.BeeSpecies.Industrious.getAllele(), ExtraBeesSpecies.DISTILLED, 8);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.DISTILLED, ExtraBeesSpecies.OIL, ExtraBeesSpecies.FUEL, 8);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.DISTILLED, ExtraBeesSpecies.COAL, ExtraBeesSpecies.CREOSOTE, 8);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.DISTILLED, ExtraBeesSpecies.RESIN, ExtraBeesSpecies.LATEX, 8);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ForestryAllele.BeeSpecies.Diligent.getAllele(), ExtraBeesSpecies.RIVER, 10, new RequirementBiomeType(BiomeDictionary.Type.RIVER));
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ForestryAllele.BeeSpecies.Diligent.getAllele(), ExtraBeesSpecies.OCEAN, 10, new RequirementBiomeType(BiomeDictionary.Type.OCEAN));
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.BLACK, ExtraBeesSpecies.OCEAN, ExtraBeesSpecies.INK, 8);
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Forest.getAllele(), ForestryAllele.BeeSpecies.Diligent.getAllele(), ExtraBeesSpecies.GROWING, 10);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.GROWING, ForestryAllele.BeeSpecies.Unweary.getAllele(), ExtraBeesSpecies.THRIVING, 10);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.THRIVING, ForestryAllele.BeeSpecies.Industrious.getAllele(), ExtraBeesSpecies.BLOOMING, 8);
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Valiant.getAllele(), ForestryAllele.BeeSpecies.Diligent.getAllele(), ExtraBeesSpecies.SWEET, 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.SWEET, ForestryAllele.BeeSpecies.Rural.getAllele(), ExtraBeesSpecies.SUGAR, 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.SWEET, ExtraBeesSpecies.GROWING, ExtraBeesSpecies.RIPENING, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.SWEET, ExtraBeesSpecies.THRIVING, ExtraBeesSpecies.FRUIT, 5);
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Farmerly.getAllele(), ForestryAllele.BeeSpecies.Meadows.getAllele(), ExtraBeesSpecies.ALCOHOL, 10);
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Farmerly.getAllele(), ForestryAllele.BeeSpecies.Meadows.getAllele(), ExtraBeesSpecies.FARM, 10);
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Farmerly.getAllele(), ExtraBeesSpecies.WATER, ExtraBeesSpecies.MILK, 10);
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Farmerly.getAllele(), ForestryAllele.BeeSpecies.Tropical.getAllele(), ExtraBeesSpecies.COFFEE, 10);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ForestryAllele.BeeSpecies.Miry.getAllele(), ExtraBeesSpecies.SWAMP, 10);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.SWAMP, ForestryAllele.BeeSpecies.Boggy.getAllele(), ExtraBeesSpecies.BOGGY, 8);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.BOGGY, ExtraBeesSpecies.SWAMP, ExtraBeesSpecies.FUNGAL, 8);
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Boggy.getAllele(), ForestryAllele.BeeSpecies.Miry.getAllele(), ExtraBeesSpecies.FUNGAL, 8);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ForestryAllele.BeeSpecies.Forest.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ForestryAllele.BeeSpecies.Meadows.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ForestryAllele.BeeSpecies.Modest.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ForestryAllele.BeeSpecies.Tropical.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ForestryAllele.BeeSpecies.Marshy.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ForestryAllele.BeeSpecies.Wintry.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ExtraBeesSpecies.ROCK, ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ExtraBeesSpecies.BASALT, ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.ROCK, ForestryAllele.BeeSpecies.Forest.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.ROCK, ForestryAllele.BeeSpecies.Meadows.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.ROCK, ForestryAllele.BeeSpecies.Modest.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.ROCK, ForestryAllele.BeeSpecies.Tropical.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.ROCK, ForestryAllele.BeeSpecies.Marshy.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.ROCK, ForestryAllele.BeeSpecies.Wintry.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.ROCK, ExtraBeesSpecies.BASALT, ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.BASALT, ForestryAllele.BeeSpecies.Forest.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.BASALT, ForestryAllele.BeeSpecies.Meadows.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.BASALT, ForestryAllele.BeeSpecies.Modest.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.BASALT, ForestryAllele.BeeSpecies.Tropical.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.BASALT, ForestryAllele.BeeSpecies.Marshy.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.BASALT, ForestryAllele.BeeSpecies.Wintry.getAllele(), ForestryAllele.BeeSpecies.Common.getTemplate(), 15);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ForestryAllele.BeeSpecies.Common.getAllele(), ForestryAllele.BeeSpecies.Cultivated.getTemplate(), 12);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.ROCK, ForestryAllele.BeeSpecies.Common.getAllele(), ForestryAllele.BeeSpecies.Cultivated.getTemplate(), 12);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.BASALT, ForestryAllele.BeeSpecies.Common.getAllele(), ForestryAllele.BeeSpecies.Cultivated.getTemplate(), 12);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.BASALT, ForestryAllele.BeeSpecies.Fiendish.getAllele(), ExtraBeesSpecies.TEMPERED, 30, new RequirementBiomeType(BiomeDictionary.Type.NETHER));
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.TEMPERED, ForestryAllele.BeeSpecies.Demonic.getAllele(), ExtraBeesSpecies.VOLCANIC, 20, new RequirementBiomeType(BiomeDictionary.Type.NETHER));
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.BASALT, ForestryAllele.BeeSpecies.Cultivated.getAllele(), ForestryAllele.BeeSpecies.Sinister.getTemplate(), 60, new RequirementBiomeType(BiomeDictionary.Type.NETHER));
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.BASALT, ForestryAllele.BeeSpecies.Sinister.getAllele(), ForestryAllele.BeeSpecies.Fiendish.getTemplate(), 40, new RequirementBiomeType(BiomeDictionary.Type.NETHER));
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Sinister.getAllele(), ForestryAllele.BeeSpecies.Tropical.getAllele(), ExtraBeesSpecies.MALICIOUS, 10);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.MALICIOUS, ForestryAllele.BeeSpecies.Tropical.getAllele(), ExtraBeesSpecies.INFECTIOUS, 8);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.MALICIOUS, ExtraBeesSpecies.INFECTIOUS, ExtraBeesSpecies.VIRULENT, 8);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ForestryAllele.BeeSpecies.Exotic.getAllele(), ExtraBeesSpecies.VISCOUS, 10);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.VISCOUS, ForestryAllele.BeeSpecies.Exotic.getAllele(), ExtraBeesSpecies.GLUTINOUS, 8);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.VISCOUS, ExtraBeesSpecies.GLUTINOUS, ExtraBeesSpecies.STICKY, 8);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.MALICIOUS, ExtraBeesSpecies.VISCOUS, ExtraBeesSpecies.CORROSIVE, 10);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.CORROSIVE, ForestryAllele.BeeSpecies.Fiendish.getAllele(), ExtraBeesSpecies.CAUSTIC, 8);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.CORROSIVE, ExtraBeesSpecies.CAUSTIC, ExtraBeesSpecies.ACIDIC, 4);
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Cultivated.getAllele(), ForestryAllele.BeeSpecies.Valiant.getAllele(), ExtraBeesSpecies.EXCITED, 10);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.EXCITED, ForestryAllele.BeeSpecies.Diligent.getAllele(), ExtraBeesSpecies.ENERGETIC, 8);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.EXCITED, ExtraBeesSpecies.ENERGETIC, ExtraBeesSpecies.ECSTATIC, 8);
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Wintry.getAllele(), ForestryAllele.BeeSpecies.Diligent.getAllele(), ExtraBeesSpecies.ARTIC, 10);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.OCEAN, ExtraBeesSpecies.ARTIC, ExtraBeesSpecies.FREEZING, 10);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.ROCK, ForestryAllele.BeeSpecies.Sinister.getAllele(), ExtraBeesSpecies.SHADOW, 10);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.SHADOW, ExtraBeesSpecies.ROCK, ExtraBeesSpecies.DARKENED, 8);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.SHADOW, ExtraBeesSpecies.DARKENED, ExtraBeesSpecies.ABYSS, 8);
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Forest.getAllele(), ForestryAllele.BeeSpecies.Valiant.getAllele(), ExtraBeesSpecies.RED, 5);
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Meadows.getAllele(), ForestryAllele.BeeSpecies.Valiant.getAllele(), ExtraBeesSpecies.YELLOW, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.WATER, ForestryAllele.BeeSpecies.Valiant.getAllele(), ExtraBeesSpecies.BLUE, 5);
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Tropical.getAllele(), ForestryAllele.BeeSpecies.Valiant.getAllele(), ExtraBeesSpecies.GREEN, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.ROCK, ForestryAllele.BeeSpecies.Valiant.getAllele(), ExtraBeesSpecies.BLACK, 5);
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Wintry.getAllele(), ForestryAllele.BeeSpecies.Valiant.getAllele(), ExtraBeesSpecies.WHITE, 5);
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Marshy.getAllele(), ForestryAllele.BeeSpecies.Valiant.getAllele(), ExtraBeesSpecies.BROWN, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.RED, ExtraBeesSpecies.YELLOW, ExtraBeesSpecies.ORANGE, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.GREEN, ExtraBeesSpecies.BLUE, ExtraBeesSpecies.CYAN, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.RED, ExtraBeesSpecies.BLUE, ExtraBeesSpecies.PURPLE, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.BLACK, ExtraBeesSpecies.WHITE, ExtraBeesSpecies.GRAY, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.BLUE, ExtraBeesSpecies.WHITE, ExtraBeesSpecies.LIGHTBLUE, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.RED, ExtraBeesSpecies.WHITE, ExtraBeesSpecies.PINK, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.GREEN, ExtraBeesSpecies.WHITE, ExtraBeesSpecies.LIMEGREEN, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.PURPLE, ExtraBeesSpecies.PINK, ExtraBeesSpecies.MAGENTA, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.GRAY, ExtraBeesSpecies.WHITE, ExtraBeesSpecies.LIGHTGRAY, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.TEMPERED, ExtraBeesSpecies.EXCITED, ExtraBeesSpecies.GLOWSTONE, 5);
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Austere.getAllele(), ExtraBeesSpecies.DESOLATE, ExtraBeesSpecies.HAZARDOUS, 5);
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Ended.getAllele(), ExtraBeesSpecies.RELIC, ExtraBeesSpecies.JADED, 2, new RequirementPerson("jadedcat"));
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Austere.getAllele(), ExtraBeesSpecies.EXCITED, ExtraBeesSpecies.CELEBRATORY, 5);
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Secluded.getAllele(), ForestryAllele.BeeSpecies.Ended.getAllele(), ExtraBeesSpecies.UNUSUAL, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.UNUSUAL, ForestryAllele.BeeSpecies.Hermitic.getAllele(), ExtraBeesSpecies.SPATIAL, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.SPATIAL, ForestryAllele.BeeSpecies.Spectral.getAllele(), ExtraBeesSpecies.QUANTUM, 5);
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Noble.getAllele(), ForestryAllele.BeeSpecies.Monastic.getAllele(), ExtraBeesSpecies.MYSTICAL, 5);
|
||||
for (final IBeeMutation mutation : ExtraBeeMutation.mutations) {
|
||||
Binnie.Genetics.getBeeRoot().registerMutation(mutation);
|
||||
}
|
||||
}
|
||||
|
||||
public ExtraBeeMutation(final IAlleleBeeSpecies allele0, final IAlleleBeeSpecies allele1, final ExtraBeesSpecies mutation, final int chance) {
|
||||
this(allele0, allele1, mutation.getTemplate(), chance, null);
|
||||
}
|
||||
|
||||
public ExtraBeeMutation(final IAlleleBeeSpecies allele0, final IAlleleBeeSpecies allele1, final ExtraBeesSpecies mutation, final int chance, final MutationRequirement req) {
|
||||
this(allele0, allele1, mutation.getTemplate(), chance, req);
|
||||
}
|
||||
|
||||
public ExtraBeeMutation(final IAlleleBeeSpecies allele0, final IAlleleBeeSpecies allele1, final IAllele[] mutation, final int chance) {
|
||||
this(allele0, allele1, mutation, chance, null);
|
||||
}
|
||||
|
||||
public ExtraBeeMutation(final IAlleleBeeSpecies allele0, final IAlleleBeeSpecies allele1, final IAllele[] mutation, final int chance, final MutationRequirement req) {
|
||||
this.species0 = null;
|
||||
this.species1 = null;
|
||||
this.template = new IAllele[0];
|
||||
this.chance = 80;
|
||||
this.chance = chance;
|
||||
this.req = req;
|
||||
this.species0 = allele0;
|
||||
this.species1 = allele1;
|
||||
this.template = mutation;
|
||||
if (this.species0 != null && this.species1 != null && this.template != null) {
|
||||
ExtraBeeMutation.mutations.add(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAlleleSpecies getAllele0() {
|
||||
return this.species0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAlleleSpecies getAllele1() {
|
||||
return this.species1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAllele[] getTemplate() {
|
||||
return this.template;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBaseChance() {
|
||||
return this.chance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPartner(final IAllele allele) {
|
||||
return allele.getUID().equals(this.species0.getUID()) || allele.getUID().equals(this.species1.getUID());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAllele getPartner(final IAllele allele) {
|
||||
return allele.getUID().equals(this.species0.getUID()) ? this.species1 : this.species0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSecret() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getChance(final IBeeHousing housing, final IAlleleBeeSpecies allele0, final IAlleleBeeSpecies allele1, final IBeeGenome genome0, final IBeeGenome genome1) {
|
||||
if (this.species0 == null || this.species1 == null || allele0 == null || allele1 == null) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
final World world = housing.getWorld();
|
||||
final BiomeGenBase biome = housing.getBiome();
|
||||
if (this.req != null && !this.req.fufilled(housing, allele0, allele1, genome0, genome1)) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
final int processedChance = Math.round(this.chance * BeeManager.beeRoot.createBeeHousingModifier(housing).getMutationModifier(genome0, genome1, 1.0f)
|
||||
* Binnie.Genetics.getBeeRoot().getBeekeepingMode(world).getBeeModifier().getMutationModifier(genome0, genome1, 1.0f));
|
||||
if (this.species0.getUID().equals(allele0.getUID()) && this.species1.getUID().equals(allele1.getUID())) {
|
||||
return processedChance;
|
||||
}
|
||||
if (this.species1.getUID().equals(allele0.getUID()) && this.species0.getUID().equals(allele1.getUID())) {
|
||||
return processedChance;
|
||||
}
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<String> getSpecialConditions() {
|
||||
final List<String> conditions = new ArrayList<String>();
|
||||
if (this.req != null) {
|
||||
for (final String s : this.req.tooltip()) {
|
||||
conditions.add(s);
|
||||
}
|
||||
}
|
||||
return conditions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBeeRoot getRoot() {
|
||||
return Binnie.Genetics.getBeeRoot();
|
||||
}
|
||||
|
||||
static {
|
||||
ExtraBeeMutation.mutations = new ArrayList<IBeeMutation>();
|
||||
}
|
||||
|
||||
abstract static class MutationRequirement
|
||||
{
|
||||
public abstract String[] tooltip();
|
||||
|
||||
public abstract boolean fufilled(final IBeeHousing p0, final IAllele p1, final IAllele p2, final IGenome p3, final IGenome p4);
|
||||
}
|
||||
|
||||
static class RequirementBiomeType extends MutationRequirement
|
||||
{
|
||||
BiomeDictionary.Type type;
|
||||
|
||||
public RequirementBiomeType(final BiomeDictionary.Type type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] tooltip() {
|
||||
return new String[] { "Is restricted to " + this.type + "-like biomes." };
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean fufilled(final IBeeHousing housing, final IAllele allele0, final IAllele allele1, final IGenome genome0, final IGenome genome1) {
|
||||
return BiomeDictionary.isBiomeOfType(housing.getBiome(), this.type);
|
||||
}
|
||||
}
|
||||
|
||||
static class RequirementPerson extends MutationRequirement
|
||||
{
|
||||
String name;
|
||||
|
||||
public RequirementPerson(final String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] tooltip() {
|
||||
return new String[] { "Can only be bred by " + this.name };
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean fufilled(final IBeeHousing housing, final IAllele allele0, final IAllele allele1, final IGenome genome0, final IGenome genome1) {
|
||||
return housing.getOwner().getName() != null && housing.getOwner().getName().equals(this.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,308 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.genetics;
|
||||
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import java.util.LinkedHashSet;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import java.util.Set;
|
||||
import forestry.api.genetics.IClassification;
|
||||
|
||||
public enum ExtraBeesBranch implements IClassification
|
||||
{
|
||||
BARREN("Vacapis"),
|
||||
HOSTILE("Infenapis"),
|
||||
ROCKY("Monapis"),
|
||||
METALLIC("Lamminapis"),
|
||||
METALLIC2("Metalapis"),
|
||||
ALLOY("Allapis"),
|
||||
PRECIOUS("Pluriapis"),
|
||||
MINERAL("Niphapis"),
|
||||
GEMSTONE("Gemmapis"),
|
||||
NUCLEAR("Levapis"),
|
||||
HISTORIC("Priscapis"),
|
||||
FOSSILIZED("Fosiapis"),
|
||||
REFINED("Petrapis"),
|
||||
AQUATIC("Aquapis"),
|
||||
SACCHARINE("Sacchapis"),
|
||||
CLASSICAL("Grecapis"),
|
||||
VOLCANIC("Irrapis"),
|
||||
VIRULENT("Virapis"),
|
||||
VISCOUS("Viscapis"),
|
||||
CAUSTIC("Morbapis"),
|
||||
ENERGETIC("Incitapis"),
|
||||
FARMING("Agriapis"),
|
||||
SHADOW("Pullapis"),
|
||||
PRIMARY("Primapis"),
|
||||
SECONDARY("Secapis"),
|
||||
TERTIARY("Tertiapis"),
|
||||
FTB("Eftebeapis"),
|
||||
QUANTUM("Quantapis"),
|
||||
BOTANIA("Botaniapis");
|
||||
|
||||
private String uid;
|
||||
private String scientific;
|
||||
private Set<IAlleleBeeSpecies> speciesSet;
|
||||
IClassification parent;
|
||||
|
||||
@Override
|
||||
public String getUID() {
|
||||
return "extrabees.genus." + this.uid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraBees.proxy.localise("branch." + this.toString().toLowerCase() + ".name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getScientific() {
|
||||
return this.scientific;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return ExtraBees.proxy.localiseOrBlank("branch." + this.toString().toLowerCase() + ".desc");
|
||||
}
|
||||
|
||||
private ExtraBeesBranch(final String scientific) {
|
||||
this.uid = "";
|
||||
this.scientific = "";
|
||||
this.speciesSet = new LinkedHashSet<IAlleleBeeSpecies>();
|
||||
this.scientific = scientific;
|
||||
this.uid = this.toString().toLowerCase();
|
||||
}
|
||||
|
||||
public void register() {
|
||||
if (!this.speciesSet.isEmpty()) {
|
||||
AlleleManager.alleleRegistry.registerClassification(this);
|
||||
final IClassification parent = AlleleManager.alleleRegistry.getClassification("family.apidae");
|
||||
if (parent != null) {
|
||||
parent.addMemberGroup(this);
|
||||
this.setParent(parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void doInit() {
|
||||
final IClassification frozenBranch = AlleleManager.alleleRegistry.getClassification("genus.bees.frozen");
|
||||
if (frozenBranch != null) {
|
||||
frozenBranch.addMemberSpecies(ExtraBeesSpecies.ARTIC);
|
||||
ExtraBeesSpecies.ARTIC.setBranch(frozenBranch);
|
||||
frozenBranch.addMemberSpecies(ExtraBeesSpecies.FREEZING);
|
||||
ExtraBeesSpecies.FREEZING.setBranch(frozenBranch);
|
||||
}
|
||||
final IClassification agrarianBranch = AlleleManager.alleleRegistry.getClassification("genus.bees.agrarian");
|
||||
if (agrarianBranch != null) {
|
||||
agrarianBranch.addMemberSpecies(ExtraBeesSpecies.FARM);
|
||||
ExtraBeesSpecies.FARM.setBranch(agrarianBranch);
|
||||
ExtraBeesSpecies.GROWING.setBranch(agrarianBranch);
|
||||
ExtraBeesSpecies.THRIVING.setBranch(agrarianBranch);
|
||||
ExtraBeesSpecies.BLOOMING.setBranch(agrarianBranch);
|
||||
}
|
||||
final IClassification boggyBranch = AlleleManager.alleleRegistry.getClassification("genus.bees.boggy");
|
||||
if (boggyBranch != null) {
|
||||
boggyBranch.addMemberSpecies(ExtraBeesSpecies.SWAMP);
|
||||
boggyBranch.addMemberSpecies(ExtraBeesSpecies.BOGGY);
|
||||
boggyBranch.addMemberSpecies(ExtraBeesSpecies.FUNGAL);
|
||||
ExtraBeesSpecies.SWAMP.setBranch(boggyBranch);
|
||||
ExtraBeesSpecies.BOGGY.setBranch(boggyBranch);
|
||||
ExtraBeesSpecies.FUNGAL.setBranch(boggyBranch);
|
||||
}
|
||||
final IClassification festiveBranch = AlleleManager.alleleRegistry.getClassification("genus.bees.festive");
|
||||
if (festiveBranch != null) {
|
||||
festiveBranch.addMemberSpecies(ExtraBeesSpecies.CELEBRATORY);
|
||||
ExtraBeesSpecies.CELEBRATORY.setBranch(festiveBranch);
|
||||
}
|
||||
final IClassification austereBranch = AlleleManager.alleleRegistry.getClassification("genus.bees.austere");
|
||||
if (austereBranch != null) {
|
||||
austereBranch.addMemberSpecies(ExtraBeesSpecies.HAZARDOUS);
|
||||
ExtraBeesSpecies.HAZARDOUS.setBranch(austereBranch);
|
||||
}
|
||||
ExtraBeesBranch.FARMING.addMemberSpecies(ExtraBeesSpecies.ALCOHOL);
|
||||
ExtraBeesBranch.FARMING.addMemberSpecies(ExtraBeesSpecies.MILK);
|
||||
ExtraBeesBranch.FARMING.addMemberSpecies(ExtraBeesSpecies.COFFEE);
|
||||
ExtraBeesBranch.FARMING.addMemberSpecies(ExtraBeesSpecies.CITRUS);
|
||||
ExtraBeesBranch.FARMING.addMemberSpecies(ExtraBeesSpecies.MINT);
|
||||
ExtraBeesBranch.FARMING.register();
|
||||
ExtraBeesBranch.BARREN.addMemberSpecies(ExtraBeesSpecies.ARID);
|
||||
ExtraBeesBranch.BARREN.addMemberSpecies(ExtraBeesSpecies.BARREN);
|
||||
ExtraBeesBranch.BARREN.addMemberSpecies(ExtraBeesSpecies.DESOLATE);
|
||||
ExtraBeesBranch.BARREN.addMemberSpecies(ExtraBeesSpecies.DECOMPOSING);
|
||||
ExtraBeesBranch.BARREN.addMemberSpecies(ExtraBeesSpecies.GNAWING);
|
||||
ExtraBeesBranch.BARREN.register();
|
||||
ExtraBeesBranch.HOSTILE.addMemberSpecies(ExtraBeesSpecies.ROTTEN);
|
||||
ExtraBeesBranch.HOSTILE.addMemberSpecies(ExtraBeesSpecies.BONE);
|
||||
ExtraBeesBranch.HOSTILE.addMemberSpecies(ExtraBeesSpecies.CREEPER);
|
||||
ExtraBeesBranch.HOSTILE.register();
|
||||
ExtraBeesBranch.ROCKY.addMemberSpecies(ExtraBeesSpecies.ROCK);
|
||||
ExtraBeesBranch.ROCKY.addMemberSpecies(ExtraBeesSpecies.STONE);
|
||||
ExtraBeesBranch.ROCKY.addMemberSpecies(ExtraBeesSpecies.GRANITE);
|
||||
ExtraBeesBranch.ROCKY.addMemberSpecies(ExtraBeesSpecies.MINERAL);
|
||||
ExtraBeesBranch.ROCKY.register();
|
||||
ExtraBeesBranch.METALLIC.addMemberSpecies(ExtraBeesSpecies.IRON);
|
||||
ExtraBeesBranch.METALLIC.addMemberSpecies(ExtraBeesSpecies.COPPER);
|
||||
ExtraBeesBranch.METALLIC.addMemberSpecies(ExtraBeesSpecies.TIN);
|
||||
ExtraBeesBranch.METALLIC.addMemberSpecies(ExtraBeesSpecies.LEAD);
|
||||
ExtraBeesBranch.METALLIC.register();
|
||||
ExtraBeesBranch.METALLIC2.addMemberSpecies(ExtraBeesSpecies.NICKEL);
|
||||
ExtraBeesBranch.METALLIC2.addMemberSpecies(ExtraBeesSpecies.ZINC);
|
||||
ExtraBeesBranch.METALLIC2.addMemberSpecies(ExtraBeesSpecies.TUNGSTATE);
|
||||
ExtraBeesBranch.METALLIC2.addMemberSpecies(ExtraBeesSpecies.TITANIUM);
|
||||
ExtraBeesBranch.METALLIC2.register();
|
||||
ExtraBeesBranch.ALLOY.addMemberSpecies(ExtraBeesSpecies.BRONZE);
|
||||
ExtraBeesBranch.ALLOY.addMemberSpecies(ExtraBeesSpecies.BRASS);
|
||||
ExtraBeesBranch.ALLOY.addMemberSpecies(ExtraBeesSpecies.STEEL);
|
||||
ExtraBeesBranch.ALLOY.addMemberSpecies(ExtraBeesSpecies.INVAR);
|
||||
ExtraBeesBranch.ALLOY.register();
|
||||
ExtraBeesBranch.PRECIOUS.addMemberSpecies(ExtraBeesSpecies.SILVER);
|
||||
ExtraBeesBranch.PRECIOUS.addMemberSpecies(ExtraBeesSpecies.GOLD);
|
||||
ExtraBeesBranch.PRECIOUS.addMemberSpecies(ExtraBeesSpecies.ELECTRUM);
|
||||
ExtraBeesBranch.PRECIOUS.addMemberSpecies(ExtraBeesSpecies.PLATINUM);
|
||||
ExtraBeesBranch.PRECIOUS.register();
|
||||
ExtraBeesBranch.MINERAL.addMemberSpecies(ExtraBeesSpecies.LAPIS);
|
||||
ExtraBeesBranch.MINERAL.addMemberSpecies(ExtraBeesSpecies.SODALITE);
|
||||
ExtraBeesBranch.MINERAL.addMemberSpecies(ExtraBeesSpecies.PYRITE);
|
||||
ExtraBeesBranch.MINERAL.addMemberSpecies(ExtraBeesSpecies.BAUXITE);
|
||||
ExtraBeesBranch.MINERAL.addMemberSpecies(ExtraBeesSpecies.CINNABAR);
|
||||
ExtraBeesBranch.MINERAL.addMemberSpecies(ExtraBeesSpecies.SPHALERITE);
|
||||
ExtraBeesBranch.MINERAL.register();
|
||||
ExtraBeesBranch.GEMSTONE.addMemberSpecies(ExtraBeesSpecies.EMERALD);
|
||||
ExtraBeesBranch.GEMSTONE.addMemberSpecies(ExtraBeesSpecies.RUBY);
|
||||
ExtraBeesBranch.GEMSTONE.addMemberSpecies(ExtraBeesSpecies.SAPPHIRE);
|
||||
ExtraBeesBranch.GEMSTONE.addMemberSpecies(ExtraBeesSpecies.OLIVINE);
|
||||
ExtraBeesBranch.GEMSTONE.addMemberSpecies(ExtraBeesSpecies.DIAMOND);
|
||||
ExtraBeesBranch.GEMSTONE.register();
|
||||
ExtraBeesBranch.NUCLEAR.addMemberSpecies(ExtraBeesSpecies.UNSTABLE);
|
||||
ExtraBeesBranch.NUCLEAR.addMemberSpecies(ExtraBeesSpecies.NUCLEAR);
|
||||
ExtraBeesBranch.NUCLEAR.addMemberSpecies(ExtraBeesSpecies.RADIOACTIVE);
|
||||
ExtraBeesBranch.NUCLEAR.addMemberSpecies(ExtraBeesSpecies.YELLORIUM);
|
||||
ExtraBeesBranch.NUCLEAR.addMemberSpecies(ExtraBeesSpecies.CYANITE);
|
||||
ExtraBeesBranch.NUCLEAR.addMemberSpecies(ExtraBeesSpecies.BLUTONIUM);
|
||||
ExtraBeesBranch.NUCLEAR.register();
|
||||
ExtraBeesBranch.HISTORIC.addMemberSpecies(ExtraBeesSpecies.ANCIENT);
|
||||
ExtraBeesBranch.HISTORIC.addMemberSpecies(ExtraBeesSpecies.PRIMEVAL);
|
||||
ExtraBeesBranch.HISTORIC.addMemberSpecies(ExtraBeesSpecies.PREHISTORIC);
|
||||
ExtraBeesBranch.HISTORIC.addMemberSpecies(ExtraBeesSpecies.RELIC);
|
||||
ExtraBeesBranch.HISTORIC.register();
|
||||
ExtraBeesBranch.FOSSILIZED.addMemberSpecies(ExtraBeesSpecies.COAL);
|
||||
ExtraBeesBranch.FOSSILIZED.addMemberSpecies(ExtraBeesSpecies.RESIN);
|
||||
ExtraBeesBranch.FOSSILIZED.addMemberSpecies(ExtraBeesSpecies.OIL);
|
||||
ExtraBeesBranch.FOSSILIZED.addMemberSpecies(ExtraBeesSpecies.PEAT);
|
||||
ExtraBeesBranch.FOSSILIZED.register();
|
||||
ExtraBeesBranch.REFINED.addMemberSpecies(ExtraBeesSpecies.DISTILLED);
|
||||
ExtraBeesBranch.REFINED.addMemberSpecies(ExtraBeesSpecies.FUEL);
|
||||
ExtraBeesBranch.REFINED.addMemberSpecies(ExtraBeesSpecies.CREOSOTE);
|
||||
ExtraBeesBranch.REFINED.addMemberSpecies(ExtraBeesSpecies.LATEX);
|
||||
ExtraBeesBranch.REFINED.register();
|
||||
ExtraBeesBranch.AQUATIC.addMemberSpecies(ExtraBeesSpecies.WATER);
|
||||
ExtraBeesBranch.AQUATIC.addMemberSpecies(ExtraBeesSpecies.RIVER);
|
||||
ExtraBeesBranch.AQUATIC.addMemberSpecies(ExtraBeesSpecies.OCEAN);
|
||||
ExtraBeesBranch.AQUATIC.addMemberSpecies(ExtraBeesSpecies.INK);
|
||||
ExtraBeesBranch.AQUATIC.register();
|
||||
ExtraBeesBranch.SACCHARINE.addMemberSpecies(ExtraBeesSpecies.SWEET);
|
||||
ExtraBeesBranch.SACCHARINE.addMemberSpecies(ExtraBeesSpecies.SUGAR);
|
||||
ExtraBeesBranch.SACCHARINE.addMemberSpecies(ExtraBeesSpecies.FRUIT);
|
||||
ExtraBeesBranch.SACCHARINE.addMemberSpecies(ExtraBeesSpecies.RIPENING);
|
||||
ExtraBeesBranch.SACCHARINE.register();
|
||||
ExtraBeesBranch.CLASSICAL.addMemberSpecies(ExtraBeesSpecies.MARBLE);
|
||||
ExtraBeesBranch.CLASSICAL.addMemberSpecies(ExtraBeesSpecies.ROMAN);
|
||||
ExtraBeesBranch.CLASSICAL.addMemberSpecies(ExtraBeesSpecies.GREEK);
|
||||
ExtraBeesBranch.CLASSICAL.addMemberSpecies(ExtraBeesSpecies.CLASSICAL);
|
||||
ExtraBeesBranch.CLASSICAL.register();
|
||||
ExtraBeesBranch.VOLCANIC.addMemberSpecies(ExtraBeesSpecies.BASALT);
|
||||
ExtraBeesBranch.VOLCANIC.addMemberSpecies(ExtraBeesSpecies.TEMPERED);
|
||||
ExtraBeesBranch.VOLCANIC.addMemberSpecies(ExtraBeesSpecies.ANGRY);
|
||||
ExtraBeesBranch.VOLCANIC.addMemberSpecies(ExtraBeesSpecies.VOLCANIC);
|
||||
ExtraBeesBranch.VOLCANIC.addMemberSpecies(ExtraBeesSpecies.GLOWSTONE);
|
||||
ExtraBeesBranch.VOLCANIC.register();
|
||||
ExtraBeesBranch.VISCOUS.addMemberSpecies(ExtraBeesSpecies.VISCOUS);
|
||||
ExtraBeesBranch.VISCOUS.addMemberSpecies(ExtraBeesSpecies.GLUTINOUS);
|
||||
ExtraBeesBranch.VISCOUS.addMemberSpecies(ExtraBeesSpecies.STICKY);
|
||||
ExtraBeesBranch.VISCOUS.register();
|
||||
ExtraBeesBranch.VIRULENT.addMemberSpecies(ExtraBeesSpecies.MALICIOUS);
|
||||
ExtraBeesBranch.VIRULENT.addMemberSpecies(ExtraBeesSpecies.INFECTIOUS);
|
||||
ExtraBeesBranch.VIRULENT.addMemberSpecies(ExtraBeesSpecies.VIRULENT);
|
||||
ExtraBeesBranch.VIRULENT.register();
|
||||
ExtraBeesBranch.CAUSTIC.addMemberSpecies(ExtraBeesSpecies.CORROSIVE);
|
||||
ExtraBeesBranch.CAUSTIC.addMemberSpecies(ExtraBeesSpecies.CAUSTIC);
|
||||
ExtraBeesBranch.CAUSTIC.addMemberSpecies(ExtraBeesSpecies.ACIDIC);
|
||||
ExtraBeesBranch.CAUSTIC.register();
|
||||
ExtraBeesBranch.ENERGETIC.addMemberSpecies(ExtraBeesSpecies.EXCITED);
|
||||
ExtraBeesBranch.ENERGETIC.addMemberSpecies(ExtraBeesSpecies.ENERGETIC);
|
||||
ExtraBeesBranch.ENERGETIC.addMemberSpecies(ExtraBeesSpecies.ECSTATIC);
|
||||
ExtraBeesBranch.ENERGETIC.register();
|
||||
ExtraBeesBranch.SHADOW.addMemberSpecies(ExtraBeesSpecies.SHADOW);
|
||||
ExtraBeesBranch.SHADOW.addMemberSpecies(ExtraBeesSpecies.DARKENED);
|
||||
ExtraBeesBranch.SHADOW.addMemberSpecies(ExtraBeesSpecies.ABYSS);
|
||||
ExtraBeesBranch.SHADOW.register();
|
||||
ExtraBeesBranch.PRIMARY.addMemberSpecies(ExtraBeesSpecies.RED);
|
||||
ExtraBeesBranch.PRIMARY.addMemberSpecies(ExtraBeesSpecies.YELLOW);
|
||||
ExtraBeesBranch.PRIMARY.addMemberSpecies(ExtraBeesSpecies.BLUE);
|
||||
ExtraBeesBranch.PRIMARY.addMemberSpecies(ExtraBeesSpecies.GREEN);
|
||||
ExtraBeesBranch.PRIMARY.addMemberSpecies(ExtraBeesSpecies.BLACK);
|
||||
ExtraBeesBranch.PRIMARY.addMemberSpecies(ExtraBeesSpecies.WHITE);
|
||||
ExtraBeesBranch.PRIMARY.addMemberSpecies(ExtraBeesSpecies.BROWN);
|
||||
ExtraBeesBranch.PRIMARY.register();
|
||||
ExtraBeesBranch.SECONDARY.addMemberSpecies(ExtraBeesSpecies.ORANGE);
|
||||
ExtraBeesBranch.SECONDARY.addMemberSpecies(ExtraBeesSpecies.CYAN);
|
||||
ExtraBeesBranch.SECONDARY.addMemberSpecies(ExtraBeesSpecies.PURPLE);
|
||||
ExtraBeesBranch.SECONDARY.addMemberSpecies(ExtraBeesSpecies.GRAY);
|
||||
ExtraBeesBranch.SECONDARY.addMemberSpecies(ExtraBeesSpecies.LIGHTBLUE);
|
||||
ExtraBeesBranch.SECONDARY.addMemberSpecies(ExtraBeesSpecies.PINK);
|
||||
ExtraBeesBranch.SECONDARY.addMemberSpecies(ExtraBeesSpecies.LIMEGREEN);
|
||||
ExtraBeesBranch.SECONDARY.register();
|
||||
ExtraBeesBranch.TERTIARY.addMemberSpecies(ExtraBeesSpecies.MAGENTA);
|
||||
ExtraBeesBranch.TERTIARY.addMemberSpecies(ExtraBeesSpecies.LIGHTGRAY);
|
||||
ExtraBeesBranch.TERTIARY.register();
|
||||
ExtraBeesBranch.FTB.addMemberSpecies(ExtraBeesSpecies.JADED);
|
||||
ExtraBeesBranch.FTB.register();
|
||||
ExtraBeesBranch.QUANTUM.addMemberSpecies(ExtraBeesSpecies.UNUSUAL);
|
||||
ExtraBeesBranch.QUANTUM.addMemberSpecies(ExtraBeesSpecies.SPATIAL);
|
||||
ExtraBeesBranch.QUANTUM.addMemberSpecies(ExtraBeesSpecies.QUANTUM);
|
||||
ExtraBeesBranch.QUANTUM.register();
|
||||
ExtraBeesBranch.BOTANIA.addMemberSpecies(ExtraBeesSpecies.MYSTICAL);
|
||||
ExtraBeesBranch.BOTANIA.register();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IClassification.EnumClassLevel getLevel() {
|
||||
return IClassification.EnumClassLevel.GENUS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IClassification[] getMemberGroups() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addMemberGroup(final IClassification group) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAlleleSpecies[] getMemberSpecies() {
|
||||
return this.speciesSet.toArray(new IAlleleSpecies[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addMemberSpecies(final IAlleleSpecies species) {
|
||||
this.speciesSet.add((IAlleleBeeSpecies) species);
|
||||
if (species instanceof ExtraBeesSpecies) {
|
||||
((ExtraBeesSpecies) species).setBranch(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IClassification getParent() {
|
||||
return this.parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setParent(final IClassification parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,264 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.genetics;
|
||||
|
||||
import forestry.api.apiculture.FlowerManager;
|
||||
import forestry.api.genetics.IFlower;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Set;
|
||||
|
||||
import binnie.core.Mods;
|
||||
import forestry.api.genetics.IFruitBearer;
|
||||
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
import forestry.api.genetics.IIndividual;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
|
||||
import forestry.api.genetics.IPollinatable;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import forestry.api.genetics.IAlleleFlowers;
|
||||
import forestry.api.genetics.IFlowerProvider;
|
||||
|
||||
public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromosomeType
|
||||
{
|
||||
WATER,
|
||||
SUGAR,
|
||||
ROCK,
|
||||
BOOK,
|
||||
DEAD,
|
||||
REDSTONE,
|
||||
WOOD,
|
||||
LEAVES,
|
||||
Sapling,
|
||||
Fruit,
|
||||
Mystical;
|
||||
|
||||
boolean dominant;
|
||||
|
||||
private ExtraBeesFlowers() {
|
||||
this.dominant = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUID() {
|
||||
return "extrabees.flower." + this.toString().toLowerCase();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDominant() {
|
||||
return this.dominant;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IFlowerProvider getProvider() {
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return ExtraBees.proxy.localise("flowers." + this.name().toString().toLowerCase() + ".name");
|
||||
}
|
||||
|
||||
public void register() {
|
||||
// AlleleManager.alleleRegistry.registerAllele((IAllele)this);
|
||||
|
||||
for (ItemStack stack : getItemStacks()) {
|
||||
FlowerManager.flowerRegistry.registerAcceptableFlower(Block.getBlockFromItem(stack.getItem()), getUID());
|
||||
}
|
||||
|
||||
AlleleManager.alleleRegistry.registerAllele(this, this);
|
||||
}
|
||||
|
||||
public static void doInit() {
|
||||
for (final ExtraBeesFlowers effect : values()) {
|
||||
effect.register();
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack[] getItemStacks() {
|
||||
switch (this) {
|
||||
case WATER: {
|
||||
return new ItemStack[] { new ItemStack(Blocks.waterlily) };
|
||||
}
|
||||
case SUGAR: {
|
||||
return new ItemStack[] { new ItemStack(Blocks.reeds) };
|
||||
}
|
||||
case ROCK: {
|
||||
return new ItemStack[] { new ItemStack(Blocks.cobblestone) };
|
||||
}
|
||||
case BOOK: {
|
||||
return new ItemStack[] { new ItemStack(Blocks.bookshelf) };
|
||||
}
|
||||
case REDSTONE: {
|
||||
return new ItemStack[] { new ItemStack(Blocks.redstone_torch) };
|
||||
}
|
||||
case DEAD: {
|
||||
return new ItemStack[] { new ItemStack(Blocks.deadbush) };
|
||||
}
|
||||
case Fruit: {
|
||||
return new ItemStack[] { new ItemStack(Items.apple) };
|
||||
}
|
||||
case LEAVES: {
|
||||
return new ItemStack[] { new ItemStack(Blocks.leaves) };
|
||||
}
|
||||
case Sapling: {
|
||||
return new ItemStack[] { new ItemStack(Blocks.sapling) };
|
||||
}
|
||||
case WOOD: {
|
||||
return new ItemStack[] { new ItemStack(Blocks.log) };
|
||||
}
|
||||
default: {
|
||||
return new ItemStack[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedPollinatable(final World world, final IPollinatable pollinatable) {
|
||||
final EnumSet<EnumPlantType> types = pollinatable.getPlantType();
|
||||
return types.size() > 1 || !types.contains(EnumPlantType.Nether);
|
||||
}
|
||||
|
||||
public boolean isAcceptedFlower(final World world, final IIndividual individual, final int x, final int y, final int z) {
|
||||
final Block block = world.getBlock(x, y, z);
|
||||
if (block == null) {
|
||||
return false;
|
||||
}
|
||||
switch (this) {
|
||||
case WATER: {
|
||||
return block == Blocks.waterlily;
|
||||
}
|
||||
case ROCK: {
|
||||
return block.getMaterial() == Material.rock;
|
||||
}
|
||||
case SUGAR: {
|
||||
return block == Blocks.reeds;
|
||||
}
|
||||
case BOOK: {
|
||||
return block == Blocks.bookshelf;
|
||||
}
|
||||
case REDSTONE: {
|
||||
return block == Blocks.redstone_torch;
|
||||
}
|
||||
case DEAD: {
|
||||
return block == Blocks.deadbush;
|
||||
}
|
||||
case WOOD: {
|
||||
return block.isWood(world, x, y, z);
|
||||
}
|
||||
case Fruit: {
|
||||
return world.getTileEntity(x, y, z) instanceof IFruitBearer;
|
||||
}
|
||||
case LEAVES: {
|
||||
return block.isLeaves(world, x, y, z);
|
||||
}
|
||||
case Sapling: {
|
||||
return block.getClass().getName().toLowerCase().contains("sapling");
|
||||
}
|
||||
case Mystical: {
|
||||
return block == Mods.Botania.block("flower");
|
||||
}
|
||||
default: {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean growFlower(final World world, final IIndividual individual, final int x, final int y, final int z) {
|
||||
switch (this) {
|
||||
case WATER: {
|
||||
return world.isAirBlock(x, y, z) && world.getBlock(x, y - 1, z) == Blocks.water && world.setBlock(x, y, z, Blocks.waterlily, 0, 2);
|
||||
}
|
||||
case SUGAR: {
|
||||
return world.getBlock(x, y - 1, z) == Blocks.reeds && world.isAirBlock(x, y, z) && world.setBlock(x, y, z, Blocks.reeds, 0, 0);
|
||||
}
|
||||
default: {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] affectProducts(final World world, final IIndividual individual, final int x, final int y, final int z, final ItemStack[] products) {
|
||||
if (this == ExtraBeesFlowers.Mystical) {
|
||||
final List<ItemStack> prods = new ArrayList<ItemStack>();
|
||||
for (final ItemStack stack : products) {
|
||||
prods.add(stack);
|
||||
}
|
||||
for (int k = 0; k < 50; ++k) {
|
||||
final int tX = 7;
|
||||
final int tY = 7;
|
||||
final int tZ = 3;
|
||||
final int x2 = x - tX + world.rand.nextInt(1 + 2 * tX);
|
||||
final int y2 = y - tY + world.rand.nextInt(1 + 2 * tY);
|
||||
final int z2 = z - tZ + world.rand.nextInt(1 + 2 * tZ);
|
||||
final Block block = world.getBlock(x2, y2, z2);
|
||||
if (block != null) {
|
||||
if (block == Mods.Botania.block("flower")) {
|
||||
final int meta = world.getBlockMetadata(x2, y2, z2);
|
||||
final Item item = Mods.Botania.item("petal");
|
||||
if (item != null) {
|
||||
prods.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return prods.toArray(new ItemStack[0]);
|
||||
}
|
||||
return products;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName() {
|
||||
return this.getUID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFlowerType() {
|
||||
return this.getUID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<IFlower> getFlowers() {
|
||||
return new HashSet<IFlower>();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends IAllele> getAlleleClass() {
|
||||
return getClass();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ISpeciesRoot getSpeciesRoot() {
|
||||
return AlleleManager.alleleRegistry.getSpeciesRoot(getUID());
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,79 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.genetics;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import binnie.core.BinnieCore;
|
||||
import forestry.api.genetics.IGenome;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import binnie.Binnie;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import binnie.extrabees.genetics.effect.ExtraBeesEffect;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import binnie.extrabees.genetics.effect.BlockEctoplasm;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.genetics.items.ItemDictionary;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import binnie.core.IInitializable;
|
||||
|
||||
public class ModuleGenetics implements IInitializable
|
||||
{
|
||||
@Override
|
||||
public void preInit() {
|
||||
for (final ExtraBeesSpecies species : ExtraBeesSpecies.values()) {
|
||||
AlleleManager.alleleRegistry.registerAllele(species);
|
||||
}
|
||||
ExtraBees.dictionary = new ItemDictionary();
|
||||
GameRegistry.registerBlock(ExtraBees.ectoplasm = new BlockEctoplasm(), "ectoplasm");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
ExtraBeesEffect.doInit();
|
||||
ExtraBeesFlowers.doInit();
|
||||
ExtraBeesSpecies.doInit();
|
||||
ExtraBeeMutation.doInit();
|
||||
ExtraBeesBranch.doInit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
int ebSpeciesCount = 0;
|
||||
int ebTotalSpeciesCount = 0;
|
||||
for (final ExtraBeesSpecies species : ExtraBeesSpecies.values()) {
|
||||
++ebTotalSpeciesCount;
|
||||
if (!AlleleManager.alleleRegistry.isBlacklisted(species.getUID())) {
|
||||
++ebSpeciesCount;
|
||||
}
|
||||
}
|
||||
RecipeManagers.carpenterManager.addRecipe(100, Binnie.Liquid.getLiquidStack("water", 2000), (ItemStack) null, new ItemStack(ExtraBees.dictionary), new Object[] { "X#X", "YEY", "RDR", '#', Blocks.glass_pane, 'X', Items.gold_ingot, 'Y', "ingotTin", 'R', Items.redstone, 'D', Items.diamond, 'E', Items.emerald });
|
||||
}
|
||||
|
||||
public static IGenome getGenome(final IAlleleBeeSpecies allele0) {
|
||||
return Binnie.Genetics.getBeeRoot().templateAsGenome(Binnie.Genetics.getBeeRoot().getTemplate(allele0.getUID()));
|
||||
}
|
||||
|
||||
public static ItemStack getBeeIcon(final IAlleleBeeSpecies species) {
|
||||
if (species == null) {
|
||||
return null;
|
||||
}
|
||||
final IAllele[] template = Binnie.Genetics.getBeeRoot().getTemplate(species.getUID());
|
||||
if (template == null) {
|
||||
return null;
|
||||
}
|
||||
final IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(template);
|
||||
final IBee bee = Binnie.Genetics.getBeeRoot().getBee(BinnieCore.proxy.getWorld(), genome);
|
||||
final ItemStack item = Binnie.Genetics.getBeeRoot().getMemberStack(bee, EnumBeeType.PRINCESS.ordinal());
|
||||
return item;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.genetics.effect;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import java.util.Random;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.BlockWeb;
|
||||
|
||||
public class BlockEctoplasm extends BlockWeb
|
||||
{
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(final IIconRegister register) {
|
||||
this.blockIcon = ExtraBees.proxy.getIcon(register, "ectoplasm");
|
||||
}
|
||||
|
||||
public BlockEctoplasm() {
|
||||
this.setLightOpacity(1);
|
||||
this.setHardness(0.5f);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(final Random rand) {
|
||||
return (rand.nextInt(5) == 0) ? 1 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(final int p_149650_1_, final Random p_149650_2_, final int p_149650_3_) {
|
||||
return Items.slime_ball;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName() {
|
||||
return "extrabees.block.ectoplasm";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.genetics.effect;
|
||||
|
||||
import java.util.List;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
|
||||
public class EntityBeeLightning extends EntityLightningBolt
|
||||
{
|
||||
int lightningState;
|
||||
int boltLivingTime;
|
||||
|
||||
public EntityBeeLightning(final World par1World, final double par2, final double par4, final double par6) {
|
||||
super(par1World, par2, par4, par6);
|
||||
this.lightningState = 2;
|
||||
this.boltLivingTime = this.rand.nextInt(3) + 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
this.onEntityUpdate();
|
||||
--this.lightningState;
|
||||
if (this.lightningState < 0) {
|
||||
if (this.boltLivingTime == 0) {
|
||||
this.setDead();
|
||||
}
|
||||
else if (this.lightningState < -this.rand.nextInt(10)) {
|
||||
--this.boltLivingTime;
|
||||
this.lightningState = 1;
|
||||
this.boltVertex = this.rand.nextLong();
|
||||
if (!this.worldObj.isRemote && this.worldObj.doChunksNearChunkExist(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 10)) {
|
||||
final int i = MathHelper.floor_double(this.posX);
|
||||
final int j = MathHelper.floor_double(this.posY);
|
||||
final int k = MathHelper.floor_double(this.posZ);
|
||||
if (this.worldObj.getBlock(i, j, k) == null && Blocks.fire.canPlaceBlockAt(this.worldObj, i, j, k)) {
|
||||
this.worldObj.setBlock(i, j, k, Blocks.fire);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.lightningState >= 0) {
|
||||
if (this.worldObj.isRemote) {
|
||||
this.worldObj.lastLightningBolt = 2;
|
||||
}
|
||||
else {
|
||||
final double d0 = 3.0;
|
||||
final List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getBoundingBox(this.posX - d0, this.posY - d0, this.posZ - d0, this.posX + d0, this.posY + 6.0 + d0, this.posZ + d0));
|
||||
for (int l = 0; l < list.size(); ++l) {
|
||||
final Entity entity = (Entity) list.get(l);
|
||||
entity.onStruckByLightning(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,589 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.genetics.effect;
|
||||
|
||||
import java.util.Calendar;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import forestry.api.apiculture.IArmorApiarist;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import cofh.api.energy.IEnergyReceiver;
|
||||
|
||||
import net.minecraft.item.ItemDye;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import binnie.extrabees.genetics.ExtraBeesFlowers;
|
||||
import binnie.Binnie;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.IFluidHandler;
|
||||
|
||||
import net.minecraft.entity.item.EntityFireworkRocket;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.projectile.EntitySmallFireball;
|
||||
import net.minecraft.world.WorldServer;
|
||||
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import forestry.api.genetics.IEffectData;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import forestry.api.apiculture.IAlleleBeeEffect;
|
||||
import forestry.core.proxy.Proxies;
|
||||
|
||||
public enum ExtraBeesEffect implements IAlleleBeeEffect
|
||||
{
|
||||
ECTOPLASM,
|
||||
ACID,
|
||||
SPAWN_ZOMBIE,
|
||||
SPAWN_SKELETON,
|
||||
SPAWN_CREEPER,
|
||||
LIGHTNING,
|
||||
RADIOACTIVE,
|
||||
METEOR,
|
||||
HUNGER,
|
||||
FOOD,
|
||||
BLINDNESS,
|
||||
CONFUSION,
|
||||
FIREWORKS,
|
||||
FESTIVAL,
|
||||
BIRTHDAY,
|
||||
TELEPORT,
|
||||
GRAVITY,
|
||||
THIEF,
|
||||
WITHER,
|
||||
WATER,
|
||||
SLOW,
|
||||
BonemealSapling,
|
||||
BonemealFruit,
|
||||
BonemealMushroom,
|
||||
Power;
|
||||
|
||||
String fx;
|
||||
public boolean combinable;
|
||||
public boolean dominant;
|
||||
public int id;
|
||||
private String uid;
|
||||
static List<Birthday> birthdays;
|
||||
|
||||
private ExtraBeesEffect() {
|
||||
this.fx = "";
|
||||
this.uid = this.toString().toLowerCase();
|
||||
this.combinable = false;
|
||||
this.dominant = true;
|
||||
}
|
||||
|
||||
public static void doInit() {
|
||||
ExtraBeesEffect.BLINDNESS.setFX("blindness");
|
||||
ExtraBeesEffect.FOOD.setFX("food");
|
||||
ExtraBeesEffect.GRAVITY.setFX("gravity");
|
||||
ExtraBeesEffect.THIEF.setFX("gravity");
|
||||
ExtraBeesEffect.TELEPORT.setFX("gravity");
|
||||
ExtraBeesEffect.LIGHTNING.setFX("lightning");
|
||||
ExtraBeesEffect.METEOR.setFX("meteor");
|
||||
ExtraBeesEffect.RADIOACTIVE.setFX("radioactive");
|
||||
ExtraBeesEffect.WATER.setFX("water");
|
||||
ExtraBeesEffect.WITHER.setFX("wither");
|
||||
for (final ExtraBeesEffect effect : values()) {
|
||||
effect.register();
|
||||
}
|
||||
}
|
||||
|
||||
private void setFX(final String string) {
|
||||
this.fx = "particles/" + string;
|
||||
}
|
||||
|
||||
public void register() {
|
||||
AlleleManager.alleleRegistry.registerAllele(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isCombinable() {
|
||||
return this.combinable;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData validateStorage(final IEffectData storedData) {
|
||||
return storedData;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraBees.proxy.localise("effect." + this.name().toString().toLowerCase() + ".name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDominant() {
|
||||
return this.dominant;
|
||||
}
|
||||
|
||||
public void spawnMob(final World world, final int x, final int y, final int z, final String name) {
|
||||
if (this.anyPlayerInRange(world, x, y, z, 16)) {
|
||||
final double var1 = x + world.rand.nextFloat();
|
||||
final double var2 = y + world.rand.nextFloat();
|
||||
final double var3 = z + world.rand.nextFloat();
|
||||
world.spawnParticle("smoke", var1, var2, var3, 0.0, 0.0, 0.0);
|
||||
world.spawnParticle("flame", var1, var2, var3, 0.0, 0.0, 0.0);
|
||||
final EntityLiving var4 = (EntityLiving) EntityList.createEntityByName(name, world);
|
||||
if (var4 == null) {
|
||||
return;
|
||||
}
|
||||
final int var5 = world.getEntitiesWithinAABB(var4.getClass(), AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1).expand(8.0, 4.0, 8.0)).size();
|
||||
if (var5 >= 6) {
|
||||
return;
|
||||
}
|
||||
if (var4 != null) {
|
||||
final double var6 = x + (world.rand.nextDouble() - world.rand.nextDouble()) * 4.0;
|
||||
final double var7 = y + world.rand.nextInt(3) - 1;
|
||||
final double var8 = z + (world.rand.nextDouble() - world.rand.nextDouble()) * 4.0;
|
||||
var4.setLocationAndAngles(var6, var7, var8, world.rand.nextFloat() * 360.0f, 0.0f);
|
||||
if (var4.getCanSpawnHere()) {
|
||||
world.spawnEntityInWorld(var4);
|
||||
world.playAuxSFX(2004, x, y, z, 0);
|
||||
var4.spawnExplosionParticle();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean anyPlayerInRange(final World world, final int x, final int y, final int z, final int distance) {
|
||||
return world.getClosestPlayer(x + 0.5, y + 0.5, z + 0.5, distance) != null;
|
||||
}
|
||||
|
||||
public static void doAcid(final World world, final int x, final int y, final int z) {
|
||||
final Block block = world.getBlock(x, y, z);
|
||||
if (block == Blocks.cobblestone || block == Blocks.stone) {
|
||||
world.setBlock(x, y, z, Blocks.gravel, 0, 0);
|
||||
}
|
||||
else if (block == Blocks.dirt | block == Blocks.grass) {
|
||||
world.setBlock(x, y, z, Blocks.sand, 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUID() {
|
||||
return "extrabees.effect." + this.uid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData doEffect(final IBeeGenome genome, final IEffectData storedData, final IBeeHousing housing) {
|
||||
final World world = housing.getWorld();
|
||||
final int xHouse = housing.getCoordinates().posX;
|
||||
final int yHouse = housing.getCoordinates().posY;
|
||||
final int zHouse = housing.getCoordinates().posZ;
|
||||
final int[] area = this.getModifiedArea(genome, housing);
|
||||
final int xd = 1 + area[0] / 2;
|
||||
final int yd = 1 + area[1] / 2;
|
||||
final int zd = 1 + area[2] / 2;
|
||||
final int x1 = xHouse - xd + world.rand.nextInt(2 * xd + 1);
|
||||
int y1 = yHouse - yd + world.rand.nextInt(2 * yd + 1);
|
||||
final int z1 = zHouse - zd + world.rand.nextInt(2 * zd + 1);
|
||||
switch (this) {
|
||||
case ECTOPLASM: {
|
||||
if (world.rand.nextInt(100) < 4) {
|
||||
if (world.isAirBlock(x1, y1, z1) && (world.isBlockNormalCubeDefault(x1, y1 - 1, z1, false) || world.getBlock(x1, y1 - 1, z1) == ExtraBees.ectoplasm)) {
|
||||
world.setBlock(x1, y1, z1, ExtraBees.ectoplasm, 0, 0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ACID: {
|
||||
if (world.rand.nextInt(100) < 6) {
|
||||
doAcid(world, x1, y1, z1);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SPAWN_ZOMBIE: {
|
||||
if (world.rand.nextInt(200) < 2) {
|
||||
this.spawnMob(world, x1, y1, z1, "Zombie");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SPAWN_SKELETON: {
|
||||
if (world.rand.nextInt(200) < 2) {
|
||||
this.spawnMob(world, x1, y1, z1, "Skeleton");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SPAWN_CREEPER: {
|
||||
if (world.rand.nextInt(200) < 2) {
|
||||
this.spawnMob(world, x1, y1, z1, "Creeper");
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case LIGHTNING: {
|
||||
if (world.rand.nextInt(100) < 1 && world.canBlockSeeTheSky(x1, y1, z1) && world instanceof WorldServer) {
|
||||
((WorldServer) world).addWeatherEffect(new EntityBeeLightning(world, x1, y1, z1));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case METEOR: {
|
||||
if (world.rand.nextInt(100) < 1 && world.canBlockSeeTheSky(x1, y1, z1)) {
|
||||
((WorldServer) world).spawnEntityInWorld(new EntitySmallFireball(world, x1, y1 + 64, z1, 0.0, -0.6, 0.0));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case RADIOACTIVE: {
|
||||
for (final EntityLivingBase entity : this.getEntities(EntityLivingBase.class, genome, housing)) {
|
||||
int damage = 4;
|
||||
if (entity instanceof EntityPlayer) {
|
||||
final int count = wearsItems((EntityPlayer) entity);
|
||||
if (count > 3) {
|
||||
continue;
|
||||
}
|
||||
if (count > 2) {
|
||||
damage = 1;
|
||||
}
|
||||
else if (count > 1) {
|
||||
damage = 2;
|
||||
}
|
||||
else if (count > 0) {
|
||||
damage = 3;
|
||||
}
|
||||
}
|
||||
entity.attackEntityFrom(DamageSource.generic, damage);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case FOOD: {
|
||||
for (final EntityLivingBase entity : this.getEntities(EntityLivingBase.class, genome, housing)) {
|
||||
if (entity instanceof EntityPlayer) {
|
||||
final EntityPlayer player = (EntityPlayer) entity;
|
||||
player.getFoodStats().addStats(2, 0.2f);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case HUNGER: {
|
||||
for (final EntityLivingBase entity : this.getEntities(EntityLivingBase.class, genome, housing)) {
|
||||
if (entity instanceof EntityPlayer) {
|
||||
final EntityPlayer player = (EntityPlayer) entity;
|
||||
if (world.rand.nextInt(4) < wearsItems(player)) {
|
||||
continue;
|
||||
}
|
||||
player.getFoodStats().addExhaustion(4.0f);
|
||||
player.addPotionEffect(new PotionEffect(Potion.hunger.id, 100));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BLINDNESS: {
|
||||
for (final EntityLivingBase entity : this.getEntities(EntityLivingBase.class, genome, housing)) {
|
||||
if (entity instanceof EntityPlayer) {
|
||||
final EntityPlayer player = (EntityPlayer) entity;
|
||||
if (world.rand.nextInt(4) < wearsItems(player)) {
|
||||
continue;
|
||||
}
|
||||
player.addPotionEffect(new PotionEffect(Potion.blindness.id, 200));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SLOW: {
|
||||
for (final EntityLivingBase entity : this.getEntities(EntityLivingBase.class, genome, housing)) {
|
||||
if (entity instanceof EntityPlayer) {
|
||||
final EntityPlayer player = (EntityPlayer) entity;
|
||||
if (world.rand.nextInt(4) < wearsItems(player)) {
|
||||
continue;
|
||||
}
|
||||
player.addPotionEffect(new PotionEffect(Potion.weakness.id, 200));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CONFUSION: {
|
||||
for (final EntityLivingBase entity : this.getEntities(EntityLivingBase.class, genome, housing)) {
|
||||
if (entity instanceof EntityPlayer) {
|
||||
final EntityPlayer player = (EntityPlayer) entity;
|
||||
if (world.rand.nextInt(4) < wearsItems(player)) {
|
||||
continue;
|
||||
}
|
||||
player.addPotionEffect(new PotionEffect(Potion.confusion.id, 200));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BIRTHDAY:
|
||||
case FESTIVAL:
|
||||
case FIREWORKS: {
|
||||
if (world.rand.nextInt((this == ExtraBeesEffect.FIREWORKS) ? 8 : 12) < 1) {
|
||||
final FireworkCreator.Firework firework = new FireworkCreator.Firework();
|
||||
switch (this) {
|
||||
case BIRTHDAY: {
|
||||
firework.setShape(FireworkCreator.Shape.Star);
|
||||
firework.addColor(16768256);
|
||||
for (final Birthday birthday : ExtraBeesEffect.birthdays) {
|
||||
if (birthday.isToday()) {
|
||||
firework.addColor(16711680);
|
||||
firework.addColor(65280);
|
||||
firework.addColor(255);
|
||||
firework.setTrail();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
case FIREWORKS: {
|
||||
firework.setShape(FireworkCreator.Shape.Ball);
|
||||
firework.addColor(genome.getPrimary().getIconColour(0));
|
||||
firework.addColor(genome.getPrimary().getIconColour(0));
|
||||
firework.addColor(genome.getPrimary().getIconColour(1));
|
||||
firework.addColor(genome.getSecondary().getIconColour(0));
|
||||
firework.addColor(genome.getSecondary().getIconColour(0));
|
||||
firework.addColor(genome.getPrimary().getIconColour(1));
|
||||
firework.setTrail();
|
||||
break;
|
||||
}
|
||||
}
|
||||
final EntityFireworkRocket var11 = new EntityFireworkRocket(world, x1, y1, z1, firework.getFirework());
|
||||
if (world.canBlockSeeTheSky(x1, y1, z1)) {
|
||||
((WorldServer) world).spawnEntityInWorld(var11);
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case GRAVITY: {
|
||||
final List<Entity> entities2 = this.getEntities(Entity.class, genome, housing);
|
||||
for (final Entity entity2 : entities2) {
|
||||
float entityStrength = 1.0f;
|
||||
if (entity2 instanceof EntityPlayer) {
|
||||
entityStrength *= 100.0f;
|
||||
}
|
||||
final double dx = x1 - entity2.posX;
|
||||
final double dy = y1 - entity2.posY;
|
||||
final double dz = z1 - entity2.posZ;
|
||||
if (dx * dx + dy * dy + dz * dz < 2.0) {
|
||||
return null;
|
||||
}
|
||||
final double strength = 0.5 / (dx * dx + dy * dy + dz * dz) * entityStrength;
|
||||
entity2.addVelocity(dx * strength, dy * strength, dz * strength);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case THIEF: {
|
||||
final List<EntityPlayer> entities3 = this.getEntities(EntityPlayer.class, genome, housing);
|
||||
for (final EntityPlayer entity3 : entities3) {
|
||||
final double dx = x1 - entity3.posX;
|
||||
final double dy = y1 - entity3.posY;
|
||||
final double dz = z1 - entity3.posZ;
|
||||
if (dx * dx + dy * dy + dz * dz < 2.0) {
|
||||
return null;
|
||||
}
|
||||
final double strength = 0.5 / (dx * dx + dy * dy + dz * dz);
|
||||
entity3.addVelocity(-dx * strength, -dy * strength, -dz * strength);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case TELEPORT: {
|
||||
if (world.rand.nextInt(80) > 1) {
|
||||
return null;
|
||||
}
|
||||
final List<Entity> entities4 = this.getEntities(Entity.class, genome, housing);
|
||||
if (entities4.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
final Entity entity4 = entities4.get(world.rand.nextInt(entities4.size()));
|
||||
if (!(entity4 instanceof EntityLiving)) {
|
||||
return null;
|
||||
}
|
||||
final float jumpDist = 5.0f;
|
||||
if (y1 < 4) {
|
||||
y1 = 4;
|
||||
}
|
||||
if (!world.isAirBlock(x1, y1, z1) || !world.isAirBlock(x1, y1 + 1, z1)) {
|
||||
return null;
|
||||
}
|
||||
((EntityLiving) entity4).setPositionAndUpdate(x1, y1, z1);
|
||||
((EntityLiving) entity4).addPotionEffect(new PotionEffect(Potion.confusion.id, 160, 10));
|
||||
break;
|
||||
}
|
||||
case WATER: {
|
||||
if (world.rand.nextInt(120) > 1) {
|
||||
return null;
|
||||
}
|
||||
final TileEntity tile = world.getTileEntity(x1, y1, z1);
|
||||
if (tile instanceof IFluidHandler) {
|
||||
((IFluidHandler) tile).fill(ForgeDirection.UP, Binnie.Liquid.getLiquidStack("water", 100), true);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BonemealSapling: {
|
||||
if (world.rand.nextInt(20) > 1) {
|
||||
return null;
|
||||
}
|
||||
if (ExtraBeesFlowers.Sapling.isAcceptedFlower(world, null, x1, y1, z1)) {
|
||||
ItemDye.applyBonemeal(new ItemStack(Blocks.dirt, 1), world, x1, y1, z1, (EntityPlayer) null);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BonemealFruit: {
|
||||
if (world.rand.nextInt(20) > 1) {
|
||||
return null;
|
||||
}
|
||||
if (ExtraBeesFlowers.Fruit.isAcceptedFlower(world, null, x1, y1, z1)) {
|
||||
ItemDye.applyBonemeal(new ItemStack(Blocks.dirt, 1), world, x1, y1, z1, (EntityPlayer) null);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case BonemealMushroom: {
|
||||
if (world.rand.nextInt(20) > 1) {
|
||||
return null;
|
||||
}
|
||||
if (world.getBlock(x1, y1, z1) == Blocks.brown_mushroom || world.getBlock(x1, y1, z1) == Blocks.red_mushroom) {
|
||||
ItemDye.applyBonemeal(new ItemStack(Blocks.dirt, 1), world, x1, y1, z1, (EntityPlayer) null);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case Power: {
|
||||
final TileEntity tile2 = world.getTileEntity(x1, y1, z1);
|
||||
if (tile2 instanceof IEnergyReceiver) {
|
||||
((IEnergyReceiver) tile2).receiveEnergy(ForgeDirection.getOrientation(0), 5, true);
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
protected int[] getModifiedArea(final IBeeGenome genome, final IBeeHousing housing) {
|
||||
final int[] territory;
|
||||
final int[] area = territory = genome.getTerritory();
|
||||
final int n = 0;
|
||||
territory[n] *= (int) (BeeManager.beeRoot.createBeeHousingModifier(housing).getTerritoryModifier(genome, 1.0f) * 3.0f);
|
||||
final int[] array = area;
|
||||
final int n2 = 1;
|
||||
array[n2] *= (int) (BeeManager.beeRoot.createBeeHousingModifier(housing).getTerritoryModifier(genome, 1.0f) * 3.0f);
|
||||
final int[] array2 = area;
|
||||
final int n3 = 2;
|
||||
array2[n3] *= (int) (BeeManager.beeRoot.createBeeHousingModifier(housing).getTerritoryModifier(genome, 1.0f) * 3.0f);
|
||||
if (area[0] < 1) {
|
||||
area[0] = 1;
|
||||
}
|
||||
if (area[1] < 1) {
|
||||
area[1] = 1;
|
||||
}
|
||||
if (area[2] < 1) {
|
||||
area[2] = 1;
|
||||
}
|
||||
return area;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IEffectData doFX(final IBeeGenome genome, final IEffectData storedData, final IBeeHousing housing) {
|
||||
Proxies.render.addBeeHiveFX("particles/swarm_bee", housing.getWorld(), housing.getBeeFXCoordinates().xCoord, housing.getBeeFXCoordinates().yCoord, housing.getBeeFXCoordinates().zCoord, genome.getPrimary().getIconColour(0));
|
||||
return storedData;
|
||||
}
|
||||
|
||||
public String getFX() {
|
||||
return this.fx;
|
||||
}
|
||||
|
||||
public <T extends Entity> List<T> getEntities(final Class<T> eClass, final IBeeGenome genome, final IBeeHousing housing) {
|
||||
final int[] area = genome.getTerritory();
|
||||
final int[] offset = { -Math.round(area[0] / 2), -Math.round(area[1] / 2), -Math.round(area[2] / 2) };
|
||||
final int[] min = { housing.getCoordinates().posX + offset[0], housing.getCoordinates().posY + offset[1], housing.getCoordinates().posZ + offset[2] };
|
||||
final int[] max = { housing.getCoordinates().posX + offset[0] + area[0], housing.getCoordinates().posY + offset[1] + area[1], housing.getCoordinates().posZ + offset[2] + area[2] };
|
||||
final AxisAlignedBB box = AxisAlignedBB.getBoundingBox(min[0], min[1], min[2], max[0], max[1], max[2]);
|
||||
return housing.getWorld().getEntitiesWithinAABB(eClass, box);
|
||||
}
|
||||
|
||||
public static boolean wearsHelmet(final EntityPlayer player) {
|
||||
final ItemStack armorItem = player.inventory.armorInventory[3];
|
||||
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
|
||||
}
|
||||
|
||||
public static boolean wearsChest(final EntityPlayer player) {
|
||||
final ItemStack armorItem = player.inventory.armorInventory[2];
|
||||
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
|
||||
}
|
||||
|
||||
public static boolean wearsLegs(final EntityPlayer player) {
|
||||
final ItemStack armorItem = player.inventory.armorInventory[1];
|
||||
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
|
||||
}
|
||||
|
||||
public static boolean wearsBoots(final EntityPlayer player) {
|
||||
final ItemStack armorItem = player.inventory.armorInventory[0];
|
||||
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
|
||||
}
|
||||
|
||||
public static int wearsItems(final EntityPlayer player) {
|
||||
int count = 0;
|
||||
if (wearsHelmet(player)) {
|
||||
++count;
|
||||
}
|
||||
if (wearsChest(player)) {
|
||||
++count;
|
||||
}
|
||||
if (wearsLegs(player)) {
|
||||
++count;
|
||||
}
|
||||
if (wearsBoots(player)) {
|
||||
++count;
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName() {
|
||||
return this.getUID();
|
||||
}
|
||||
|
||||
static {
|
||||
(ExtraBeesEffect.birthdays = new ArrayList<Birthday>()).add(new Birthday(3, 10, "Binnie"));
|
||||
}
|
||||
|
||||
public static class Birthday
|
||||
{
|
||||
int day;
|
||||
int month;
|
||||
String name;
|
||||
|
||||
public boolean isToday() {
|
||||
return Calendar.getInstance().get(5) == this.month && Calendar.getInstance().get(2) == this.day;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
private Birthday(final int day, final int month, final String name) {
|
||||
this.day = day;
|
||||
this.month = month + 1;
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.genetics.effect;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class FireworkCreator
|
||||
{
|
||||
public enum Shape
|
||||
{
|
||||
Ball,
|
||||
LargeBall,
|
||||
Star,
|
||||
Creeper,
|
||||
Burst;
|
||||
}
|
||||
|
||||
public static class Firework
|
||||
{
|
||||
boolean flicker;
|
||||
boolean trail;
|
||||
ArrayList<Integer> colors;
|
||||
byte shape;
|
||||
|
||||
public Firework() {
|
||||
this.flicker = false;
|
||||
this.trail = false;
|
||||
this.colors = new ArrayList<Integer>();
|
||||
this.shape = 0;
|
||||
}
|
||||
|
||||
public void setFlicker() {
|
||||
this.flicker = true;
|
||||
}
|
||||
|
||||
public void setTrail() {
|
||||
this.trail = true;
|
||||
}
|
||||
|
||||
public void setShape(final Shape shape) {
|
||||
this.shape = (byte) shape.ordinal();
|
||||
}
|
||||
|
||||
public void addColor(final int color) {
|
||||
this.colors.add(color);
|
||||
}
|
||||
|
||||
NBTTagCompound getNBT() {
|
||||
final NBTTagCompound nbt = new NBTTagCompound();
|
||||
if (this.flicker) {
|
||||
nbt.setBoolean("Flicker", true);
|
||||
}
|
||||
if (this.trail) {
|
||||
nbt.setBoolean("Trail", true);
|
||||
}
|
||||
if (this.colors.size() == 0) {
|
||||
this.addColor(16777215);
|
||||
}
|
||||
final int[] array = new int[this.colors.size()];
|
||||
for (int i = 0; i < this.colors.size(); ++i) {
|
||||
array[i] = this.colors.get(i);
|
||||
}
|
||||
nbt.setIntArray("Colors", array);
|
||||
nbt.setByte("Type", this.shape);
|
||||
return nbt;
|
||||
}
|
||||
|
||||
public ItemStack getFirework() {
|
||||
final NBTTagCompound var15 = new NBTTagCompound();
|
||||
final NBTTagCompound var16 = new NBTTagCompound();
|
||||
final NBTTagList var17 = new NBTTagList();
|
||||
var17.appendTag(this.getNBT());
|
||||
var16.setTag("Explosions", var17);
|
||||
var16.setByte("Flight", (byte) 0);
|
||||
var15.setTag("Fireworks", var16);
|
||||
final ItemStack item = new ItemStack(Items.fireworks);
|
||||
item.setTagCompound(var15);
|
||||
return item;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.genetics.items;
|
||||
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.core.Tabs;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import java.util.List;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class ItemDictionary extends Item
|
||||
{
|
||||
IIcon iconMaster;
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister register) {
|
||||
this.itemIcon = ExtraBees.proxy.getIcon(register, "apiaristDatabase");
|
||||
this.iconMaster = ExtraBees.proxy.getIcon(register, "masterApiaristDatabase");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(final int par1) {
|
||||
return (par1 == 0) ? this.itemIcon : this.iconMaster;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(final ItemStack par1ItemStack, final EntityPlayer par2EntityPlayer, final List par3List, final boolean par4) {
|
||||
super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
|
||||
if (par1ItemStack.getItemDamage() > 0) {
|
||||
par3List.add("Flora-in-a-box");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List) {
|
||||
super.getSubItems(par1, par2CreativeTabs, par3List);
|
||||
par3List.add(new ItemStack(par1, 1, 1));
|
||||
}
|
||||
|
||||
public ItemDictionary() {
|
||||
this.setCreativeTab(Tabs.tabApiculture);
|
||||
this.setUnlocalizedName("dictionary");
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(final ItemStack itemstack, final World world, final EntityPlayer player) {
|
||||
if (itemstack.getItemDamage() == 0) {
|
||||
ExtraBees.proxy.openGui(ExtraBeeGUID.Database, player, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
}
|
||||
else {
|
||||
ExtraBees.proxy.openGui(ExtraBeeGUID.DatabaseNEI, player, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
}
|
||||
return itemstack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(final ItemStack i) {
|
||||
return (i.getItemDamage() == 0) ? "Apiarist Database" : "Master Apiarist Database";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.genetics.items;
|
||||
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class ItemPunnettSquare extends Item
|
||||
{
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister register) {
|
||||
this.itemIcon = ExtraBees.proxy.getIcon(register, "");
|
||||
}
|
||||
|
||||
public ItemPunnettSquare() {
|
||||
this.setCreativeTab(CreativeTabs.tabTools);
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(final ItemStack itemstack) {
|
||||
return "Punnett Square";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(final ItemStack itemstack, final World world, final EntityPlayer player) {
|
||||
ExtraBees.proxy.openGui(ExtraBeeGUID.PunnettSquare, player, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
return itemstack;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
|
||||
public class WindowAlvearyFrame extends Window
|
||||
{
|
||||
Machine machine;
|
||||
ControlPlayerInventory playerInventory;
|
||||
|
||||
public WindowAlvearyFrame(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(176.0f, 144.0f, player, inventory, side);
|
||||
this.machine = ((TileEntityMachine) inventory).getMachine();
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
if (player == null || inventory == null) {
|
||||
return null;
|
||||
}
|
||||
return new WindowAlvearyFrame(player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle("Frame Housing");
|
||||
this.playerInventory = new ControlPlayerInventory(this);
|
||||
final ControlSlot slot = new ControlSlot(this, 79.0f, 30.0f);
|
||||
slot.assign(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractMod getMod() {
|
||||
return ExtraBees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "AlvearyFrame";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.extrabees.apiary.machine.AlvearyHatchery;
|
||||
import binnie.craftgui.minecraft.control.ControlSlotArray;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
|
||||
public class WindowAlvearyHatchery extends Window
|
||||
{
|
||||
Machine machine;
|
||||
ControlPlayerInventory playerInventory;
|
||||
|
||||
public WindowAlvearyHatchery(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(176.0f, 144.0f, player, inventory, side);
|
||||
this.machine = ((TileEntityMachine) inventory).getMachine();
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
if (player == null || inventory == null) {
|
||||
return null;
|
||||
}
|
||||
return new WindowAlvearyHatchery(player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle("Hatchery");
|
||||
this.playerInventory = new ControlPlayerInventory(this);
|
||||
final ControlSlotArray slot = new ControlSlotArray(this, 43, 30, 5, 1);
|
||||
slot.create(AlvearyHatchery.slotLarvae);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractMod getMod() {
|
||||
return ExtraBees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "AlvearyHatchery";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
|
||||
public class WindowAlvearyIndustrialFrame extends Window
|
||||
{
|
||||
Machine machine;
|
||||
ControlPlayerInventory playerInventory;
|
||||
|
||||
public WindowAlvearyIndustrialFrame(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(176.0f, 144.0f, player, inventory, side);
|
||||
this.machine = ((TileEntityMachine) inventory).getMachine();
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
if (player == null || inventory == null) {
|
||||
return null;
|
||||
}
|
||||
return new WindowAlvearyIndustrialFrame(player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle("Industrial Frame Housing");
|
||||
this.playerInventory = new ControlPlayerInventory(this);
|
||||
final ControlSlot slot = new ControlSlot(this, 79.0f, 30.0f);
|
||||
slot.assign(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractMod getMod() {
|
||||
return ExtraBees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "AlvearyIndustrialFrame";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.craftgui.minecraft.control.ControlItemDisplay;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import binnie.extrabees.apiary.machine.AlvearyMutator;
|
||||
import binnie.craftgui.controls.ControlText;
|
||||
import binnie.craftgui.core.geometry.TextJustification;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
|
||||
public class WindowAlvearyMutator extends Window
|
||||
{
|
||||
Machine machine;
|
||||
ControlPlayerInventory playerInventory;
|
||||
|
||||
public WindowAlvearyMutator(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(176.0f, 176.0f, player, inventory, side);
|
||||
this.machine = ((TileEntityMachine) inventory).getMachine();
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
if (player == null || inventory == null) {
|
||||
return null;
|
||||
}
|
||||
return new WindowAlvearyMutator(player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle("Mutator");
|
||||
this.playerInventory = new ControlPlayerInventory(this);
|
||||
final ControlSlot slot = new ControlSlot(this, 79.0f, 30.0f);
|
||||
slot.assign(0);
|
||||
new ControlText(this, new IArea(0.0f, 52.0f, this.w(), 16.0f), "Possible Mutagens:", TextJustification.MiddleCenter).setColour(5592405);
|
||||
final int size = AlvearyMutator.getMutagens().size();
|
||||
final int w = size * 18;
|
||||
if (size > 0) {
|
||||
float x = (this.w() - w) / 2.0f;
|
||||
for (final ItemStack stack : AlvearyMutator.getMutagens()) {
|
||||
final ControlItemDisplay display = new ControlItemDisplay(this, x, 66.0f);
|
||||
display.setItemStack(stack);
|
||||
display.hastooltip = true;
|
||||
x += 18.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractMod getMod() {
|
||||
return ExtraBees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "AlvearyMutator";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.extrabees.apiary.machine.AlvearyStimulator;
|
||||
import binnie.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.craftgui.core.geometry.Position;
|
||||
import binnie.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import binnie.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
|
||||
public class WindowAlvearyStimulator extends Window
|
||||
{
|
||||
Machine machine;
|
||||
ControlPlayerInventory playerInventory;
|
||||
|
||||
public WindowAlvearyStimulator(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(176.0f, 144.0f, player, inventory, side);
|
||||
this.machine = ((TileEntityMachine) inventory).getMachine();
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
if (player == null || inventory == null) {
|
||||
return null;
|
||||
}
|
||||
return new WindowAlvearyStimulator(player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle("Stimulator");
|
||||
new ControlEnergyBar(this, 75, 29, 60, 16, Position.Left);
|
||||
final ControlSlot slot = new ControlSlot(this, 41.0f, 28.0f);
|
||||
slot.assign(AlvearyStimulator.slotCircuit);
|
||||
this.playerInventory = new ControlPlayerInventory(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractMod getMod() {
|
||||
return ExtraBees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "AlvearyStimulator";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui.database;
|
||||
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.Binnie;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.resource.minecraft.CraftGUITexture;
|
||||
import binnie.craftgui.core.CraftGUI;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import binnie.craftgui.core.Tooltip;
|
||||
import binnie.craftgui.core.Attribute;
|
||||
import java.util.ArrayList;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import java.util.List;
|
||||
import binnie.craftgui.core.ITooltip;
|
||||
import binnie.craftgui.controls.core.Control;
|
||||
|
||||
public class ControlBiomes extends Control implements ITooltip
|
||||
{
|
||||
List<Integer> tolerated;
|
||||
|
||||
public ControlBiomes(final IWidget parent, final int x, final int y, final int width, final int height) {
|
||||
super(parent, x, y, width * 16, height * 16);
|
||||
this.tolerated = new ArrayList<Integer>();
|
||||
this.addAttribute(Attribute.MouseOver);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip list) {
|
||||
if (this.tolerated.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
final int x = (int) (this.getRelativeMousePosition().x() / 16.0f);
|
||||
final int y = (int) (this.getRelativeMousePosition().y() / 16.0f);
|
||||
final int i = x + y * 8;
|
||||
if (i < this.tolerated.size()) {
|
||||
list.add(BiomeGenBase.getBiome(this.tolerated.get(i)).biomeName);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderForeground() {
|
||||
for (int i = 0; i < this.tolerated.size(); ++i) {
|
||||
final int x = i % 8 * 16;
|
||||
final int y = i / 8 * 16;
|
||||
if (BiomeGenBase.getBiome(i) != null) {
|
||||
CraftGUI.Render.colour(BiomeGenBase.getBiome(i).color);
|
||||
}
|
||||
CraftGUI.Render.texture(CraftGUITexture.Button, new IArea(x, y, 16.0f, 16.0f));
|
||||
}
|
||||
}
|
||||
|
||||
public void setSpecies(final IAlleleBeeSpecies species) {
|
||||
this.tolerated.clear();
|
||||
if (species == null) {
|
||||
return;
|
||||
}
|
||||
final IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(Binnie.Genetics.getBeeRoot().getTemplate(species.getUID()));
|
||||
final IBee bee = Binnie.Genetics.getBeeRoot().getBee(BinnieCore.proxy.getWorld(), genome);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui.database;
|
||||
|
||||
import forestry.api.genetics.EnumTolerance;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import binnie.Binnie;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.resource.minecraft.CraftGUITexture;
|
||||
import binnie.craftgui.core.CraftGUI;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import binnie.craftgui.core.Tooltip;
|
||||
import binnie.craftgui.core.Attribute;
|
||||
import java.util.ArrayList;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import java.util.List;
|
||||
import binnie.craftgui.core.ITooltip;
|
||||
import binnie.craftgui.controls.core.Control;
|
||||
|
||||
public class ControlClimateBar extends Control implements ITooltip
|
||||
{
|
||||
boolean isHumidity;
|
||||
List<Integer> tolerated;
|
||||
int[] tempColours;
|
||||
int[] humidColours;
|
||||
|
||||
public ControlClimateBar(final IWidget parent, final int x, final int y, final int width, final int height) {
|
||||
super(parent, x, y, width, height);
|
||||
this.isHumidity = false;
|
||||
this.tolerated = new ArrayList<Integer>();
|
||||
this.tempColours = new int[] { 65531, 7912447, 5242672, 16776960, 16753152, 16711680 };
|
||||
this.humidColours = new int[] { 16770979, 1769216, 3177727 };
|
||||
this.addAttribute(Attribute.MouseOver);
|
||||
}
|
||||
|
||||
public ControlClimateBar(final IWidget parent, final int x, final int y, final int width, final int height, final boolean humidity) {
|
||||
super(parent, x, y, width, height);
|
||||
this.isHumidity = false;
|
||||
this.tolerated = new ArrayList<Integer>();
|
||||
this.tempColours = new int[] { 65531, 7912447, 5242672, 16776960, 16753152, 16711680 };
|
||||
this.humidColours = new int[] { 16770979, 1769216, 3177727 };
|
||||
this.addAttribute(Attribute.MouseOver);
|
||||
this.isHumidity = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip list) {
|
||||
if (this.tolerated.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
final int types = this.isHumidity ? 3 : 6;
|
||||
final int type = (int) ((int) (this.getRelativeMousePosition().x() - 1.0f) / ((this.getSize().x() - 2.0f) / types));
|
||||
if (!this.tolerated.contains(type)) {
|
||||
return;
|
||||
}
|
||||
if (type < types) {
|
||||
if (this.isHumidity) {
|
||||
list.add(EnumHumidity.values()[type].name);
|
||||
}
|
||||
else {
|
||||
list.add(EnumTemperature.values()[type + 1].name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.Render.texture(CraftGUITexture.EnergyBarBack, this.getArea());
|
||||
final int types = this.isHumidity ? 3 : 6;
|
||||
final int w = (int) ((this.getSize().x() - 2.0f) / types);
|
||||
for (int i = 0; i < types; ++i) {
|
||||
final int x = i * w;
|
||||
if (this.tolerated.contains(i)) {
|
||||
int colour = 0;
|
||||
if (this.isHumidity) {
|
||||
colour = this.humidColours[i];
|
||||
}
|
||||
else {
|
||||
colour = this.tempColours[i];
|
||||
}
|
||||
CraftGUI.Render.solid(new IArea(x + 1, 1.0f, w, this.getSize().y() - 2.0f), colour);
|
||||
}
|
||||
}
|
||||
CraftGUI.Render.texture(CraftGUITexture.EnergyBarGlass, this.getArea());
|
||||
}
|
||||
|
||||
public void setSpecies(final IAlleleBeeSpecies species) {
|
||||
this.tolerated.clear();
|
||||
if (species == null) {
|
||||
return;
|
||||
}
|
||||
int main;
|
||||
EnumTolerance tolerance;
|
||||
if (!this.isHumidity) {
|
||||
main = species.getTemperature().ordinal() - 1;
|
||||
final IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(Binnie.Genetics.getBeeRoot().getTemplate(species.getUID()));
|
||||
tolerance = genome.getToleranceTemp();
|
||||
}
|
||||
else {
|
||||
main = species.getHumidity().ordinal();
|
||||
final IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(Binnie.Genetics.getBeeRoot().getTemplate(species.getUID()));
|
||||
tolerance = genome.getToleranceHumid();
|
||||
}
|
||||
this.tolerated.add(main);
|
||||
switch (tolerance) {
|
||||
case BOTH_5:
|
||||
case UP_5: {
|
||||
this.tolerated.add(main + 5);
|
||||
}
|
||||
case BOTH_4:
|
||||
case UP_4: {
|
||||
this.tolerated.add(main + 4);
|
||||
}
|
||||
case BOTH_3:
|
||||
case UP_3: {
|
||||
this.tolerated.add(main + 3);
|
||||
}
|
||||
case BOTH_2:
|
||||
case UP_2: {
|
||||
this.tolerated.add(main + 2);
|
||||
}
|
||||
case BOTH_1:
|
||||
case UP_1: {
|
||||
this.tolerated.add(main + 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
switch (tolerance) {
|
||||
case BOTH_5:
|
||||
case DOWN_5: {
|
||||
this.tolerated.add(main - 5);
|
||||
}
|
||||
case BOTH_4:
|
||||
case DOWN_4: {
|
||||
this.tolerated.add(main - 4);
|
||||
}
|
||||
case BOTH_3:
|
||||
case DOWN_3: {
|
||||
this.tolerated.add(main - 3);
|
||||
}
|
||||
case BOTH_2:
|
||||
case DOWN_2: {
|
||||
this.tolerated.add(main - 2);
|
||||
}
|
||||
case BOTH_1:
|
||||
case DOWN_1: {
|
||||
this.tolerated.add(main - 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui.database;
|
||||
|
||||
import java.util.List;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import java.util.Map;
|
||||
import java.util.ArrayList;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.Binnie;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import binnie.craftgui.controls.listbox.ControlListBox;
|
||||
|
||||
public class ControlProductsBox extends ControlListBox<ControlProductsBox.Product>
|
||||
{
|
||||
private int index;
|
||||
private Type type;
|
||||
IAlleleBeeSpecies species;
|
||||
|
||||
@Override
|
||||
public IWidget createOption(final Product value, final int y) {
|
||||
return new ControlProductsItem(getContent(), value, y);
|
||||
}
|
||||
|
||||
public ControlProductsBox(final IWidget parent, final int x, final int y, final int width, final int height, final Type type) {
|
||||
super(parent, x, y, width, height, 12.0f);
|
||||
this.species = null;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public void setSpecies(final IAlleleBeeSpecies species) {
|
||||
if (species != this.species && (this.species = species) != null) {
|
||||
final IAllele[] template = Binnie.Genetics.getBeeRoot().getTemplate(species.getUID());
|
||||
if (template == null) {
|
||||
return;
|
||||
}
|
||||
final IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(template);
|
||||
final float speed = genome.getSpeed();
|
||||
final float modeSpeed = Binnie.Genetics.getBeeRoot().getBeekeepingMode(BinnieCore.proxy.getWorld()).getBeeModifier().getProductionModifier(genome, 1.0f);
|
||||
final List<Product> strings = new ArrayList<Product>();
|
||||
if (this.type == Type.Products) {
|
||||
for (final Map.Entry<ItemStack, Float> entry : species.getProductChances().entrySet()) {
|
||||
strings.add(new Product(entry.getKey(), speed * modeSpeed * entry.getValue()));
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (final Map.Entry<ItemStack, Float> entry : species.getSpecialtyChances().entrySet()) {
|
||||
strings.add(new Product(entry.getKey(), speed * modeSpeed * entry.getValue()));
|
||||
}
|
||||
}
|
||||
this.setOptions(strings);
|
||||
}
|
||||
}
|
||||
|
||||
enum Type
|
||||
{
|
||||
Products,
|
||||
Specialties;
|
||||
}
|
||||
|
||||
class Product
|
||||
{
|
||||
ItemStack item;
|
||||
float chance;
|
||||
|
||||
public Product(final ItemStack item, final float chance) {
|
||||
this.item = item;
|
||||
this.chance = chance;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui.database;
|
||||
|
||||
import binnie.craftgui.controls.ControlText;
|
||||
import java.text.DecimalFormat;
|
||||
import binnie.craftgui.core.geometry.CraftGUIUtil;
|
||||
import binnie.craftgui.core.geometry.IPoint;
|
||||
import binnie.craftgui.controls.ControlTextCentered;
|
||||
import binnie.craftgui.controls.listbox.ControlList;
|
||||
import binnie.craftgui.minecraft.control.ControlItemDisplay;
|
||||
import binnie.craftgui.controls.listbox.ControlOption;
|
||||
|
||||
public class ControlProductsItem extends ControlOption<ControlProductsBox.Product>
|
||||
{
|
||||
ControlItemDisplay item;
|
||||
|
||||
public ControlProductsItem(final ControlList<ControlProductsBox.Product> controlList, final ControlProductsBox.Product value, final int y) {
|
||||
super(controlList, value, y);
|
||||
(this.item = new ControlItemDisplay(this, 4.0f, 4.0f)).setTooltip();
|
||||
final ControlText textWidget = new ControlTextCentered(this, 2.0f, "");
|
||||
CraftGUIUtil.moveWidget(textWidget, new IPoint(12.0f, 0.0f));
|
||||
if (value != null) {
|
||||
this.item.setItemStack(value.item);
|
||||
final float time = (int) (55000.0 / value.chance);
|
||||
final float seconds = time / 20.0f;
|
||||
final float minutes = seconds / 60.0f;
|
||||
final float hours = minutes / 60.0f;
|
||||
final DecimalFormat df = new DecimalFormat("#.0");
|
||||
if (hours > 1.0f) {
|
||||
textWidget.setValue("Every " + df.format(hours) + " hours");
|
||||
}
|
||||
else if (minutes > 1.0f) {
|
||||
textWidget.setValue("Every " + df.format(minutes) + " min.");
|
||||
}
|
||||
else {
|
||||
textWidget.setValue("Every " + df.format(seconds) + " sec.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui.database;
|
||||
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import binnie.craftgui.controls.ControlTextCentered;
|
||||
import binnie.craftgui.mod.database.DatabaseTab;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.mod.database.PageSpecies;
|
||||
|
||||
public class PageSpeciesClimate extends PageSpecies
|
||||
{
|
||||
ControlClimateBar tempBar;
|
||||
ControlClimateBar humidBar;
|
||||
ControlBiomes biomes;
|
||||
|
||||
public PageSpeciesClimate(final IWidget parent, final DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
new ControlTextCentered(this, 8.0f, "Climate");
|
||||
this.tempBar = new ControlClimateBar(this, 8, 24, 128, 12);
|
||||
this.humidBar = new ControlClimateBar(this, 8, 42, 128, 12, true);
|
||||
new ControlTextCentered(this, 70.0f, "Biomes");
|
||||
this.biomes = new ControlBiomes(this, 8, 90, 8, 4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(final IAlleleSpecies species) {
|
||||
this.tempBar.setSpecies((IAlleleBeeSpecies) species);
|
||||
this.humidBar.setSpecies((IAlleleBeeSpecies) species);
|
||||
this.biomes.setSpecies((IAlleleBeeSpecies) species);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui.database;
|
||||
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.Binnie;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import binnie.craftgui.core.geometry.TextJustification;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.controls.ControlTextCentered;
|
||||
import binnie.craftgui.mod.database.DatabaseTab;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.controls.ControlText;
|
||||
import binnie.craftgui.mod.database.PageSpecies;
|
||||
|
||||
public class PageSpeciesGenome extends PageSpecies
|
||||
{
|
||||
ControlText pageSpeciesGenome_Title;
|
||||
ControlText pageSpeciesGenome_SpeedText;
|
||||
ControlText pageSpeciesGenome_LifespanText;
|
||||
ControlText pageSpeciesGenome_FertilityText;
|
||||
ControlText pageSpeciesGenome_FloweringText;
|
||||
ControlText pageSpeciesGenome_TerritoryText;
|
||||
ControlText pageSpeciesGenome_NocturnalText;
|
||||
ControlText pageSpeciesGenome_CaveDwellingText;
|
||||
ControlText pageSpeciesGenome_TolerantFlyerText;
|
||||
ControlText pageSpeciesGenome_FlowerText;
|
||||
ControlText pageSpeciesGenome_EffectText;
|
||||
|
||||
public PageSpeciesGenome(final IWidget parent, final DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
this.pageSpeciesGenome_Title = new ControlTextCentered(this, 8.0f, "Genome");
|
||||
new ControlText(this, new IArea(0.0f, 32.0f, 68.0f, 30.0f), "Speed:", TextJustification.TopRight);
|
||||
new ControlText(this, new IArea(0.0f, 44.0f, 68.0f, 30.0f), "Lifespan:", TextJustification.TopRight);
|
||||
new ControlText(this, new IArea(0.0f, 56.0f, 68.0f, 30.0f), "Fertility:", TextJustification.TopRight);
|
||||
new ControlText(this, new IArea(0.0f, 68.0f, 68.0f, 30.0f), "Flowering:", TextJustification.TopRight);
|
||||
new ControlText(this, new IArea(0.0f, 80.0f, 68.0f, 30.0f), "Territory:", TextJustification.TopRight);
|
||||
new ControlText(this, new IArea(0.0f, 97.0f, 68.0f, 30.0f), "Behavior:", TextJustification.TopRight);
|
||||
new ControlText(this, new IArea(0.0f, 109.0f, 68.0f, 30.0f), "Sunlight:", TextJustification.TopRight);
|
||||
new ControlText(this, new IArea(0.0f, 121.0f, 68.0f, 30.0f), "Rain:", TextJustification.TopRight);
|
||||
new ControlText(this, new IArea(0.0f, 138.0f, 68.0f, 30.0f), "Flower:", TextJustification.TopRight);
|
||||
new ControlText(this, new IArea(0.0f, 155.0f, 68.0f, 30.0f), "Effect:", TextJustification.TopRight);
|
||||
final int x = 72;
|
||||
this.pageSpeciesGenome_SpeedText = new ControlText(this, new IArea(x, 32.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
this.pageSpeciesGenome_LifespanText = new ControlText(this, new IArea(x, 44.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
this.pageSpeciesGenome_FertilityText = new ControlText(this, new IArea(x, 56.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
this.pageSpeciesGenome_FloweringText = new ControlText(this, new IArea(x, 68.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
this.pageSpeciesGenome_TerritoryText = new ControlText(this, new IArea(x, 80.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
this.pageSpeciesGenome_NocturnalText = new ControlText(this, new IArea(x, 97.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
this.pageSpeciesGenome_CaveDwellingText = new ControlText(this, new IArea(x, 109.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
this.pageSpeciesGenome_TolerantFlyerText = new ControlText(this, new IArea(x, 121.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
this.pageSpeciesGenome_FlowerText = new ControlText(this, new IArea(x, 138.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
this.pageSpeciesGenome_EffectText = new ControlText(this, new IArea(x, 155.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(final IAlleleSpecies species) {
|
||||
final IAllele[] template = Binnie.Genetics.getBeeRoot().getTemplate(species.getUID());
|
||||
if (template != null) {
|
||||
final IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(template);
|
||||
final IBee bee = Binnie.Genetics.getBeeRoot().getBee(BinnieCore.proxy.getWorld(), genome);
|
||||
this.pageSpeciesGenome_SpeedText.setValue(rateSpeed(genome.getSpeed()));
|
||||
this.pageSpeciesGenome_LifespanText.setValue(rateLifespan(genome.getLifespan()));
|
||||
this.pageSpeciesGenome_FertilityText.setValue(genome.getFertility() + " children");
|
||||
this.pageSpeciesGenome_FloweringText.setValue(rateFlowering(genome.getFlowering()));
|
||||
final int[] area = genome.getTerritory();
|
||||
this.pageSpeciesGenome_TerritoryText.setValue(area[0] + "x" + area[1] + "x" + area[2]);
|
||||
String behavior = "Daytime";
|
||||
if (genome.getPrimary().isNocturnal()) {
|
||||
behavior = "Nighttime";
|
||||
}
|
||||
if (genome.getNocturnal()) {
|
||||
behavior = "All Day";
|
||||
}
|
||||
this.pageSpeciesGenome_NocturnalText.setValue(behavior);
|
||||
if (genome.getCaveDwelling()) {
|
||||
this.pageSpeciesGenome_CaveDwellingText.setValue("Not Needed");
|
||||
}
|
||||
else {
|
||||
this.pageSpeciesGenome_CaveDwellingText.setValue("Required");
|
||||
}
|
||||
this.pageSpeciesGenome_TolerantFlyerText.setValue(tolerated(genome.getTolerantFlyer()));
|
||||
if (genome.getFlowerProvider() != null) {
|
||||
this.pageSpeciesGenome_FlowerText.setValue(genome.getFlowerProvider().getDescription());
|
||||
}
|
||||
else {
|
||||
this.pageSpeciesGenome_FlowerText.setValue("None");
|
||||
}
|
||||
this.pageSpeciesGenome_EffectText.setValue(genome.getEffect().getName());
|
||||
}
|
||||
}
|
||||
|
||||
public static String rateFlowering(final int flowering) {
|
||||
if (flowering >= 99) {
|
||||
return "Maximum";
|
||||
}
|
||||
if (flowering >= 35) {
|
||||
return "Fastest";
|
||||
}
|
||||
if (flowering >= 30) {
|
||||
return "Faster";
|
||||
}
|
||||
if (flowering >= 25) {
|
||||
return "Fast";
|
||||
}
|
||||
if (flowering >= 20) {
|
||||
return "Normal";
|
||||
}
|
||||
if (flowering >= 15) {
|
||||
return "Slow";
|
||||
}
|
||||
if (flowering >= 10) {
|
||||
return "Slower";
|
||||
}
|
||||
return "Slowest";
|
||||
}
|
||||
|
||||
public static String rateSpeed(final float speed) {
|
||||
if (speed >= 1.7f) {
|
||||
return "Fastest";
|
||||
}
|
||||
if (speed >= 1.4f) {
|
||||
return "Faster";
|
||||
}
|
||||
if (speed >= 1.2f) {
|
||||
return "Fast";
|
||||
}
|
||||
if (speed >= 1.0f) {
|
||||
return "Normal";
|
||||
}
|
||||
if (speed >= 0.8f) {
|
||||
return "Slow";
|
||||
}
|
||||
if (speed >= 0.6f) {
|
||||
return "Slower";
|
||||
}
|
||||
return "Slowest";
|
||||
}
|
||||
|
||||
public static String rateLifespan(final int life) {
|
||||
if (life >= 70) {
|
||||
return "Longest";
|
||||
}
|
||||
if (life >= 60) {
|
||||
return "Longer";
|
||||
}
|
||||
if (life >= 50) {
|
||||
return "Long";
|
||||
}
|
||||
if (life >= 45) {
|
||||
return "Elongated";
|
||||
}
|
||||
if (life >= 40) {
|
||||
return "Normal";
|
||||
}
|
||||
if (life >= 35) {
|
||||
return "Shortened";
|
||||
}
|
||||
if (life >= 30) {
|
||||
return "Short";
|
||||
}
|
||||
if (life >= 20) {
|
||||
return "Shorter";
|
||||
}
|
||||
return "Shortest";
|
||||
}
|
||||
|
||||
public static String tolerated(final boolean t) {
|
||||
if (t) {
|
||||
return "Tolerated";
|
||||
}
|
||||
return "Not Tolerated";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui.database;
|
||||
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import binnie.craftgui.controls.ControlTextCentered;
|
||||
import binnie.craftgui.mod.database.DatabaseTab;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.controls.ControlText;
|
||||
import binnie.craftgui.mod.database.PageSpecies;
|
||||
|
||||
public class PageSpeciesProducts extends PageSpecies
|
||||
{
|
||||
ControlText pageSpeciesProducts_Title;
|
||||
ControlProductsBox pageSpeciesProducts_Products;
|
||||
ControlText pageSpeciesProducts_Title2;
|
||||
ControlProductsBox pageSpeciesProducts_Specialties;
|
||||
|
||||
public PageSpeciesProducts(final IWidget parent, final DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
this.pageSpeciesProducts_Title = new ControlTextCentered(this, 8.0f, "Products");
|
||||
this.pageSpeciesProducts_Products = new ControlProductsBox(this, 4, 20, 136, 48, ControlProductsBox.Type.Products);
|
||||
this.pageSpeciesProducts_Title2 = new ControlTextCentered(this, 68.0f, "Specialties");
|
||||
this.pageSpeciesProducts_Specialties = new ControlProductsBox(this, 4, 80, 136, 48, ControlProductsBox.Type.Specialties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(final IAlleleSpecies species) {
|
||||
this.pageSpeciesProducts_Products.setSpecies((IAlleleBeeSpecies) species);
|
||||
this.pageSpeciesProducts_Specialties.setSpecies((IAlleleBeeSpecies) species);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui.database;
|
||||
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
import binnie.Binnie;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import binnie.craftgui.mod.database.PageBreeder;
|
||||
import binnie.craftgui.mod.database.PageBranchSpecies;
|
||||
import binnie.craftgui.mod.database.PageBranchOverview;
|
||||
import binnie.craftgui.mod.database.PageSpeciesMutations;
|
||||
import binnie.craftgui.mod.database.PageSpeciesResultant;
|
||||
import binnie.craftgui.mod.database.PageSpeciesClassification;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.craftgui.mod.database.DatabaseTab;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.craftgui.mod.database.PageSpeciesOverview;
|
||||
import binnie.craftgui.mod.database.WindowAbstractDatabase;
|
||||
|
||||
public class WindowApiaristDatabase extends WindowAbstractDatabase
|
||||
{
|
||||
@Override
|
||||
protected void addTabs() {
|
||||
new PageSpeciesOverview(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.overview", 0));
|
||||
new PageSpeciesClassification(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.classification", 0));
|
||||
new PageSpeciesGenome(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.genome", 0));
|
||||
new PageSpeciesProducts(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.products", 0));
|
||||
new PageSpeciesClimate(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.climate", 0));
|
||||
new PageSpeciesResultant(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.resultant", 0));
|
||||
new PageSpeciesMutations(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.further", 0));
|
||||
new PageBranchOverview(this.getInfoPages(Mode.Branches), new DatabaseTab(ExtraBees.instance, "branches.overview", 0));
|
||||
new PageBranchSpecies(this.getInfoPages(Mode.Branches), new DatabaseTab(ExtraBees.instance, "branches.species", 0));
|
||||
new PageBreeder(this.getInfoPages(Mode.Breeder), this.getUsername(), new DatabaseTab(ExtraBees.instance, "breeder", 0));
|
||||
}
|
||||
|
||||
public WindowApiaristDatabase(final EntityPlayer player, final Side side, final boolean nei) {
|
||||
super(player, side, nei, Binnie.Genetics.beeBreedingSystem, 110.0f);
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final Side side, final boolean nei) {
|
||||
return new WindowApiaristDatabase(player, side, nei);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractMod getMod() {
|
||||
return ExtraBees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Database";
|
||||
}
|
||||
|
||||
enum SpeciesTab
|
||||
{
|
||||
Overview(255),
|
||||
Genome(16776960),
|
||||
Productivity(65535),
|
||||
Climate(16711680),
|
||||
ResultantMutations(16711935),
|
||||
FurtherMutations(65280);
|
||||
|
||||
public int colour;
|
||||
|
||||
private SpeciesTab(final int colour) {
|
||||
this.colour = colour;
|
||||
}
|
||||
}
|
||||
|
||||
enum BranchesTab
|
||||
{
|
||||
Overview(255),
|
||||
Species(16711680);
|
||||
|
||||
public int colour;
|
||||
|
||||
private BranchesTab(final int colour) {
|
||||
this.colour = colour;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui.punnett;
|
||||
|
||||
import binnie.craftgui.core.Tooltip;
|
||||
import binnie.craftgui.core.CraftGUI;
|
||||
import binnie.craftgui.core.Attribute;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.core.ITooltip;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
import binnie.craftgui.controls.core.IControlValue;
|
||||
import binnie.craftgui.controls.core.Control;
|
||||
|
||||
public class ControlChromosome extends Control implements IControlValue<IChromosomeType>, ITooltip
|
||||
{
|
||||
IChromosomeType value;
|
||||
|
||||
protected ControlChromosome(final IWidget parent, final float x, final float y, final IChromosomeType type) {
|
||||
super(parent, x, y, 16.0f, 16.0f);
|
||||
this.setValue(type);
|
||||
this.addAttribute(Attribute.MouseOver);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IChromosomeType getValue() {
|
||||
return this.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(final IChromosomeType value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.Render.texture(ExtraBeeGUITexture.Chromosome, this.getArea());
|
||||
CraftGUI.Render.colour(16711680);
|
||||
CraftGUI.Render.texture(ExtraBeeGUITexture.Chromosome2, this.getArea());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
if (this.value != null) {
|
||||
tooltip.add(this.value.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui.punnett;
|
||||
|
||||
import java.util.List;
|
||||
import binnie.craftgui.controls.ControlText;
|
||||
import binnie.craftgui.core.geometry.TextJustification;
|
||||
import java.util.LinkedList;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
import binnie.craftgui.core.geometry.IArea;
|
||||
import binnie.craftgui.core.CraftGUI;
|
||||
import binnie.craftgui.core.IWidget;
|
||||
import binnie.craftgui.controls.core.Control;
|
||||
|
||||
public class ControlPunnett extends Control
|
||||
{
|
||||
static int boxWidth;
|
||||
static int boxHeight;
|
||||
|
||||
protected ControlPunnett(final IWidget parent, final float x, final float y) {
|
||||
super(parent, x, y, ControlPunnett.boxWidth * 3, ControlPunnett.boxWidth * 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.Render.solid(new IArea(0.0f, ControlPunnett.boxHeight, ControlPunnett.boxWidth * 3, 1.0f), 11184810);
|
||||
CraftGUI.Render.solid(new IArea(ControlPunnett.boxWidth / 2.0f, ControlPunnett.boxHeight * 2, ControlPunnett.boxWidth * 2.5f, 1.0f), 11184810);
|
||||
CraftGUI.Render.solid(new IArea(ControlPunnett.boxWidth, 0.0f, 1.0f, ControlPunnett.boxHeight * 3), 11184810);
|
||||
CraftGUI.Render.solid(new IArea(ControlPunnett.boxWidth * 2, ControlPunnett.boxHeight / 2.0f, 1.0f, ControlPunnett.boxHeight * 2.5f), 11184810);
|
||||
}
|
||||
|
||||
public void setup(final IChromosomeType chromosome, final IIndividual ind1, final IIndividual ind2, final ISpeciesRoot root) {
|
||||
this.deleteAllChildren();
|
||||
if (chromosome == null || ind1 == null || ind2 == null || root == null) {
|
||||
return;
|
||||
}
|
||||
final IAllele primary1 = ind1.getGenome().getActiveAllele(chromosome);
|
||||
final IAllele primary2 = ind2.getGenome().getActiveAllele(chromosome);
|
||||
final IAllele secondary1 = ind1.getGenome().getInactiveAllele(chromosome);
|
||||
final IAllele secondary2 = ind2.getGenome().getInactiveAllele(chromosome);
|
||||
int x = 1;
|
||||
int y = 1;
|
||||
for (final IAllele allele1 : new IAllele[] { primary1, secondary1 }) {
|
||||
y = 1;
|
||||
for (final IAllele allele2 : new IAllele[] { primary2, secondary2 }) {
|
||||
final List<IAllele> alleles = new LinkedList<IAllele>();
|
||||
if (allele1.isDominant() && !allele2.isDominant()) {
|
||||
alleles.add(allele1);
|
||||
}
|
||||
else if (allele2.isDominant() && !allele1.isDominant()) {
|
||||
alleles.add(allele2);
|
||||
}
|
||||
else {
|
||||
alleles.add(allele1);
|
||||
if (allele1 != allele2) {
|
||||
alleles.add(allele2);
|
||||
}
|
||||
}
|
||||
String text = "";
|
||||
for (final IAllele allele3 : alleles) {
|
||||
text = text + allele3.getName() + ": " + 25.0f / alleles.size() + "%\n";
|
||||
}
|
||||
new ControlText(this, new IArea(x * ControlPunnett.boxWidth, ControlPunnett.boxHeight * y, ControlPunnett.boxWidth, ControlPunnett.boxHeight), text, TextJustification.TopCenter).setColour(11184810);
|
||||
++y;
|
||||
}
|
||||
++x;
|
||||
}
|
||||
new ControlText(this, new IArea(ControlPunnett.boxWidth, 0.0f, ControlPunnett.boxWidth, ControlPunnett.boxHeight), "\n" + primary1.getName(), TextJustification.TopCenter).setColour(11184810);
|
||||
new ControlText(this, new IArea(ControlPunnett.boxWidth * 2, 0.0f, ControlPunnett.boxWidth, ControlPunnett.boxHeight), "\n" + secondary1.getName(), TextJustification.TopCenter).setColour(11184810);
|
||||
new ControlText(this, new IArea(0.0f, ControlPunnett.boxHeight, ControlPunnett.boxWidth, ControlPunnett.boxHeight), primary2.getName(), TextJustification.TopCenter).setColour(11184810);
|
||||
new ControlText(this, new IArea(0.0f, ControlPunnett.boxHeight * 2, ControlPunnett.boxWidth, ControlPunnett.boxHeight), primary2.getName(), TextJustification.TopCenter).setColour(11184810);
|
||||
}
|
||||
|
||||
static {
|
||||
ControlPunnett.boxWidth = 80;
|
||||
ControlPunnett.boxHeight = 28;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui.punnett;
|
||||
|
||||
public enum ExtraBeeGUITexture
|
||||
{
|
||||
Chromosome,
|
||||
Chromosome2;
|
||||
}
|
||||
@@ -0,0 +1,63 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui.punnett;
|
||||
|
||||
import binnie.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.craftgui.resource.minecraft.PaddedTexture;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import binnie.craftgui.resource.minecraft.CraftGUITexture;
|
||||
import binnie.craftgui.resource.StyleSheet;
|
||||
import binnie.craftgui.core.CraftGUI;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.AbstractMod;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import binnie.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.craftgui.minecraft.Window;
|
||||
|
||||
public class WindowPunnettSquare extends Window
|
||||
{
|
||||
ControlSlot bee1;
|
||||
ControlSlot bee2;
|
||||
ControlPunnett punnett;
|
||||
ISpeciesRoot root;
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
return new WindowPunnettSquare(player, inventory, side);
|
||||
}
|
||||
|
||||
public WindowPunnettSquare(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(245.0f, 205.0f, player, inventory, side);
|
||||
this.root = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractMod getMod() {
|
||||
return ExtraBees.instance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return "Punnett";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle("Punnett Square");
|
||||
CraftGUI.Render.stylesheet(new StyleSheetPunnett());
|
||||
}
|
||||
|
||||
static class StyleSheetPunnett extends StyleSheet
|
||||
{
|
||||
public StyleSheetPunnett() {
|
||||
this.textures.put(CraftGUITexture.Window, new PaddedTexture(0, 0, 160, 160, 0, ExtraBeeTexture.GUIPunnett, 32, 32, 32, 32));
|
||||
this.textures.put(CraftGUITexture.Slot, new StandardTexture(160, 0, 18, 18, 0, ExtraBeeTexture.GUIPunnett));
|
||||
this.textures.put(ExtraBeeGUITexture.Chromosome, new StandardTexture(160, 36, 16, 16, 0, ExtraBeeTexture.GUIPunnett));
|
||||
this.textures.put(ExtraBeeGUITexture.Chromosome2, new StandardTexture(160, 52, 16, 16, 0, ExtraBeeTexture.GUIPunnett));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.liquids;
|
||||
|
||||
import binnie.core.liquid.FluidContainer;
|
||||
import binnie.Binnie;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
import binnie.core.liquid.ILiquidType;
|
||||
|
||||
public enum ExtraBeeLiquid implements ILiquidType
|
||||
{
|
||||
ACID("acid", 11528985),
|
||||
POISON("poison", 15406315),
|
||||
GLACIAL("liquidnitrogen", 9881800);
|
||||
|
||||
String ident;
|
||||
IIcon icon;
|
||||
int colour;
|
||||
|
||||
private ExtraBeeLiquid(final String ident, final int colour) {
|
||||
this.ident = ident;
|
||||
this.colour = colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon() {
|
||||
return this.icon;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcon(final IIconRegister register) {
|
||||
this.icon = ExtraBees.proxy.getIcon(register, "liquids/" + this.getIdentifier());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraBees.proxy.localise(this.toString().toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIdentifier() {
|
||||
return this.ident;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColour() {
|
||||
return 16777215;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack get(final int amount) {
|
||||
return Binnie.Liquid.getLiquidStack(this.ident, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getTransparency() {
|
||||
return 255;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceIn(final FluidContainer container) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showInCreative(final FluidContainer container) {
|
||||
return container == FluidContainer.Bucket || container == FluidContainer.Can || container == FluidContainer.Capsule || container == FluidContainer.Refractory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getContainerColour() {
|
||||
return this.colour;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.liquids;
|
||||
|
||||
import binnie.core.liquid.ItemFluidContainer;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.IInitializable;
|
||||
|
||||
public class ModuleLiquids implements IInitializable
|
||||
{
|
||||
@Override
|
||||
public void preInit() {
|
||||
Binnie.Liquid.createLiquids(ExtraBeeLiquid.values(), ItemFluidContainer.LiquidExtraBee);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import java.util.LinkedHashMap;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import java.util.Map;
|
||||
import binnie.core.item.IItemEnum;
|
||||
|
||||
public enum EnumHoneyComb implements IItemEnum
|
||||
{
|
||||
BARREN(7564356, 12762791),
|
||||
ROTTEN(4084257, 11652233),
|
||||
BONE(12895407, 14606017),
|
||||
OIL(394760, 2894646),
|
||||
COAL(10392696, 3682590),
|
||||
FUEL(10252096, 16761856),
|
||||
WATER(2568911, 7973065),
|
||||
MILK(14145991, 16777215),
|
||||
FRUIT(8202548, 14372706),
|
||||
SEED(3428147, 7457902),
|
||||
ALCOHOL(4293921, 14604622),
|
||||
STONE(9211025, 13027020),
|
||||
REDSTONE(16422550, 15077392),
|
||||
RESIN(16762703, 13208064),
|
||||
IC2ENERGY(15332623, 2143177),
|
||||
IRON(3552564, 11038808),
|
||||
GOLD(3552564, 15125515),
|
||||
COPPER(3552564, 13722376),
|
||||
TIN(3552564, 12431805),
|
||||
SILVER(3552564, 14408667),
|
||||
BRONZE,
|
||||
URANIUM(2031360, 4303667),
|
||||
CLAY(7034426, 11583702),
|
||||
OLD(4535060, 11769444),
|
||||
FUNGAL(7234891, 2856003),
|
||||
CREOSOTE(10256652, 12429911),
|
||||
LATEX(5854529, 11051653),
|
||||
ACIDIC(3441987, 1374014),
|
||||
VENOMOUS(8198269, 16724991),
|
||||
SLIME(3884860, 8442245),
|
||||
BLAZE(16738816, 16763904),
|
||||
COFFEE(5519389, 11763531),
|
||||
GLACIAL(5146503, 13366002),
|
||||
MINT,
|
||||
CITRUS,
|
||||
PEAT,
|
||||
SHADOW(0, 3545141),
|
||||
LEAD(3552564, 10125468),
|
||||
BRASS,
|
||||
ELECTRUM,
|
||||
ZINC(3552564, 15592447),
|
||||
TITANIUM(3552564, 11578083),
|
||||
TUNGSTEN(3552564, 1249812),
|
||||
STEEL,
|
||||
IRIDIUM,
|
||||
PLATINUM(3552564, 10125468),
|
||||
LAPIS(3552564, 4009179),
|
||||
SODALITE,
|
||||
PYRITE,
|
||||
BAUXITE,
|
||||
CINNABAR,
|
||||
SPHALERITE,
|
||||
EMERALD(3552564, 1900291),
|
||||
RUBY(3552564, 14024704),
|
||||
SAPPHIRE(3552564, 673791),
|
||||
OLIVINE,
|
||||
DIAMOND(3552564, 8371706),
|
||||
RED(13388876, 16711680),
|
||||
YELLOW(15066419, 16768256),
|
||||
BLUE(10072818, 8959),
|
||||
GREEN(6717235, 39168),
|
||||
BLACK(1644825, 5723991),
|
||||
WHITE(14079702, 16777215),
|
||||
BROWN(8349260, 6042895),
|
||||
ORANGE(15905331, 16751872),
|
||||
CYAN(5020082, 65509),
|
||||
PURPLE(11691749, 11403519),
|
||||
GRAY(5000268, 12237498),
|
||||
LIGHTBLUE(10072818, 40447),
|
||||
PINK(15905484, 16744671),
|
||||
LIMEGREEN(8375321, 65288),
|
||||
MAGENTA(15040472, 16711884),
|
||||
LIGHTGRAY(10066329, 13224393),
|
||||
NICKEL(3552564, 16768764),
|
||||
INVAR,
|
||||
GLOWSTONE(10919006, 14730249),
|
||||
SALTPETER(10919006, 14730249),
|
||||
PULP,
|
||||
MULCH,
|
||||
COMPOST(4338440, 7036475),
|
||||
SAWDUST(12561009, 15913854),
|
||||
CERTUS(13029631, 3755363),
|
||||
ENDERPEARL(3446662, 206368),
|
||||
YELLORIUM(2564173, 14019840),
|
||||
CYANITE(2564173, 34541),
|
||||
BLUTONIUM(2564173, 1769702);
|
||||
|
||||
int[] colour;
|
||||
public Map<ItemStack, Float> products;
|
||||
boolean active;
|
||||
public boolean deprecated;
|
||||
|
||||
private EnumHoneyComb() {
|
||||
this(16777215, 16777215);
|
||||
this.active = false;
|
||||
this.deprecated = true;
|
||||
}
|
||||
|
||||
private EnumHoneyComb(final int colour, final int colour2) {
|
||||
this.colour = new int[0];
|
||||
this.products = new LinkedHashMap<ItemStack, Float>();
|
||||
this.active = true;
|
||||
this.deprecated = false;
|
||||
this.colour = new int[] { colour, colour2 };
|
||||
}
|
||||
|
||||
public void addRecipe() {
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, this.get(1), this.products);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return this.active;
|
||||
}
|
||||
|
||||
public static EnumHoneyComb get(final ItemStack itemStack) {
|
||||
final int i = itemStack.getItemDamage();
|
||||
if (i >= 0 && i < values().length) {
|
||||
return values()[i];
|
||||
}
|
||||
return values()[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack get(final int size) {
|
||||
return new ItemStack(ExtraBees.comb, size, this.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName(final ItemStack stack) {
|
||||
return ExtraBees.proxy.localise("item.comb." + this.name().toLowerCase());
|
||||
}
|
||||
|
||||
public boolean addProduct(final ItemStack item, final Float chance) {
|
||||
if (item == null) {
|
||||
return false;
|
||||
}
|
||||
this.products.put(item.copy(), chance);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void tryAddProduct(final ItemStack item, final Float chance) {
|
||||
this.active = this.addProduct(item, chance);
|
||||
}
|
||||
|
||||
public void tryAddProduct(final String oreDict, final Float chance) {
|
||||
if (!OreDictionary.getOres(oreDict).isEmpty()) {
|
||||
this.tryAddProduct(OreDictionary.getOres(oreDict).get(0), chance);
|
||||
}
|
||||
else {
|
||||
this.active = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void tryAddProduct(final IItemEnum type, final Float chance) {
|
||||
this.tryAddProduct(type.get(1), chance);
|
||||
this.active = (this.active && type.isActive());
|
||||
}
|
||||
|
||||
public void copyProducts(final EnumHoneyComb comb) {
|
||||
this.products.putAll(comb.products);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import binnie.Binnie;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import binnie.core.item.IItemEnum;
|
||||
|
||||
public enum EnumHoneyDrop implements IItemEnum
|
||||
{
|
||||
ENERGY(10242418, 14905713, ""),
|
||||
ACID(4961601, 4841020, "acid"),
|
||||
POISON(13698745, 16712674, "poison"),
|
||||
APPLE(13062738, 13183530, "juice"),
|
||||
CITRUS,
|
||||
ICE(11462882, 9895925, "liquidnitrogen"),
|
||||
MILK(14737632, 16777215, "milk"),
|
||||
SEED(8176242, 12762791, "seedoil"),
|
||||
ALCOHOL(14411853, 10872909, "short.mead"),
|
||||
FRUIT,
|
||||
VEGETABLE,
|
||||
PUMPKIN,
|
||||
MELON,
|
||||
RED(13388876, 16711680, "for.honey"),
|
||||
YELLOW(15066419, 16768256, "for.honey"),
|
||||
BLUE(10072818, 8959, "for.honey"),
|
||||
GREEN(6717235, 39168, "for.honey"),
|
||||
BLACK(1644825, 5723991, "for.honey"),
|
||||
WHITE(14079702, 16777215, "for.honey"),
|
||||
BROWN(8349260, 6042895, "for.honey"),
|
||||
ORANGE(15905331, 16751872, "for.honey"),
|
||||
CYAN(5020082, 65509, "for.honey"),
|
||||
PURPLE(11691749, 11403519, "for.honey"),
|
||||
GRAY(5000268, 12237498, "for.honey"),
|
||||
LIGHTBLUE(10072818, 40447, "for.honey"),
|
||||
PINK(15905484, 16744671, "for.honey"),
|
||||
LIMEGREEN(8375321, 65288, "for.honey"),
|
||||
MAGENTA(15040472, 16711884, "for.honey"),
|
||||
LIGHTGRAY(10066329, 13224393, "for.honey");
|
||||
|
||||
int[] colour;
|
||||
String liquidName;
|
||||
ItemStack remenant;
|
||||
public boolean deprecated;
|
||||
|
||||
public void addRemenant(final ItemStack stack) {
|
||||
this.remenant = stack;
|
||||
this.deprecated = true;
|
||||
}
|
||||
|
||||
private EnumHoneyDrop() {
|
||||
this(16777215, 16777215, "");
|
||||
}
|
||||
|
||||
private EnumHoneyDrop(final int colour, final int colour2, final String liquid) {
|
||||
this.liquidName = "";
|
||||
this.remenant = null;
|
||||
this.deprecated = false;
|
||||
this.colour = new int[] { colour, colour2 };
|
||||
this.liquidName = liquid;
|
||||
}
|
||||
|
||||
public void addRecipe() {
|
||||
final FluidStack liquid = Binnie.Liquid.getLiquidStack(this.liquidName, 200);
|
||||
if (liquid != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[] { this.get(1) }, liquid, this.remenant, 100);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return !this.deprecated && (this.liquidName == null || FluidRegistry.isFluidRegistered(this.liquidName));
|
||||
}
|
||||
|
||||
public static EnumHoneyDrop get(final ItemStack itemStack) {
|
||||
final int i = itemStack.getItemDamage();
|
||||
if (i >= 0 && i < values().length) {
|
||||
return values()[i];
|
||||
}
|
||||
return values()[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack get(final int size) {
|
||||
return new ItemStack(ExtraBees.honeyDrop, size, this.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName(final ItemStack stack) {
|
||||
return ExtraBees.proxy.localise("item.honeydrop." + this.name().toLowerCase());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.item.IItemEnum;
|
||||
|
||||
public enum EnumPropolis implements IItemEnum
|
||||
{
|
||||
WATER(2405321, 12762791, "Water"),
|
||||
OIL(1519411, 12762791, "oil"),
|
||||
FUEL(10718482, 12762791, "fuel"),
|
||||
MILK,
|
||||
FRUIT,
|
||||
SEED,
|
||||
ALCOHOL,
|
||||
CREOSOTE(8877313, 12428819, "creosote"),
|
||||
GLACIAL,
|
||||
PEAT;
|
||||
|
||||
int[] colour;
|
||||
String liquidName;
|
||||
boolean active;
|
||||
|
||||
private EnumPropolis() {
|
||||
this(16777215, 16777215, "");
|
||||
this.active = false;
|
||||
}
|
||||
|
||||
private EnumPropolis(final int colour, final int colour2, final String liquid) {
|
||||
this.colour = new int[0];
|
||||
this.active = true;
|
||||
this.colour = new int[] { colour, colour2 };
|
||||
this.liquidName = liquid;
|
||||
}
|
||||
|
||||
public void addRecipe() {
|
||||
final FluidStack liquid = Binnie.Liquid.getLiquidStack(this.liquidName, 500);
|
||||
if (liquid != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(20, new ItemStack[] { this.get(1) }, liquid, (ItemStack) null, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return this.active && Binnie.Liquid.getLiquidStack(this.liquidName, 100) != null;
|
||||
}
|
||||
|
||||
public static EnumPropolis get(final ItemStack itemStack) {
|
||||
final int i = itemStack.getItemDamage();
|
||||
if (i >= 0 && i < values().length) {
|
||||
return values()[i];
|
||||
}
|
||||
return values()[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack get(final int size) {
|
||||
return new ItemStack(ExtraBees.propolis, size, this.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName(final ItemStack stack) {
|
||||
return ExtraBees.proxy.localise("item.propolis." + this.name().toLowerCase());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,296 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.init.Blocks;
|
||||
import binnie.extrabees.core.ExtraBeeItems;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraft.init.Items;
|
||||
import binnie.core.Mods;
|
||||
import forestry.api.core.Tabs;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class ItemHoneyComb extends ItemProduct
|
||||
{
|
||||
IIcon icon1;
|
||||
IIcon icon2;
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public ItemHoneyComb() {
|
||||
super(EnumHoneyComb.values());
|
||||
this.setCreativeTab(Tabs.tabApiculture);
|
||||
this.setUnlocalizedName("honeyComb");
|
||||
}
|
||||
|
||||
public static void addSubtypes() {
|
||||
final ItemStack beeswax = Mods.Forestry.stack("beeswax");
|
||||
final ItemStack honeyDrop = Mods.Forestry.stack("honeyDrop");
|
||||
OreDictionary.registerOre("ingotIron", Items.iron_ingot);
|
||||
OreDictionary.registerOre("ingotGold", Items.gold_ingot);
|
||||
OreDictionary.registerOre("gemDiamond", Items.diamond);
|
||||
OreDictionary.registerOre("gemEmerald", Items.emerald);
|
||||
OreDictionary.registerOre("gemLapis", new ItemStack(Items.dye, 1, 4));
|
||||
EnumHoneyComb.BARREN.addProduct(beeswax, 1.00f);
|
||||
EnumHoneyComb.BARREN.addProduct(honeyDrop, 0.50f);
|
||||
EnumHoneyComb.ROTTEN.addProduct(beeswax, 0.20f);
|
||||
EnumHoneyComb.ROTTEN.addProduct(honeyDrop, 0.20f);
|
||||
EnumHoneyComb.ROTTEN.addProduct(new ItemStack(Items.rotten_flesh, 1, 0), 0.80f);
|
||||
EnumHoneyComb.BONE.addProduct(beeswax, 0.20f);
|
||||
EnumHoneyComb.BONE.addProduct(honeyDrop, 0.20f);
|
||||
EnumHoneyComb.BONE.addProduct(new ItemStack(Items.dye, 1, 15), 0.80f);
|
||||
EnumHoneyComb.OIL.tryAddProduct(EnumPropolis.OIL, 0.60f);
|
||||
EnumHoneyComb.OIL.addProduct(honeyDrop, 0.75f);
|
||||
EnumHoneyComb.COAL.addProduct(beeswax, 0.80f);
|
||||
EnumHoneyComb.COAL.addProduct(honeyDrop, 0.75f);
|
||||
EnumHoneyComb.COAL.tryAddProduct(ExtraBeeItems.CoalDust, 1.00f);
|
||||
EnumHoneyComb.WATER.tryAddProduct(EnumPropolis.WATER, 1.00f);
|
||||
EnumHoneyComb.WATER.addProduct(honeyDrop, 0.90f);
|
||||
EnumHoneyComb.STONE.addProduct(beeswax, 0.50f);
|
||||
EnumHoneyComb.STONE.addProduct(honeyDrop, 0.25f);
|
||||
EnumHoneyComb.MILK.tryAddProduct(EnumHoneyDrop.MILK, 1.00f);
|
||||
EnumHoneyComb.MILK.addProduct(honeyDrop, 0.90f);
|
||||
EnumHoneyComb.FRUIT.tryAddProduct(EnumHoneyDrop.APPLE, 1.00f);
|
||||
EnumHoneyComb.FRUIT.addProduct(honeyDrop, 0.90f);
|
||||
EnumHoneyComb.SEED.tryAddProduct(EnumHoneyDrop.SEED, 1.00f);
|
||||
EnumHoneyComb.SEED.addProduct(honeyDrop, 0.90f);
|
||||
EnumHoneyComb.ALCOHOL.tryAddProduct(EnumHoneyDrop.ALCOHOL, 1.00f);
|
||||
EnumHoneyComb.ALCOHOL.addProduct(honeyDrop, 0.90f);
|
||||
EnumHoneyComb.FUEL.tryAddProduct(EnumPropolis.FUEL, 0.60f);
|
||||
EnumHoneyComb.FUEL.addProduct(honeyDrop, 0.50f);
|
||||
EnumHoneyComb.CREOSOTE.tryAddProduct(EnumPropolis.CREOSOTE, 0.70f);
|
||||
EnumHoneyComb.CREOSOTE.addProduct(honeyDrop, 0.50f);
|
||||
EnumHoneyComb.LATEX.addProduct(honeyDrop, 0.50f);
|
||||
EnumHoneyComb.LATEX.addProduct(beeswax, 0.85f);
|
||||
if (!OreDictionary.getOres("itemRubber").isEmpty()) {
|
||||
EnumHoneyComb.LATEX.tryAddProduct(OreDictionary.getOres("itemRubber").get(0), 1.00f);
|
||||
}
|
||||
else {
|
||||
EnumHoneyComb.LATEX.active = false;
|
||||
}
|
||||
EnumHoneyComb.REDSTONE.addProduct(beeswax, 0.80f);
|
||||
EnumHoneyComb.REDSTONE.addProduct(new ItemStack(Items.redstone, 1, 0), 1.00f);
|
||||
EnumHoneyComb.REDSTONE.addProduct(honeyDrop, 0.50f);
|
||||
EnumHoneyComb.RESIN.addProduct(beeswax, 1.00f);
|
||||
EnumHoneyComb.RESIN.tryAddProduct(Mods.IC2.stack("itemHarz"), 1.00f);
|
||||
EnumHoneyComb.RESIN.tryAddProduct(Mods.IC2.stack("itemHarz"), 0.50f);
|
||||
EnumHoneyComb.IC2ENERGY.addProduct(beeswax, 0.80f);
|
||||
EnumHoneyComb.IC2ENERGY.addProduct(new ItemStack(Items.redstone, 1, 0), 0.75f);
|
||||
EnumHoneyComb.IC2ENERGY.tryAddProduct(EnumHoneyDrop.ENERGY, 1.00f);
|
||||
EnumHoneyComb.IRON.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.IRON.tryAddProduct(ExtraBeeItems.IronDust, 1.00f);
|
||||
EnumHoneyComb.GOLD.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.GOLD.tryAddProduct(ExtraBeeItems.GoldDust, 1.00f);
|
||||
EnumHoneyComb.COPPER.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.COPPER.tryAddProduct(ExtraBeeItems.CopperDust, 1.00f);
|
||||
EnumHoneyComb.TIN.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.TIN.tryAddProduct(ExtraBeeItems.TinDust, 1.00f);
|
||||
EnumHoneyComb.NICKEL.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.NICKEL.tryAddProduct(ExtraBeeItems.NickelDust, 1.00f);
|
||||
EnumHoneyComb.SILVER.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.SILVER.tryAddProduct(ExtraBeeItems.SilverDust, 1.00f);
|
||||
EnumHoneyComb.URANIUM.copyProducts(EnumHoneyComb.STONE);
|
||||
if (!OreDictionary.getOres("crushedUranium").isEmpty()) {
|
||||
EnumHoneyComb.URANIUM.tryAddProduct(OreDictionary.getOres("crushedUranium").get(0), 0.50f);
|
||||
}
|
||||
EnumHoneyComb.CLAY.addProduct(beeswax, 0.25f);
|
||||
EnumHoneyComb.CLAY.addProduct(honeyDrop, 0.80f);
|
||||
EnumHoneyComb.CLAY.addProduct(new ItemStack(Items.clay_ball), 0.80f);
|
||||
EnumHoneyComb.OLD.addProduct(beeswax, 1.00f);
|
||||
EnumHoneyComb.OLD.addProduct(honeyDrop, 0.90f);
|
||||
EnumHoneyComb.FUNGAL.addProduct(beeswax, 0.90f);
|
||||
EnumHoneyComb.FUNGAL.addProduct(new ItemStack(Blocks.brown_mushroom_block, 1, 0), 1.00f);
|
||||
EnumHoneyComb.FUNGAL.addProduct(new ItemStack(Blocks.red_mushroom_block, 1, 0), 0.75f);
|
||||
EnumHoneyComb.ACIDIC.addProduct(beeswax, 0.80f);
|
||||
EnumHoneyComb.ACIDIC.tryAddProduct(EnumHoneyDrop.ACID, 0.50f);
|
||||
if (!OreDictionary.getOres("dustSulfur").isEmpty()) {
|
||||
EnumHoneyComb.ACIDIC.addProduct(OreDictionary.getOres("dustSulfur").get(0), 0.75f);
|
||||
}
|
||||
EnumHoneyComb.VENOMOUS.addProduct(beeswax, 0.80f);
|
||||
EnumHoneyComb.VENOMOUS.tryAddProduct(EnumHoneyDrop.POISON, 0.80f);
|
||||
EnumHoneyComb.SLIME.addProduct(beeswax, 1.00f);
|
||||
EnumHoneyComb.SLIME.addProduct(honeyDrop, 0.75f);
|
||||
EnumHoneyComb.SLIME.addProduct(new ItemStack(Items.slime_ball, 1, 0), 0.75f);
|
||||
EnumHoneyComb.BLAZE.addProduct(beeswax, 0.75f);
|
||||
EnumHoneyComb.BLAZE.addProduct(new ItemStack(Items.blaze_powder, 1, 0), 1.00f);
|
||||
EnumHoneyComb.COFFEE.addProduct(beeswax, 0.90f);
|
||||
EnumHoneyComb.COFFEE.addProduct(honeyDrop, 0.75f);
|
||||
EnumHoneyComb.COFFEE.tryAddProduct(Mods.IC2.stack("itemCofeePowder"), 0.75f);
|
||||
EnumHoneyComb.GLACIAL.tryAddProduct(EnumHoneyDrop.ICE, 0.80f);
|
||||
EnumHoneyComb.GLACIAL.addProduct(honeyDrop, 0.75f);
|
||||
EnumHoneyComb.SHADOW.addProduct(honeyDrop, 0.50f);
|
||||
if (!OreDictionary.getOres("dustObsidian").isEmpty()) {
|
||||
EnumHoneyComb.SHADOW.tryAddProduct(OreDictionary.getOres("dustObsidian").get(0), 0.75f);
|
||||
}
|
||||
else {
|
||||
EnumHoneyComb.SHADOW.active = false;
|
||||
}
|
||||
EnumHoneyComb.LEAD.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.LEAD.tryAddProduct(ExtraBeeItems.LeadDust, 1.00f);
|
||||
EnumHoneyComb.ZINC.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.ZINC.tryAddProduct(ExtraBeeItems.ZincDust, 1.00f);
|
||||
EnumHoneyComb.TITANIUM.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.TITANIUM.tryAddProduct(ExtraBeeItems.TitaniumDust, 1.00f);
|
||||
EnumHoneyComb.TUNGSTEN.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.TUNGSTEN.tryAddProduct(ExtraBeeItems.TungstenDust, 1.00f);
|
||||
EnumHoneyComb.PLATINUM.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.PLATINUM.tryAddProduct(ExtraBeeItems.PlatinumDust, 1.00f);
|
||||
EnumHoneyComb.LAPIS.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.LAPIS.addProduct(new ItemStack(Items.dye, 6, 4), 1.00f);
|
||||
EnumHoneyComb.EMERALD.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.EMERALD.tryAddProduct(ExtraBeeItems.EmeraldShard, 1.00f);
|
||||
EnumHoneyComb.RUBY.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.RUBY.tryAddProduct(ExtraBeeItems.RubyShard, 1.00f);
|
||||
EnumHoneyComb.SAPPHIRE.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.SAPPHIRE.tryAddProduct(ExtraBeeItems.SapphireShard, 1.00f);
|
||||
EnumHoneyComb.DIAMOND.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.DIAMOND.tryAddProduct(ExtraBeeItems.DiamondShard, 1.00f);
|
||||
EnumHoneyComb.RED.addProduct(honeyDrop, 0.80f);
|
||||
EnumHoneyComb.RED.addProduct(beeswax, 0.80f);
|
||||
EnumHoneyComb.GLOWSTONE.addProduct(honeyDrop, 0.25f);
|
||||
EnumHoneyComb.GLOWSTONE.addProduct(new ItemStack(Items.glowstone_dust), 1.00f);
|
||||
EnumHoneyComb.SALTPETER.addProduct(honeyDrop, 0.25f);
|
||||
EnumHoneyComb.SALTPETER.tryAddProduct(getOreDictionary("dustSaltpeter"), 1.00f);
|
||||
EnumHoneyComb.COMPOST.addProduct(honeyDrop, 0.25f);
|
||||
EnumHoneyComb.COMPOST.tryAddProduct(Mods.Forestry.stack("fertilizerBio"), 1.00f);
|
||||
EnumHoneyComb.SAWDUST.addProduct(honeyDrop, 0.25f);
|
||||
if (!OreDictionary.getOres("dustSawdust").isEmpty()) {
|
||||
EnumHoneyComb.SAWDUST.tryAddProduct(OreDictionary.getOres("dustSawdust").get(0), 1.00f);
|
||||
}
|
||||
else if (!OreDictionary.getOres("sawdust").isEmpty()) {
|
||||
EnumHoneyComb.SAWDUST.tryAddProduct(OreDictionary.getOres("sawdust").get(0), 1.00f);
|
||||
}
|
||||
EnumHoneyComb.CERTUS.addProduct(honeyDrop, 0.25f);
|
||||
EnumHoneyComb.CERTUS.addProduct(new ItemStack(Items.quartz), 0.25f);
|
||||
if (!OreDictionary.getOres("dustCertusQuartz").isEmpty()) {
|
||||
EnumHoneyComb.CERTUS.tryAddProduct(OreDictionary.getOres("dustCertusQuartz").get(0), 0.20f);
|
||||
}
|
||||
EnumHoneyComb.ENDERPEARL.addProduct(honeyDrop, 0.25f);
|
||||
if (!OreDictionary.getOres("dustEnderPearl").isEmpty()) {
|
||||
EnumHoneyComb.ENDERPEARL.tryAddProduct(OreDictionary.getOres("dustEnderPearl").get(0), 0.25f);
|
||||
}
|
||||
EnumHoneyComb.YELLORIUM.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.CYANITE.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.BLUTONIUM.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.YELLORIUM.tryAddProduct(ExtraBeeItems.YelloriumDust, 0.25f);
|
||||
EnumHoneyComb.CYANITE.tryAddProduct(ExtraBeeItems.CyaniteDust, 0.25f);
|
||||
EnumHoneyComb.BLUTONIUM.tryAddProduct(ExtraBeeItems.BlutoniumDust, 0.25f);
|
||||
OreDictionary.registerOre("beeComb", new ItemStack(ExtraBees.comb, 1, 32767));
|
||||
for (int i = 0; i < 16; ++i) {
|
||||
final EnumHoneyComb type = EnumHoneyComb.values()[EnumHoneyComb.RED.ordinal() + i];
|
||||
if (type != EnumHoneyComb.RED) {
|
||||
type.copyProducts(EnumHoneyComb.RED);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < 16; ++i) {
|
||||
final EnumHoneyComb type = EnumHoneyComb.values()[EnumHoneyComb.RED.ordinal() + i];
|
||||
final EnumHoneyDrop drop = EnumHoneyDrop.values()[EnumHoneyDrop.RED.ordinal() + i];
|
||||
final int[] dyeC = { 1, 11, 4, 2, 0, 15, 3, 14, 6, 5, 8, 12, 9, 10, 13, 7 };
|
||||
final int k = dyeC[i];
|
||||
ItemStack dye = new ItemStack(Items.dye, 1, k);
|
||||
switch (k) {
|
||||
case 0: {
|
||||
dye = ExtraBeeItems.BlackDye.get(1);
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
dye = ExtraBeeItems.RedDye.get(1);
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
dye = ExtraBeeItems.GreenDye.get(1);
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
dye = ExtraBeeItems.BrownDye.get(1);
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
dye = ExtraBeeItems.BlueDye.get(1);
|
||||
break;
|
||||
}
|
||||
case 11: {
|
||||
dye = ExtraBeeItems.YellowDye.get(1);
|
||||
break;
|
||||
}
|
||||
case 15: {
|
||||
dye = ExtraBeeItems.WhiteDye.get(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
type.addProduct(drop.get(1), 1.00f);
|
||||
drop.addRemenant(dye);
|
||||
}
|
||||
}
|
||||
|
||||
private static ItemStack getOreDictionary(final String string) {
|
||||
if (OreDictionary.getOres(string).size() > 0) {
|
||||
return OreDictionary.getOres(string).get(0);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColorFromItemStack(final ItemStack itemStack, final int j) {
|
||||
if (EnumHoneyComb.get(itemStack) == null) {
|
||||
return 16777215;
|
||||
}
|
||||
if (j == 0) {
|
||||
return EnumHoneyComb.get(itemStack).colour[0];
|
||||
}
|
||||
return EnumHoneyComb.get(itemStack).colour[1];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamageForRenderPass(final int i, final int j) {
|
||||
if (j > 0) {
|
||||
return this.icon1;
|
||||
}
|
||||
return this.icon2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister register) {
|
||||
this.icon1 = BinnieCore.proxy.getIcon(register, "forestry", "beeCombs.0");
|
||||
this.icon2 = BinnieCore.proxy.getIcon(register, "forestry", "beeCombs.1");
|
||||
}
|
||||
|
||||
public enum VanillaComb
|
||||
{
|
||||
HONEY,
|
||||
COCOA,
|
||||
SIMMERING,
|
||||
STRINGY,
|
||||
FROZEN,
|
||||
DRIPPING,
|
||||
SILKY,
|
||||
PARCHED,
|
||||
MYSTERIOUS,
|
||||
IRRADIATED,
|
||||
POWDERY,
|
||||
REDDENED,
|
||||
DARKENED,
|
||||
OMEGA,
|
||||
WHEATEN,
|
||||
MOSSY,
|
||||
QUARTZ;
|
||||
|
||||
public ItemStack get() {
|
||||
return new ItemStack(Mods.Forestry.item("beeCombs"), 1, this.ordinal());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import forestry.api.core.Tabs;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class ItemHoneyCrystal extends Item
|
||||
{
|
||||
private int maxCharge;
|
||||
private int transferLimit;
|
||||
private int tier;
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister register) {
|
||||
this.itemIcon = ExtraBees.proxy.getIcon(register, "honeyCrystal");
|
||||
}
|
||||
|
||||
public ItemHoneyCrystal() {
|
||||
this.maxCharge = 8000;
|
||||
this.transferLimit = 500;
|
||||
this.tier = 1;
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
this.setCreativeTab(Tabs.tabApiculture);
|
||||
this.setUnlocalizedName("honeyCrystal");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(final ItemStack i) {
|
||||
return ExtraBees.proxy.localise("item.honeycrystal");
|
||||
}
|
||||
|
||||
public static NBTTagCompound getOrCreateNbtData(final ItemStack itemStack) {
|
||||
NBTTagCompound ret = itemStack.getTagCompound();
|
||||
if (ret == null) {
|
||||
ret = new NBTTagCompound();
|
||||
itemStack.setTagCompound(ret);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
public class ItemHoneyCrystalEmpty extends ItemHoneyCrystal
|
||||
{
|
||||
public ItemHoneyCrystalEmpty() {
|
||||
this.setMaxDamage(0);
|
||||
this.setMaxStackSize(64);
|
||||
this.setUnlocalizedName("honeyCrystalEmpty");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(final IIconRegister register) {
|
||||
this.itemIcon = ExtraBees.proxy.getIcon(register, "honeyCrystalEmpty");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(final ItemStack i) {
|
||||
return ExtraBees.proxy.localise("item.honeycrystal.empty");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import forestry.api.core.Tabs;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class ItemHoneyDrop extends ItemProduct
|
||||
{
|
||||
IIcon icon1;
|
||||
IIcon icon2;
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public ItemHoneyDrop() {
|
||||
super(EnumHoneyDrop.values());
|
||||
this.setCreativeTab(Tabs.tabApiculture);
|
||||
this.setUnlocalizedName("honeyDrop");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColorFromItemStack(final ItemStack itemStack, final int j) {
|
||||
final int i = itemStack.getItemDamage();
|
||||
if (j == 0) {
|
||||
return EnumHoneyDrop.get(itemStack).colour[0];
|
||||
}
|
||||
return EnumHoneyDrop.get(itemStack).colour[1];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamageForRenderPass(final int i, final int j) {
|
||||
if (j > 0) {
|
||||
return this.icon1;
|
||||
}
|
||||
return this.icon2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister register) {
|
||||
this.icon1 = BinnieCore.proxy.getIcon(register, "forestry", "honeyDrop.0");
|
||||
this.icon2 = BinnieCore.proxy.getIcon(register, "forestry", "honeyDrop.1");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import java.util.List;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import binnie.core.item.IItemEnum;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class ItemProduct extends Item
|
||||
{
|
||||
IItemEnum[] types;
|
||||
|
||||
public ItemProduct(final IItemEnum[] types) {
|
||||
this.setMaxStackSize(64);
|
||||
this.setMaxDamage(0);
|
||||
this.setHasSubtypes(true);
|
||||
this.types = types;
|
||||
}
|
||||
|
||||
public IItemEnum get(final ItemStack stack) {
|
||||
final int i = stack.getItemDamage();
|
||||
if (i >= 0 && i < this.types.length) {
|
||||
return this.types[i];
|
||||
}
|
||||
return this.types[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(final ItemStack itemstack) {
|
||||
return this.get(itemstack).getName(itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
|
||||
for (final IItemEnum type : this.types) {
|
||||
if (type.isActive()) {
|
||||
itemList.add(new ItemStack(this, 1, type.ordinal()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import binnie.core.BinnieCore;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import forestry.api.core.Tabs;
|
||||
|
||||
public class ItemPropolis extends ItemProduct
|
||||
{
|
||||
public ItemPropolis() {
|
||||
super(EnumPropolis.values());
|
||||
this.setCreativeTab(Tabs.tabApiculture);
|
||||
this.setUnlocalizedName("propolis");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColorFromItemStack(final ItemStack itemStack, final int j) {
|
||||
final int i = itemStack.getItemDamage();
|
||||
if (j == 0) {
|
||||
return EnumPropolis.get(itemStack).colour[0];
|
||||
}
|
||||
return EnumPropolis.get(itemStack).colour[1];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister register) {
|
||||
this.itemIcon = BinnieCore.proxy.getIcon(register, "forestry", "propolis.0");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import binnie.core.Mods;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraft.init.Items;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.IInitializable;
|
||||
|
||||
public class ModuleProducts implements IInitializable
|
||||
{
|
||||
@Override
|
||||
public void preInit() {
|
||||
ExtraBees.honeyCrystal = new ItemHoneyCrystal();
|
||||
ExtraBees.honeyCrystalEmpty = new ItemHoneyCrystalEmpty();
|
||||
ExtraBees.honeyDrop = new ItemHoneyDrop();
|
||||
ExtraBees.comb = new ItemHoneyComb();
|
||||
ExtraBees.propolis = new ItemPropolis();
|
||||
OreDictionary.registerOre("ingotIron", Items.iron_ingot);
|
||||
OreDictionary.registerOre("ingotGold", Items.gold_ingot);
|
||||
OreDictionary.registerOre("gemDiamond", Items.diamond);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
ItemHoneyComb.addSubtypes();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
GameRegistry.addRecipe(new ItemStack(ExtraBees.honeyCrystalEmpty), new Object[] { "#@#", "@#@", "#@#", '@', Mods.Forestry.stack("honeyDrop"), '#', EnumHoneyDrop.ENERGY.get(1) });
|
||||
for (final EnumHoneyComb info : EnumHoneyComb.values()) {
|
||||
info.addRecipe();
|
||||
}
|
||||
for (final EnumHoneyDrop info2 : EnumHoneyDrop.values()) {
|
||||
info2.addRecipe();
|
||||
}
|
||||
for (final EnumPropolis info3 : EnumPropolis.values()) {
|
||||
info3.addRecipe();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.proxy;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.proxy.BinnieModProxy;
|
||||
|
||||
public class ExtraBeesProxy extends BinnieModProxy
|
||||
{
|
||||
public ExtraBeesProxy() {
|
||||
super(ExtraBees.instance);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.proxy;
|
||||
|
||||
public class ExtraBeesProxyClient extends ExtraBeesProxy
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.proxy;
|
||||
|
||||
public class ExtraBeesProxyServer extends ExtraBeesProxy
|
||||
{
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.worldgen;
|
||||
|
||||
import forestry.api.apiculture.IHiveDrop;
|
||||
import java.util.Collections;
|
||||
import java.util.ArrayList;
|
||||
import net.minecraft.world.World;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.List;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import forestry.api.core.Tabs;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
public class BlockExtraBeeHive extends Block
|
||||
{
|
||||
IIcon[][] icons;
|
||||
|
||||
public BlockExtraBeeHive() {
|
||||
super(ExtraBees.materialBeehive);
|
||||
this.setLightLevel(0.2f);
|
||||
this.setHardness(1.0f);
|
||||
this.setTickRandomly(true);
|
||||
this.setBlockName("hive");
|
||||
this.setCreativeTab(Tabs.tabApiculture);
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(final ItemStack par1ItemStack) {
|
||||
return "extrabees.block.hive." + par1ItemStack.getItemDamage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
itemList.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(final int side, final int metadata) {
|
||||
if (metadata >= EnumHiveType.values().length) {
|
||||
return null;
|
||||
}
|
||||
if (side < 2) {
|
||||
return this.icons[metadata][1];
|
||||
}
|
||||
return this.icons[metadata][0];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(final IIconRegister register) {
|
||||
this.icons = new IIcon[EnumHiveType.values().length][2];
|
||||
for (final EnumHiveType hive : EnumHiveType.values()) {
|
||||
this.icons[hive.ordinal()][0] = ExtraBees.proxy.getIcon(register, "hive/" + hive.toString().toLowerCase() + ".0");
|
||||
this.icons[hive.ordinal()][1] = ExtraBees.proxy.getIcon(register, "hive/" + hive.toString().toLowerCase() + ".1");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int metadata, final int fortune) {
|
||||
final ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
final List<IHiveDrop> dropList = EnumHiveType.values()[metadata].drops;
|
||||
Collections.shuffle(dropList);
|
||||
int tries = 0;
|
||||
for (boolean hasPrincess = false; tries <= 10 && !hasPrincess; hasPrincess = true) {
|
||||
++tries;
|
||||
for (final IHiveDrop drop : dropList) {
|
||||
if (world.rand.nextInt(100) < drop.getChance(world, x, y, z)) {
|
||||
ret.add(drop.getPrincess(world, x, y, z, fortune));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (final IHiveDrop drop : dropList) {
|
||||
if (world.rand.nextInt(100) < drop.getChance(world, x, y, z)) {
|
||||
ret.addAll(drop.getDrones(world, x, y, z, fortune));
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (final IHiveDrop drop : dropList) {
|
||||
if (world.rand.nextInt(100) < drop.getChance(world, x, y, z)) {
|
||||
ret.addAll(drop.getAdditional(world, x, y, z, fortune));
|
||||
break;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.worldgen;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import forestry.api.apiculture.IHiveDrop;
|
||||
import java.util.List;
|
||||
|
||||
public enum EnumHiveType
|
||||
{
|
||||
Water,
|
||||
Rock,
|
||||
Nether,
|
||||
Marble;
|
||||
|
||||
public List<IHiveDrop> drops;
|
||||
|
||||
private EnumHiveType() {
|
||||
this.drops = new ArrayList<IHiveDrop>();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.worldgen;
|
||||
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import net.minecraft.world.World;
|
||||
import binnie.Binnie;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import java.util.ArrayList;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.apiculture.IHiveDrop;
|
||||
|
||||
public class HiveDrop implements IHiveDrop
|
||||
{
|
||||
private IAllele[] template;
|
||||
private ArrayList<ItemStack> additional;
|
||||
private int chance;
|
||||
|
||||
public HiveDrop(final IAlleleBeeSpecies species, final int chance) {
|
||||
this(Binnie.Genetics.getBeeRoot().getTemplate(species.getUID()), new ItemStack[0], chance);
|
||||
}
|
||||
|
||||
public HiveDrop(IAllele[] template, final ItemStack[] bonus, final int chance) {
|
||||
this.additional = new ArrayList<ItemStack>();
|
||||
if (template == null) {
|
||||
template = Binnie.Genetics.getBeeRoot().getDefaultTemplate();
|
||||
}
|
||||
this.template = template;
|
||||
this.chance = chance;
|
||||
for (final ItemStack stack : bonus) {
|
||||
this.additional.add(stack);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPrincess(final World world, final int x, final int y, final int z, final int fortune) {
|
||||
return Binnie.Genetics.getBeeRoot().getMemberStack(Binnie.Genetics.getBeeRoot().getBee(world, Binnie.Genetics.getBeeRoot().templateAsGenome(this.template)), EnumBeeType.PRINCESS.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrones(final World world, final int x, final int y, final int z, final int fortune) {
|
||||
final ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
ret.add(Binnie.Genetics.getBeeRoot().getMemberStack(Binnie.Genetics.getBeeRoot().templateAsIndividual(this.template), EnumBeeType.DRONE.ordinal()));
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getAdditional(final World world, final int x, final int y, final int z, final int fortune) {
|
||||
final ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
for (final ItemStack stack : this.additional) {
|
||||
ret.add(stack.copy());
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getChance(final World world, final int x, final int y, final int z) {
|
||||
return this.chance;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.worldgen;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import java.util.List;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
|
||||
public class ItemBeehive extends ItemBlock
|
||||
{
|
||||
public ItemBeehive(final Block block) {
|
||||
super(block);
|
||||
this.setMaxDamage(0);
|
||||
this.setHasSubtypes(true);
|
||||
this.setCreativeTab(CreativeTabs.tabBlock);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(final int i) {
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
itemList.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(final ItemStack itemStack) {
|
||||
return EnumHiveType.values()[itemStack.getItemDamage()].toString() + " Hive";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.worldgen;
|
||||
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
public class MaterialBeehive extends Material
|
||||
{
|
||||
public MaterialBeehive() {
|
||||
super(MapColor.stoneColor);
|
||||
this.setRequiresTool();
|
||||
this.setImmovableMobility();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaque() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,89 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.worldgen;
|
||||
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.World;
|
||||
import java.util.Random;
|
||||
import binnie.core.genetics.ForestryAllele;
|
||||
import forestry.api.apiculture.IHiveDrop;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import binnie.extrabees.genetics.ExtraBeesSpecies;
|
||||
import buildcraft.api.core.BuildCraftAPI;
|
||||
import binnie.extrabees.config.ConfigurationMain;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.IInitializable;
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
|
||||
public class ModuleGeneration implements IWorldGenerator, IInitializable
|
||||
{
|
||||
static int waterRate;
|
||||
static int rockRate;
|
||||
static int netherRate;
|
||||
static int marbleRate;
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
ExtraBees.materialBeehive = new MaterialBeehive();
|
||||
GameRegistry.registerBlock(ExtraBees.hive = new BlockExtraBeeHive(), ItemBeehive.class, "hive");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
ModuleGeneration.waterRate = ConfigurationMain.waterHiveRate;
|
||||
ModuleGeneration.rockRate = ConfigurationMain.rockHiveRate;
|
||||
ModuleGeneration.netherRate = ConfigurationMain.netherHiveRate;
|
||||
GameRegistry.registerWorldGenerator(new ModuleGeneration(), 0);
|
||||
if (!ConfigurationMain.canQuarryMineHives) {
|
||||
BuildCraftAPI.softBlocks.add(ExtraBees.hive);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
EnumHiveType.Water.drops.add(new HiveDrop(ExtraBeesSpecies.WATER, 80));
|
||||
EnumHiveType.Water.drops.add(new HiveDrop(ForestryAllele.BeeSpecies.Valiant.getAllele(), 3));
|
||||
EnumHiveType.Rock.drops.add(new HiveDrop(ExtraBeesSpecies.ROCK, 80));
|
||||
EnumHiveType.Rock.drops.add(new HiveDrop(ForestryAllele.BeeSpecies.Valiant.getAllele(), 3));
|
||||
EnumHiveType.Nether.drops.add(new HiveDrop(ExtraBeesSpecies.BASALT, 80));
|
||||
EnumHiveType.Nether.drops.add(new HiveDrop(ForestryAllele.BeeSpecies.Valiant.getAllele(), 3));
|
||||
ExtraBees.hive.setHarvestLevel("scoop", 0, 0);
|
||||
ExtraBees.hive.setHarvestLevel("scoop", 0, 1);
|
||||
ExtraBees.hive.setHarvestLevel("scoop", 0, 2);
|
||||
ExtraBees.hive.setHarvestLevel("scoop", 0, 3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate(final Random rand, int chunkX, int chunkZ, final World world, final IChunkProvider chunkGenerator, final IChunkProvider chunkProvider) {
|
||||
chunkX <<= 4;
|
||||
chunkZ <<= 4;
|
||||
for (int i = 0; i < ModuleGeneration.waterRate; ++i) {
|
||||
final int randPosX = chunkX + rand.nextInt(16);
|
||||
final int randPosY = rand.nextInt(50) + 20;
|
||||
final int randPosZ = chunkZ + rand.nextInt(16);
|
||||
new WorldGenHiveWater().generate(world, rand, randPosX, randPosY, randPosZ);
|
||||
}
|
||||
for (int i = 0; i < ModuleGeneration.rockRate; ++i) {
|
||||
final int randPosX = chunkX + rand.nextInt(16);
|
||||
final int randPosY = rand.nextInt(50) + 20;
|
||||
final int randPosZ = chunkZ + rand.nextInt(16);
|
||||
new WorldGenHiveRock().generate(world, rand, randPosX, randPosY, randPosZ);
|
||||
}
|
||||
for (int i = 0; i < ModuleGeneration.netherRate; ++i) {
|
||||
final int randPosX = chunkX + rand.nextInt(16);
|
||||
final int randPosY = rand.nextInt(50) + 20;
|
||||
final int randPosZ = chunkZ + rand.nextInt(16);
|
||||
new WorldGenHiveNether().generate(world, rand, randPosX, randPosY, randPosZ);
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
ModuleGeneration.waterRate = 2;
|
||||
ModuleGeneration.rockRate = 2;
|
||||
ModuleGeneration.netherRate = 2;
|
||||
ModuleGeneration.marbleRate = 2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.worldgen;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
import java.util.Random;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
public class WorldGenHiveNether extends WorldGenerator
|
||||
{
|
||||
@Override
|
||||
public boolean generate(final World world, final Random random, final int i, final int j, final int k) {
|
||||
final BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(i, k);
|
||||
if (!BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.NETHER)) {
|
||||
return true;
|
||||
}
|
||||
if (this.embedInWall(world, Blocks.netherrack, i, j, k)) {
|
||||
world.setBlock(i, j, k, ExtraBees.hive, 2, 0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean embedInWall(final World world, final Block blockID, final int i, final int j, final int k) {
|
||||
return world.getBlock(i, j, k) == blockID && world.getBlock(i, j + 1, k) == blockID && world.getBlock(i, j - 1, k) == blockID && (world.isAirBlock(i + 1, j, k) || world.isAirBlock(i - 1, j, k) || world.isAirBlock(i, j, k + 1) || world.isAirBlock(i, j, k - 1));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.worldgen;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.init.Blocks;
|
||||
import java.util.Random;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
public class WorldGenHiveRock extends WorldGenerator
|
||||
{
|
||||
@Override
|
||||
public boolean generate(final World world, final Random random, final int i, final int j, final int k) {
|
||||
final BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(i, k);
|
||||
final Block block = world.getBlock(i, j, k);
|
||||
if (block == null) {
|
||||
return true;
|
||||
}
|
||||
if (block.isReplaceableOreGen(world, i, j, k, Blocks.stone)) {
|
||||
world.setBlock(i, j, k, ExtraBees.hive, 1, 0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.worldgen;
|
||||
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
import java.util.Random;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
public class WorldGenHiveWater extends WorldGenerator
|
||||
{
|
||||
@Override
|
||||
public boolean generate(final World world, final Random random, final int i, final int j, final int k) {
|
||||
final BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(i, k);
|
||||
final int i2 = i + random.nextInt(8) - random.nextInt(8);
|
||||
final int j2 = j + random.nextInt(4) - random.nextInt(4);
|
||||
final int k2 = k + random.nextInt(8) - random.nextInt(8);
|
||||
if (world.getBlock(i2, j2, k2) != Blocks.water && world.getBlock(i2, j2, k2) != Blocks.water) {
|
||||
return false;
|
||||
}
|
||||
if (world.getBlock(i2, j2 - 1, k2).getMaterial() == Material.sand || world.getBlock(i2, j2 - 1, k2).getMaterial() == Material.clay || world.getBlock(i2, j2 - 1, k2).getMaterial() == Material.ground || world.getBlock(i2, j2 - 1, k2).getMaterial() == Material.rock) {
|
||||
world.setBlock(i2, j2, k2, ExtraBees.hive, 0, 0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user