diff options
Diffstat (limited to 'src/Java/binnie/extrabees/apiary')
16 files changed, 0 insertions, 2029 deletions
diff --git a/src/Java/binnie/extrabees/apiary/ComponentBeeModifier.java b/src/Java/binnie/extrabees/apiary/ComponentBeeModifier.java deleted file mode 100644 index 32cb7dcd48..0000000000 --- a/src/Java/binnie/extrabees/apiary/ComponentBeeModifier.java +++ /dev/null @@ -1,88 +0,0 @@ -package binnie.extrabees.apiary; - -import binnie.core.machines.Machine; -import binnie.core.machines.MachineComponent; -import forestry.api.apiculture.IBee; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeListener; -import forestry.api.apiculture.IBeeModifier; -import forestry.api.genetics.IIndividual; -import net.minecraft.item.ItemStack; - -public class ComponentBeeModifier - extends MachineComponent - implements IBeeModifier, IBeeListener -{ - public ComponentBeeModifier(Machine machine) - { - super(machine); - } - - public float getTerritoryModifier(IBeeGenome genome, float currentModifier) - { - return 1.0F; - } - - public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) - { - return 1.0F; - } - - public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) - { - return 1.0F; - } - - public float getProductionModifier(IBeeGenome genome, float currentModifier) - { - return 1.0F; - } - - public float getFloweringModifier(IBeeGenome genome, float currentModifier) - { - return 1.0F; - } - - public boolean isSealed() - { - return false; - } - - public boolean isSelfLighted() - { - return false; - } - - public boolean isSunlightSimulated() - { - return false; - } - - public boolean isHellish() - { - return false; - } - - public void onQueenChange(ItemStack queen) {} - - public void wearOutEquipment(int amount) {} - - public void onQueenDeath(IBee queen) {} - - public void onPostQueenDeath(IBee queen) {} - - public boolean onPollenRetrieved(IBee queen, IIndividual pollen, boolean isHandled) - { - return false; - } - - public boolean onEggLaid(IBee queen) - { - return false; - } - - public float getGeneticDecay(IBeeGenome genome, float currentModifier) - { - return 1.0F; - } -} diff --git a/src/Java/binnie/extrabees/apiary/ComponentExtraBeeGUI.java b/src/Java/binnie/extrabees/apiary/ComponentExtraBeeGUI.java deleted file mode 100644 index db2527e14c..0000000000 --- a/src/Java/binnie/extrabees/apiary/ComponentExtraBeeGUI.java +++ /dev/null @@ -1,28 +0,0 @@ -package binnie.extrabees.apiary; - -import binnie.core.machines.Machine; -import binnie.core.machines.MachineComponent; -import binnie.core.machines.component.IInteraction.RightClick; -import binnie.extrabees.ExtraBees; -import binnie.extrabees.core.ExtraBeeGUID; -import binnie.extrabees.proxy.ExtraBeesProxy; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; - -public class ComponentExtraBeeGUI - extends MachineComponent - implements IInteraction.RightClick -{ - ExtraBeeGUID id; - - public ComponentExtraBeeGUI(Machine machine, ExtraBeeGUID id) - { - super(machine); - this.id = id; - } - - public void onRightClick(World world, EntityPlayer player, int x, int y, int z) - { - ExtraBees.proxy.openGui(this.id, player, x, y, z); - } -} diff --git a/src/Java/binnie/extrabees/apiary/EnumHiveFrame.java b/src/Java/binnie/extrabees/apiary/EnumHiveFrame.java deleted file mode 100644 index 6a135c2532..0000000000 --- a/src/Java/binnie/extrabees/apiary/EnumHiveFrame.java +++ /dev/null @@ -1,140 +0,0 @@ -package binnie.extrabees.apiary; - -import binnie.core.Mods; -import binnie.core.Mods.Mod; -import binnie.core.genetics.BeeModifierLogic; -import binnie.core.genetics.EnumBeeBooleanModifier; -import binnie.core.genetics.EnumBeeModifier; -import binnie.extrabees.ExtraBees; -import binnie.extrabees.proxy.ExtraBeesProxy; -import cpw.mods.fml.common.registry.GameRegistry; -import forestry.api.apiculture.IBee; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeHousing; -import forestry.api.apiculture.IHiveFrame; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -public enum EnumHiveFrame - implements IHiveFrame -{ - Cocoa, Cage, Soul, Clay, Debug; - - Item item; - - public static void init() - { - Cocoa.logic.setModifier(EnumBeeModifier.Lifespan, 0.75F, 0.25F); - Cocoa.logic.setModifier(EnumBeeModifier.Production, 1.5F, 5.0F); - - Cage.logic.setModifier(EnumBeeModifier.Territory, 0.5F, 0.1F); - Cage.logic.setModifier(EnumBeeModifier.Lifespan, 0.75F, 0.5F); - Cage.logic.setModifier(EnumBeeModifier.Production, 0.75F, 0.5F); - - Soul.logic.setModifier(EnumBeeModifier.Mutation, 1.5F, 5.0F); - Soul.logic.setModifier(EnumBeeModifier.Lifespan, 0.75F, 0.5F); - Soul.logic.setModifier(EnumBeeModifier.Production, 0.25F, 0.1F); - Soul.setMaxDamage(80); - - Clay.logic.setModifier(EnumBeeModifier.Lifespan, 1.5F, 5.0F); - Clay.logic.setModifier(EnumBeeModifier.Mutation, 0.5F, 0.2F); - Clay.logic.setModifier(EnumBeeModifier.Production, 0.75F, 0.2F); - - Debug.logic.setModifier(EnumBeeModifier.Lifespan, 1.0E-004F, 1.0E-004F); - - - - GameRegistry.addRecipe(new ItemStack(Cocoa.item), new Object[] { " c ", "cFc", " c ", Character.valueOf('F'), Mods.Forestry.stack("frameImpregnated"), Character.valueOf('c'), new ItemStack(Items.dye, 1, 3) }); - - - - GameRegistry.addShapelessRecipe(new ItemStack(Cage.item), new Object[] { Mods.Forestry.stack("frameImpregnated"), Blocks.iron_bars }); - - - GameRegistry.addShapelessRecipe(new ItemStack(Soul.item), new Object[] { Mods.Forestry.stack("frameImpregnated"), Blocks.soul_sand }); - - - GameRegistry.addRecipe(new ItemStack(Clay.item), new Object[] { " c ", "cFc", " c ", Character.valueOf('F'), Mods.Forestry.stack("frameImpregnated"), Character.valueOf('c'), Items.clay_ball }); - } - - public int getIconIndex() - { - return 55 + ordinal(); - } - - public void setMaxDamage(int damage) - { - this.maxDamage = damage; - } - - int maxDamage = 240; - BeeModifierLogic logic = new BeeModifierLogic(); - - private EnumHiveFrame() {} - - public ItemStack frameUsed(IBeeHousing house, ItemStack frame, IBee queen, int wear) - { - frame.setItemDamage(frame.getItemDamage() + wear); - if (frame.getItemDamage() >= frame.getMaxDamage()) { - return null; - } - return frame; - } - - public float getTerritoryModifier(IBeeGenome genome, float currentModifier) - { - return this.logic.getModifier(EnumBeeModifier.Territory, currentModifier); - } - - public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) - { - return this.logic.getModifier(EnumBeeModifier.Mutation, currentModifier); - } - - public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) - { - return this.logic.getModifier(EnumBeeModifier.Lifespan, currentModifier); - } - - public float getProductionModifier(IBeeGenome genome, float currentModifier) - { - return this.logic.getModifier(EnumBeeModifier.Production, currentModifier); - } - - public float getFloweringModifier(IBeeGenome genome, float currentModifier) - { - return this.logic.getModifier(EnumBeeModifier.Flowering, currentModifier); - } - - public float getGeneticDecay(IBeeGenome genome, float currentModifier) - { - return this.logic.getModifier(EnumBeeModifier.GeneticDecay, currentModifier); - } - - public boolean isSealed() - { - return this.logic.getModifier(EnumBeeBooleanModifier.Sealed); - } - - public boolean isSelfLighted() - { - return this.logic.getModifier(EnumBeeBooleanModifier.SelfLighted); - } - - public boolean isSunlightSimulated() - { - return this.logic.getModifier(EnumBeeBooleanModifier.SunlightStimulated); - } - - public boolean isHellish() - { - return this.logic.getModifier(EnumBeeBooleanModifier.Hellish); - } - - public String getName() - { - return ExtraBees.proxy.localise("item.frame." + toString().toLowerCase()); - } -} diff --git a/src/Java/binnie/extrabees/apiary/IndustrialFrame.java b/src/Java/binnie/extrabees/apiary/IndustrialFrame.java deleted file mode 100644 index f8d3e5ff7a..0000000000 --- a/src/Java/binnie/extrabees/apiary/IndustrialFrame.java +++ /dev/null @@ -1,141 +0,0 @@ -package binnie.extrabees.apiary; - -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeModifier; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -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; - - private IndustrialFrame(String name, int wear, int power) - { - this.name = name; - this.wearMod = wear; - this.power = power; - } - - public static ItemStack getItemStack(Item item, IndustrialFrame frame) - { - ItemStack stack = new ItemStack(item); - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setInteger("frame", frame.ordinal()); - stack.setTagCompound(nbt); - return stack; - } - - static - { - Light.lighted = true; - - Rain.rain = true; - - Sunlight.lighted = true; - Sunlight.sunlight = true; - - Soul.mutationMod = 1.3F; - - Uranium.mutationMod = 2.0F; - - Cage.territoryMod = 0.4F; - - Freedom.territoryMod = 1.4F; - - Honey.productionMod = 1.4F; - - Jelly.productionMod = 1.8F; - - Leaf.floweringMod = 1.4F; - - Pollen.floweringMod = 2.0F; - - Clay.lifespanMod = 1.4F; - - Emerald.lifespanMod = 2.0F; - - NetherStar.lifespanMod = 20.0F; - - Poison.lifespanMod = 0.5F; - } - - float territoryMod = 1.0F; - float mutationMod = 1.0F; - float lifespanMod = 1.0F; - float productionMod = 1.0F; - float floweringMod = 1.0F; - boolean lighted = false; - boolean sunlight = false; - boolean rain = false; - int wearMod; - int power; - - public float getTerritoryModifier(IBeeGenome genome, float currentModifier) - { - return this.territoryMod; - } - - public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) - { - return this.mutationMod; - } - - public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) - { - return this.lifespanMod; - } - - public float getProductionModifier(IBeeGenome genome, float currentModifier) - { - return this.productionMod; - } - - public float getFloweringModifier(IBeeGenome genome, float currentModifier) - { - return this.floweringMod; - } - - public boolean isSealed() - { - return this.rain; - } - - public boolean isSelfLighted() - { - return this.lighted; - } - - public boolean isSunlightSimulated() - { - return this.sunlight; - } - - public boolean isHellish() - { - return false; - } - - public Object getName() - { - return this.name; - } - - public int getWearModifier() - { - return this.wearMod; - } - - public int getPowerUsage() - { - return this.power; - } - - public float getGeneticDecay(IBeeGenome genome, float currentModifier) - { - return 1.0F; - } -} diff --git a/src/Java/binnie/extrabees/apiary/ItemHiveFrame.java b/src/Java/binnie/extrabees/apiary/ItemHiveFrame.java deleted file mode 100644 index c2e8c27fbc..0000000000 --- a/src/Java/binnie/extrabees/apiary/ItemHiveFrame.java +++ /dev/null @@ -1,100 +0,0 @@ -package binnie.extrabees.apiary; - -import binnie.extrabees.ExtraBees; -import binnie.extrabees.proxy.ExtraBeesProxy; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.apiculture.IBee; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeHousing; -import forestry.api.apiculture.IHiveFrame; -import forestry.api.core.Tabs; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -public class ItemHiveFrame - extends Item - implements IHiveFrame -{ - EnumHiveFrame frame; - - public String getItemStackDisplayName(ItemStack par1ItemStack) - { - return this.frame.getName(); - } - - public ItemHiveFrame(EnumHiveFrame frame) - { - this.frame = frame; - setMaxDamage(frame.maxDamage); - setCreativeTab(Tabs.tabApiculture); - setMaxStackSize(1); - setUnlocalizedName("hiveFrame"); - } - - public float getTerritoryModifier(IBeeGenome genome, float currentModifier) - { - return this.frame.getTerritoryModifier(genome, currentModifier); - } - - public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) - { - return this.frame.getMutationModifier(genome, mate, currentModifier); - } - - public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) - { - return this.frame.getLifespanModifier(genome, mate, currentModifier); - } - - public float getProductionModifier(IBeeGenome genome, float currentModifier) - { - return this.frame.getProductionModifier(genome, currentModifier); - } - - public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear) - { - frame.setItemDamage(frame.getItemDamage() + wear); - if (frame.getItemDamage() >= frame.getMaxDamage()) { - return null; - } - return frame; - } - - public float getFloweringModifier(IBeeGenome genome, float currentModifier) - { - return 1.0F; - } - - public boolean isSealed() - { - return false; - } - - public boolean isSelfLighted() - { - return false; - } - - public boolean isSunlightSimulated() - { - return false; - } - - public boolean isHellish() - { - return false; - } - - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister register) - { - this.itemIcon = ExtraBees.proxy.getIcon(register, "frame" + this.frame.toString()); - } - - public float getGeneticDecay(IBeeGenome genome, float currentModifier) - { - return 1.0F; - } -} diff --git a/src/Java/binnie/extrabees/apiary/ItemIndustrialFrame.java b/src/Java/binnie/extrabees/apiary/ItemIndustrialFrame.java deleted file mode 100644 index 0450798b52..0000000000 --- a/src/Java/binnie/extrabees/apiary/ItemIndustrialFrame.java +++ /dev/null @@ -1,66 +0,0 @@ -package binnie.extrabees.apiary; - -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import java.util.List; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -public class ItemIndustrialFrame - extends Item -{ - @SideOnly(Side.CLIENT) - public boolean requiresMultipleRenderPasses() - { - return true; - } - - @SideOnly(Side.CLIENT) - public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) - { - for (IndustrialFrame frame : ) - { - ItemStack stack = new ItemStack(this); - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setInteger("frame", frame.ordinal()); - stack.setTagCompound(nbt); - par3List.add(stack); - } - } - - @SideOnly(Side.CLIENT) - public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) - { - super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4); - IndustrialFrame frame = getFrame(par1ItemStack); - if (frame == null) { - par3List.add("Invalid Contents"); - } else { - par3List.add(frame.getName()); - } - } - - public String getItemStackDisplayName(ItemStack par1ItemStack) - { - return "Industrial Frame"; - } - - public ItemIndustrialFrame() - { - setCreativeTab(CreativeTabs.tabMisc); - setMaxDamage(400); - setMaxStackSize(1); - setUnlocalizedName("industrialFrame"); - } - - public static IndustrialFrame getFrame(ItemStack stack) - { - if ((stack == null) || (!stack.hasTagCompound()) || (!stack.getTagCompound().hasKey("frame"))) { - return null; - } - return IndustrialFrame.values()[stack.getTagCompound().getInteger("frame")]; - } -} diff --git a/src/Java/binnie/extrabees/apiary/ModuleApiary.java b/src/Java/binnie/extrabees/apiary/ModuleApiary.java deleted file mode 100644 index bcf9da626b..0000000000 --- a/src/Java/binnie/extrabees/apiary/ModuleApiary.java +++ /dev/null @@ -1,96 +0,0 @@ -package binnie.extrabees.apiary; - -import binnie.core.BinnieCore; -import binnie.core.IInitializable; -import binnie.core.Mods; -import binnie.core.Mods.Mod; -import binnie.core.circuits.BinnieCircuitLayout; -import binnie.core.machines.MachineGroup; -import binnie.core.proxy.BinnieProxy; -import binnie.extrabees.ExtraBees; -import binnie.extrabees.apiary.machine.AlvearyMachine; -import binnie.extrabees.apiary.machine.AlvearyMutator; -import binnie.extrabees.apiary.machine.AlvearyStimulator.CircuitType; -import cpw.mods.fml.common.registry.GameRegistry; -import forestry.api.core.Tabs; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.ShapedOreRecipe; - -public class ModuleApiary - implements IInitializable -{ - public static Block blockComponent; - BinnieCircuitLayout stimulatorLayout; - - public void preInit() - { - 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")); - - - - - - 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 (EnumHiveFrame frame : EnumHiveFrame.values()) - { - frame.item = new ItemHiveFrame(frame); - GameRegistry.registerItem(frame.item, "hiveFrame." + frame.name().toLowerCase()); - } - } - - public void postInit() - { - EnumHiveFrame.init(); - - GameRegistry.addRecipe(AlvearyMachine.Mutator.get(1), new Object[] { "g g", " a ", "t t", Character.valueOf('g'), Items.gold_ingot, Character.valueOf('a'), Mods.Forestry.block("alveary"), Character.valueOf('t'), new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 5) }); - - - - GameRegistry.addRecipe(AlvearyMachine.Frame.get(1), new Object[] { "iii", "tat", " t ", Character.valueOf('i'), Items.iron_ingot, Character.valueOf('a'), Mods.Forestry.block("alveary"), Character.valueOf('t'), new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4) }); - - - - GameRegistry.addRecipe(AlvearyMachine.RainShield.get(1), new Object[] { " b ", "bab", "t t", Character.valueOf('b'), Items.brick, Character.valueOf('a'), Mods.Forestry.block("alveary"), Character.valueOf('t'), new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4) }); - - - - - GameRegistry.addRecipe(AlvearyMachine.Lighting.get(1), new Object[] { "iii", "iai", " t ", Character.valueOf('i'), Items.glowstone_dust, Character.valueOf('a'), Mods.Forestry.block("alveary"), Character.valueOf('t'), new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4) }); - - - GameRegistry.addRecipe(AlvearyMachine.Stimulator.get(1), new Object[] { "kik", "iai", " t ", Character.valueOf('i'), Items.gold_nugget, Character.valueOf('a'), Mods.Forestry.block("alveary"), Character.valueOf('t'), new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4), Character.valueOf('k'), new ItemStack(Mods.Forestry.item("chipsets"), 1, 2) }); - - - GameRegistry.addRecipe(AlvearyMachine.Hatchery.get(1), new Object[] { "i i", " a ", "iti", Character.valueOf('i'), Blocks.glass_pane, Character.valueOf('a'), Mods.Forestry.block("alveary"), Character.valueOf('t'), new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 5) }); - - - GameRegistry.addRecipe(new ShapedOreRecipe(AlvearyMachine.Transmission.get(1), new Object[] { " t ", "tat", " t ", Character.valueOf('a'), Mods.Forestry.block("alveary"), Character.valueOf('t'), "gearTin" })); - for (AlvearyStimulator.CircuitType type : AlvearyStimulator.CircuitType.values()) { - type.createCircuit(this.stimulatorLayout); - } - } - - public void init() - { - this.stimulatorLayout = new BinnieCircuitLayout(ExtraBees.instance, "Stimulator"); - } -} diff --git a/src/Java/binnie/extrabees/apiary/TileExtraBeeAlveary.java b/src/Java/binnie/extrabees/apiary/TileExtraBeeAlveary.java deleted file mode 100644 index 3edf7e4a9c..0000000000 --- a/src/Java/binnie/extrabees/apiary/TileExtraBeeAlveary.java +++ /dev/null @@ -1,355 +0,0 @@ -package binnie.extrabees.apiary; - -import binnie.Binnie; -import binnie.core.BinnieCore; -import binnie.core.genetics.ManagerGenetics; -import binnie.core.machines.Machine; -import binnie.core.machines.TileEntityMachine; -import binnie.core.proxy.BinnieProxy; -import binnie.extrabees.apiary.machine.AlvearyMachine.AlvearyPackage; -import forestry.api.apiculture.IAlvearyComponent; -import forestry.api.apiculture.IBee; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeHousing; -import forestry.api.apiculture.IBeeListener; -import forestry.api.apiculture.IBeeModifier; -import forestry.api.apiculture.IBeeRoot; -import forestry.api.core.IStructureLogic; -import forestry.api.core.ITileStructure; -import forestry.api.genetics.IIndividual; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.inventory.ISidedInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -public class TileExtraBeeAlveary - extends TileEntityMachine - implements IAlvearyComponent, IBeeModifier, IBeeListener -{ - boolean init = false; - IStructureLogic structureLogic; - private boolean isMaster; - protected int masterX; - protected int masterZ; - - public void updateEntity() - { - super.updateEntity(); - if (!BinnieCore.proxy.isSimulating(this.worldObj)) { - return; - } - if (this.worldObj.getWorldTime() % 200L == 0L) - { - if ((!isIntegratedIntoStructure()) || (isMaster())) { - validateStructure(); - } - ITileStructure master = getCentralTE(); - if (master == null) { - return; - } - if (getBeeListener() != null) { - ((IAlvearyComponent)master).registerBeeListener(getBeeListener()); - } - if (getBeeModifier() != null) { - ((IAlvearyComponent)master).registerBeeModifier(getBeeModifier()); - } - this.init = true; - } - } - - public void readFromNBT(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) { - makeMaster(); - } - this.structureLogic.readFromNBT(nbttagcompound); - - updateAlvearyBlocks(); - - this.init = false; - } - - public void writeToNBT(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)getMachine().getPackage(); - } - - public TileExtraBeeAlveary() - { - this.structureLogic = Binnie.Genetics.getBeeRoot().createAlvearyStructureLogic(this); - } - - public TileExtraBeeAlveary(AlvearyMachine.AlvearyPackage alvearyPackage) - { - super(alvearyPackage); - this.structureLogic = Binnie.Genetics.getBeeRoot().createAlvearyStructureLogic(this); - } - - public String getTypeUID() - { - return this.structureLogic.getTypeUID(); - } - - protected int masterY = -99; - - public void makeMaster() {} - - public void onStructureReset() - { - setCentralTE(null); - this.isMaster = false; - this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord); - updateAlvearyBlocks(); - } - - public ITileStructure getCentralTE() - { - if ((this.worldObj == null) || (!isIntegratedIntoStructure())) { - return null; - } - if (!isMaster()) - { - TileEntity tile = this.worldObj.getTileEntity(this.masterX, this.masterY, this.masterZ); - if ((tile instanceof ITileStructure)) - { - ITileStructure master = (ITileStructure)this.worldObj.getTileEntity(this.masterX, this.masterY, this.masterZ); - if (master.isMaster()) { - return master; - } - return null; - } - return null; - } - return this; - } - - public void validateStructure() - { - this.structureLogic.validateStructure(); - updateAlvearyBlocks(); - } - - private boolean isSameTile(TileEntity tile) - { - return (tile.xCoord == this.xCoord) && (tile.yCoord == this.yCoord) && (tile.zCoord == this.zCoord); - } - - public void setCentralTE(TileEntity tile) - { - if ((tile == null) || (tile == this) || (isSameTile(tile))) - { - this.masterX = (this.masterZ = 0); - this.masterY = -99; - updateAlvearyBlocks(); - return; - } - this.isMaster = false; - this.masterX = tile.xCoord; - this.masterY = tile.yCoord; - this.masterZ = tile.zCoord; - - - markDirty(); - if (getBeeListener() != null) { - ((IAlvearyComponent)tile).registerBeeListener(getBeeListener()); - } - if (getBeeModifier() != null) { - ((IAlvearyComponent)tile).registerBeeModifier(getBeeModifier()); - } - 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(IBeeModifier modifier) {} - - public void removeBeeModifier(IBeeModifier modifier) {} - - public void addTemperatureChange(float change, float boundaryDown, float boundaryUp) {} - - public void addHumidityChange(float change, float boundaryDown, float boundaryUp) {} - - public boolean hasFunction() - { - return true; - } - - public IBeeModifier getBeeModifier() - { - return (IBeeModifier)getMachine().getInterface(IBeeModifier.class); - } - - public IBeeListener getBeeListener() - { - return (IBeeListener)getMachine().getInterface(IBeeListener.class); - } - - public float getTerritoryModifier(IBeeGenome genome, float currentModifier) - { - return getBeeModifier() == null ? 1.0F : getBeeModifier().getTerritoryModifier(genome, currentModifier); - } - - public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) - { - return getBeeModifier() == null ? 1.0F : getBeeModifier().getMutationModifier(genome, mate, currentModifier); - } - - public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) - { - return getBeeModifier() == null ? 1.0F : getBeeModifier().getLifespanModifier(genome, mate, currentModifier); - } - - public float getProductionModifier(IBeeGenome genome, float currentModifier) - { - return getBeeModifier() == null ? 1.0F : getBeeModifier().getProductionModifier(genome, currentModifier); - } - - public float getFloweringModifier(IBeeGenome genome, float currentModifier) - { - return getBeeModifier() == null ? 1.0F : getBeeModifier().getFloweringModifier(genome, currentModifier); - } - - public boolean isSealed() - { - return getBeeModifier() == null ? false : getBeeModifier().isSealed(); - } - - public boolean isSelfLighted() - { - return getBeeModifier() == null ? false : getBeeModifier().isSelfLighted(); - } - - public boolean isSunlightSimulated() - { - return getBeeModifier() == null ? false : getBeeModifier().isSunlightSimulated(); - } - - public boolean isHellish() - { - return getBeeModifier() == null ? false : getBeeModifier().isHellish(); - } - - public void registerBeeListener(IBeeListener event) {} - - public void removeBeeListener(IBeeListener event) {} - - public void onQueenChange(ItemStack queen) - { - if (getBeeListener() != null) { - getBeeListener().onQueenChange(queen); - } - } - - public void wearOutEquipment(int amount) - { - if (getBeeListener() != null) { - getBeeListener().wearOutEquipment(amount); - } - } - - public void onQueenDeath(IBee queen) - { - if (getBeeListener() != null) { - getBeeListener().onQueenDeath(queen); - } - } - - public void onPostQueenDeath(IBee queen) - { - if (getBeeListener() != null) { - getBeeListener().onPostQueenDeath(queen); - } - } - - public boolean onPollenRetrieved(IBee queen, IIndividual pollen, boolean isHandled) - { - return false; - } - - public boolean onEggLaid(IBee queen) - { - return false; - } - - public float getGeneticDecay(IBeeGenome genome, float currentModifier) - { - return 1.0F; - } - - public IBeeHousing getBeeHousing() - { - return getCentralTE() == null ? null : (IBeeHousing)getCentralTE(); - } - - List<TileEntity> tiles = new ArrayList(); - - public List<TileEntity> getAlvearyBlocks() - { - updateAlvearyBlocks(); - return this.tiles; - } - - private void updateAlvearyBlocks() - { - this.tiles.clear(); - if (getCentralTE() != null) - { - ITileStructure struct = getCentralTE(); - if (!struct.isIntegratedIntoStructure()) { - return; - } - 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++) - { - TileEntity tile = getWorldObj().getTileEntity(this.xCoord + x, this.yCoord + y, this.zCoord + z); - if ((tile != null) && ((tile instanceof ITileStructure)) && (((ITileStructure)tile).getCentralTE() == struct)) { - this.tiles.add(tile); - } - } - } - } - } - } - - public ISidedInventory getStructureInventory() - { - return (ISidedInventory)getMachine().getInterface(ISidedInventory.class); - } -} diff --git a/src/Java/binnie/extrabees/apiary/machine/AlvearyFrame.java b/src/Java/binnie/extrabees/apiary/machine/AlvearyFrame.java deleted file mode 100644 index a910e101f9..0000000000 --- a/src/Java/binnie/extrabees/apiary/machine/AlvearyFrame.java +++ /dev/null @@ -1,125 +0,0 @@ -package binnie.extrabees.apiary.machine; - -import binnie.Binnie; -import binnie.core.genetics.ManagerGenetics; -import binnie.core.machines.IMachine; -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.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; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeHousing; -import forestry.api.apiculture.IBeeListener; -import forestry.api.apiculture.IBeeModifier; -import forestry.api.apiculture.IBeeRoot; -import forestry.api.apiculture.IBeekeepingMode; -import forestry.api.apiculture.IHiveFrame; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; - -public class AlvearyFrame -{ - public static int slotFrame = 0; - - public static class PackageAlvearyFrame - extends AlvearyMachine.AlvearyPackage - implements IMachineInformation - { - public PackageAlvearyFrame() - { - super(ExtraBeeTexture.AlvearyFrame.getTexture(), false); - } - - public void createMachine(Machine machine) - { - new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyFrame); - - ComponentInventorySlots inventory = new ComponentInventorySlots(machine); - - inventory.addSlot(AlvearyFrame.slotFrame, "frame"); - inventory.getSlot(AlvearyFrame.slotFrame).setValidator(new AlvearyFrame.SlotValidatorFrame()); - - new AlvearyFrame.ComponentFrameModifier(machine); - } - } - - public static class SlotValidatorFrame - extends SlotValidator - { - public SlotValidatorFrame() - { - super(); - } - - public boolean isValid(ItemStack itemStack) - { - return (itemStack != null) && ((itemStack.getItem() instanceof IHiveFrame)); - } - - public String getTooltip() - { - return "Hive Frames"; - } - } - - public static class ComponentFrameModifier - extends ComponentBeeModifier - implements IBeeModifier, IBeeListener - { - public ComponentFrameModifier(Machine machine) - { - super(); - } - - public void wearOutEquipment(int amount) - { - if (getHiveFrame() == null) { - return; - } - World world = getMachine().getTileEntity().getWorldObj(); - int wear = Math.round(amount * 5 * Binnie.Genetics.getBeeRoot().getBeekeepingMode(world).getWearModifier()); - getInventory().setInventorySlotContents(AlvearyFrame.slotFrame, getHiveFrame().frameUsed((IBeeHousing)((TileExtraBeeAlveary)getMachine().getTileEntity()).getCentralTE(), getInventory().getStackInSlot(AlvearyFrame.slotFrame), null, wear)); - } - - public IHiveFrame getHiveFrame() - { - if (getInventory().getStackInSlot(AlvearyFrame.slotFrame) != null) { - return (IHiveFrame)getInventory().getStackInSlot(AlvearyFrame.slotFrame).getItem(); - } - return null; - } - - public float getTerritoryModifier(IBeeGenome genome, float currentModifier) - { - return getHiveFrame() == null ? 1.0F : getHiveFrame().getTerritoryModifier(genome, currentModifier); - } - - public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) - { - return getHiveFrame() == null ? 1.0F : getHiveFrame().getMutationModifier(genome, mate, currentModifier); - } - - public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) - { - return getHiveFrame() == null ? 1.0F : getHiveFrame().getLifespanModifier(genome, mate, currentModifier); - } - - public float getProductionModifier(IBeeGenome genome, float currentModifier) - { - return getHiveFrame() == null ? 1.0F : getHiveFrame().getProductionModifier(genome, currentModifier); - } - - public float getFloweringModifier(IBeeGenome genome, float currentModifier) - { - return getHiveFrame() == null ? 1.0F : getHiveFrame().getFloweringModifier(genome, currentModifier); - } - } -} diff --git a/src/Java/binnie/extrabees/apiary/machine/AlvearyHatchery.java b/src/Java/binnie/extrabees/apiary/machine/AlvearyHatchery.java deleted file mode 100644 index 276683b860..0000000000 --- a/src/Java/binnie/extrabees/apiary/machine/AlvearyHatchery.java +++ /dev/null @@ -1,106 +0,0 @@ -package binnie.extrabees.apiary.machine; - -import binnie.Binnie; -import binnie.core.genetics.ManagerGenetics; -import binnie.core.machines.IMachine; -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; -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.apiculture.IBeeRoot; -import forestry.core.EnumErrorCode; -import java.util.Random; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -public class AlvearyHatchery -{ - public static int[] slotLarvae = { 0, 1, 2, 3, 4 }; - - public static class PackageAlvearyHatchery - extends AlvearyMachine.AlvearyPackage - implements IMachineInformation - { - public PackageAlvearyHatchery() - { - super(ExtraBeeTexture.AlvearyHatchery.getTexture(), false); - } - - public void createMachine(Machine machine) - { - new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyHatchery); - - ComponentInventorySlots inventory = new ComponentInventorySlots(machine); - for (InventorySlot slot : inventory.addSlotArray(AlvearyHatchery.slotLarvae, "hatchery")) { - slot.setValidator(new AlvearyHatchery.SlotValidatorLarvae()); - } - new AlvearyHatchery.ComponentFrameModifier(machine); - } - } - - public static class SlotValidatorLarvae - extends SlotValidator - { - public SlotValidatorLarvae() - { - super(); - } - - public boolean isValid(ItemStack itemStack) - { - return (Binnie.Genetics.getBeeRoot().isMember(itemStack)) && (Binnie.Genetics.getBeeRoot().getType(itemStack) == EnumBeeType.LARVAE); - } - - public String getTooltip() - { - return "Larvae"; - } - } - - public static class ComponentFrameModifier - extends ComponentBeeModifier - implements IBeeModifier, IBeeListener - { - public ComponentFrameModifier(Machine machine) - { - super(); - } - - public void onUpdate() - { - if (new Random().nextInt(2400) == 0) - { - TileEntity tile = getMachine().getTileEntity(); - if ((tile instanceof TileExtraBeeAlveary)) - { - IBeeHousing house = ((TileExtraBeeAlveary)tile).getBeeHousing(); - if ((house != null) && (house.getErrorState() == EnumErrorCode.OK)) - { - ItemStack queenStack = house.getQueen(); - IBee queen = queenStack == null ? null : Binnie.Genetics.getBeeRoot().getMember(queenStack); - if (queen != null) - { - ItemStack larvae = Binnie.Genetics.getBeeRoot().getMemberStack(Binnie.Genetics.getBeeRoot().getBee(getMachine().getWorld(), queen.getGenome()), EnumBeeType.LARVAE.ordinal()); - - - - new TransferRequest(larvae, getInventory()).transfer(true); - } - } - } - } - } - } -} diff --git a/src/Java/binnie/extrabees/apiary/machine/AlvearyLighting.java b/src/Java/binnie/extrabees/apiary/machine/AlvearyLighting.java deleted file mode 100644 index fad796c889..0000000000 --- a/src/Java/binnie/extrabees/apiary/machine/AlvearyLighting.java +++ /dev/null @@ -1,41 +0,0 @@ -package binnie.extrabees.apiary.machine; - -import binnie.core.machines.Machine; -import binnie.craftgui.minecraft.IMachineInformation; -import binnie.extrabees.apiary.ComponentBeeModifier; -import binnie.extrabees.core.ExtraBeeTexture; -import forestry.api.apiculture.IBeeListener; -import forestry.api.apiculture.IBeeModifier; - -public class AlvearyLighting -{ - public static class PackageAlvearyLighting - extends AlvearyMachine.AlvearyPackage - implements IMachineInformation - { - public PackageAlvearyLighting() - { - super(ExtraBeeTexture.AlvearyLighting.getTexture(), false); - } - - public void createMachine(Machine machine) - { - new AlvearyLighting.ComponentLighting(machine); - } - } - - public static class ComponentLighting - extends ComponentBeeModifier - implements IBeeModifier, IBeeListener - { - public ComponentLighting(Machine machine) - { - super(); - } - - public boolean isSelfLighted() - { - return true; - } - } -} diff --git a/src/Java/binnie/extrabees/apiary/machine/AlvearyMachine.java b/src/Java/binnie/extrabees/apiary/machine/AlvearyMachine.java deleted file mode 100644 index 2dc0410770..0000000000 --- a/src/Java/binnie/extrabees/apiary/machine/AlvearyMachine.java +++ /dev/null @@ -1,66 +0,0 @@ -package binnie.extrabees.apiary.machine; - -import binnie.core.machines.IMachineType; -import binnie.core.machines.Machine; -import binnie.core.machines.MachinePackage; -import binnie.core.machines.MachineRendererBlock; -import binnie.core.resource.BinnieResource; -import binnie.extrabees.apiary.ModuleApiary; -import binnie.extrabees.apiary.TileExtraBeeAlveary; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; - -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(Class<? extends MachinePackage> clss) - { - this.clss = clss; - } - - public Class<? extends MachinePackage> getPackageClass() - { - return this.clss; - } - - public ItemStack get(int size) - { - return new ItemStack(ModuleApiary.blockComponent, size, ordinal()); - } - - public static abstract class AlvearyPackage - extends MachinePackage - { - BinnieResource machineTexture; - - public AlvearyPackage(String id, BinnieResource machineTexture, boolean powered) - { - super(powered); - this.machineTexture = machineTexture; - } - - public void createMachine(Machine machine) {} - - public TileEntity createTileEntity() - { - return new TileExtraBeeAlveary(this); - } - - public void register() {} - - public void renderMachine(Machine machine, double x, double y, double z, float var8, RenderBlocks renderer) - { - MachineRendererBlock.instance.renderMachine(this.machineTexture, x, y, z, var8); - } - } - - public boolean isActive() - { - return true; - } -} diff --git a/src/Java/binnie/extrabees/apiary/machine/AlvearyMutator.java b/src/Java/binnie/extrabees/apiary/machine/AlvearyMutator.java deleted file mode 100644 index 9c9fafc15a..0000000000 --- a/src/Java/binnie/extrabees/apiary/machine/AlvearyMutator.java +++ /dev/null @@ -1,125 +0,0 @@ -package binnie.extrabees.apiary.machine; - -import binnie.core.machines.Machine; -import binnie.core.machines.MachineUtil; -import binnie.core.machines.inventory.ComponentInventorySlots; -import binnie.core.machines.inventory.InventorySlot; -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; -import forestry.api.apiculture.IBee; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeListener; -import forestry.api.apiculture.IBeeModifier; -import java.util.Collection; -import java.util.HashMap; -import java.util.Map; -import net.minecraft.item.ItemStack; - -public class AlvearyMutator -{ - public static int slotMutator = 0; - - public static class PackageAlvearyMutator - extends AlvearyMachine.AlvearyPackage - implements IMachineInformation - { - public PackageAlvearyMutator() - { - super(ExtraBeeTexture.AlvearyMutator.getTexture(), false); - } - - public void createMachine(Machine machine) - { - new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyMutator); - - ComponentInventorySlots inventory = new ComponentInventorySlots(machine); - - inventory.addSlot(AlvearyMutator.slotMutator, "mutator"); - inventory.getSlot(AlvearyMutator.slotMutator).setValidator(new AlvearyMutator.SlotValidatorMutator()); - - new AlvearyMutator.ComponentMutatorModifier(machine); - } - } - - public static class SlotValidatorMutator - extends SlotValidator - { - public SlotValidatorMutator() - { - super(); - } - - public boolean isValid(ItemStack itemStack) - { - return AlvearyMutator.isMutationItem(itemStack); - } - - public String getTooltip() - { - return "Mutagenic Agents"; - } - } - - public static class ComponentMutatorModifier - extends ComponentBeeModifier - implements IBeeModifier, IBeeListener - { - public ComponentMutatorModifier(Machine machine) - { - super(); - } - - public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) - { - if (getUtil().isSlotEmpty(AlvearyMutator.slotMutator)) { - return 1.0F; - } - float mult = AlvearyMutator.getMutationMult(getUtil().getStack(AlvearyMutator.slotMutator)); - return Math.min(mult, 15.0F / currentModifier); - } - - public void onPostQueenDeath(IBee queen) - { - getUtil().decreaseStack(AlvearyMutator.slotMutator, 1); - } - } - - static Map<ItemStack, Float> mutations = new HashMap(); - - public static boolean isMutationItem(ItemStack item) - { - return getMutationMult(item) > 0.0F; - } - - public static float getMutationMult(ItemStack item) - { - if (item == null) { - return 1.0F; - } - for (ItemStack comp : mutations.keySet()) { - if ((ItemStack.areItemStackTagsEqual(item, comp)) && (item.isItemEqual(comp))) { - return ((Float)mutations.get(comp)).floatValue(); - } - } - return 1.0F; - } - - public static void addMutationItem(ItemStack item, float chance) - { - if (item == null) { - return; - } - mutations.put(item, Float.valueOf(chance)); - } - - public static Collection<ItemStack> getMutagens() - { - return mutations.keySet(); - } -} diff --git a/src/Java/binnie/extrabees/apiary/machine/AlvearyRainShield.java b/src/Java/binnie/extrabees/apiary/machine/AlvearyRainShield.java deleted file mode 100644 index 18b5dcee34..0000000000 --- a/src/Java/binnie/extrabees/apiary/machine/AlvearyRainShield.java +++ /dev/null @@ -1,41 +0,0 @@ -package binnie.extrabees.apiary.machine; - -import binnie.core.machines.Machine; -import binnie.craftgui.minecraft.IMachineInformation; -import binnie.extrabees.apiary.ComponentBeeModifier; -import binnie.extrabees.core.ExtraBeeTexture; -import forestry.api.apiculture.IBeeListener; -import forestry.api.apiculture.IBeeModifier; - -public class AlvearyRainShield -{ - public static class PackageAlvearyRainShield - extends AlvearyMachine.AlvearyPackage - implements IMachineInformation - { - public PackageAlvearyRainShield() - { - super(ExtraBeeTexture.AlvearyRainShield.getTexture(), false); - } - - public void createMachine(Machine machine) - { - new AlvearyRainShield.ComponentRainShield(machine); - } - } - - public static class ComponentRainShield - extends ComponentBeeModifier - implements IBeeModifier, IBeeListener - { - public ComponentRainShield(Machine machine) - { - super(); - } - - public boolean isSealed() - { - return true; - } - } -} diff --git a/src/Java/binnie/extrabees/apiary/machine/AlvearyStimulator.java b/src/Java/binnie/extrabees/apiary/machine/AlvearyStimulator.java deleted file mode 100644 index 47b6dab48b..0000000000 --- a/src/Java/binnie/extrabees/apiary/machine/AlvearyStimulator.java +++ /dev/null @@ -1,430 +0,0 @@ -package binnie.extrabees.apiary.machine; - -import binnie.core.Mods; -import binnie.core.Mods.Mod; -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.MachineUtil; -import binnie.core.machines.inventory.ComponentInventorySlots; -import binnie.core.machines.inventory.InventorySlot; -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; -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 forestry.api.circuits.ICircuitRegistry; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.item.ItemStack; - -public class AlvearyStimulator -{ - public static int slotCircuit = 0; - - public static class PackageAlvearyStimulator - extends AlvearyMachine.AlvearyPackage - implements IMachineInformation - { - public PackageAlvearyStimulator() - { - super(ExtraBeeTexture.AlvearyStimulator.getTexture(), true); - } - - public void createMachine(Machine machine) - { - new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyStimulator); - - ComponentInventorySlots inventory = new ComponentInventorySlots(machine); - - inventory.addSlot(AlvearyStimulator.slotCircuit, "circuit"); - inventory.getSlot(AlvearyStimulator.slotCircuit).setValidator(new AlvearyStimulator.SlotValidatorCircuit()); - - ComponentPowerReceptor power = new ComponentPowerReceptor(machine); - - - new AlvearyStimulator.ComponentStimulatorModifier(machine); - } - } - - public static class SlotValidatorCircuit - extends SlotValidator - { - public SlotValidatorCircuit() - { - super(); - } - - public boolean isValid(ItemStack itemStack) - { - return (itemStack != null) && (ChipsetManager.circuitRegistry.isChipset(itemStack)); - } - - public String getTooltip() - { - return "Forestry Circuits"; - } - } - - public static class ComponentStimulatorModifier - extends ComponentBeeModifier - implements IBeeModifier, IBeeListener - { - public ComponentStimulatorModifier(Machine machine) - { - super(); - } - - float powerUsage = 0.0F; - boolean powered = false; - - public void onUpdate() - { - super.onUpdate(); - this.modifiers = getCircuits(); - this.powerUsage = 0.0F; - for (AlvearyStimulator.StimulatorCircuit beeMod : this.modifiers) { - this.powerUsage += beeMod.getPowerUsage(); - } - this.powered = getUtil().hasEnergyMJ(this.powerUsage); - } - - AlvearyStimulator.StimulatorCircuit[] modifiers = new AlvearyStimulator.StimulatorCircuit[0]; - - public ICircuitBoard getHiveFrame() - { - if (!getUtil().isSlotEmpty(AlvearyStimulator.slotCircuit)) { - return ChipsetManager.circuitRegistry.getCircuitboard(getUtil().getStack(AlvearyStimulator.slotCircuit)); - } - return null; - } - - public AlvearyStimulator.StimulatorCircuit[] getCircuits() - { - ICircuitBoard board = getHiveFrame(); - if (board == null) { - return new AlvearyStimulator.StimulatorCircuit[0]; - } - ICircuit[] circuits = board.getCircuits(); - List<IBeeModifier> mod = new ArrayList(); - for (ICircuit circuit : circuits) { - if ((circuit instanceof AlvearyStimulator.StimulatorCircuit)) { - mod.add((AlvearyStimulator.StimulatorCircuit)circuit); - } - } - return (AlvearyStimulator.StimulatorCircuit[])mod.toArray(new AlvearyStimulator.StimulatorCircuit[0]); - } - - public float getTerritoryModifier(IBeeGenome genome, float currentModifier) - { - float mod = 1.0F; - if (!this.powered) { - return mod; - } - for (IBeeModifier beeMod : this.modifiers) { - mod *= beeMod.getTerritoryModifier(genome, mod); - } - return mod; - } - - public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) - { - float mod = 1.0F; - if (!this.powered) { - return mod; - } - for (IBeeModifier beeMod : this.modifiers) { - mod *= beeMod.getMutationModifier(genome, mate, mod); - } - return mod; - } - - public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) - { - float mod = 1.0F; - if (!this.powered) { - return mod; - } - for (IBeeModifier beeMod : this.modifiers) { - mod *= beeMod.getLifespanModifier(genome, mate, mod); - } - return mod; - } - - public float getProductionModifier(IBeeGenome genome, float currentModifier) - { - float mod = 1.0F; - if (!this.powered) { - return mod; - } - for (IBeeModifier beeMod : this.modifiers) { - mod *= beeMod.getProductionModifier(genome, mod); - } - return mod; - } - - public float getFloweringModifier(IBeeGenome genome, float currentModifier) - { - float mod = 1.0F; - if (!this.powered) { - return mod; - } - for (IBeeModifier beeMod : this.modifiers) { - mod *= beeMod.getFloweringModifier(genome, mod); - } - return mod; - } - - public float getGeneticDecay(IBeeGenome genome, float currentModifier) - { - float mod = 1.0F; - if (!this.powered) { - return mod; - } - for (IBeeModifier beeMod : this.modifiers) { - mod *= beeMod.getGeneticDecay(genome, mod); - } - return mod; - } - - public boolean isSealed() - { - if (!this.powered) { - return false; - } - for (IBeeModifier beeMod : this.modifiers) { - if (beeMod.isSealed()) { - return true; - } - } - return false; - } - - public boolean isSelfLighted() - { - if (!this.powered) { - return false; - } - for (IBeeModifier beeMod : this.modifiers) { - if (beeMod.isSelfLighted()) { - return true; - } - } - return false; - } - - public boolean isSunlightSimulated() - { - if (!this.powered) { - return false; - } - for (IBeeModifier beeMod : this.modifiers) { - if (beeMod.isSunlightSimulated()) { - return true; - } - } - return false; - } - - public boolean isHellish() - { - if (!this.powered) { - return false; - } - for (IBeeModifier beeMod : this.modifiers) { - if (beeMod.isHellish()) { - return true; - } - } - return false; - } - - public void wearOutEquipment(int amount) - { - getUtil().useEnergyMJ(this.powerUsage); - } - } - - public static class StimulatorCircuit - extends BinnieCircuit - implements IBeeModifier - { - AlvearyStimulator.CircuitType type; - - public StimulatorCircuit(AlvearyStimulator.CircuitType type, ICircuitLayout layout) - { - super(4, layout, Mods.Forestry.item("thermionicTubes"), type.recipe); - this.type = type; - } - - public int getPowerUsage() - { - return this.type.power; - } - - public float getTerritoryModifier(IBeeGenome genome, float currentModifier) - { - return this.type.getTerritoryModifier(genome, currentModifier); - } - - public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) - { - return this.type.getMutationModifier(genome, mate, currentModifier); - } - - public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) - { - return this.type.getLifespanModifier(genome, mate, currentModifier); - } - - public float getProductionModifier(IBeeGenome genome, float currentModifier) - { - return this.type.getProductionModifier(genome, currentModifier); - } - - public float getFloweringModifier(IBeeGenome genome, float currentModifier) - { - return this.type.getFloweringModifier(genome, currentModifier); - } - - public boolean isSealed() - { - return this.type.isSealed(); - } - - public boolean isSelfLighted() - { - return this.type.isSelfLighted(); - } - - public boolean isSunlightSimulated() - { - return this.type.isSunlightSimulated(); - } - - public boolean isHellish() - { - return this.type.isHellish(); - } - - public float getGeneticDecay(IBeeGenome genome, float currentModifier) - { - return this.type.getGeneticDecay(genome, currentModifier); - } - } - - public static 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 = new BeeModifierLogic(); - - static - { - LowVoltage.logic.setModifier(EnumBeeModifier.Production, 1.5F, 5.0F); - HighVoltage.logic.setModifier(EnumBeeModifier.Production, 2.5F, 10.0F); - Plant.logic.setModifier(EnumBeeModifier.Flowering, 1.5F, 5.0F); - Death.logic.setModifier(EnumBeeModifier.Lifespan, 0.8F, 0.2F); - Life.logic.setModifier(EnumBeeModifier.Lifespan, 1.5F, 5.0F); - Nether.logic.setModifier(EnumBeeBooleanModifier.Hellish); - Mutation.logic.setModifier(EnumBeeModifier.Mutation, 1.5F, 5.0F); - Inhibitor.logic.setModifier(EnumBeeModifier.Territory, 0.4F, 0.1F); - Inhibitor.logic.setModifier(EnumBeeModifier.Production, 0.9F, 0.5F); - Territory.logic.setModifier(EnumBeeModifier.Territory, 1.5F, 5.0F); - for (CircuitType type : values()) { - type.logic.setModifier(EnumBeeModifier.GeneticDecay, 1.5F, 10.0F); - } - } - - private CircuitType(int recipe, int power) - { - this.recipe = recipe; - this.power = power; - } - - public void createCircuit(ICircuitLayout layout) - { - AlvearyStimulator.StimulatorCircuit circuit = new AlvearyStimulator.StimulatorCircuit(this, layout); - for (EnumBeeModifier modifier : EnumBeeModifier.values()) - { - float mod = this.logic.getModifier(modifier, 1.0F); - if (mod != 1.0F) { - if (mod > 1.0F) - { - int increase = (int)((mod - 1.0F) * 100.0F); - circuit.addTooltipString("Increases " + modifier.getName() + " by " + increase + "%"); - } - else - { - int decrease = (int)((1.0F - mod) * 100.0F); - circuit.addTooltipString("Decreases " + modifier.getName() + " by " + decrease + "%"); - } - } - } - } - - public float getTerritoryModifier(IBeeGenome genome, float currentModifier) - { - return this.logic.getModifier(EnumBeeModifier.Territory, currentModifier); - } - - public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) - { - return this.logic.getModifier(EnumBeeModifier.Mutation, currentModifier); - } - - public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) - { - return this.logic.getModifier(EnumBeeModifier.Lifespan, currentModifier); - } - - public float getProductionModifier(IBeeGenome genome, float currentModifier) - { - return this.logic.getModifier(EnumBeeModifier.Production, currentModifier); - } - - public float getFloweringModifier(IBeeGenome genome, float currentModifier) - { - return this.logic.getModifier(EnumBeeModifier.Flowering, currentModifier); - } - - public float getGeneticDecay(IBeeGenome genome, float currentModifier) - { - return this.logic.getModifier(EnumBeeModifier.GeneticDecay, currentModifier); - } - - public boolean isSealed() - { - return this.logic.getModifier(EnumBeeBooleanModifier.Sealed); - } - - public boolean isSelfLighted() - { - return this.logic.getModifier(EnumBeeBooleanModifier.SelfLighted); - } - - public boolean isSunlightSimulated() - { - return this.logic.getModifier(EnumBeeBooleanModifier.SunlightStimulated); - } - - public boolean isHellish() - { - return this.logic.getModifier(EnumBeeBooleanModifier.Hellish); - } - } -} diff --git a/src/Java/binnie/extrabees/apiary/machine/AlvearyTransmission.java b/src/Java/binnie/extrabees/apiary/machine/AlvearyTransmission.java deleted file mode 100644 index b041bf1c37..0000000000 --- a/src/Java/binnie/extrabees/apiary/machine/AlvearyTransmission.java +++ /dev/null @@ -1,81 +0,0 @@ -package binnie.extrabees.apiary.machine; - -import binnie.core.machines.IMachine; -import binnie.core.machines.Machine; -import binnie.core.machines.MachineComponent; -import binnie.core.machines.MachineUtil; -import binnie.core.machines.power.ComponentPowerReceptor; -import binnie.core.machines.power.IPoweredMachine; -import binnie.craftgui.minecraft.IMachineInformation; -import binnie.extrabees.apiary.TileExtraBeeAlveary; -import binnie.extrabees.core.ExtraBeeTexture; -import cofh.api.energy.IEnergyHandler; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; - -public class AlvearyTransmission -{ - public static class PackageAlvearyTransmission - extends AlvearyMachine.AlvearyPackage - implements IMachineInformation - { - public PackageAlvearyTransmission() - { - super(ExtraBeeTexture.AlvearyTransmission.getTexture(), false); - } - - public void createMachine(Machine machine) - { - new ComponentPowerReceptor(machine, 1000); - new AlvearyTransmission.ComponentTransmission(machine); - } - } - - public static class ComponentTransmission - extends MachineComponent - { - public ComponentTransmission(Machine machine) - { - super(); - } - - public void onUpdate() - { - super.onUpdate(); - int energy = getUtil().getPoweredMachine().getEnergyStored(ForgeDirection.NORTH); - if (energy == 0) { - return; - } - TileExtraBeeAlveary tile = (TileExtraBeeAlveary)getMachine().getTileEntity(); - - List<IEnergyHandler> handlers = new ArrayList(); - for (TileEntity alvearyTile : tile.getAlvearyBlocks()) { - if (((alvearyTile instanceof IEnergyHandler)) && (alvearyTile != tile)) { - handlers.add((IEnergyHandler)alvearyTile); - } - } - if (handlers.isEmpty()) { - return; - } - int maxOutput = 500; - int output = energy / handlers.size(); - if (output > maxOutput) { - output = maxOutput; - } - if (output < 1) { - output = 1; - } - for (IEnergyHandler handler : handlers) - { - int recieved = handler.receiveEnergy(ForgeDirection.NORTH, output, false); - getUtil().getPoweredMachine().extractEnergy(ForgeDirection.NORTH, recieved, false); - energy = getUtil().getPoweredMachine().getEnergyStored(ForgeDirection.NORTH); - if (energy == 0) { - return; - } - } - } - } -} |