diff options
author | Draknyte1 <Draknyte1@hotmail.com> | 2016-01-20 16:38:33 +1000 |
---|---|---|
committer | Draknyte1 <Draknyte1@hotmail.com> | 2016-01-20 16:38:33 +1000 |
commit | c68c67d74f39c3eb075ac29e88936a1976ef089b (patch) | |
tree | 3b51aa3ade38f5ca852cb65691d7830e9b39d9aa /src | |
parent | 869c206c4fcc8001bd2e1d66f704290331813835 (diff) | |
download | GT5-Unofficial-c68c67d74f39c3eb075ac29e88936a1976ef089b.tar.gz GT5-Unofficial-c68c67d74f39c3eb075ac29e88936a1976ef089b.tar.bz2 GT5-Unofficial-c68c67d74f39c3eb075ac29e88936a1976ef089b.zip |
Removing shit from Binnies packages.
Diffstat (limited to 'src')
143 files changed, 176 insertions, 12626 deletions
diff --git a/src/Java/binnie/Binnie.java b/src/Java/binnie/Binnie.java index a8bd664f1a..eb976368cd 100644 --- a/src/Java/binnie/Binnie.java +++ b/src/Java/binnie/Binnie.java @@ -1,23 +1,22 @@ package binnie; +import java.util.ArrayList; +import java.util.List; + import binnie.core.ManagerBase; -import binnie.core.genetics.ManagerGenetics; import binnie.core.item.ManagerItem; import binnie.core.language.ManagerLanguage; -import binnie.core.liquid.ManagerLiquid; import binnie.core.machines.ManagerMachine; import binnie.core.mod.config.ManagerConfig; import binnie.core.resource.ManagerResource; -import java.util.ArrayList; -import java.util.List; public final class Binnie { public static final List<ManagerBase> Managers = new ArrayList(); public static final ManagerLanguage Language = new ManagerLanguage(); - public static final ManagerGenetics Genetics = new ManagerGenetics(); + //public static final ManagerGenetics Genetics = new ManagerGenetics(); public static final ManagerConfig Configuration = new ManagerConfig(); - public static final ManagerLiquid Liquid = new ManagerLiquid(); + //public static final ManagerLiquid Liquid = new ManagerLiquid(); public static final ManagerMachine Machine = new ManagerMachine(); public static final ManagerItem Item = new ManagerItem(); public static final ManagerResource Resource = new ManagerResource(); diff --git a/src/Java/binnie/core/BinnieCore.java b/src/Java/binnie/core/BinnieCore.java index 6f1ce219ef..e2dbc502e3 100644 --- a/src/Java/binnie/core/BinnieCore.java +++ b/src/Java/binnie/core/BinnieCore.java @@ -1,5 +1,12 @@ package binnie.core; +import java.util.ArrayList; +import java.util.List; + +import net.minecraft.entity.player.EntityPlayerMP; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.server.MinecraftServer; +import net.minecraftforge.client.event.TextureStitchEvent; import binnie.Binnie; import binnie.core.block.MultipassBlockRenderer; import binnie.core.block.TileEntityMetadata; @@ -8,15 +15,10 @@ import binnie.core.gui.BinnieGUIHandler; import binnie.core.gui.IBinnieGUID; import binnie.core.item.ItemFieldKit; import binnie.core.item.ItemGenesis; -import binnie.core.item.ModuleItems; -import binnie.core.liquid.FluidContainer; -import binnie.core.liquid.ItemFluidContainer; -import binnie.core.liquid.ManagerLiquid; import binnie.core.machines.MachineGroup; import binnie.core.machines.storage.ModuleStorage; import binnie.core.mod.config.ConfigurationMain; import binnie.core.mod.config.ConfigurationMods; -import binnie.core.mod.config.ManagerConfig; import binnie.core.mod.parser.FieldParser; import binnie.core.mod.parser.ItemParser; import binnie.core.network.BinnieCorePacketID; @@ -24,15 +26,11 @@ import binnie.core.network.BinniePacketHandler; import binnie.core.network.IPacketID; import binnie.core.proxy.BinnieProxy; import binnie.core.proxy.IBinnieProxy; -import binnie.core.resource.ManagerResource; import binnie.core.triggers.ModuleTrigger; import binnie.craftgui.minecraft.ModuleCraftGUI; -import com.mojang.authlib.GameProfile; import cpw.mods.fml.client.registry.RenderingRegistry; import cpw.mods.fml.common.Loader; import cpw.mods.fml.common.Mod; -import cpw.mods.fml.common.Mod.EventHandler; -import cpw.mods.fml.common.Mod.Instance; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLInitializationEvent; import cpw.mods.fml.common.event.FMLPostInitializationEvent; @@ -42,20 +40,8 @@ import cpw.mods.fml.common.network.NetworkRegistry; import cpw.mods.fml.common.registry.GameRegistry; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.core.ForestryEvent.SpeciesDiscovered; -import forestry.api.genetics.IAlleleSpecies; -import forestry.api.genetics.IBreedingTracker; -import forestry.plugins.PluginManager.Module; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import net.minecraft.client.renderer.texture.TextureMap; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.item.Item; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.server.MinecraftServer; -import net.minecraft.server.management.ServerConfigurationManager; -import net.minecraftforge.client.event.TextureStitchEvent.Pre; +import forestry.api.core.ForestryEvent; +import forestry.plugins.PluginManager; @Mod(modid="BinnieCore", name="Binnie Core", useMetadata=true) public final class BinnieCore @@ -76,7 +62,7 @@ public final class BinnieCore } addModule(new ModuleCraftGUI()); addModule(new ModuleStorage()); - addModule(new ModuleItems()); + //addModule(new ModuleItems()); if (Loader.isModLoaded("BuildCraft|Silicon")) { addModule(new ModuleTrigger()); } @@ -103,11 +89,6 @@ public final class BinnieCore public void preInit() { instance = this; - for (FluidContainer container : FluidContainer.values()) - { - Item item = new ItemFluidContainer(container); - GameRegistry.registerItem(item, item.getUnlocalizedName().substring(5)); - } FieldParser.parsers.add(new ItemParser()); super.preInit(); @@ -228,7 +209,7 @@ public final class BinnieCore public void handleTextureRemap(TextureStitchEvent.Pre event) { if (event.map.getTextureType() == 0) { - Binnie.Liquid.reloadIcons(event.map); + //Binnie.Liquid.reloadIcons(event.map); } Binnie.Resource.registerIcons(event.map, event.map.getTextureType()); } @@ -248,7 +229,7 @@ public final class BinnieCore { public PacketHandler() { - super(); + super(instance); } } diff --git a/src/Java/binnie/core/genetics/BeeBreedingSystem.java b/src/Java/binnie/core/genetics/BeeBreedingSystem.java deleted file mode 100644 index 2c3947b5a0..0000000000 --- a/src/Java/binnie/core/genetics/BeeBreedingSystem.java +++ /dev/null @@ -1,125 +0,0 @@ -package binnie.core.genetics; - -import binnie.Binnie; -import binnie.core.BinnieCore; -import binnie.core.language.ManagerLanguage; -import binnie.core.resource.ManagerResource; -import binnie.extrabees.ExtraBees; -import forestry.api.apiculture.EnumBeeChromosome; -import forestry.api.apiculture.EnumBeeType; -import forestry.api.apiculture.IApiaristTracker; -import forestry.api.apiculture.IBeeMutation; -import forestry.api.apiculture.IBeeRoot; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IBreedingTracker; -import forestry.api.genetics.IChromosomeType; -import forestry.api.genetics.IMutation; -import forestry.api.genetics.ISpeciesRoot; -import java.util.TreeSet; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -class BeeBreedingSystem - extends BreedingSystem -{ - public BeeBreedingSystem() - { - this.iconUndiscovered = Binnie.Resource.getItemIcon(ExtraBees.instance, "icon/undiscoveredBee"); - this.iconDiscovered = Binnie.Resource.getItemIcon(ExtraBees.instance, "icon/discoveredBee"); - } - - public float getChance(IMutation mutation, EntityPlayer player, IAllele species1, IAllele species2) - { - return ((IBeeMutation)mutation).getChance(new VirtualBeeHousing(player), species1, species2, getSpeciesRoot().templateAsGenome(getSpeciesRoot().getTemplate(species1.getUID())), getSpeciesRoot().templateAsGenome(getSpeciesRoot().getTemplate(species2.getUID()))); - } - - public ISpeciesRoot getSpeciesRoot() - { - return Binnie.Genetics.getBeeRoot(); - } - - public int getColour() - { - return 16767232; - } - - public Class<? extends IBreedingTracker> getTrackerClass() - { - return IApiaristTracker.class; - } - - public String getAlleleName(IChromosomeType chromosome, IAllele allele) - { - if (chromosome == EnumBeeChromosome.FERTILITY) - { - if (allele.getUID().contains("Low")) { - return Binnie.Language.localise(BinnieCore.instance, "allele.fertility.low"); - } - if (allele.getUID().contains("Normal")) { - return Binnie.Language.localise(BinnieCore.instance, "allele.fertility.normal"); - } - if (allele.getUID().contains("High")) { - return Binnie.Language.localise(BinnieCore.instance, "allele.fertility.high"); - } - if (allele.getUID().contains("Maximum")) { - return Binnie.Language.localise(BinnieCore.instance, "allele.fertility.maximum"); - } - } - return super.getAlleleName(chromosome, allele); - } - - public boolean isDNAManipulable(ItemStack member) - { - return ((IBeeRoot)getSpeciesRoot()).getType(member) == EnumBeeType.LARVAE; - } - - public int[] getActiveTypes() - { - return new int[] { EnumBeeType.DRONE.ordinal(), EnumBeeType.PRINCESS.ordinal(), EnumBeeType.QUEEN.ordinal(), EnumBeeType.LARVAE.ordinal() }; - } - - public void addExtraAlleles(IChromosomeType chromosome, TreeSet<IAllele> alleles) - { - switch (1.$SwitchMap$forestry$api$apiculture$EnumBeeChromosome[((EnumBeeChromosome)chromosome).ordinal()]) - { - case 1: - for (ForestryAllele.Fertility a : ForestryAllele.Fertility.values()) { - alleles.add(a.getAllele()); - } - break; - case 2: - for (ForestryAllele.Flowering a : ForestryAllele.Flowering.values()) { - alleles.add(a.getAllele()); - } - break; - case 3: - case 4: - for (Tolerance a : Tolerance.values()) { - alleles.add(a.getAllele()); - } - break; - case 5: - for (ForestryAllele.Lifespan a : ForestryAllele.Lifespan.values()) { - alleles.add(a.getAllele()); - } - break; - case 6: - for (ForestryAllele.Speed a : ForestryAllele.Speed.values()) { - alleles.add(a.getAllele()); - } - break; - case 7: - for (ForestryAllele.Territory a : ForestryAllele.Territory.values()) { - alleles.add(a.getAllele()); - } - break; - case 8: - case 9: - case 10: - for (ForestryAllele.Bool a : ForestryAllele.Bool.values()) { - alleles.add(a.getAllele()); - } - break; - } - } -} diff --git a/src/Java/binnie/core/genetics/BeeModifierLogic.java b/src/Java/binnie/core/genetics/BeeModifierLogic.java deleted file mode 100644 index 65a2ab3103..0000000000 --- a/src/Java/binnie/core/genetics/BeeModifierLogic.java +++ /dev/null @@ -1,47 +0,0 @@ -package binnie.core.genetics; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -public class BeeModifierLogic -{ - private Map<EnumBeeModifier, Float[]> modifiers = new HashMap(); - private List<EnumBeeBooleanModifier> booleanModifiers = new ArrayList(); - - public float getModifier(EnumBeeModifier modifier, float currentModifier) - { - if (!this.modifiers.containsKey(modifier)) { - return 1.0F; - } - float mult = ((Float[])this.modifiers.get(modifier))[0].floatValue(); - float max = ((Float[])this.modifiers.get(modifier))[1].floatValue(); - if (max >= 1.0F) - { - if (max <= currentModifier) { - return 1.0F; - } - return Math.min(max / currentModifier, mult); - } - if (max >= currentModifier) { - return 1.0F; - } - return Math.max(max / currentModifier, mult); - } - - public boolean getModifier(EnumBeeBooleanModifier modifier) - { - return this.booleanModifiers.contains(modifier); - } - - public void setModifier(EnumBeeBooleanModifier modifier) - { - this.booleanModifiers.add(modifier); - } - - public void setModifier(EnumBeeModifier modifier, float mult, float max) - { - this.modifiers.put(modifier, new Float[] { Float.valueOf(mult), Float.valueOf(max) }); - } -} diff --git a/src/Java/binnie/core/genetics/BreedingSystem.java b/src/Java/binnie/core/genetics/BreedingSystem.java deleted file mode 100644 index 1bdd5d6376..0000000000 --- a/src/Java/binnie/core/genetics/BreedingSystem.java +++ /dev/null @@ -1,558 +0,0 @@ -package binnie.core.genetics; - -import binnie.Binnie; -import binnie.core.BinnieCore; -import binnie.core.language.ManagerLanguage; -import binnie.core.proxy.BinnieProxy; -import binnie.core.resource.BinnieIcon; -import binnie.extrabees.genetics.ExtraBeeMutation; -import com.mojang.authlib.GameProfile; -import cpw.mods.fml.common.eventhandler.EventBus; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import forestry.api.core.ForestryEvent.SyncedBreedingTracker; -import forestry.api.genetics.AlleleManager; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IAlleleBoolean; -import forestry.api.genetics.IAlleleRegistry; -import forestry.api.genetics.IAlleleSpecies; -import forestry.api.genetics.IBreedingTracker; -import forestry.api.genetics.IChromosomeType; -import forestry.api.genetics.IClassification; -import forestry.api.genetics.IGenome; -import forestry.api.genetics.IIndividual; -import forestry.api.genetics.IMutation; -import forestry.api.genetics.ISpeciesRoot; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; -import java.util.TreeSet; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import net.minecraftforge.common.MinecraftForge; - -public abstract class BreedingSystem - implements IItemStackRepresentitive -{ - protected BinnieIcon iconUndiscovered; - protected BinnieIcon iconDiscovered; - - public BreedingSystem() - { - Binnie.Genetics.registerBreedingSystem(this); - MinecraftForge.EVENT_BUS.register(this); - } - - public String getChromosomeName(IChromosomeType chromo) - { - return BinnieCore.proxy.localise(getSpeciesRoot().getUID() + ".chromosome." + chromo.getName()); - } - - public String getChromosomeShortName(IChromosomeType chromo) - { - return BinnieCore.proxy.localise(getSpeciesRoot().getUID() + ".chromosome." + chromo.getName() + ".short"); - } - - public final String getEpitome(float discoveredPercentage) - { - int i = 0; - if (discoveredPercentage == 1.0F) { - i = 6; - } else if (discoveredPercentage < 0.1F) { - i = 0; - } else if (discoveredPercentage < 0.3F) { - i = 1; - } else if (discoveredPercentage < 0.5F) { - i = 2; - } else if (discoveredPercentage < 0.7F) { - i = 3; - } else if (discoveredPercentage < 0.9F) { - i = 4; - } else if (discoveredPercentage < 1.0F) { - i = 5; - } - return BinnieCore.proxy.localise(getSpeciesRoot().getUID() + ".epitome." + i); - } - - private List<IClassification> allBranches = new ArrayList(); - List<IAlleleSpecies> allActiveSpecies = new ArrayList(); - private List<IAlleleSpecies> allSpecies = new ArrayList(); - private List<IMutation> allMutations = new ArrayList(); - private Map<IAlleleSpecies, List<IMutation>> resultantMutations = new HashMap(); - private Map<IAlleleSpecies, List<IMutation>> furtherMutations = new HashMap(); - private Map<IAlleleSpecies, List<IMutation>> allResultantMutations = new HashMap(); - private Map<IAlleleSpecies, List<IMutation>> allFurtherMutations = new HashMap(); - public float discoveredSpeciesPercentage; - public int totalSpeciesCount; - public int discoveredSpeciesCount; - public int totalSecretCount; - public int discoveredSecretCount; - public float discoveredBranchPercentage; - public int totalBranchCount; - public int discoveredBranchCount; - private int totalSecretBranchCount; - private int discoveredSecretBranchCount; - String currentEpithet; - - public abstract ISpeciesRoot getSpeciesRoot(); - - public final List<IClassification> getAllBranches() - { - return this.allBranches; - } - - public final Collection<IAlleleSpecies> getAllSpecies() - { - return this.allActiveSpecies; - } - - public final Collection<IMutation> getAllMutations() - { - return this.allMutations; - } - - public void calculateArrays() - { - Collection<IAllele> allAlleles = AlleleManager.alleleRegistry.getRegisteredAlleles().values(); - - - this.resultantMutations = new HashMap(); - this.furtherMutations = new HashMap(); - this.allResultantMutations = new HashMap(); - this.allFurtherMutations = new HashMap(); - - this.allActiveSpecies = new ArrayList(); - this.allSpecies = new ArrayList(); - for (IAllele species : allAlleles) { - if (getSpeciesRoot().getTemplate(species.getUID()) != null) - { - this.resultantMutations.put((IAlleleSpecies)species, new ArrayList()); - - this.furtherMutations.put((IAlleleSpecies)species, new ArrayList()); - - this.allResultantMutations.put((IAlleleSpecies)species, new ArrayList()); - - this.allFurtherMutations.put((IAlleleSpecies)species, new ArrayList()); - - this.allSpecies.add((IAlleleSpecies)species); - if ((!isBlacklisted(species)) && (!species.getUID().contains("speciesBotAlfheim"))) { - this.allActiveSpecies.add((IAlleleSpecies)species); - } - } - } - this.allMutations = new ArrayList(); - - Collection<IClassification> allRegBranches = AlleleManager.alleleRegistry.getRegisteredClassifications().values(); - - - this.allBranches = new ArrayList(); - for (IClassification branch : allRegBranches) { - if ((branch.getMemberSpecies().length > 0) && - (getSpeciesRoot().getTemplate(branch.getMemberSpecies()[0].getUID()) != null)) - { - boolean possible = false; - for (IAlleleSpecies species : branch.getMemberSpecies()) { - if (this.allActiveSpecies.contains(species)) { - possible = true; - } - } - if (possible) { - this.allBranches.add(branch); - } - } - } - if (getSpeciesRoot().getMutations(false) != null) - { - Set<IMutation> mutations = new LinkedHashSet(); - mutations.addAll(getSpeciesRoot().getMutations(false)); - if (this == Binnie.Genetics.beeBreedingSystem) { - mutations.addAll(ExtraBeeMutation.mutations); - } - for (IMutation mutation : mutations) - { - this.allMutations.add(mutation); - - Set<IAlleleSpecies> participatingSpecies = new LinkedHashSet(); - if ((mutation.getAllele0() instanceof IAlleleSpecies)) { - participatingSpecies.add((IAlleleSpecies)mutation.getAllele0()); - } - if ((mutation.getAllele1() instanceof IAlleleSpecies)) { - participatingSpecies.add((IAlleleSpecies)mutation.getAllele1()); - } - for (IAlleleSpecies species : participatingSpecies) - { - ((List)this.allFurtherMutations.get(species)).add(mutation); - if (this.allActiveSpecies.contains(species)) { - ((List)this.furtherMutations.get(species)).add(mutation); - } - } - if (this.resultantMutations.containsKey(mutation.getTemplate()[0])) - { - ((List)this.allResultantMutations.get(mutation.getTemplate()[0])).add(mutation); - ((List)this.resultantMutations.get(mutation.getTemplate()[0])).add(mutation); - } - } - } - } - - public final boolean isBlacklisted(IAllele allele) - { - return AlleleManager.alleleRegistry.isBlacklisted(allele.getUID()); - } - - public final List<IMutation> getResultantMutations(IAlleleSpecies species, boolean includeInactive) - { - if (this.resultantMutations.isEmpty()) { - calculateArrays(); - } - return includeInactive ? (List)this.allResultantMutations.get(species) : (List)this.resultantMutations.get(species); - } - - public final List<IMutation> getResultantMutations(IAlleleSpecies species) - { - if (this.resultantMutations.isEmpty()) { - calculateArrays(); - } - return (List)this.resultantMutations.get(species); - } - - public final List<IMutation> getFurtherMutations(IAlleleSpecies species, boolean includeInactive) - { - if (this.furtherMutations.isEmpty()) { - calculateArrays(); - } - return includeInactive ? (List)this.allFurtherMutations.get(species) : (List)this.furtherMutations.get(species); - } - - public final List<IMutation> getFurtherMutations(IAlleleSpecies species) - { - if (this.furtherMutations.isEmpty()) { - calculateArrays(); - } - return (List)this.furtherMutations.get(species); - } - - public final boolean isMutationDiscovered(IMutation mutation, World world, GameProfile name) - { - return isMutationDiscovered(mutation, getSpeciesRoot().getBreedingTracker(world, name)); - } - - public final boolean isMutationDiscovered(IMutation mutation, IBreedingTracker tracker) - { - if (tracker == null) { - return true; - } - return tracker.isDiscovered(mutation); - } - - public final boolean isSpeciesDiscovered(IAlleleSpecies species, World world, GameProfile name) - { - return isSpeciesDiscovered(species, getSpeciesRoot().getBreedingTracker(world, name)); - } - - public final boolean isSpeciesDiscovered(IAlleleSpecies species, IBreedingTracker tracker) - { - if (tracker == null) { - return true; - } - return tracker.isDiscovered(species); - } - - public final boolean isSecret(IAlleleSpecies species) - { - return !species.isCounted(); - } - - public final boolean isSecret(IClassification branch) - { - for (IAlleleSpecies species : branch.getMemberSpecies()) { - if (!isSecret(species)) { - return false; - } - } - return true; - } - - public final Collection<IClassification> getDiscoveredBranches(World world, GameProfile player) - { - List<IClassification> branches = new ArrayList(); - for (IClassification branch : getAllBranches()) - { - boolean discovered = false; - for (IAlleleSpecies species : branch.getMemberSpecies()) { - if (isSpeciesDiscovered(species, world, player)) { - discovered = true; - } - } - if (discovered) { - branches.add(branch); - } - } - return branches; - } - - public final Collection<IClassification> getDiscoveredBranches(IBreedingTracker tracker) - { - List<IClassification> branches = new ArrayList(); - for (IClassification branch : getAllBranches()) - { - boolean discovered = false; - for (IAlleleSpecies species : branch.getMemberSpecies()) { - if (isSpeciesDiscovered(species, tracker)) { - discovered = true; - } - } - if (discovered) { - branches.add(branch); - } - } - return branches; - } - - public final Collection<IAlleleSpecies> getDiscoveredSpecies(World world, GameProfile player) - { - List<IAlleleSpecies> speciesList = new ArrayList(); - for (IAlleleSpecies species : getAllSpecies()) { - if (isSpeciesDiscovered(species, world, player)) { - speciesList.add(species); - } - } - return speciesList; - } - - public final Collection<IAlleleSpecies> getDiscoveredSpecies(IBreedingTracker tracker) - { - List<IAlleleSpecies> speciesList = new ArrayList(); - for (IAlleleSpecies species : getAllSpecies()) { - if (isSpeciesDiscovered(species, tracker)) { - speciesList.add(species); - } - } - return speciesList; - } - - public final List<IMutation> getDiscoveredMutations(World world, GameProfile player) - { - List<IMutation> speciesList = new ArrayList(); - for (IMutation species : getAllMutations()) { - if (isMutationDiscovered(species, world, player)) { - speciesList.add(species); - } - } - return speciesList; - } - - public final List<IMutation> getDiscoveredMutations(IBreedingTracker tracker) - { - List<IMutation> speciesList = new ArrayList(); - for (IMutation species : getAllMutations()) { - if (isMutationDiscovered(species, tracker)) { - speciesList.add(species); - } - } - return speciesList; - } - - public final int getDiscoveredBranchMembers(IClassification branch, IBreedingTracker tracker) - { - int discoveredSpecies = 0; - for (IAlleleSpecies species : branch.getMemberSpecies()) { - if (isSpeciesDiscovered(species, tracker)) { - discoveredSpecies++; - } - } - return discoveredSpecies; - } - - public IIcon getUndiscoveredIcon() - { - return this.iconUndiscovered.getIcon(); - } - - public IIcon getDiscoveredIcon() - { - return this.iconDiscovered.getIcon(); - } - - public abstract float getChance(IMutation paramIMutation, EntityPlayer paramEntityPlayer, IAllele paramIAllele1, IAllele paramIAllele2); - - public abstract Class<? extends IBreedingTracker> getTrackerClass(); - - @SubscribeEvent - public final void onSyncBreedingTracker(ForestryEvent.SyncedBreedingTracker event) - { - IBreedingTracker tracker = event.tracker; - if (!getTrackerClass().isInstance(tracker)) { - return; - } - syncTracker(tracker); - } - - public final void syncTracker(IBreedingTracker tracker) - { - this.discoveredSpeciesPercentage = 0.0F; - - this.totalSpeciesCount = 0; - this.discoveredSpeciesCount = 0; - - this.totalSecretCount = 0; - this.discoveredSecretCount = 0; - - Collection<IAlleleSpecies> discoveredSpecies = getDiscoveredSpecies(tracker); - Collection<IAlleleSpecies> allSpecies = getAllSpecies(); - for (IAlleleSpecies species : allSpecies) { - if (!isSecret(species)) - { - this.totalSpeciesCount += 1; - if (isSpeciesDiscovered(species, tracker)) { - this.discoveredSpeciesCount += 1; - } - } - else - { - this.totalSecretCount += 1; - if (isSpeciesDiscovered(species, tracker)) { - this.discoveredSecretCount += 1; - } - } - } - this.discoveredBranchPercentage = 0.0F; - - this.totalBranchCount = 0; - this.discoveredBranchCount = 0; - - Collection<IClassification> discoveredBranches = getDiscoveredBranches(tracker); - Collection<IClassification> allBranches = getAllBranches(); - for (IClassification branch : allBranches) { - if (!isSecret(branch)) - { - this.totalBranchCount += 1; - if (discoveredBranches.contains(branch)) { - this.discoveredBranchCount += 1; - } - } - else - { - this.totalSecretBranchCount += 1; - if (discoveredBranches.contains(branch)) { - this.discoveredSecretBranchCount += 1; - } - } - } - this.discoveredSpeciesPercentage = (this.discoveredSpeciesCount / this.totalSpeciesCount); - - this.discoveredBranchPercentage = (this.discoveredBranchCount / this.totalBranchCount); - - - String epithet = getEpitome(); - - onSyncBreedingTracker(tracker); - } - - public void onSyncBreedingTracker(IBreedingTracker tracker) {} - - public String getEpitome() - { - return getEpitome(this.discoveredSpeciesPercentage); - } - - public final String getDescriptor() - { - return BinnieCore.proxy.localise(getSpeciesRoot().getUID() + ".descriptor"); - } - - public final String getIdent() - { - return getSpeciesRoot().getUID(); - } - - public final IChromosomeType getChromosome(int i) - { - for (IChromosomeType chromosome : getSpeciesRoot().getKaryotype()) { - if (i == chromosome.ordinal()) { - return chromosome; - } - } - return null; - } - - public abstract int getColour(); - - public String getAlleleName(IChromosomeType chromosome, IAllele allele) - { - if ((allele instanceof IAlleleBoolean)) { - return ((IAlleleBoolean)allele).getValue() ? Binnie.Language.localise(BinnieCore.instance, "allele.true") : Binnie.Language.localise(BinnieCore.instance, "allele.false"); - } - if (allele.getName() == "for.gui.maximum") { - return Binnie.Language.localise(BinnieCore.instance, "allele.fertility.maximum"); - } - return allele.getName(); - } - - public String getName() - { - return BinnieCore.proxy.localise(getSpeciesRoot().getUID() + ".shortName"); - } - - public ItemStack getItemStackRepresentitive() - { - IIndividual first = (IIndividual)getSpeciesRoot().getIndividualTemplates().get(0); - return getSpeciesRoot().getMemberStack(first, getDefaultType()); - } - - public String toString() - { - return getName(); - } - - public abstract boolean isDNAManipulable(ItemStack paramItemStack); - - public IIndividual getConversion(ItemStack stack) - { - return null; - } - - public final IIndividual getDefaultIndividual() - { - return getSpeciesRoot().templateAsIndividual(getSpeciesRoot().getDefaultTemplate()); - } - - public final int getDefaultType() - { - return getActiveTypes()[0]; - } - - public abstract int[] getActiveTypes(); - - public abstract void addExtraAlleles(IChromosomeType paramIChromosomeType, TreeSet<IAllele> paramTreeSet); - - public ItemStack getConversionStack(ItemStack stack) - { - return getSpeciesRoot().getMemberStack(getConversion(stack), getDefaultType()); - } - - public final Collection<IChromosomeType> getActiveKaryotype() - { - return Binnie.Genetics.getActiveChromosomes(getSpeciesRoot()); - } - - public ItemStack getDefaultMember(String uid) - { - return getSpeciesRoot().getMemberStack(getIndividual(uid), getDefaultType()); - } - - public IIndividual getIndividual(String uid) - { - return getSpeciesRoot().templateAsIndividual(getSpeciesRoot().getTemplate(uid)); - } - - public IGenome getGenome(String uid) - { - return getSpeciesRoot().templateAsGenome(getSpeciesRoot().getTemplate(uid)); - } -} diff --git a/src/Java/binnie/core/genetics/EnumBeeBooleanModifier.java b/src/Java/binnie/core/genetics/EnumBeeBooleanModifier.java deleted file mode 100644 index 58eae12e79..0000000000 --- a/src/Java/binnie/core/genetics/EnumBeeBooleanModifier.java +++ /dev/null @@ -1,8 +0,0 @@ -package binnie.core.genetics; - -public enum EnumBeeBooleanModifier -{ - Sealed, SelfLighted, SunlightStimulated, Hellish; - - private EnumBeeBooleanModifier() {} -} diff --git a/src/Java/binnie/core/genetics/EnumBeeModifier.java b/src/Java/binnie/core/genetics/EnumBeeModifier.java deleted file mode 100644 index 92fc30bda0..0000000000 --- a/src/Java/binnie/core/genetics/EnumBeeModifier.java +++ /dev/null @@ -1,17 +0,0 @@ -package binnie.core.genetics; - -import binnie.Binnie; -import binnie.core.BinnieCore; -import binnie.core.language.ManagerLanguage; - -public enum EnumBeeModifier -{ - Territory, Mutation, Lifespan, Production, Flowering, GeneticDecay; - - private EnumBeeModifier() {} - - public String getName() - { - return Binnie.Language.localise(BinnieCore.instance, "beemodifier." + name().toLowerCase()); - } -} diff --git a/src/Java/binnie/core/genetics/FlowerBreedingSystem.java b/src/Java/binnie/core/genetics/FlowerBreedingSystem.java deleted file mode 100644 index bc706976c8..0000000000 --- a/src/Java/binnie/core/genetics/FlowerBreedingSystem.java +++ /dev/null @@ -1,129 +0,0 @@ -package binnie.core.genetics; - -import binnie.Binnie; -import binnie.botany.api.EnumFlowerChromosome; -import binnie.botany.api.EnumFlowerStage; -import binnie.botany.api.IBotanistTracker; -import binnie.botany.api.IFlowerMutation; -import binnie.botany.api.IFlowerRoot; -import binnie.botany.core.BotanyCore; -import binnie.botany.genetics.EnumFlowerColor; -import binnie.core.BinnieCore; -import binnie.core.language.ManagerLanguage; -import binnie.core.resource.ManagerResource; -import binnie.extrabees.ExtraBees; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IBreedingTracker; -import forestry.api.genetics.IChromosomeType; -import forestry.api.genetics.IIndividual; -import forestry.api.genetics.IMutation; -import forestry.api.genetics.ISpeciesRoot; -import java.util.TreeSet; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -class FlowerBreedingSystem - extends BreedingSystem -{ - public FlowerBreedingSystem() - { - this.iconUndiscovered = Binnie.Resource.getItemIcon(ExtraBees.instance, "icon/undiscoveredBee"); - this.iconDiscovered = Binnie.Resource.getItemIcon(ExtraBees.instance, "icon/discoveredBee"); - } - - public float getChance(IMutation mutation, EntityPlayer player, IAllele species1, IAllele species2) - { - return ((IFlowerMutation)mutation).getBaseChance(); - } - - public ISpeciesRoot getSpeciesRoot() - { - return Binnie.Genetics.getFlowerRoot(); - } - - public int getColour() - { - return 14563127; - } - - public Class<? extends IBreedingTracker> getTrackerClass() - { - return IBotanistTracker.class; - } - - public String getAlleleName(IChromosomeType chromosome, IAllele allele) - { - if (chromosome == EnumFlowerChromosome.FERTILITY) - { - if (allele.getUID().contains("Low")) { - return Binnie.Language.localise(BinnieCore.instance, "allele.fertility.low"); - } - if (allele.getUID().contains("Normal")) { - return Binnie.Language.localise(BinnieCore.instance, "allele.fertility.normal"); - } - if (allele.getUID().contains("High")) { - return Binnie.Language.localise(BinnieCore.instance, "allele.fertility.high"); - } - if (allele.getUID().contains("Maximum")) { - return Binnie.Language.localise(BinnieCore.instance, "allele.fertility.maximum"); - } - } - return super.getAlleleName(chromosome, allele); - } - - public boolean isDNAManipulable(ItemStack member) - { - return ((IFlowerRoot)getSpeciesRoot()).getType(member) == EnumFlowerStage.POLLEN; - } - - public IIndividual getConversion(ItemStack stack) - { - return BotanyCore.getFlowerRoot().getConversion(stack); - } - - public int[] getActiveTypes() - { - return new int[] { EnumFlowerStage.FLOWER.ordinal(), EnumFlowerStage.POLLEN.ordinal(), EnumFlowerStage.SEED.ordinal() }; - } - - public void addExtraAlleles(IChromosomeType chromosome, TreeSet<IAllele> alleles) - { - switch (1.$SwitchMap$binnie$botany$api$EnumFlowerChromosome[((EnumFlowerChromosome)chromosome).ordinal()]) - { - case 1: - for (ForestryAllele.Fertility a : ForestryAllele.Fertility.values()) { - alleles.add(a.getAllele()); - } - break; - case 2: - for (ForestryAllele.Lifespan a : ForestryAllele.Lifespan.values()) { - alleles.add(a.getAllele()); - } - break; - case 3: - case 4: - case 5: - for (Tolerance a : Tolerance.values()) { - alleles.add(a.getAllele()); - } - break; - case 6: - case 7: - case 8: - for (EnumFlowerColor a : EnumFlowerColor.values()) { - alleles.add(a.getAllele()); - } - break; - case 9: - for (ForestryAllele.Sappiness a : ForestryAllele.Sappiness.values()) { - alleles.add(a.getAllele()); - } - break; - case 10: - for (ForestryAllele.Territory a : ForestryAllele.Territory.values()) { - alleles.add(a.getAllele()); - } - break; - } - } -} diff --git a/src/Java/binnie/core/genetics/ForestryAllele.java b/src/Java/binnie/core/genetics/ForestryAllele.java deleted file mode 100644 index 19a3ad8b6f..0000000000 --- a/src/Java/binnie/core/genetics/ForestryAllele.java +++ /dev/null @@ -1,211 +0,0 @@ -package binnie.core.genetics; - -import binnie.Binnie; -import forestry.api.apiculture.IAlleleBeeSpecies; -import forestry.api.apiculture.IBeeRoot; -import forestry.api.genetics.AlleleManager; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IAlleleRegistry; - -public class ForestryAllele -{ - public static enum Lifespan - { - Shortest, Shorter, Short, Shortened, Normal, Elongated, Long, Longer, Longest; - - private Lifespan() {} - - public IAllele getAllele() - { - return AlleleManager.alleleRegistry.getAllele("forestry.lifespan" + toString()); - } - } - - public static enum Speed - { - Slowest, Slower, Slow, Norm, Fast, Faster, Fastest; - - private Speed() {} - - public IAllele getAllele() - { - return AlleleManager.alleleRegistry.getAllele("forestry.speed" + toString()); - } - } - - public static enum Fertility - { - Low, Normal, High, Maximum; - - private Fertility() {} - - public IAllele getAllele() - { - return AlleleManager.alleleRegistry.getAllele("forestry.fertility" + toString()); - } - } - - public static enum Flowering - { - Slowest, Slower, Slow, Average, Fast, Faster, Fastest, Maximum; - - private Flowering() {} - - public IAllele getAllele() - { - return AlleleManager.alleleRegistry.getAllele("forestry.flowering" + toString()); - } - } - - public static enum Territory - { - Default, Large, Larger, Largest; - - private Territory() {} - - public IAllele getAllele() - { - return AlleleManager.alleleRegistry.getAllele("forestry.territory" + toString()); - } - } - - public static enum Sappiness - { - Lowest, Lower, Low, Average, High, Higher, Highest; - - private Sappiness() {} - - public IAllele getAllele() - { - return AlleleManager.alleleRegistry.getAllele("forestry.sappiness" + toString()); - } - } - - public static enum TreeHeight - { - Smallest, Smaller, Small, Average, Large, Larger, Largest, Gigantic; - - private TreeHeight() {} - - public IAllele getAllele() - { - return AlleleManager.alleleRegistry.getAllele("forestry.height" + (this == Average ? "Max10" : toString())); - } - } - - public static enum Size - { - Smallest, Smaller, Small, Average, Large, Larger, Largest; - - private Size() {} - - public IAllele getAllele() - { - return AlleleManager.alleleRegistry.getAllele("forestry.size" + toString()); - } - } - - public static enum Saplings - { - Lowest, Lower, Low, Average, High, Higher, Highest; - - private Saplings() {} - - public IAllele getAllele() - { - String s = toString(); - if (this == Average) { - s = "Default"; - } - if (this == High) { - s = "Double"; - } - if (this == Higher) { - s = "Triple"; - } - return AlleleManager.alleleRegistry.getAllele("forestry.saplings" + s); - } - } - - public static enum Yield - { - Lowest, Lower, Low, Average, High, Higher, Highest; - - private Yield() {} - - public IAllele getAllele() - { - return AlleleManager.alleleRegistry.getAllele("forestry.yield" + (this == Average ? "Default" : toString())); - } - } - - public static enum Maturation - { - Slowest, Slower, Slow, Average, Fast, Faster, Fastest; - - private Maturation() {} - - public IAllele getAllele() - { - return AlleleManager.alleleRegistry.getAllele("forestry.maturation" + toString()); - } - } - - public static enum Bool - { - True, False; - - private Bool() {} - - public IAllele getAllele() - { - return AlleleManager.alleleRegistry.getAllele("forestry.bool" + toString()); - } - - public static IAllele get(boolean bool) - { - return (bool ? True : False).getAllele(); - } - } - - public static enum Growth - { - Tropical; - - private Growth() {} - - public IAllele getAllele() - { - return AlleleManager.alleleRegistry.getAllele("forestry.growth" + toString()); - } - } - - public static enum Int - { - Int1, Int2, Int3, Int4, Int5, Int6, Int7, Int8, Int9, Int10; - - private Int() {} - - public IAllele getAllele() - { - return AlleleManager.alleleRegistry.getAllele("forestry.i" + (ordinal() + 1) + "d"); - } - } - - public static enum BeeSpecies - { - Modest, Noble, Forest, Rural, Marshy, Sinister, Tropical, Wintry, Merry, Austere, Imperial, Ended, Meadows, Common, Frugal, Unweary, Diligent, Majestic, Cultivated, Industrious, Valiant, Secluded, Hermitic, Spectral, Exotic, Fiendish, Monastic, Steadfast, Miry, Farmerly, Boggy, Demonic; - - private BeeSpecies() {} - - public IAlleleBeeSpecies getAllele() - { - return (IAlleleBeeSpecies)AlleleManager.alleleRegistry.getAllele("forestry.species" + toString()); - } - - public IAllele[] getTemplate() - { - return Binnie.Genetics.getBeeRoot().getTemplate(getAllele().getUID()); - } - } -} diff --git a/src/Java/binnie/core/genetics/Gene.java b/src/Java/binnie/core/genetics/Gene.java deleted file mode 100644 index 3d071cc1ab..0000000000 --- a/src/Java/binnie/core/genetics/Gene.java +++ /dev/null @@ -1,128 +0,0 @@ -package binnie.core.genetics; - -import binnie.Binnie; -import binnie.genetics.api.IGene; -import forestry.api.core.INBTTagable; -import forestry.api.genetics.AlleleManager; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IAlleleRegistry; -import forestry.api.genetics.IChromosomeType; -import forestry.api.genetics.ISpeciesRoot; -import net.minecraft.nbt.NBTTagCompound; - -public class Gene - implements INBTTagable, IGene -{ - private IAllele allele; - private IChromosomeType chromosome; - private ISpeciesRoot root; - - public ISpeciesRoot getSpeciesRoot() - { - return this.root; - } - - public String toString() - { - return getAlleleName(); - } - - public Gene(IAllele allele, IChromosomeType chromosome, ISpeciesRoot root) - { - this.allele = allele; - this.chromosome = chromosome; - this.root = root; - } - - public Gene(NBTTagCompound nbt) - { - readFromNBT(nbt); - } - - public void readFromNBT(NBTTagCompound nbt) - { - this.allele = AlleleManager.alleleRegistry.getAllele(nbt.getString("allele")); - - this.root = AlleleManager.alleleRegistry.getSpeciesRoot(nbt.getString("root")); - - int chromoID = nbt.getByte("chromo"); - if ((this.root != null) && (chromoID >= 0) && (chromoID < this.root.getKaryotype().length)) { - this.chromosome = this.root.getKaryotype()[chromoID]; - } - } - - public void writeToNBT(NBTTagCompound nbt) - { - nbt.setString("allele", this.allele.getUID()); - nbt.setString("root", this.root.getUID()); - nbt.setByte("chromo", (byte)this.chromosome.ordinal()); - } - - public boolean isCorrupted() - { - return (this.allele == null) || (this.chromosome == null) || (this.root == null); - } - - public static Gene create(NBTTagCompound nbt) - { - Gene gene = new Gene(nbt); - return gene.isCorrupted() ? null : gene; - } - - public static Gene create(IAllele allele, IChromosomeType chromosome, ISpeciesRoot root) - { - Gene gene = new Gene(allele, chromosome, root); - return gene.isCorrupted() ? null : gene; - } - - public NBTTagCompound getNBTTagCompound() - { - NBTTagCompound nbt = new NBTTagCompound(); - writeToNBT(nbt); - return nbt; - } - - public String getName() - { - return Binnie.Genetics.getSystem(this.root).getAlleleName(this.chromosome, this.allele); - } - - public BreedingSystem getSystem() - { - return Binnie.Genetics.getSystem(this.root); - } - - public IChromosomeType getChromosome() - { - return this.chromosome; - } - - public IAllele getAllele() - { - return this.allele; - } - - public boolean equals(Object obj) - { - if (!(obj instanceof Gene)) { - return false; - } - Gene g = (Gene)obj; - return (this.allele == g.allele) && (this.chromosome.ordinal() == g.chromosome.ordinal()) && (this.root == g.root); - } - - public String getAlleleName() - { - return getSystem().getAlleleName(this.chromosome, this.allele); - } - - public String getChromosomeName() - { - return getSystem().getChromosomeName(this.chromosome); - } - - public String getShortChromosomeName() - { - return getSystem().getChromosomeShortName(this.chromosome); - } -} diff --git a/src/Java/binnie/core/genetics/IAlleleProvider.java b/src/Java/binnie/core/genetics/IAlleleProvider.java deleted file mode 100644 index 30dc8992e4..0000000000 --- a/src/Java/binnie/core/genetics/IAlleleProvider.java +++ /dev/null @@ -1,8 +0,0 @@ -package binnie.core.genetics; - -import forestry.api.genetics.IAllele; - -public abstract interface IAlleleProvider -{ - public abstract IAllele getAllele(); -} diff --git a/src/Java/binnie/core/genetics/IBreedingMessage.java b/src/Java/binnie/core/genetics/IBreedingMessage.java deleted file mode 100644 index fdd815c122..0000000000 --- a/src/Java/binnie/core/genetics/IBreedingMessage.java +++ /dev/null @@ -1,124 +0,0 @@ -package binnie.core.genetics; - -import binnie.Binnie; -import binnie.core.BinnieCore; -import binnie.core.language.ManagerLanguage; -import forestry.api.genetics.AlleleManager; -import forestry.api.genetics.IAlleleRegistry; -import forestry.api.genetics.IAlleleSpecies; -import forestry.api.genetics.IChromosomeType; -import forestry.api.genetics.IClassification; -import forestry.api.genetics.ISpeciesRoot; -import java.util.Map; -import net.minecraft.item.ItemStack; - -abstract interface IBreedingMessage -{ - public abstract String getTitle(); - - public abstract String getBody(); - - public abstract ItemStack getIcon(); - - public static class MessageSpeciesDiscovered - implements IBreedingMessage - { - IAlleleSpecies species; - ItemStack stack; - - public MessageSpeciesDiscovered(IAlleleSpecies species) - { - this.species = species; - ISpeciesRoot root = null; - for (ISpeciesRoot sRoot : AlleleManager.alleleRegistry.getSpeciesRoot().values()) { - if (sRoot.getKaryotype()[0].getAlleleClass().isInstance(species)) { - root = sRoot; - } - } - if (root != null) { - this.stack = root.getMemberStack(root.templateAsIndividual(root.getTemplate(species.getUID())), 0); - } - } - - public String getTitle() - { - return Binnie.Language.localise(BinnieCore.instance, "gui.breedingmessage.species"); - } - - public String getBody() - { - return this.species.getName(); - } - - public ItemStack getIcon() - { - return this.stack; - } - } - - public static class BranchDiscovered - implements IBreedingMessage - { - IAlleleSpecies species; - IClassification classification; - ItemStack stack; - - public BranchDiscovered(IAlleleSpecies species, IClassification classification) - { - this.species = species; - this.classification = classification; - ISpeciesRoot root = null; - for (ISpeciesRoot sRoot : AlleleManager.alleleRegistry.getSpeciesRoot().values()) { - if (sRoot.getKaryotype()[0].getAlleleClass().isInstance(species)) { - root = sRoot; - } - } - if (root != null) { - this.stack = root.getMemberStack(root.templateAsIndividual(root.getTemplate(species.getUID())), 0); - } - } - - public String getTitle() - { - return Binnie.Language.localise(BinnieCore.instance, "gui.breedingmessage.branch"); - } - - public String getBody() - { - return this.classification.getScientific(); - } - - public ItemStack getIcon() - { - return this.stack; - } - } - - public static class EpithetGained - implements IBreedingMessage - { - String epithet; - ItemStack stack; - - public EpithetGained(String epithet, ISpeciesRoot root) - { - this.epithet = epithet; - this.stack = root.getMemberStack(root.templateAsIndividual(root.getDefaultTemplate()), 0); - } - - public String getTitle() - { - return Binnie.Language.localise(BinnieCore.instance, "gui.breedingmessage.epithet"); - } - - public String getBody() - { - return this.epithet; - } - - public ItemStack getIcon() - { - return this.stack; - } - } -} diff --git a/src/Java/binnie/core/genetics/IItemStackRepresentitive.java b/src/Java/binnie/core/genetics/IItemStackRepresentitive.java deleted file mode 100644 index ccaf2d4ec4..0000000000 --- a/src/Java/binnie/core/genetics/IItemStackRepresentitive.java +++ /dev/null @@ -1,8 +0,0 @@ -package binnie.core.genetics; - -import net.minecraft.item.ItemStack; - -public abstract interface IItemStackRepresentitive -{ - public abstract ItemStack getItemStackRepresentitive(); -} diff --git a/src/Java/binnie/core/genetics/ManagerGenetics.java b/src/Java/binnie/core/genetics/ManagerGenetics.java deleted file mode 100644 index 4ea18ca7a4..0000000000 --- a/src/Java/binnie/core/genetics/ManagerGenetics.java +++ /dev/null @@ -1,298 +0,0 @@ -package binnie.core.genetics; - -import binnie.Binnie; -import binnie.botany.api.IFlowerRoot; -import binnie.botany.genetics.AlleleColor; -import binnie.core.BinnieCore; -import binnie.core.ManagerBase; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import forestry.api.apiculture.IBeeRoot; -import forestry.api.arboriculture.ITreeRoot; -import forestry.api.genetics.AlleleManager; -import forestry.api.genetics.EnumTolerance; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IAlleleFloat; -import forestry.api.genetics.IAlleleInteger; -import forestry.api.genetics.IAlleleRegistry; -import forestry.api.genetics.IAlleleSpecies; -import forestry.api.genetics.IChromosomeType; -import forestry.api.genetics.IGenome; -import forestry.api.genetics.IIndividual; -import forestry.api.genetics.ISpeciesRoot; -import forestry.api.lepidopterology.IButterflyRoot; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Comparator; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; -import java.util.TreeSet; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.event.world.WorldEvent.Load; - -public class ManagerGenetics - extends ManagerBase -{ - public BreedingSystem beeBreedingSystem; - public BreedingSystem treeBreedingSystem; - public BreedingSystem mothBreedingSystem; - public BreedingSystem flowerBreedingSystem; - private final Map<ISpeciesRoot, BreedingSystem> BREEDING_SYSTEMS; - private List<IChromosomeType> invalidChromosomeTypes; - private Map<ISpeciesRoot, Map<IChromosomeType, List<IAllele>>> chromosomeArray; - - public void init() - { - if (BinnieCore.isApicultureActive()) { - this.beeBreedingSystem = new BeeBreedingSystem(); - } - if (BinnieCore.isArboricultureActive()) { - this.treeBreedingSystem = new TreeBreedingSystem(); - } - if (BinnieCore.isLepidopteryActive()) { - this.mothBreedingSystem = new MothBreedingSystem(); - } - if (BinnieCore.isBotanyActive()) { - this.flowerBreedingSystem = new FlowerBreedingSystem(); - } - } - - public void postInit() - { - refreshData(); - } - - public boolean isSpeciesDiscovered(IAlleleSpecies species, World world, boolean nei) - { - return true; - } - - public ITreeRoot getTreeRoot() - { - return (ITreeRoot)AlleleManager.alleleRegistry.getSpeciesRoot("rootTrees"); - } - - public IBeeRoot getBeeRoot() - { - return (IBeeRoot)AlleleManager.alleleRegistry.getSpeciesRoot("rootBees"); - } - - public IButterflyRoot getButterflyRoot() - { - return (IButterflyRoot)AlleleManager.alleleRegistry.getSpeciesRoot("rootButterflies"); - } - - public IFlowerRoot getFlowerRoot() - { - return (IFlowerRoot)AlleleManager.alleleRegistry.getSpeciesRoot("rootFlowers"); - } - - public BreedingSystem getSystem(String string) - { - for (BreedingSystem system : this.BREEDING_SYSTEMS.values()) { - if (system.getIdent().equals(string)) { - return system; - } - } - return null; - } - - public BreedingSystem getSystem(ISpeciesRoot root) - { - return getSystem(root.getUID()); - } - - public ISpeciesRoot getSpeciesRoot(IAlleleSpecies species) - { - for (ISpeciesRoot root : AlleleManager.alleleRegistry.getSpeciesRoot().values()) { - if (root.getKaryotype()[0].getAlleleClass().isInstance(species)) { - return root; - } - } - return null; - } - - public IAllele getToleranceAllele(EnumTolerance tol) - { - return AlleleManager.alleleRegistry.getAllele(Tolerance.values()[tol.ordinal()].getUID()); - } - - public int[] getTolerance(EnumTolerance tol) - { - return Tolerance.values()[tol.ordinal()].getBounds(); - } - - public Collection<BreedingSystem> getActiveSystems() - { - return this.BREEDING_SYSTEMS.values(); - } - - public void registerBreedingSystem(BreedingSystem system) - { - this.BREEDING_SYSTEMS.put(system.getSpeciesRoot(), system); - } - - public BreedingSystem getConversionSystem(ItemStack stack) - { - for (BreedingSystem system : getActiveSystems()) { - if (system.getConversion(stack) != null) { - return system; - } - } - return null; - } - - public ItemStack getConversionStack(ItemStack stack) - { - BreedingSystem system = getConversionSystem(stack); - return system == null ? null : system.getConversionStack(stack); - } - - public IIndividual getConversion(ItemStack stack) - { - BreedingSystem system = getConversionSystem(stack); - return system == null ? null : system.getConversion(stack); - } - - @SubscribeEvent - public void onWorldLoad(WorldEvent.Load event) - { - refreshData(); - } - - private void refreshData() - { - loadAlleles(); - for (BreedingSystem system : Binnie.Genetics.getActiveSystems()) { - system.calculateArrays(); - } - } - - public ManagerGenetics() - { - this.BREEDING_SYSTEMS = new LinkedHashMap(); - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - this.invalidChromosomeTypes = new ArrayList(); - - this.chromosomeArray = new LinkedHashMap(); - } - - private void loadAlleles() - { - this.invalidChromosomeTypes.clear(); - for (ISpeciesRoot root : AlleleManager.alleleRegistry.getSpeciesRoot().values()) - { - BreedingSystem system = getSystem(root); - Map<IChromosomeType, List<IAllele>> chromosomeMap = new LinkedHashMap(); - for (IChromosomeType chromosome : root.getKaryotype()) - { - TreeSet<IAllele> alleles = new TreeSet(new ComparatorAllele()); - for (IIndividual individual : root.getIndividualTemplates()) - { - IGenome genome = individual.getGenome(); - try - { - IAllele a1 = genome.getActiveAllele(chromosome); - IAllele a2 = genome.getInactiveAllele(chromosome); - if (chromosome.getAlleleClass().isInstance(a1)) { - alleles.add(a1); - } - if (chromosome.getAlleleClass().isInstance(a2)) { - alleles.add(a2); - } - } - catch (Exception e) {} - } - system.addExtraAlleles(chromosome, alleles); - if (alleles.size() == 0) - { - this.invalidChromosomeTypes.add(chromosome); - } - else - { - List<IAllele> alleleList = new ArrayList(); - alleleList.addAll(alleles); - chromosomeMap.put(chromosome, alleleList); - } - } - this.chromosomeArray.put(root, chromosomeMap); - } - } - - static class ComparatorAllele - implements Comparator<IAllele> - { - public int compare(IAllele o1, IAllele o2) - { - if ((o1 == null) || (o2 == null)) { - throw new NullPointerException("Allele is null!"); - } - if (((o1 instanceof IAlleleFloat)) && ((o2 instanceof IAlleleFloat))) { - return Float.valueOf(((IAlleleFloat)o1).getValue()).compareTo(Float.valueOf(((IAlleleFloat)o2).getValue())); - } - if (((o1 instanceof IAlleleInteger)) && ((o2 instanceof IAlleleInteger)) && (!(o1 instanceof AlleleColor))) { - return Integer.valueOf(((IAlleleInteger)o1).getValue()).compareTo(Integer.valueOf(((IAlleleInteger)o2).getValue())); - } - if ((o1.getName() != null) && (o2.getName() != null)) { - return o1.getName().compareTo(o2.getName()); - } - return o1.getUID().compareTo(o2.getUID()); - } - } - - public Map<IChromosomeType, List<IAllele>> getChromosomeMap(ISpeciesRoot root) - { - return (Map)this.chromosomeArray.get(root); - } - - public Collection<IChromosomeType> getActiveChromosomes(ISpeciesRoot root) - { - return getChromosomeMap(root).keySet(); - } - - public boolean isInvalidChromosome(IChromosomeType type) - { - return this.invalidChromosomeTypes.contains(type); - } -} diff --git a/src/Java/binnie/core/genetics/MothBreedingSystem.java b/src/Java/binnie/core/genetics/MothBreedingSystem.java deleted file mode 100644 index e1a45c9a9c..0000000000 --- a/src/Java/binnie/core/genetics/MothBreedingSystem.java +++ /dev/null @@ -1,138 +0,0 @@ -package binnie.core.genetics; - -import binnie.Binnie; -import binnie.core.BinnieCore; -import binnie.core.language.ManagerLanguage; -import binnie.core.resource.ManagerResource; -import binnie.extratrees.ExtraTrees; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IAlleleInteger; -import forestry.api.genetics.IBreedingTracker; -import forestry.api.genetics.IChromosomeType; -import forestry.api.genetics.IMutation; -import forestry.api.genetics.ISpeciesRoot; -import forestry.api.lepidopterology.EnumButterflyChromosome; -import forestry.api.lepidopterology.EnumFlutterType; -import forestry.api.lepidopterology.IButterflyRoot; -import forestry.api.lepidopterology.ILepidopteristTracker; -import java.util.TreeSet; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -class MothBreedingSystem - extends BreedingSystem -{ - public MothBreedingSystem() - { - this.iconUndiscovered = Binnie.Resource.getItemIcon(ExtraTrees.instance, "icon/undiscoveredMoth"); - this.iconDiscovered = Binnie.Resource.getItemIcon(ExtraTrees.instance, "icon/discoveredMoth"); - } - - public float getChance(IMutation mutation, EntityPlayer player, IAllele species1, IAllele species2) - { - return 0.0F; - } - - public ISpeciesRoot getSpeciesRoot() - { - return Binnie.Genetics.getButterflyRoot(); - } - - public int getColour() - { - return 62194; - } - - public Class<? extends IBreedingTracker> getTrackerClass() - { - return ILepidopteristTracker.class; - } - - public String getAlleleName(IChromosomeType chromosome, IAllele allele) - { - if (chromosome == EnumButterflyChromosome.METABOLISM) - { - int metabolism = ((IAlleleInteger)allele).getValue(); - if (metabolism >= 19) { - return Binnie.Language.localise(BinnieCore.instance, "allele.metabolism.highest"); - } - if (metabolism >= 16) { - return Binnie.Language.localise(BinnieCore.instance, "allele.metabolism.higher"); - } - if (metabolism >= 13) { - return Binnie.Language.localise(BinnieCore.instance, "allele.metabolism.high"); - } - if (metabolism >= 10) { - return Binnie.Language.localise(BinnieCore.instance, "allele.metabolism.normal"); - } - if (metabolism >= 7) { - return Binnie.Language.localise(BinnieCore.instance, "allele.metabolism.slow"); - } - if (metabolism >= 4) { - return Binnie.Language.localise(BinnieCore.instance, "allele.metabolism.slower"); - } - return Binnie.Language.localise(BinnieCore.instance, "allele.metabolism.slowest"); - } - if (chromosome == EnumButterflyChromosome.FERTILITY) - { - int metabolism = ((IAlleleInteger)allele).getValue(); - return metabolism + "x"; - } - return super.getAlleleName(chromosome, allele); - } - - public boolean isDNAManipulable(ItemStack member) - { - return ((IButterflyRoot)getSpeciesRoot()).getType(member) == EnumFlutterType.SERUM; - } - - public int[] getActiveTypes() - { - return new int[] { EnumFlutterType.BUTTERFLY.ordinal(), EnumFlutterType.CATERPILLAR.ordinal(), EnumFlutterType.SERUM.ordinal() }; - } - - public void addExtraAlleles(IChromosomeType chromosome, TreeSet<IAllele> alleles) - { - switch (1.$SwitchMap$forestry$api$lepidopterology$EnumButterflyChromosome[((EnumButterflyChromosome)chromosome).ordinal()]) - { - case 1: - for (ForestryAllele.Int a : ForestryAllele.Int.values()) { - alleles.add(a.getAllele()); - } - break; - case 2: - for (ForestryAllele.Lifespan a : ForestryAllele.Lifespan.values()) { - alleles.add(a.getAllele()); - } - break; - case 3: - for (ForestryAllele.Int a : ForestryAllele.Int.values()) { - alleles.add(a.getAllele()); - } - break; - case 4: - case 5: - case 6: - for (ForestryAllele.Bool a : ForestryAllele.Bool.values()) { - alleles.add(a.getAllele()); - } - break; - case 7: - for (ForestryAllele.Size a : ForestryAllele.Size.values()) { - alleles.add(a.getAllele()); - } - break; - case 8: - for (ForestryAllele.Speed a : ForestryAllele.Speed.values()) { - alleles.add(a.getAllele()); - } - break; - case 9: - case 10: - for (Tolerance a : Tolerance.values()) { - alleles.add(a.getAllele()); - } - break; - } - } -} diff --git a/src/Java/binnie/core/genetics/Tolerance.java b/src/Java/binnie/core/genetics/Tolerance.java deleted file mode 100644 index 7d9f62dfbf..0000000000 --- a/src/Java/binnie/core/genetics/Tolerance.java +++ /dev/null @@ -1,48 +0,0 @@ -package binnie.core.genetics; - -import forestry.api.genetics.AlleleManager; -import forestry.api.genetics.EnumTolerance; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IAlleleRegistry; - -public enum Tolerance -{ - None(0, 0), Both1(-1, 1), Both2(-2, 2), Both3(-3, 3), Both4(-4, 4), Both5(-5, 5), Up1(0, 1), Up2(0, 2), Up3(0, 3), Up4(0, 4), Up5(0, 5), Down1(-1, 0), Down2(-2, 0), Down3(-3, 0), Down4(-4, 0), Down5(-5, 0); - - private int[] bounds; - - private Tolerance(int a, int b) - { - this.bounds = new int[] { a, b }; - } - - public String getUID() - { - return "forestry.tolerance" + toString(); - } - - public int[] getBounds() - { - return this.bounds; - } - - public static Tolerance get(EnumTolerance tol) - { - return values()[tol.ordinal()]; - } - - public IAllele getAllele() - { - return AlleleManager.alleleRegistry.getAllele(getUID()); - } - - public <T extends Enum<T>> boolean canTolerate(T base, T test) - { - return (test.ordinal() <= base.ordinal() + this.bounds[1]) && (test.ordinal() >= base.ordinal() + this.bounds[0]); - } - - public static <T extends Enum<T>> boolean canTolerate(T base, T test, EnumTolerance tol) - { - return get(tol).canTolerate(base, test); - } -} diff --git a/src/Java/binnie/core/genetics/TreeBreedingSystem.java b/src/Java/binnie/core/genetics/TreeBreedingSystem.java deleted file mode 100644 index 9793126cb1..0000000000 --- a/src/Java/binnie/core/genetics/TreeBreedingSystem.java +++ /dev/null @@ -1,303 +0,0 @@ -package binnie.core.genetics; - -import binnie.Binnie; -import binnie.core.BinnieCore; -import binnie.core.language.ManagerLanguage; -import binnie.core.resource.ManagerResource; -import binnie.core.util.UniqueItemStackSet; -import binnie.extratrees.ExtraTrees; -import binnie.extratrees.machines.Lumbermill; -import com.mojang.authlib.GameProfile; -import forestry.api.arboriculture.EnumGermlingType; -import forestry.api.arboriculture.EnumTreeChromosome; -import forestry.api.arboriculture.IAlleleFruit; -import forestry.api.arboriculture.IAlleleTreeSpecies; -import forestry.api.arboriculture.IArboristTracker; -import forestry.api.arboriculture.IFruitProvider; -import forestry.api.arboriculture.ITreeGenome; -import forestry.api.arboriculture.ITreeMutation; -import forestry.api.arboriculture.ITreeRoot; -import forestry.api.genetics.AlleleManager; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IAlleleInteger; -import forestry.api.genetics.IAllelePlantType; -import forestry.api.genetics.IAlleleSpecies; -import forestry.api.genetics.IBreedingTracker; -import forestry.api.genetics.IChromosomeType; -import forestry.api.genetics.IFruitFamily; -import forestry.api.genetics.IGenome; -import forestry.api.genetics.IIndividual; -import forestry.api.genetics.IMutation; -import forestry.api.genetics.ISpeciesRoot; -import java.util.ArrayList; -import java.util.Collection; -import java.util.EnumSet; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.List; -import java.util.Map.Entry; -import java.util.Set; -import java.util.TreeSet; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.common.EnumPlantType; - -public class TreeBreedingSystem - extends BreedingSystem -{ - public UniqueItemStackSet allFruits = new UniqueItemStackSet(); - public UniqueItemStackSet allWoods = new UniqueItemStackSet(); - private UniqueItemStackSet discoveredFruits = new UniqueItemStackSet(); - private UniqueItemStackSet discoveredWoods = new UniqueItemStackSet(); - public UniqueItemStackSet discoveredPlanks = new UniqueItemStackSet(); - - public TreeBreedingSystem() - { - this.iconUndiscovered = Binnie.Resource.getItemIcon(ExtraTrees.instance, "icon/undiscoveredTree"); - this.iconDiscovered = Binnie.Resource.getItemIcon(ExtraTrees.instance, "icon/discoveredTree"); - } - - public float getChance(IMutation mutation, EntityPlayer player, IAllele species1, IAllele species2) - { - IGenome genome0 = getSpeciesRoot().templateAsGenome(getSpeciesRoot().getTemplate(species1.getUID())); - IGenome genome1 = getSpeciesRoot().templateAsGenome(getSpeciesRoot().getTemplate(species2.getUID())); - return ((ITreeMutation)mutation).getChance(player.worldObj, (int)player.posX, (int)player.posY, (int)player.posZ, species1, species2, genome0, genome1); - } - - public ISpeciesRoot getSpeciesRoot() - { - return Binnie.Genetics.getTreeRoot(); - } - - public int getColour() - { - return 53006; - } - - public Class<? extends IBreedingTracker> getTrackerClass() - { - return IArboristTracker.class; - } - - public String getAlleleName(IChromosomeType chromosome, IAllele allele) - { - if (chromosome == EnumTreeChromosome.GIRTH) { - return ((IAlleleInteger)allele).getValue() + "x" + ((IAlleleInteger)allele).getValue(); - } - if (chromosome == EnumTreeChromosome.PLANT) - { - EnumSet<EnumPlantType> types = ((IAllelePlantType)allele).getPlantTypes(); - return types.isEmpty() ? Binnie.Language.localise(BinnieCore.instance, "allele.none") : ((EnumPlantType)types.iterator().next()).toString(); - } - if ((chromosome == EnumTreeChromosome.FRUITS) && (allele.getUID().contains("."))) - { - IFruitProvider provider = ((IAlleleFruit)allele).getProvider(); - return provider.getProducts().length == 0 ? Binnie.Language.localise(BinnieCore.instance, "allele.none") : provider.getProducts()[0].getDisplayName(); - } - if (chromosome == EnumTreeChromosome.GROWTH) - { - if (allele.getUID().contains("Tropical")) { - return Binnie.Language.localise(BinnieCore.instance, "allele.growth.tropical"); - } - if (allele.getUID().contains("Lightlevel")) { - return Binnie.Language.localise(BinnieCore.instance, "allele.growth.lightlevel"); - } - } - return super.getAlleleName(chromosome, allele); - } - - public void onSyncBreedingTracker(IBreedingTracker tracker) - { - this.discoveredFruits.clear(); - this.discoveredWoods.clear(); - for (IAlleleSpecies species : getDiscoveredSpecies(tracker)) - { - IAlleleTreeSpecies tSpecies = (IAlleleTreeSpecies)species; - - ITreeGenome genome = (ITreeGenome)getSpeciesRoot().templateAsGenome(getSpeciesRoot().getTemplate(tSpecies.getUID())); - for (ItemStack wood : tSpecies.getLogStacks()) { - this.discoveredWoods.add(wood); - } - for (ItemStack fruit : genome.getFruitProvider().getProducts()) { - this.discoveredFruits.add(fruit); - } - for (Iterator i$ = this.discoveredWoods.iterator(); i$.hasNext(); wood = (ItemStack)i$.next()) {} - } - ItemStack wood; - } - - public final void calculateArrays() - { - super.calculateArrays(); - for (IAlleleSpecies species : this.allActiveSpecies) - { - IAlleleTreeSpecies tSpecies = (IAlleleTreeSpecies)species; - - - ITreeGenome genome = (ITreeGenome)getSpeciesRoot().templateAsGenome(getSpeciesRoot().getTemplate(tSpecies.getUID())); - for (ItemStack wood : tSpecies.getLogStacks()) { - this.allWoods.add(wood); - } - for (ItemStack fruit : genome.getFruitProvider().getProducts()) { - this.allFruits.add(fruit); - } - } - } - - public Collection<IAlleleSpecies> getTreesThatBearFruit(ItemStack fruit, boolean nei, World world, GameProfile player) - { - Collection<IAlleleSpecies> set = nei ? getAllSpecies() : getDiscoveredSpecies(world, player); - List<IAlleleSpecies> found = new ArrayList(); - for (IAlleleSpecies species : set) - { - IAlleleTreeSpecies tSpecies = (IAlleleTreeSpecies)species; - ITreeGenome genome = (ITreeGenome)getSpeciesRoot().templateAsGenome(getSpeciesRoot().getTemplate(tSpecies.getUID())); - for (ItemStack fruit2 : genome.getFruitProvider().getProducts()) { - if (fruit2.isItemEqual(fruit)) { - found.add(species); - } - } - } - return found; - } - - public Collection<IAlleleSpecies> getTreesThatCanBearFruit(ItemStack fruit, boolean nei, World world, GameProfile player) - { - Collection<IAlleleSpecies> set = nei ? getAllSpecies() : getDiscoveredSpecies(world, player); - List<IAlleleSpecies> found = new ArrayList(); - - Set<IFruitFamily> providers = new HashSet(); - for (IAlleleSpecies species : set) - { - IAlleleTreeSpecies tSpecies = (IAlleleTreeSpecies)species; - ITreeGenome genome = (ITreeGenome)getSpeciesRoot().templateAsGenome(getSpeciesRoot().getTemplate(tSpecies.getUID())); - for (ItemStack fruit2 : genome.getFruitProvider().getProducts()) { - if (fruit2.isItemEqual(fruit)) { - providers.add(genome.getFruitProvider().getFamily()); - } - } - } - for (Iterator i$ = set.iterator(); i$.hasNext();) - { - species = (IAlleleSpecies)i$.next(); - tSpecies = (IAlleleTreeSpecies)species; - for (IFruitFamily family : providers) { - if (tSpecies.getSuitableFruit().contains(family)) - { - found.add(species); - break; - } - } - } - IAlleleSpecies species; - IAlleleTreeSpecies tSpecies; - return found; - } - - public Collection<IAlleleSpecies> getTreesThatHaveWood(ItemStack fruit, boolean nei, World world, GameProfile player) - { - Collection<IAlleleSpecies> set = nei ? getAllSpecies() : getDiscoveredSpecies(world, player); - List<IAlleleSpecies> found = new ArrayList(); - for (IAlleleSpecies species : set) - { - IAlleleTreeSpecies tSpecies = (IAlleleTreeSpecies)species; - for (ItemStack fruit2 : tSpecies.getLogStacks()) { - if (fruit2.isItemEqual(fruit)) { - found.add(species); - } - } - } - return found; - } - - public Collection<IAlleleSpecies> getTreesThatMakePlanks(ItemStack fruit, boolean nei, World world, GameProfile player) - { - if (fruit == null) { - return new ArrayList(); - } - Collection<IAlleleSpecies> set = nei ? getAllSpecies() : getDiscoveredSpecies(world, player); - List<IAlleleSpecies> found = new ArrayList(); - for (IAlleleSpecies species : set) - { - IAlleleTreeSpecies tSpecies = (IAlleleTreeSpecies)species; - for (ItemStack fruit2 : tSpecies.getLogStacks()) { - if ((Lumbermill.getPlankProduct(fruit2) != null) && (fruit.isItemEqual(Lumbermill.getPlankProduct(fruit2)))) { - found.add(species); - } - } - } - return found; - } - - public boolean isDNAManipulable(ItemStack member) - { - return ((ITreeRoot)getSpeciesRoot()).getType(member) == EnumGermlingType.POLLEN; - } - - public IIndividual getConversion(ItemStack stack) - { - if (stack == null) { - return null; - } - for (Map.Entry<ItemStack, IIndividual> entry : AlleleManager.ersatzSaplings.entrySet()) { - if (ItemStack.areItemStacksEqual(stack, (ItemStack)entry.getKey())) { - return (IIndividual)entry.getValue(); - } - } - return null; - } - - public int[] getActiveTypes() - { - return new int[] { EnumGermlingType.SAPLING.ordinal(), EnumGermlingType.POLLEN.ordinal() }; - } - - public void addExtraAlleles(IChromosomeType chromosome, TreeSet<IAllele> alleles) - { - switch (1.$SwitchMap$forestry$api$arboriculture$EnumTreeChromosome[((EnumTreeChromosome)chromosome).ordinal()]) - { - case 1: - for (ForestryAllele.Saplings a : ForestryAllele.Saplings.values()) { - alleles.add(a.getAllele()); - } - break; - case 2: - for (ForestryAllele.Int a : ForestryAllele.Int.values()) { - alleles.add(a.getAllele()); - } - break; - case 3: - for (ForestryAllele.TreeHeight a : ForestryAllele.TreeHeight.values()) { - alleles.add(a.getAllele()); - } - break; - case 4: - for (ForestryAllele.Maturation a : ForestryAllele.Maturation.values()) { - alleles.add(a.getAllele()); - } - break; - case 5: - for (ForestryAllele.Sappiness a : ForestryAllele.Sappiness.values()) { - alleles.add(a.getAllele()); - } - break; - case 6: - for (ForestryAllele.Territory a : ForestryAllele.Territory.values()) { - alleles.add(a.getAllele()); - } - break; - case 7: - for (ForestryAllele.Yield a : ForestryAllele.Yield.values()) { - alleles.add(a.getAllele()); - } - break; - case 8: - for (ForestryAllele.Bool a : ForestryAllele.Bool.values()) { - alleles.add(a.getAllele()); - } - break; - } - } -} diff --git a/src/Java/binnie/core/genetics/VirtualBeeHousing.java b/src/Java/binnie/core/genetics/VirtualBeeHousing.java deleted file mode 100644 index b425a21d83..0000000000 --- a/src/Java/binnie/core/genetics/VirtualBeeHousing.java +++ /dev/null @@ -1,111 +0,0 @@ -package binnie.core.genetics; - -import forestry.api.apiculture.IBee; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeHousing; -import forestry.api.genetics.IIndividual; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.biome.BiomeGenBase; - -public class VirtualBeeHousing - extends VirtualHousing - implements IBeeHousing -{ - public VirtualBeeHousing(EntityPlayer player) - { - super(player); - } - - 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 ItemStack getQueen() - { - return null; - } - - public ItemStack getDrone() - { - return null; - } - - public void setQueen(ItemStack itemstack) {} - - public void setDrone(ItemStack itemstack) {} - - public boolean canBreed() - { - return true; - } - - public boolean addProduct(ItemStack product, boolean all) - { - return false; - } - - public void wearOutEquipment(int amount) {} - - public void onQueenChange(ItemStack queen) {} - - public boolean isSealed() - { - return false; - } - - public boolean isSelfLighted() - { - return false; - } - - public boolean isSunlightSimulated() - { - return false; - } - - public boolean isHellish() - { - return getBiomeId() == BiomeGenBase.hell.biomeID; - } - - public float getFloweringModifier(IBeeGenome genome, float currentModifier) - { - return 1.0F; - } - - 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/core/genetics/VirtualHousing.java b/src/Java/binnie/core/genetics/VirtualHousing.java deleted file mode 100644 index b6caa48360..0000000000 --- a/src/Java/binnie/core/genetics/VirtualHousing.java +++ /dev/null @@ -1,98 +0,0 @@ -package binnie.core.genetics; - -import com.mojang.authlib.GameProfile; -import forestry.api.core.EnumHumidity; -import forestry.api.core.EnumTemperature; -import forestry.api.core.IErrorState; -import forestry.api.genetics.IHousing; -import forestry.core.EnumErrorCode; -import java.util.Set; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; - -class VirtualHousing - implements IHousing -{ - private EntityPlayer player; - - public VirtualHousing(EntityPlayer player) - { - this.player = player; - } - - public int getXCoord() - { - return (int)this.player.posX; - } - - public int getYCoord() - { - return (int)this.player.posY; - } - - public int getZCoord() - { - return (int)this.player.posZ; - } - - public int getBiomeId() - { - return this.player.worldObj.getBiomeGenForCoords(getXCoord(), getYCoord()).biomeID; - } - - public EnumTemperature getTemperature() - { - return EnumTemperature.getFromValue(getBiome().temperature); - } - - public EnumHumidity getHumidity() - { - return EnumHumidity.getFromValue(getBiome().rainfall); - } - - public World getWorld() - { - return this.player.worldObj; - } - - public void setErrorState(int state) {} - - public int getErrorOrdinal() - { - return 0; - } - - public boolean addProduct(ItemStack product, boolean all) - { - return false; - } - - public GameProfile getOwnerName() - { - return this.player.getGameProfile(); - } - - public BiomeGenBase getBiome() - { - return this.player.worldObj.getBiomeGenForCoords(getXCoord(), getZCoord()); - } - - public EnumErrorCode getErrorState() - { - return null; - } - - public void setErrorState(IErrorState state) {} - - public boolean setErrorCondition(boolean condition, IErrorState errorState) - { - return false; - } - - public Set<IErrorState> getErrorStates() - { - return null; - } -} diff --git a/src/Java/binnie/core/genetics/VirtualMothHousing.java b/src/Java/binnie/core/genetics/VirtualMothHousing.java deleted file mode 100644 index ad0f8d0cfc..0000000000 --- a/src/Java/binnie/core/genetics/VirtualMothHousing.java +++ /dev/null @@ -1,33 +0,0 @@ -package binnie.core.genetics; - -import forestry.api.genetics.IIndividual; -import forestry.api.lepidopterology.IButterfly; -import forestry.api.lepidopterology.IButterflyNursery; -import net.minecraft.entity.player.EntityPlayer; - -public class VirtualMothHousing - extends VirtualHousing - implements IButterflyNursery -{ - public VirtualMothHousing(EntityPlayer player) - { - super(player); - } - - public IButterfly getCaterpillar() - { - return null; - } - - public IIndividual getNanny() - { - return null; - } - - public void setCaterpillar(IButterfly butterfly) {} - - public boolean canNurse(IButterfly butterfly) - { - return false; - } -} diff --git a/src/Java/binnie/core/item/ModuleItems.java b/src/Java/binnie/core/item/ModuleItems.java deleted file mode 100644 index 335106e040..0000000000 --- a/src/Java/binnie/core/item/ModuleItems.java +++ /dev/null @@ -1,75 +0,0 @@ -package binnie.core.item; - -import binnie.botany.Botany; -import binnie.botany.api.IAlleleFlowerSpecies; -import binnie.botany.api.IFlower; -import binnie.botany.api.IFlowerColour; -import binnie.botany.api.IFlowerGenome; -import binnie.botany.flower.TileEntityFlower; -import binnie.botany.network.PacketID; -import binnie.botany.proxy.Proxy; -import binnie.core.BinnieCore; -import binnie.core.IInitializable; -import binnie.core.network.packet.MessageNBT; -import cpw.mods.fml.common.eventhandler.SubscribeEvent; -import cpw.mods.fml.common.registry.GameRegistry; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; -import net.minecraftforge.event.entity.player.PlayerInteractEvent; -import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action; - -public class ModuleItems - implements IInitializable -{ - public void preInit() - { - BinnieCore.fieldKit = new ItemFieldKit(); - BinnieCore.genesis = new ItemGenesis(); - } - - public void init() {} - - public void postInit() - { - GameRegistry.addRecipe(new ItemStack(BinnieCore.fieldKit, 1, 63), new Object[] { "g ", " is", " pi", Character.valueOf('g'), Blocks.glass_pane, Character.valueOf('i'), Items.iron_ingot, Character.valueOf('p'), Items.paper, Character.valueOf('s'), new ItemStack(Items.dye, 1) }); - } - - @SubscribeEvent - public void onUseFieldKit(PlayerInteractEvent event) - { - if (!BinnieCore.isBotanyActive()) { - return; - } - if (event.action != PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) { - return; - } - if ((event.entityPlayer != null) && (event.entityPlayer.getHeldItem() != null) && (event.entityPlayer.getHeldItem().getItem() == BinnieCore.fieldKit) && (event.entityPlayer.isSneaking())) - { - TileEntity tile = event.world.getTileEntity(event.x, event.y, event.z); - if ((tile instanceof TileEntityFlower)) - { - TileEntityFlower tileFlower = (TileEntityFlower)tile; - IFlower flower = tileFlower.getFlower(); - if (flower != null) - { - NBTTagCompound info = new NBTTagCompound(); - info.setString("Species", flower.getGenome().getPrimary().getUID()); - info.setString("Species2", flower.getGenome().getSecondary().getUID()); - info.setFloat("Age", flower.getAge() / flower.getGenome().getLifespan()); - info.setShort("Colour", (short)flower.getGenome().getPrimaryColor().getID()); - info.setShort("Colour2", (short)flower.getGenome().getSecondaryColor().getID()); - info.setBoolean("Wilting", flower.isWilted()); - info.setBoolean("Flowered", flower.hasFlowered()); - - Botany.proxy.sendToPlayer(new MessageNBT(PacketID.Encylopedia.ordinal(), info), event.entityPlayer); - event.entityPlayer.getHeldItem().damageItem(1, event.entityPlayer); - } - } - } - } -} diff --git a/src/Java/binnie/core/liquid/BinnieFluid.java b/src/Java/binnie/core/liquid/BinnieFluid.java deleted file mode 100644 index e0ac5fc815..0000000000 --- a/src/Java/binnie/core/liquid/BinnieFluid.java +++ /dev/null @@ -1,32 +0,0 @@ -package binnie.core.liquid; - -import net.minecraftforge.fluids.Fluid; - -class BinnieFluid - extends Fluid -{ - private final String name; - final IFluidType fluidType; - - public String getLocalizedName() - { - return this.name; - } - - public BinnieFluid(IFluidType fluid) - { - super(fluid.getIdentifier()); - this.fluidType = fluid; - this.name = fluid.getName(); - } - - public int getColor() - { - return this.fluidType.getColour(); - } - - public IFluidType getType() - { - return this.fluidType; - } -} diff --git a/src/Java/binnie/core/liquid/FluidContainer.java b/src/Java/binnie/core/liquid/FluidContainer.java deleted file mode 100644 index 0bfb14512b..0000000000 --- a/src/Java/binnie/core/liquid/FluidContainer.java +++ /dev/null @@ -1,95 +0,0 @@ -package binnie.core.liquid; - -import binnie.core.BinnieCore; -import binnie.core.Mods; -import binnie.core.Mods.Mod; -import binnie.core.proxy.BinnieProxy; -import binnie.genetics.item.GeneticsItems; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraftforge.fluids.FluidContainerRegistry; -import net.minecraftforge.fluids.FluidContainerRegistry.FluidContainerData; - -public enum FluidContainer -{ - Bucket, Capsule, Refractory, Can, Glass, Cylinder; - - IIcon bottle; - IIcon contents; - ItemFluidContainer item; - - private FluidContainer() {} - - public int getMaxStackSize() - { - return this == Bucket ? 1 : 16; - } - - @SideOnly(Side.CLIENT) - public void updateIcons(IIconRegister register) - { - this.bottle = BinnieCore.proxy.getIcon(register, this == Cylinder ? "binniecore" : "forestry", "liquids/" + toString().toLowerCase() + ".bottle"); - - this.contents = BinnieCore.proxy.getIcon(register, this == Cylinder ? "binniecore" : "forestry", "liquids/" + toString().toLowerCase() + ".contents"); - } - - public IIcon getBottleIcon() - { - return this.bottle; - } - - public IIcon getContentsIcon() - { - return this.contents; - } - - public String getName() - { - return BinnieCore.proxy.localise("item.container." + name().toLowerCase()); - } - - public boolean isActive() - { - return getEmpty() != null; - } - - public ItemStack getEmpty() - { - switch (1.$SwitchMap$binnie$core$liquid$FluidContainer[ordinal()]) - { - case 1: - return new ItemStack(Items.bucket, 1, 0); - case 2: - return Mods.Forestry.stack("canEmpty"); - case 3: - return Mods.Forestry.stack("waxCapsule"); - case 4: - return new ItemStack(Items.glass_bottle, 1, 0); - case 5: - return Mods.Forestry.stack("refractoryEmpty"); - case 6: - return GeneticsItems.Cylinder.get(1); - } - return null; - } - - public void registerContainerData(IFluidType fluid) - { - if (!isActive()) { - return; - } - ItemStack filled = this.item.getContainer(fluid); - - ItemStack empty = getEmpty(); - if ((filled == null) || (empty == null) || (fluid.get(1000) == null)) { - return; - } - FluidContainerRegistry.FluidContainerData data = new FluidContainerRegistry.FluidContainerData(fluid.get(1000), filled, empty); - - FluidContainerRegistry.registerFluidContainer(data); - } -} diff --git a/src/Java/binnie/core/liquid/IFluidType.java b/src/Java/binnie/core/liquid/IFluidType.java deleted file mode 100644 index 3d0bd46d2b..0000000000 --- a/src/Java/binnie/core/liquid/IFluidType.java +++ /dev/null @@ -1,28 +0,0 @@ -package binnie.core.liquid; - -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.util.IIcon; -import net.minecraftforge.fluids.FluidStack; - -public abstract interface IFluidType -{ - public abstract IIcon getIcon(); - - public abstract void registerIcon(IIconRegister paramIIconRegister); - - public abstract String getName(); - - public abstract String getIdentifier(); - - public abstract FluidStack get(int paramInt); - - public abstract int getColour(); - - public abstract int getContainerColour(); - - public abstract int getTransparency(); - - public abstract boolean canPlaceIn(FluidContainer paramFluidContainer); - - public abstract boolean showInCreative(FluidContainer paramFluidContainer); -} diff --git a/src/Java/binnie/core/liquid/ILiquidType.java b/src/Java/binnie/core/liquid/ILiquidType.java deleted file mode 100644 index 69e035a3c3..0000000000 --- a/src/Java/binnie/core/liquid/ILiquidType.java +++ /dev/null @@ -1,7 +0,0 @@ -package binnie.core.liquid; - -public abstract interface ILiquidType - extends IFluidType -{ - public abstract int ordinal(); -} diff --git a/src/Java/binnie/core/liquid/ItemFluidContainer.java b/src/Java/binnie/core/liquid/ItemFluidContainer.java deleted file mode 100644 index fe3e72a123..0000000000 --- a/src/Java/binnie/core/liquid/ItemFluidContainer.java +++ /dev/null @@ -1,179 +0,0 @@ -package binnie.core.liquid; - -import binnie.Binnie; -import binnie.extratrees.alcohol.AlcoholEffect; -import binnie.extratrees.alcohol.drink.DrinkManager; -import binnie.extratrees.alcohol.drink.IDrinkLiquid; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import java.util.Random; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.EnumAction; -import net.minecraft.item.Item; -import net.minecraft.item.ItemFood; -import net.minecraft.item.ItemStack; -import net.minecraft.util.FoodStats; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; - -public class ItemFluidContainer - extends ItemFood -{ - private FluidContainer container; - public static int LiquidExtraBee = 64; - public static int LiquidExtraTree = 128; - public static int LiquidJuice = 256; - public static int LiquidAlcohol = 384; - public static int LiquidSpirit = 512; - public static int LiquidLiqueuer = 640; - public static int LiquidGenetics = 768; - private static Map<Integer, String> idToFluid = new HashMap(); - private static Map<String, Integer> fluidToID = new HashMap(); - - public static void registerFluid(IFluidType fluid, int id) - { - idToFluid.put(Integer.valueOf(id), fluid.getIdentifier().toLowerCase()); - fluidToID.put(fluid.getIdentifier().toLowerCase(), Integer.valueOf(id)); - } - - public ItemFluidContainer(FluidContainer container) - { - super(0, false); - this.container = container; - container.item = this; - this.maxStackSize = container.getMaxStackSize(); - setHasSubtypes(true); - setUnlocalizedName("container" + container.name()); - setCreativeTab(CreativeTabs.tabMaterials); - } - - private FluidStack getLiquid(ItemStack stack) - { - String liquid = (String)idToFluid.get(Integer.valueOf(stack.getItemDamage())); - return liquid == null ? null : Binnie.Liquid.getLiquidStack(liquid, 1000); - } - - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister register) - { - this.container.updateIcons(register); - } - - public String getItemStackDisplayName(ItemStack itemstack) - { - if (itemstack == null) { - return "???"; - } - FluidStack fluid = getLiquid(itemstack); - if (fluid == null) { - return "Missing Fluid"; - } - return fluid.getFluid().getLocalizedName(fluid) + " " + this.container.getName(); - } - - public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List itemList) - { - for (IFluidType liquid : Binnie.Liquid.fluids.values()) { - if ((liquid.canPlaceIn(this.container)) && - - (liquid.showInCreative(this.container))) { - itemList.add(getContainer(liquid)); - } - } - } - - public ItemStack getContainer(IFluidType liquid) - { - int id = ((Integer)fluidToID.get(liquid.getIdentifier().toLowerCase())).intValue(); - ItemStack itemstack = new ItemStack(this, 1, id); - return itemstack; - } - - public IIcon getIcon(ItemStack itemstack, int j) - { - if (j > 0) { - return this.container.getBottleIcon(); - } - return this.container.getContentsIcon(); - } - - @SideOnly(Side.CLIENT) - public int getColorFromItemStack(ItemStack item, int pass) - { - FluidStack fluid = getLiquid(item); - if (fluid == null) { - return 16777215; - } - if ((pass == 0) && ((fluid.getFluid() instanceof BinnieFluid))) { - return ((BinnieFluid)fluid.getFluid()).fluidType.getContainerColour(); - } - return super.getColorFromItemStack(item, pass); - } - - public boolean requiresMultipleRenderPasses() - { - return true; - } - - public ItemStack onEaten(ItemStack stack, World world, EntityPlayer player) - { - player.getFoodStats().func_151686_a(this, stack); - world.playSoundAtEntity(player, "random.burp", 0.5F, world.rand.nextFloat() * 0.1F + 0.9F); - onFoodEaten(stack, world, player); - return this.container.getEmpty(); - } - - protected void onFoodEaten(ItemStack stack, World world, EntityPlayer player) - { - if (!world.isRemote) - { - FluidStack fluid = getLiquid(stack); - IDrinkLiquid liquid = DrinkManager.getLiquid(fluid); - if (liquid != null) { - AlcoholEffect.makeDrunk(player, liquid.getABV() * fluid.amount); - } - } - } - - public int getMaxItemUseDuration(ItemStack stack) - { - return 32; - } - - public EnumAction getItemUseAction(ItemStack stack) - { - return isDrinkable(stack) ? EnumAction.drink : EnumAction.none; - } - - public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) - { - if (isDrinkable(stack)) { - player.setItemInUse(stack, getMaxItemUseDuration(stack)); - } - return stack; - } - - public int func_150905_g(ItemStack p_150905_1_) - { - return 0; - } - - public float func_150906_h(ItemStack p_150906_1_) - { - return 0.0F; - } - - private boolean isDrinkable(ItemStack stack) - { - FluidStack fluid = getLiquid(stack); - IDrinkLiquid liquid = DrinkManager.getLiquid(fluid); - return liquid == null ? false : liquid.isConsumable(); - } -} diff --git a/src/Java/binnie/core/liquid/ManagerLiquid.java b/src/Java/binnie/core/liquid/ManagerLiquid.java deleted file mode 100644 index f0ab486cc0..0000000000 --- a/src/Java/binnie/core/liquid/ManagerLiquid.java +++ /dev/null @@ -1,80 +0,0 @@ -package binnie.core.liquid; - -import binnie.core.ManagerBase; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import java.util.Collection; -import java.util.LinkedHashMap; -import java.util.Map; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; - -public class ManagerLiquid - extends ManagerBase -{ - Map<String, IFluidType> fluids = new LinkedHashMap(); - - public Collection<IFluidType> getFluidTypes() - { - return this.fluids.values(); - } - - public void createLiquids(IFluidType[] liquids, int startID) - { - for (IFluidType liquid : liquids) - { - BinnieFluid fluid = createLiquid(liquid, startID++); - if (fluid == null) { - throw new RuntimeException("Liquid registered incorrectly - " + liquid.getIdentifier()); - } - } - } - - public BinnieFluid createLiquid(IFluidType fluid, int id) - { - this.fluids.put(fluid.getIdentifier().toLowerCase(), fluid); - BinnieFluid bFluid = new BinnieFluid(fluid); - FluidRegistry.registerFluid(bFluid); - ItemFluidContainer.registerFluid(fluid, id); - return bFluid; - } - - public FluidStack getLiquidStack(String name, int amount) - { - return FluidRegistry.getFluidStack(name.toLowerCase(), amount); - } - - @SideOnly(Side.CLIENT) - public void reloadIcons(IIconRegister register) - { - for (IFluidType type : this.fluids.values()) - { - Fluid fluid = getLiquidStack(type.getIdentifier(), 1).getFluid(); - type.registerIcon(register); - if (fluid == null) { - throw new RuntimeException("[Binnie] Liquid not registered properly - " + type.getIdentifier()); - } - fluid.setIcons(type.getIcon()); - } - } - - public void init() {} - - public void postInit() - { - for (IFluidType fluid : this.fluids.values()) { - for (FluidContainer container : FluidContainer.values()) { - if ((container.isActive()) && (fluid.canPlaceIn(container))) { - container.registerContainerData(fluid); - } - } - } - } - - public IFluidType getFluidType(String liquid) - { - return (IFluidType)this.fluids.get(liquid.toLowerCase()); - } -} diff --git a/src/Java/binnie/core/machines/BlockMachine.java b/src/Java/binnie/core/machines/BlockMachine.java index 042e213aec..e2ad883207 100644 --- a/src/Java/binnie/core/machines/BlockMachine.java +++ b/src/Java/binnie/core/machines/BlockMachine.java @@ -1,14 +1,9 @@ package binnie.core.machines; -import binnie.Binnie; -import binnie.core.BinnieCore; -import binnie.core.machines.component.IRender.RandomDisplayTick; -import binnie.core.proxy.BinnieProxy; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; import java.util.ArrayList; import java.util.List; import java.util.Random; + import net.minecraft.block.Block; import net.minecraft.block.BlockContainer; import net.minecraft.block.material.Material; @@ -16,7 +11,6 @@ import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.PlayerCapabilities; import net.minecraft.init.Blocks; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -24,6 +18,11 @@ import net.minecraft.tileentity.TileEntity; import net.minecraft.util.IIcon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; +import binnie.Binnie; +import binnie.core.BinnieCore; +import binnie.core.machines.component.IRender; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; class BlockMachine extends BlockContainer diff --git a/src/Java/binnie/core/machines/Machine.java b/src/Java/binnie/core/machines/Machine.java index 474b32c627..70dc65c485 100644 --- a/src/Java/binnie/core/machines/Machine.java +++ b/src/Java/binnie/core/machines/Machine.java @@ -1,27 +1,11 @@ package binnie.core.machines; -import binnie.core.BinnieCore; -import binnie.core.machines.component.IInteraction.RightClick; -import binnie.core.machines.component.IRender.DisplayTick; -import binnie.core.machines.network.INetwork.GuiNBT; -import binnie.core.machines.network.INetwork.RecieveGuiNBT; -import binnie.core.machines.network.INetwork.SendGuiNBT; -import binnie.core.machines.network.INetwork.TilePacketSync; -import binnie.core.machines.power.ITankMachine; -import binnie.core.network.BinnieCorePacketID; -import binnie.core.network.INetworkedEntity; -import binnie.core.network.packet.MessageTileNBT; -import binnie.core.network.packet.PacketPayload; -import binnie.core.proxy.BinnieProxy; -import com.mojang.authlib.GameProfile; -import cpw.mods.fml.common.network.simpleimpl.SimpleNetworkWrapper; -import cpw.mods.fml.relauncher.Side; -import forestry.api.core.INBTTagable; import java.util.ArrayList; import java.util.Collection; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.IInventory; import net.minecraft.nbt.NBTTagCompound; @@ -29,6 +13,20 @@ import net.minecraft.nbt.NBTUtil; import net.minecraft.network.Packet; import net.minecraft.tileentity.TileEntity; import net.minecraft.world.World; +import binnie.core.BinnieCore; +import binnie.core.machines.component.IInteraction; +import binnie.core.machines.component.IRender; +import binnie.core.machines.network.INetwork; +import binnie.core.machines.power.ITankMachine; +import binnie.core.network.BinnieCorePacketID; +import binnie.core.network.INetworkedEntity; +import binnie.core.network.packet.MessageTileNBT; +import binnie.core.network.packet.PacketPayload; + +import com.mojang.authlib.GameProfile; + +import cpw.mods.fml.relauncher.Side; +import forestry.api.core.INBTTagable; public class Machine implements INetworkedEntity, INBTTagable, INetwork.TilePacketSync, IMachine, INetwork.GuiNBT @@ -67,7 +65,7 @@ public class Machine return this.componentMap.values(); } - public <T extends MachineComponent> T getComponent(Class<T> componentClass) + public <T extends MachineComponent> MachineComponent getComponent(Class<T> componentClass) { return hasComponent(componentClass) ? (MachineComponent)componentClass.cast(this.componentMap.get(componentClass)) : null; } diff --git a/src/Java/binnie/core/machines/TileEntityMachine.java b/src/Java/binnie/core/machines/TileEntityMachine.java index c6acf1fda8..27038b1c1c 100644 --- a/src/Java/binnie/core/machines/TileEntityMachine.java +++ b/src/Java/binnie/core/machines/TileEntityMachine.java @@ -1,13 +1,12 @@ package binnie.core.machines; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.network.Packet; import binnie.Binnie; import binnie.core.machines.base.TileEntityMachineBase; -import binnie.core.machines.component.IInteraction.ChunkUnload; -import binnie.core.machines.component.IInteraction.Invalidation; +import binnie.core.machines.component.IInteraction; import binnie.core.network.INetworkedEntity; import binnie.core.network.packet.PacketPayload; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.network.Packet; public class TileEntityMachine extends TileEntityMachineBase diff --git a/src/Java/binnie/core/machines/base/DefaultPower.java b/src/Java/binnie/core/machines/base/DefaultPower.java index 5d3e143b2b..527ce0801a 100644 --- a/src/Java/binnie/core/machines/base/DefaultPower.java +++ b/src/Java/binnie/core/machines/base/DefaultPower.java @@ -1,11 +1,10 @@ package binnie.core.machines.base; +import net.minecraft.tileentity.TileEntity; +import net.minecraftforge.common.util.ForgeDirection; import binnie.core.machines.power.IPoweredMachine; import binnie.core.machines.power.PowerInfo; import binnie.core.machines.power.PowerInterface; -import cpw.mods.fml.common.Optional.Method; -import net.minecraft.tileentity.TileEntity; -import net.minecraftforge.common.util.ForgeDirection; class DefaultPower implements IPoweredMachine @@ -15,25 +14,25 @@ class DefaultPower return new PowerInfo(this, 0.0F); } - @Optional.Method(modid="IC2") + public double getDemandedEnergy() { return 0.0D; } - @Optional.Method(modid="IC2") + public int getSinkTier() { return 0; } - @Optional.Method(modid="IC2") + public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage) { return 0.0D; } - @Optional.Method(modid="IC2") + public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction) { return false; diff --git a/src/Java/binnie/core/machines/base/TileEntityMachineBase.java b/src/Java/binnie/core/machines/base/TileEntityMachineBase.java index 927671b67a..471bb4ab68 100644 --- a/src/Java/binnie/core/machines/base/TileEntityMachineBase.java +++ b/src/Java/binnie/core/machines/base/TileEntityMachineBase.java @@ -1,23 +1,21 @@ package binnie.core.machines.base; -import binnie.core.machines.Machine; -import binnie.core.machines.inventory.IInventoryMachine; -import binnie.core.machines.inventory.TankSlot; -import binnie.core.machines.power.IPoweredMachine; -import binnie.core.machines.power.ITankMachine; -import binnie.core.machines.power.PowerInfo; -import binnie.core.machines.power.PowerInterface; -import binnie.core.machines.power.TankInfo; -import cpw.mods.fml.common.Optional.Method; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; -import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidTankInfo; import net.minecraftforge.fluids.IFluidTank; +import binnie.core.machines.Machine; +import binnie.core.machines.inventory.IInventoryMachine; +import binnie.core.machines.inventory.TankSlot; +import binnie.core.machines.power.IPoweredMachine; +import binnie.core.machines.power.ITankMachine; +import binnie.core.machines.power.PowerInfo; +import binnie.core.machines.power.PowerInterface; +import binnie.core.machines.power.TankInfo; public class TileEntityMachineBase extends TileEntity @@ -206,25 +204,21 @@ public class TileEntityMachineBase return getTankContainer().getTanks(); } - @Optional.Method(modid="IC2") public double getDemandedEnergy() { return getPower().getDemandedEnergy(); } - @Optional.Method(modid="IC2") public int getSinkTier() { return getPower().getSinkTier(); } - @Optional.Method(modid="IC2") public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage) { return getPower().injectEnergy(directionFrom, amount, voltage); } - @Optional.Method(modid="IC2") public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction) { return getPower().acceptsEnergyFrom(emitter, direction); diff --git a/src/Java/binnie/core/machines/inventory/ComponentChargedSlots.java b/src/Java/binnie/core/machines/inventory/ComponentChargedSlots.java index 078a2f98d5..ceaab46538 100644 --- a/src/Java/binnie/core/machines/inventory/ComponentChargedSlots.java +++ b/src/Java/binnie/core/machines/inventory/ComponentChargedSlots.java @@ -1,18 +1,16 @@ package binnie.core.machines.inventory; -import binnie.core.machines.Machine; -import binnie.core.machines.MachineComponent; -import binnie.core.machines.MachineUtil; -import binnie.core.machines.network.INetwork.GuiNBT; -import cpw.mods.fml.relauncher.Side; import java.util.HashMap; import java.util.Iterator; import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; +import binnie.core.machines.Machine; +import binnie.core.machines.MachineComponent; +import binnie.core.machines.network.INetwork; +import cpw.mods.fml.relauncher.Side; public class ComponentChargedSlots extends MachineComponent diff --git a/src/Java/binnie/core/machines/inventory/ComponentInventoryTransfer.java b/src/Java/binnie/core/machines/inventory/ComponentInventoryTransfer.java index 8ee10080e8..e8bbf00f88 100644 --- a/src/Java/binnie/core/machines/inventory/ComponentInventoryTransfer.java +++ b/src/Java/binnie/core/machines/inventory/ComponentInventoryTransfer.java @@ -1,12 +1,13 @@ package binnie.core.machines.inventory; -import binnie.core.machines.IMachine; -import binnie.core.machines.MachineComponent; -import binnie.core.machines.transfer.TransferRequest; import java.util.ArrayList; import java.util.List; + import net.minecraft.inventory.IInventory; import net.minecraft.item.ItemStack; +import binnie.core.machines.IMachine; +import binnie.core.machines.MachineComponent; +import binnie.core.machines.transfer.TransferRequest; public class ComponentInventoryTransfer extends MachineComponent @@ -62,7 +63,7 @@ public class ComponentInventoryTransfer private Restock(IMachine machine, int[] buffer, int destination, int limit) { - super(machine, null); + super(machine); this.buffer = buffer; this.destination = destination; this.limit = limit; @@ -99,7 +100,7 @@ public class ComponentInventoryTransfer private Storage(IMachine machine, int source, int[] destination) { - super(machine, null); + super(machine); this.source = source; this.destination = destination; } @@ -122,22 +123,22 @@ public class ComponentInventoryTransfer public void addRestock(int[] buffer, int destination, int limit) { - this.transfers.add(new Restock(getMachine(), buffer, destination, limit, null)); + this.transfers.add(new Restock(getMachine(), buffer, destination, limit)); } public void addRestock(int[] buffer, int destination) { - this.transfers.add(new Restock(getMachine(), buffer, destination, null)); + this.transfers.add(new Restock(getMachine(), buffer, destination)); } public void addStorage(int source, int[] destination) { - this.transfers.add(new Storage(getMachine(), source, destination, null)); + this.transfers.add(new Storage(getMachine(), source, destination)); } public void performTransfer(int source, int[] destination) { - new Storage(getMachine(), source, destination, null).transfer((IInventory)getMachine().getInterface(IInventoryMachine.class)); + new Storage(getMachine(), source, destination).transfer((IInventory)getMachine().getInterface(IInventoryMachine.class)); } public void onUpdate() @@ -149,7 +150,7 @@ public class ComponentInventoryTransfer public void addStorage(int source, int[] destination, Condition condition) { - this.transfers.add(new Storage(getMachine(), source, destination, null).setCondition(condition)); + this.transfers.add(new Storage(getMachine(), source, destination).setCondition(condition)); } public static abstract class Condition diff --git a/src/Java/binnie/core/machines/inventory/SlotValidator.java b/src/Java/binnie/core/machines/inventory/SlotValidator.java index 952ff99761..0e0aab4e03 100644 --- a/src/Java/binnie/core/machines/inventory/SlotValidator.java +++ b/src/Java/binnie/core/machines/inventory/SlotValidator.java @@ -1,10 +1,8 @@ package binnie.core.machines.inventory; -import binnie.core.resource.BinnieIcon; -import forestry.api.genetics.AlleleManager; -import forestry.api.genetics.IAlleleRegistry; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; +import forestry.api.genetics.AlleleManager; public abstract class SlotValidator extends Validator<ItemStack> @@ -32,7 +30,7 @@ public abstract class SlotValidator public Item(ItemStack target, ValidatorIcon icon) { - super(); + super(icon); this.target = target; } @@ -52,7 +50,7 @@ public abstract class SlotValidator { public Individual() { - super(); + super(IconBee); } public boolean isValid(ItemStack itemStack) diff --git a/src/Java/binnie/core/machines/inventory/TankValidator.java b/src/Java/binnie/core/machines/inventory/TankValidator.java deleted file mode 100644 index 07c8f2f9c9..0000000000 --- a/src/Java/binnie/core/machines/inventory/TankValidator.java +++ /dev/null @@ -1,33 +0,0 @@ -package binnie.core.machines.inventory; - -import binnie.Binnie; -import binnie.core.liquid.ManagerLiquid; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; - -public abstract class TankValidator - extends Validator<FluidStack> -{ - public abstract boolean isValid(FluidStack paramFluidStack); - - public static class Basic - extends TankValidator - { - private Fluid fluid; - - public Basic(String name) - { - this.fluid = Binnie.Liquid.getLiquidStack(name, 1).getFluid(); - } - - public boolean isValid(FluidStack stack) - { - return new FluidStack(this.fluid, 1).isFluidEqual(stack); - } - - public String getTooltip() - { - return new FluidStack(this.fluid, 1).getLocalizedName(); - } - } -} diff --git a/src/Java/binnie/core/machines/power/ComponentPowerReceptor.java b/src/Java/binnie/core/machines/power/ComponentPowerReceptor.java index 217af86c43..5392ea7012 100644 --- a/src/Java/binnie/core/machines/power/ComponentPowerReceptor.java +++ b/src/Java/binnie/core/machines/power/ComponentPowerReceptor.java @@ -1,28 +1,24 @@ package binnie.core.machines.power; -import binnie.core.Mods; -import binnie.core.Mods.Mod; -import binnie.core.machines.IMachine; -import binnie.core.machines.MachineComponent; -import binnie.core.machines.component.IBuildcraft.TriggerProvider; -import binnie.core.machines.component.IInteraction.ChunkUnload; -import binnie.core.machines.component.IInteraction.Invalidation; -import binnie.core.triggers.TriggerData; -import binnie.core.triggers.TriggerPower; -import cpw.mods.fml.common.Optional.Interface; -import cpw.mods.fml.common.Optional.Method; -import cpw.mods.fml.common.eventhandler.EventBus; import ic2.api.energy.event.EnergyTileLoadEvent; import ic2.api.energy.event.EnergyTileUnloadEvent; import ic2.api.energy.tile.IEnergyTile; + import java.util.LinkedList; import java.util.List; + +import miscutil.core.lib.LoadedMods; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.tileentity.TileEntity; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.util.ForgeDirection; +import binnie.core.machines.IMachine; +import binnie.core.machines.MachineComponent; +import binnie.core.machines.component.IBuildcraft; +import binnie.core.machines.component.IInteraction; +import binnie.core.triggers.TriggerData; +import binnie.core.triggers.TriggerPower; -@Optional.Interface(iface="binnie.core.machines.component.IBuildcraft.TriggerProvider", modid="BuildCraft|Silicon") public class ComponentPowerReceptor extends MachineComponent implements IPoweredMachine, IBuildcraft.TriggerProvider, IInteraction.ChunkUnload, IInteraction.Invalidation @@ -74,7 +70,6 @@ public class ComponentPowerReceptor return new PowerInfo(this, 0.0F); } - @Optional.Method(modid="BuildCraft|Silicon") public final void getTriggers(List<TriggerData> triggers) { triggers.add(TriggerPower.powerNone(this)); @@ -84,26 +79,25 @@ public class ComponentPowerReceptor triggers.add(TriggerPower.powerFull(this)); } - @Optional.Method(modid="IC2") public double getDemandedEnergy() { return this.container.getEnergySpace(PowerSystem.EU); } - @Optional.Method(modid="IC2") + public int getSinkTier() { return 1; } - @Optional.Method(modid="IC2") + public double injectEnergy(ForgeDirection directionFrom, double amount, double voltage) { this.container.addEnergy(PowerSystem.EU, amount, true); return 0.0D; } - @Optional.Method(modid="IC2") + public boolean acceptsEnergyFrom(TileEntity emitter, ForgeDirection direction) { return acceptsPowerSystem(PowerSystem.EU); @@ -160,7 +154,7 @@ public class ComponentPowerReceptor if (getMachine().getWorld() == null) { return; } - if (Mods.IC2.active()) { + if (LoadedMods.IndustrialCraft2) { do_addToEnergyNet(); } } @@ -170,19 +164,17 @@ public class ComponentPowerReceptor if (getMachine().getWorld() == null) { return; } - if (Mods.IC2.active()) { + if (LoadedMods.IndustrialCraft2) { do_removeFromEnergyNet(); } } - @Optional.Method(modid="IC2") private void do_addToEnergyNet() { MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent((IEnergyTile)getMachine().getTileEntity())); this.registeredToIC2EnergyNet = true; } - @Optional.Method(modid="IC2") private void do_removeFromEnergyNet() { MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent((IEnergyTile)getMachine().getTileEntity())); diff --git a/src/Java/binnie/core/machines/power/ComponentProcessIndefinate.java b/src/Java/binnie/core/machines/power/ComponentProcessIndefinate.java index f1442107f4..b4c81e0d62 100644 --- a/src/Java/binnie/core/machines/power/ComponentProcessIndefinate.java +++ b/src/Java/binnie/core/machines/power/ComponentProcessIndefinate.java @@ -1,10 +1,9 @@ package binnie.core.machines.power; +import net.minecraft.nbt.NBTTagCompound; import binnie.core.machines.IMachine; import binnie.core.machines.MachineComponent; -import binnie.core.machines.MachineUtil; -import binnie.core.machines.network.INetwork.TilePacketSync; -import net.minecraft.nbt.NBTTagCompound; +import binnie.core.machines.network.INetwork; public abstract class ComponentProcessIndefinate extends MachineComponent diff --git a/src/Java/binnie/core/machines/power/ErrorState.java b/src/Java/binnie/core/machines/power/ErrorState.java index 03ed4de1f0..65a3946829 100644 --- a/src/Java/binnie/core/machines/power/ErrorState.java +++ b/src/Java/binnie/core/machines/power/ErrorState.java @@ -1,7 +1,7 @@ package binnie.core.machines.power; -import forestry.api.core.INBTTagable; import net.minecraft.nbt.NBTTagCompound; +import forestry.api.core.INBTTagable; public class ErrorState implements INBTTagable @@ -54,7 +54,7 @@ public class ErrorState { public Item(String name, String desc, int[] slots) { - super(desc, slots); + super(name, desc, slots); } } @@ -63,7 +63,7 @@ public class ErrorState { public Tank(String name, String desc, int[] slots) { - super(desc, slots); + super(name, desc, slots); } } @@ -77,7 +77,7 @@ public class ErrorState public NoItem(String desc, int[] slots) { - super(desc, slots); + super("null", desc, slots); } } @@ -91,7 +91,7 @@ public class ErrorState public InvalidItem(String name, String desc, int slot) { - super(desc, new int[] { slot }); + super(name, desc, new int[] { slot }); } } @@ -100,7 +100,7 @@ public class ErrorState { public NoSpace(String desc, int[] slots) { - super(desc, slots); + super("null", desc, slots); } } @@ -109,7 +109,7 @@ public class ErrorState { public InsufficientPower() { - super("Not enough power to operate"); + super("Not enough power to operate", "."); } } @@ -118,7 +118,7 @@ public class ErrorState { public TankSpace(String desc, int tank) { - super(desc, new int[] { tank }); + super("null", desc, new int[] { tank }); } } @@ -127,7 +127,7 @@ public class ErrorState { public InsufficientLiquid(String desc, int tank) { - super(desc, new int[] { tank }); + super("null", desc, new int[] { tank }); } } @@ -136,7 +136,7 @@ public class ErrorState { public InvalidRecipe(String string, int[] slots) { - super(string, slots); + super("null", string, slots); } } diff --git a/src/Java/binnie/core/machines/power/IPoweredMachine.java b/src/Java/binnie/core/machines/power/IPoweredMachine.java index b5e57aeff0..61b505e3d3 100644 --- a/src/Java/binnie/core/machines/power/IPoweredMachine.java +++ b/src/Java/binnie/core/machines/power/IPoweredMachine.java @@ -1,10 +1,8 @@ package binnie.core.machines.power; -import cofh.api.energy.IEnergyHandler; -import cpw.mods.fml.common.Optional.Interface; import ic2.api.energy.tile.IEnergySink; +import cofh.api.energy.IEnergyHandler; -@Optional.Interface(iface="ic2.api.energy.tile.IEnergySink", modid="IC2") public abstract interface IPoweredMachine extends IEnergySink, IEnergyHandler { diff --git a/src/Java/binnie/core/machines/storage/Compartment.java b/src/Java/binnie/core/machines/storage/Compartment.java index d7694e2502..4ed8406346 100644 --- a/src/Java/binnie/core/machines/storage/Compartment.java +++ b/src/Java/binnie/core/machines/storage/Compartment.java @@ -1,16 +1,15 @@ package binnie.core.machines.storage; +import net.minecraft.client.renderer.RenderBlocks; +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntity; import binnie.core.BinnieCore; import binnie.core.machines.IMachineType; import binnie.core.machines.Machine; -import binnie.core.machines.MachineGroup; import binnie.core.machines.MachinePackage; import binnie.core.machines.TileEntityMachine; import binnie.core.resource.BinnieResource; import binnie.core.resource.IBinnieTexture; -import net.minecraft.client.renderer.RenderBlocks; -import net.minecraft.item.ItemStack; -import net.minecraft.tileentity.TileEntity; enum Compartment implements IMachineType @@ -36,7 +35,7 @@ import net.minecraft.tileentity.TileEntity; protected PackageCompartment(String uid, IBinnieTexture renderTexture) { - super(false); + super(uid, false); this.renderTexture = renderTexture.getTexture(); } diff --git a/src/Java/binnie/core/machines/storage/ComponentBinnieCoreGUI.java b/src/Java/binnie/core/machines/storage/ComponentBinnieCoreGUI.java index d987129378..abb2307687 100644 --- a/src/Java/binnie/core/machines/storage/ComponentBinnieCoreGUI.java +++ b/src/Java/binnie/core/machines/storage/ComponentBinnieCoreGUI.java @@ -1,13 +1,12 @@ package binnie.core.machines.storage; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.world.World; import binnie.core.BinnieCore; import binnie.core.gui.BinnieCoreGUI; import binnie.core.machines.Machine; import binnie.core.machines.MachineComponent; -import binnie.core.machines.component.IInteraction.RightClick; -import binnie.core.proxy.BinnieProxy; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.world.World; +import binnie.core.machines.component.IInteraction; class ComponentBinnieCoreGUI extends MachineComponent diff --git a/src/Java/binnie/core/machines/storage/ComponentCompartmentInventory.java b/src/Java/binnie/core/machines/storage/ComponentCompartmentInventory.java index ef55e9df9e..efe77be7e7 100644 --- a/src/Java/binnie/core/machines/storage/ComponentCompartmentInventory.java +++ b/src/Java/binnie/core/machines/storage/ComponentCompartmentInventory.java @@ -1,15 +1,15 @@ package binnie.core.machines.storage; -import binnie.core.machines.IMachine; -import binnie.core.machines.inventory.ComponentInventorySlots; -import binnie.core.machines.network.INetwork.GuiNBT; -import cpw.mods.fml.relauncher.Side; import java.util.HashMap; import java.util.Map; + import net.minecraft.entity.player.EntityPlayer; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; -import net.minecraft.tileentity.TileEntity; +import binnie.core.machines.IMachine; +import binnie.core.machines.inventory.ComponentInventorySlots; +import binnie.core.machines.network.INetwork; +import cpw.mods.fml.relauncher.Side; class ComponentCompartmentInventory extends ComponentInventorySlots diff --git a/src/Java/binnie/craftgui/botany/ControlColourDisplay.java b/src/Java/binnie/craftgui/botany/ControlColourDisplay.java deleted file mode 100644 index 21408ec4ad..0000000000 --- a/src/Java/binnie/craftgui/botany/ControlColourDisplay.java +++ /dev/null @@ -1,47 +0,0 @@ -package binnie.craftgui.botany; - -import binnie.botany.api.IFlowerColour; -import binnie.craftgui.controls.core.Control; -import binnie.craftgui.controls.core.IControlValue; -import binnie.craftgui.core.Attribute; -import binnie.craftgui.core.CraftGUI; -import binnie.craftgui.core.ITooltip; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.Tooltip; -import binnie.craftgui.core.geometry.IArea; -import binnie.craftgui.core.renderer.Renderer; - -public class ControlColourDisplay - extends Control - implements IControlValue<IFlowerColour>, ITooltip -{ - IFlowerColour value; - - public ControlColourDisplay(IWidget parent, float x, float y) - { - super(parent, x, y, 16.0F, 16.0F); - addAttribute(Attribute.MouseOver); - } - - public IFlowerColour getValue() - { - return this.value; - } - - public void setValue(IFlowerColour value) - { - this.value = value; - } - - public void onRenderBackground() - { - CraftGUI.Render.solid(getArea(), -1); - CraftGUI.Render.solid(getArea().inset(1), -16777216 + getValue().getColor(false)); - } - - public void getTooltip(Tooltip tooltip) - { - super.getTooltip(tooltip); - tooltip.add(this.value.getName()); - } -} diff --git a/src/Java/binnie/craftgui/botany/ControlColourMixBox.java b/src/Java/binnie/craftgui/botany/ControlColourMixBox.java deleted file mode 100644 index 7ca4fa98f2..0000000000 --- a/src/Java/binnie/craftgui/botany/ControlColourMixBox.java +++ /dev/null @@ -1,31 +0,0 @@ -package binnie.craftgui.botany; - -import binnie.botany.api.IColourMix; -import binnie.craftgui.controls.listbox.ControlList; -import binnie.craftgui.controls.listbox.ControlListBox; -import binnie.craftgui.core.IWidget; - -public class ControlColourMixBox - extends ControlListBox<IColourMix> -{ - private int index; - private Type type; - - public IWidget createOption(IColourMix value, int y) - { - return new ControlColourMixItem((ControlList)getContent(), value, y); - } - - static enum Type - { - Resultant, Further; - - private Type() {} - } - - public ControlColourMixBox(IWidget parent, int x, int y, int width, int height, Type type) - { - super(parent, x, y, width, height, 12.0F); - this.type = type; - } -} diff --git a/src/Java/binnie/craftgui/botany/ControlColourMixItem.java b/src/Java/binnie/craftgui/botany/ControlColourMixItem.java deleted file mode 100644 index cf519b9a8e..0000000000 --- a/src/Java/binnie/craftgui/botany/ControlColourMixItem.java +++ /dev/null @@ -1,37 +0,0 @@ -package binnie.craftgui.botany; - -import binnie.botany.api.IColourMix; -import binnie.core.genetics.BreedingSystem; -import binnie.craftgui.controls.listbox.ControlList; -import binnie.craftgui.controls.listbox.ControlOption; -import binnie.craftgui.mod.database.WindowAbstractDatabase; - -public class ControlColourMixItem - extends ControlOption<IColourMix> -{ - ControlColourDisplay itemWidget1; - ControlColourDisplay itemWidget2; - ControlColourDisplay itemWidget3; - ControlColourMixSymbol addSymbol; - ControlColourMixSymbol arrowSymbol; - - public ControlColourMixItem(ControlList<IColourMix> controlList, IColourMix option, int y) - { - super(controlList, option, y); - this.itemWidget1 = new ControlColourDisplay(this, 4.0F, 4.0F); - this.itemWidget2 = new ControlColourDisplay(this, 44.0F, 4.0F); - this.itemWidget3 = new ControlColourDisplay(this, 104.0F, 4.0F); - this.addSymbol = new ControlColourMixSymbol(this, 24, 4, 0); - this.arrowSymbol = new ControlColourMixSymbol(this, 64, 4, 1); - - BreedingSystem system = ((WindowAbstractDatabase)getSuperParent()).getBreedingSystem(); - if (getValue() != null) - { - this.itemWidget1.setValue(((IColourMix)getValue()).getColour1()); - this.itemWidget2.setValue(((IColourMix)getValue()).getColour2()); - this.itemWidget3.setValue(((IColourMix)getValue()).getResult()); - this.addSymbol.setValue((IColourMix)getValue()); - this.arrowSymbol.setValue((IColourMix)getValue()); - } - } -} diff --git a/src/Java/binnie/craftgui/botany/ControlColourMixSymbol.java b/src/Java/binnie/craftgui/botany/ControlColourMixSymbol.java deleted file mode 100644 index 5afb98d54f..0000000000 --- a/src/Java/binnie/craftgui/botany/ControlColourMixSymbol.java +++ /dev/null @@ -1,58 +0,0 @@ -package binnie.craftgui.botany; - -import binnie.botany.api.IColourMix; -import binnie.craftgui.controls.core.Control; -import binnie.craftgui.core.Attribute; -import binnie.craftgui.core.CraftGUI; -import binnie.craftgui.core.ITooltip; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.Tooltip; -import binnie.craftgui.core.geometry.IPoint; -import binnie.craftgui.core.renderer.Renderer; -import binnie.craftgui.resource.Texture; -import binnie.craftgui.resource.minecraft.CraftGUITextureSheet; -import binnie.craftgui.resource.minecraft.StandardTexture; - -public class ControlColourMixSymbol - extends Control - implements ITooltip -{ - static Texture MutationPlus = new StandardTexture(2, 94, 16, 16, CraftGUITextureSheet.Controls2); - static Texture MutationArrow = new StandardTexture(20, 94, 32, 16, CraftGUITextureSheet.Controls2); - IColourMix value; - int type; - - public void onRenderBackground() - { - super.onRenderBackground(); - if (this.type == 0) { - CraftGUI.Render.texture(MutationPlus, IPoint.ZERO); - } else { - CraftGUI.Render.texture(MutationArrow, IPoint.ZERO); - } - } - - protected ControlColourMixSymbol(IWidget parent, int x, int y, int type) - { - super(parent, x, y, 16 + type * 16, 16.0F); - this.value = null; - this.type = type; - addAttribute(Attribute.MouseOver); - } - - public void setValue(IColourMix value) - { - this.value = value; - - setColour(16777215); - } - - public void getTooltip(Tooltip tooltip) - { - if (this.type == 1) - { - float chance = this.value.getChance(); - tooltip.add("Current Chance - " + chance + "%"); - } - } -} diff --git a/src/Java/binnie/craftgui/botany/ControlColourOption.java b/src/Java/binnie/craftgui/botany/ControlColourOption.java deleted file mode 100644 index 0a94e5690f..0000000000 --- a/src/Java/binnie/craftgui/botany/ControlColourOption.java +++ /dev/null @@ -1,38 +0,0 @@ -package binnie.craftgui.botany; - -import binnie.botany.api.IFlowerColour; -import binnie.craftgui.controls.ControlText; -import binnie.craftgui.controls.listbox.ControlList; -import binnie.craftgui.controls.listbox.ControlTextOption; -import binnie.craftgui.core.Attribute; -import binnie.craftgui.core.CraftGUI; -import binnie.craftgui.core.geometry.CraftGUIUtil; -import binnie.craftgui.core.geometry.IPoint; -import binnie.craftgui.core.renderer.Renderer; - -public class ControlColourOption - extends ControlTextOption<IFlowerColour> -{ - ControlColourDisplay controlBee; - IPoint boxPosition; - - public ControlColourOption(ControlList<IFlowerColour> controlList, IFlowerColour option, int y) - { - super(controlList, option, option.getName(), y); - setSize(new IPoint(getSize().x(), 20.0F)); - - this.controlBee = new ControlColourDisplay(this, 2.0F, 2.0F); - this.controlBee.setValue(option); - - addAttribute(Attribute.MouseOver); - - CraftGUIUtil.moveWidget(this.textWidget, new IPoint(22.0F, 0.0F)); - this.textWidget.setSize(this.textWidget.getSize().sub(new IPoint(24.0F, 0.0F))); - - int th = (int)CraftGUI.Render.textHeight(this.textWidget.getValue(), this.textWidget.getSize().x()); - int height = Math.max(20, th + 6); - setSize(new IPoint(size().x(), height)); - this.textWidget.setSize(new IPoint(this.textWidget.getSize().x(), height)); - this.boxPosition = new IPoint(2.0F, (height - 18) / 2); - } -} diff --git a/src/Java/binnie/craftgui/botany/PageColourMix.java b/src/Java/binnie/craftgui/botany/PageColourMix.java deleted file mode 100644 index 5fc7e335db..0000000000 --- a/src/Java/binnie/craftgui/botany/PageColourMix.java +++ /dev/null @@ -1,40 +0,0 @@ -package binnie.craftgui.botany; - -import binnie.botany.api.IColourMix; -import binnie.botany.api.IFlowerColour; -import binnie.botany.api.IFlowerRoot; -import binnie.botany.core.BotanyCore; -import binnie.craftgui.controls.ControlText; -import binnie.craftgui.controls.ControlTextCentered; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.mod.database.DatabaseTab; -import binnie.craftgui.mod.database.PageAbstract; -import java.util.ArrayList; -import java.util.List; - -public class PageColourMix - extends PageAbstract<IFlowerColour> -{ - ControlText pageSpeciesFurther_Title; - ControlColourMixBox pageSpeciesFurther_List; - - public PageColourMix(IWidget parent, DatabaseTab tab) - { - super(parent, tab); - - this.pageSpeciesFurther_Title = new ControlTextCentered(this, 8.0F, "Further Mixes"); - - this.pageSpeciesFurther_List = new ControlColourMixBox(this, 4, 20, 136, 152, ControlColourMixBox.Type.Further); - } - - public void onValueChanged(IFlowerColour colour) - { - List<IColourMix> mixes = new ArrayList(); - for (IColourMix mix : BotanyCore.getFlowerRoot().getColourMixes(false)) { - if ((mix.getColour1() == colour) || (mix.getColour2() == colour)) { - mixes.add(mix); - } - } - this.pageSpeciesFurther_List.setOptions(mixes); - } -} diff --git a/src/Java/binnie/craftgui/botany/PageColourMixResultant.java b/src/Java/binnie/craftgui/botany/PageColourMixResultant.java deleted file mode 100644 index a8a50f2cb7..0000000000 --- a/src/Java/binnie/craftgui/botany/PageColourMixResultant.java +++ /dev/null @@ -1,40 +0,0 @@ -package binnie.craftgui.botany; - -import binnie.botany.api.IColourMix; -import binnie.botany.api.IFlowerColour; -import binnie.botany.api.IFlowerRoot; -import binnie.botany.core.BotanyCore; -import binnie.craftgui.controls.ControlText; -import binnie.craftgui.controls.ControlTextCentered; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.mod.database.DatabaseTab; -import binnie.craftgui.mod.database.PageAbstract; -import java.util.ArrayList; -import java.util.List; - -public class PageColourMixResultant - extends PageAbstract<IFlowerColour> -{ - ControlText pageSpeciesFurther_Title; - ControlColourMixBox pageSpeciesFurther_List; - - public PageColourMixResultant(IWidget parent, DatabaseTab tab) - { - super(parent, tab); - - this.pageSpeciesFurther_Title = new ControlTextCentered(this, 8.0F, "Resultant Mixes"); - - this.pageSpeciesFurther_List = new ControlColourMixBox(this, 4, 20, 136, 152, ControlColourMixBox.Type.Resultant); - } - - public void onValueChanged(IFlowerColour colour) - { - List<IColourMix> mixes = new ArrayList(); - for (IColourMix mix : BotanyCore.getFlowerRoot().getColourMixes(false)) { - if (mix.getResult() == colour) { - mixes.add(mix); - } - } - this.pageSpeciesFurther_List.setOptions(mixes); - } -} diff --git a/src/Java/binnie/craftgui/botany/PageSpeciesFlowerGenome.java b/src/Java/binnie/craftgui/botany/PageSpeciesFlowerGenome.java deleted file mode 100644 index dece27f306..0000000000 --- a/src/Java/binnie/craftgui/botany/PageSpeciesFlowerGenome.java +++ /dev/null @@ -1,137 +0,0 @@ -package binnie.craftgui.botany; - -import binnie.Binnie; -import binnie.botany.api.EnumFlowerChromosome; -import binnie.botany.api.EnumFlowerStage; -import binnie.botany.api.IAlleleFlowerSpecies; -import binnie.botany.api.IFlower; -import binnie.botany.api.IFlowerGenome; -import binnie.botany.api.IFlowerRoot; -import binnie.botany.core.BotanyCore; -import binnie.core.genetics.ManagerGenetics; -import binnie.core.language.ManagerLanguage; -import binnie.craftgui.controls.ControlText; -import binnie.craftgui.controls.core.Control; -import binnie.craftgui.controls.scroll.ControlScrollableContent; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.geometry.IArea; -import binnie.craftgui.core.geometry.IPoint; -import binnie.craftgui.core.geometry.TextJustification; -import binnie.craftgui.minecraft.control.ControlItemDisplay; -import binnie.craftgui.mod.database.DatabaseTab; -import binnie.craftgui.mod.database.PageSpecies; -import forestry.api.core.EnumTemperature; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IAlleleSpecies; -import forestry.api.genetics.IGenome; -import forestry.api.genetics.IIndividual; -import net.minecraft.item.ItemStack; - -public class PageSpeciesFlowerGenome - extends PageSpecies -{ - public PageSpeciesFlowerGenome(IWidget parent, DatabaseTab tab) - { - super(parent, tab); - } - - public void onValueChanged(IAlleleSpecies species) - { - deleteAllChildren(); - IAllele[] template = Binnie.Genetics.getFlowerRoot().getTemplate(species.getUID()); - if (template == null) { - return; - } - IFlower tree = Binnie.Genetics.getFlowerRoot().templateAsIndividual(template); - if (tree == null) { - return; - } - IFlowerGenome genome = tree.getGenome(); - IAlleleFlowerSpecies treeSpecies = genome.getPrimary(); - - int w = 144; - int h = 176; - - new ControlText(this, new IArea(0.0F, 4.0F, w, 16.0F), "Genome", TextJustification.MiddleCenter); - - ControlScrollableContent scrollable = new ControlScrollableContent(this, 4.0F, 20.0F, w - 8, h - 8 - 16, 12.0F); - - Control contents = new Control(scrollable, 0.0F, 0.0F, w - 8 - 12, h - 8 - 16); - - int tw = w - 8 - 12; - int w1 = 55; - int w2 = tw - 50; - int y = 0; - int th = 14; - int th2 = 18; - - new ControlText(contents, new IArea(0.0F, y, w1, th), "Temp. : ", TextJustification.MiddleRight); - new ControlText(contents, new IArea(w1, y, w2, th), treeSpecies.getTemperature().getName(), TextJustification.MiddleLeft); - - y += th; - - new ControlText(contents, new IArea(0.0F, y, w1, th), "Moist. : ", TextJustification.MiddleRight); - new ControlText(contents, new IArea(w1, y, w2, th), Binnie.Language.localise(treeSpecies.getMoisture()), TextJustification.MiddleLeft); - - - y += th; - - new ControlText(contents, new IArea(0.0F, y, w1, th), "pH. : ", TextJustification.MiddleRight); - new ControlText(contents, new IArea(w1, y, w2, th), Binnie.Language.localise(treeSpecies.getPH()), TextJustification.MiddleLeft); - - y += th; - - new ControlText(contents, new IArea(0.0F, y, w1, th), "Fertility : ", TextJustification.MiddleRight); - new ControlText(contents, new IArea(w1, y, w2, th), genome.getFertility() + "x", TextJustification.MiddleLeft); - y += th; - - float lifespan = genome.getLifespan() * 68.269997F / genome.getAgeChance() / 24000.0F; - - new ControlText(contents, new IArea(0.0F, y, w1, th), "Lifespan : ", TextJustification.MiddleRight); - new ControlText(contents, new IArea(w1, y, w2, th), "" + String.format("%.2f", new Object[] { Float.valueOf(lifespan) }) + " days", TextJustification.MiddleLeft); - - y += th; - - new ControlText(contents, new IArea(0.0F, y, w1, th), "Nectar : ", TextJustification.MiddleRight); - new ControlText(contents, new IArea(w1, y, w2, th), genome.getActiveAllele(EnumFlowerChromosome.SAPPINESS).getName(), TextJustification.MiddleLeft); - - - y += th; - - int x = w1; - int tot = 0; - for (IIndividual vid : BotanyCore.getFlowerRoot().getIndividualTemplates()) { - if (vid.getGenome().getPrimary() == treeSpecies) - { - if ((tot > 0) && (tot % 3 == 0)) - { - x -= 54; - y += 18; - } - ItemStack stack = BotanyCore.getFlowerRoot().getMemberStack((IFlower)vid, EnumFlowerStage.FLOWER.ordinal()); - ControlItemDisplay display = new ControlItemDisplay(contents, x, y); - display.setItemStack(stack); - tot++; - x += 18; - } - } - int numOfLines = 1 + (tot - 1) / 3; - - new ControlText(contents, new IArea(0.0F, y - (numOfLines - 1) * 18, w1, 4 + 18 * numOfLines), "Varieties : ", TextJustification.MiddleRight); - - - y += th; - - contents.setSize(new IPoint(contents.size().x(), y)); - - scrollable.setScrollableContent(contents); - } - - public static String tolerated(boolean t) - { - if (t) { - return "Tolerated"; - } - return "Not Tolerated"; - } -} diff --git a/src/Java/binnie/craftgui/botany/WindowBotanistDatabase.java b/src/Java/binnie/craftgui/botany/WindowBotanistDatabase.java deleted file mode 100644 index 69a2a291ca..0000000000 --- a/src/Java/binnie/craftgui/botany/WindowBotanistDatabase.java +++ /dev/null @@ -1,103 +0,0 @@ -package binnie.craftgui.botany; - -import binnie.Binnie; -import binnie.botany.Botany; -import binnie.botany.api.IFlowerColour; -import binnie.botany.genetics.EnumFlowerColor; -import binnie.botany.proxy.Proxy; -import binnie.core.AbstractMod; -import binnie.core.genetics.ManagerGenetics; -import binnie.craftgui.controls.listbox.ControlList; -import binnie.craftgui.controls.listbox.ControlListBox; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.geometry.IArea; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.mod.database.DatabaseTab; -import binnie.craftgui.mod.database.IDatabaseMode; -import binnie.craftgui.mod.database.PageBranchOverview; -import binnie.craftgui.mod.database.PageBranchSpecies; -import binnie.craftgui.mod.database.PageBreeder; -import binnie.craftgui.mod.database.PageSpeciesClassification; -import binnie.craftgui.mod.database.PageSpeciesMutations; -import binnie.craftgui.mod.database.PageSpeciesOverview; -import binnie.craftgui.mod.database.PageSpeciesResultant; -import binnie.craftgui.mod.database.WindowAbstractDatabase; -import binnie.craftgui.mod.database.WindowAbstractDatabase.Mode; -import binnie.craftgui.mod.database.WindowAbstractDatabase.ModeWidgets; -import cpw.mods.fml.relauncher.Side; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.entity.player.EntityPlayer; - -public class WindowBotanistDatabase - extends WindowAbstractDatabase -{ - ControlListBox<EnumFlowerColor> selectionBoxColors; - - static enum FlowerMode - implements IDatabaseMode - { - Colour; - - private FlowerMode() {} - - public String getName() - { - return Botany.proxy.localise("gui.database.mode." + name().toLowerCase()); - } - } - - public WindowBotanistDatabase(EntityPlayer player, Side side, boolean nei) - { - super(player, side, nei, Binnie.Genetics.flowerBreedingSystem, 130.0F); - } - - public static Window create(EntityPlayer player, Side side, boolean nei) - { - return new WindowBotanistDatabase(player, side, nei); - } - - protected void addTabs() - { - new PageSpeciesOverview(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(Botany.instance, "species.overview", 0)); - new PageSpeciesFlowerGenome(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(Botany.instance, "species.genome", 0)); - new PageSpeciesClassification(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(Botany.instance, "species.classification", 0)); - new PageSpeciesResultant(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(Botany.instance, "species.resultant", 0)); - new PageSpeciesMutations(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(Botany.instance, "species.further", 0)); - - new PageBranchOverview(getInfoPages(WindowAbstractDatabase.Mode.Branches), new DatabaseTab(Botany.instance, "branches.overview", 0)); - new PageBranchSpecies(getInfoPages(WindowAbstractDatabase.Mode.Branches), new DatabaseTab(Botany.instance, "branches.species", 0)); - - createMode(FlowerMode.Colour, new WindowAbstractDatabase.ModeWidgets(FlowerMode.Colour, this) - { - public void createListBox(IArea area) - { - this.listBox = new ControlListBox(this.modePage, area.x(), area.y(), area.w(), area.h(), 12.0F) - { - public IWidget createOption(IFlowerColour value, int y) - { - return new ControlColourOption((ControlList)getContent(), value, y); - } - }; - List<IFlowerColour> colors = new ArrayList(); - for (IFlowerColour c : EnumFlowerColor.values()) { - colors.add(c); - } - this.listBox.setOptions(colors); - } - }); - new PageColourMixResultant(getInfoPages(FlowerMode.Colour), new DatabaseTab(Botany.instance, "colour.resultant", 0)); - new PageColourMix(getInfoPages(FlowerMode.Colour), new DatabaseTab(Botany.instance, "colour.further", 0)); - new PageBreeder(getInfoPages(WindowAbstractDatabase.Mode.Breeder), getUsername(), new DatabaseTab(Botany.instance, "breeder", 0)); - } - - protected AbstractMod getMod() - { - return Botany.instance; - } - - protected String getName() - { - return "FlowerDatabase"; - } -} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/ControlBlockIconDisplay.java b/src/Java/binnie/craftgui/extratrees/dictionary/ControlBlockIconDisplay.java deleted file mode 100644 index 58b93a2782..0000000000 --- a/src/Java/binnie/craftgui/extratrees/dictionary/ControlBlockIconDisplay.java +++ /dev/null @@ -1,25 +0,0 @@ -package binnie.craftgui.extratrees.dictionary; - -import binnie.craftgui.controls.core.Control; -import binnie.craftgui.core.CraftGUI; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.geometry.IPoint; -import binnie.craftgui.core.renderer.Renderer; -import net.minecraft.util.IIcon; - -public class ControlBlockIconDisplay - extends Control -{ - IIcon icon; - - public ControlBlockIconDisplay(IWidget parent, float x, float y, IIcon icon) - { - super(parent, x, y, 18.0F, 18.0F); - this.icon = icon; - } - - public void onRenderBackground() - { - CraftGUI.Render.iconBlock(IPoint.ZERO, this.icon); - } -} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/ControlBreweryProgress.java b/src/Java/binnie/craftgui/extratrees/dictionary/ControlBreweryProgress.java deleted file mode 100644 index d6d18d3a69..0000000000 --- a/src/Java/binnie/craftgui/extratrees/dictionary/ControlBreweryProgress.java +++ /dev/null @@ -1,115 +0,0 @@ -package binnie.craftgui.extratrees.dictionary; - -import binnie.core.machines.Machine; -import binnie.core.util.ItemStackSet; -import binnie.craftgui.core.Attribute; -import binnie.craftgui.core.CraftGUI; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.geometry.IArea; -import binnie.craftgui.core.geometry.IPoint; -import binnie.craftgui.core.renderer.Renderer; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.minecraft.control.ControlProgressBase; -import binnie.craftgui.resource.Texture; -import binnie.craftgui.resource.minecraft.StandardTexture; -import binnie.extratrees.core.ExtraTreeTexture; -import binnie.extratrees.machines.Brewery; -import binnie.extratrees.machines.Brewery.BreweryCrafting; -import binnie.extratrees.machines.Brewery.ComponentBreweryLogic; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import org.lwjgl.opengl.GL11; - -public class ControlBreweryProgress - extends ControlProgressBase -{ - static Texture Brewery = new StandardTexture(0, 69, 34, 39, ExtraTreeTexture.Gui); - static Texture BreweryOverlay = new StandardTexture(34, 69, 34, 39, ExtraTreeTexture.Gui); - - public void onRenderBackground() - { - CraftGUI.Render.texture(Brewery, new IPoint(0.0F, 0.0F)); - - Brewery.ComponentBreweryLogic logic = (Brewery.ComponentBreweryLogic)Machine.getInterface(Brewery.ComponentBreweryLogic.class, Window.get(this).getInventory()); - if (logic.currentCrafting == null) { - return; - } - if (logic.currentCrafting.currentInput == null) { - return; - } - int fermentedHeight = (int)(32.0F * logic.getProgress() / 100.0F); - - CraftGUI.Render.limitArea(new IArea(new IPoint(1.0F, 6.0F).add(getAbsolutePosition()), new IPoint(32.0F, 32 - fermentedHeight))); - - GL11.glEnable(3089); - - renderFluid(logic.currentCrafting.currentInput, new IPoint(1.0F, 6.0F)); - renderFluid(logic.currentCrafting.currentInput, new IPoint(17.0F, 6.0F)); - renderFluid(logic.currentCrafting.currentInput, new IPoint(1.0F, 22.0F)); - renderFluid(logic.currentCrafting.currentInput, new IPoint(17.0F, 22.0F)); - - GL11.glDisable(3089); - - CraftGUI.Render.limitArea(new IArea(new IPoint(1.0F, 38 - fermentedHeight).add(getAbsolutePosition()), new IPoint(32.0F, fermentedHeight))); - - - GL11.glEnable(3089); - - renderFluid(Brewery.getOutput(logic.currentCrafting), new IPoint(1.0F, 6.0F)); - renderFluid(Brewery.getOutput(logic.currentCrafting), new IPoint(17.0F, 6.0F)); - renderFluid(Brewery.getOutput(logic.currentCrafting), new IPoint(1.0F, 22.0F)); - renderFluid(Brewery.getOutput(logic.currentCrafting), new IPoint(17.0F, 22.0F)); - - GL11.glDisable(3089); - - ItemStackSet stacks = new ItemStackSet(); - for (ItemStack stack : logic.currentCrafting.inputs) { - stacks.add(stack); - } - stacks.add(logic.currentCrafting.ingr); - - int x = 1; - int y = 6; - for (ItemStack stack : stacks) - { - CraftGUI.Render.item(new IPoint(x, y), stack); - x += 16; - if (x > 18) - { - x = 1; - y += 16; - } - } - } - - public void onRenderForeground() {} - - protected ControlBreweryProgress(IWidget parent, float x, float y) - { - super(parent, x, y, 34.0F, 39.0F); - addAttribute(Attribute.MouseOver); - } - - public void renderFluid(FluidStack fluid, IPoint pos) - { - int hex = fluid.getFluid().getColor(fluid); - - int r = (hex & 0xFF0000) >> 16; - int g = (hex & 0xFF00) >> 8; - int b = hex & 0xFF; - - IIcon icon = fluid.getFluid().getIcon(); - - GL11.glColor4f(r / 255.0F, g / 255.0F, b / 255.0F, 1.0F); - - GL11.glEnable(3042); - - GL11.glBlendFunc(770, 771); - - CraftGUI.Render.iconBlock(pos, fluid.getFluid().getIcon()); - - GL11.glDisable(3042); - } -} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/ControlDistilleryProgress.java b/src/Java/binnie/craftgui/extratrees/dictionary/ControlDistilleryProgress.java deleted file mode 100644 index 5a44b09ca3..0000000000 --- a/src/Java/binnie/craftgui/extratrees/dictionary/ControlDistilleryProgress.java +++ /dev/null @@ -1,104 +0,0 @@ -package binnie.craftgui.extratrees.dictionary; - -import binnie.core.machines.Machine; -import binnie.craftgui.core.CraftGUI; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.geometry.IArea; -import binnie.craftgui.core.geometry.IPoint; -import binnie.craftgui.core.geometry.Position; -import binnie.craftgui.core.renderer.Renderer; -import binnie.craftgui.events.EventMouse.Down; -import binnie.craftgui.events.EventMouse.Down.Handler; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.minecraft.control.ControlProgressBase; -import binnie.craftgui.resource.Texture; -import binnie.craftgui.resource.minecraft.StandardTexture; -import binnie.extratrees.core.ExtraTreeTexture; -import binnie.extratrees.machines.Distillery.ComponentDistilleryLogic; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.IIcon; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import org.lwjgl.opengl.GL11; - -public class ControlDistilleryProgress - extends ControlProgressBase -{ - static Texture DistilleryBase = new StandardTexture(43, 0, 58, 66, ExtraTreeTexture.Gui); - static Texture DistilleryOverlay = new StandardTexture(139, 0, 18, 66, ExtraTreeTexture.Gui); - static Texture LiquidFlow = new StandardTexture(101, 0, 38, 66, ExtraTreeTexture.Gui); - static Texture Output = new StandardTexture(68, 66, 17, 7, ExtraTreeTexture.Gui); - - public void onRenderBackground() - { - CraftGUI.Render.texture(DistilleryBase, new IPoint(0.0F, 0.0F)); - CraftGUI.Render.texturePercentage(LiquidFlow, new IArea(18.0F, 0.0F, 38.0F, 66.0F), Position.Left, this.progress); - - Distillery.ComponentDistilleryLogic component = (Distillery.ComponentDistilleryLogic)Machine.getInterface(Distillery.ComponentDistilleryLogic.class, Window.get(this).getInventory()); - - - FluidStack stack = null; - if (component != null) { - stack = component.currentFluid; - } - if (stack != null) { - for (int y = 0; y < 4; y++) { - renderFluid(stack, new IPoint(1.0F, 1 + y * 16)); - } - } - } - - public void onRenderForeground() - { - int level = ((Distillery.ComponentDistilleryLogic)Machine.getInterface(Distillery.ComponentDistilleryLogic.class, Window.get(this).getInventory())).level; - CraftGUI.Render.texture(Output, new IPoint(47.0F, 14 + level * 15)); - CraftGUI.Render.texture(DistilleryOverlay, new IPoint(0.0F, 0.0F)); - } - - protected ControlDistilleryProgress(IWidget parent, float x, float y) - { - super(parent, x, y, 58.0F, 66.0F); - - addSelfEventHandler(new EventMouse.Down.Handler() - { - public void onEvent(EventMouse.Down event) - { - int distillationLevel = -1; - if (new IArea(45.0F, 8.0F, 19.0F, 11.0F).contains(ControlDistilleryProgress.this.getRelativeMousePosition())) { - distillationLevel = 0; - } else if (new IArea(45.0F, 23.0F, 19.0F, 11.0F).contains(ControlDistilleryProgress.this.getRelativeMousePosition())) { - distillationLevel = 1; - } else if (new IArea(45.0F, 38.0F, 19.0F, 11.0F).contains(ControlDistilleryProgress.this.getRelativeMousePosition())) { - distillationLevel = 2; - } - if (distillationLevel >= 0) - { - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setByte("i", (byte)distillationLevel); - Window.get(ControlDistilleryProgress.this.getWidget()).sendClientAction("still-level", nbt); - } - } - }); - } - - public void renderFluid(FluidStack fluid, IPoint pos) - { - int hex = fluid.getFluid().getColor(fluid); - - int r = (hex & 0xFF0000) >> 16; - int g = (hex & 0xFF00) >> 8; - int b = hex & 0xFF; - - IIcon icon = fluid.getFluid().getIcon(); - - GL11.glColor4f(r / 255.0F, g / 255.0F, b / 255.0F, 1.0F); - - GL11.glEnable(3042); - - GL11.glBlendFunc(770, 771); - - CraftGUI.Render.iconBlock(pos, fluid.getFluid().getIcon()); - - GL11.glDisable(3042); - } -} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/ControlFruitPressProgress.java b/src/Java/binnie/craftgui/extratrees/dictionary/ControlFruitPressProgress.java deleted file mode 100644 index 79d21a3025..0000000000 --- a/src/Java/binnie/craftgui/extratrees/dictionary/ControlFruitPressProgress.java +++ /dev/null @@ -1,90 +0,0 @@ -package binnie.craftgui.extratrees.dictionary; - -import binnie.craftgui.core.Attribute; -import binnie.craftgui.core.CraftGUI; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.geometry.IPoint; -import binnie.craftgui.core.renderer.Renderer; -import binnie.craftgui.events.EventMouse.Down; -import binnie.craftgui.events.EventMouse.Down.Handler; -import binnie.craftgui.minecraft.ContainerCraftGUI; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.minecraft.control.ControlProgressBase; -import binnie.craftgui.resource.Texture; -import binnie.craftgui.resource.minecraft.StandardTexture; -import binnie.extratrees.core.ExtraTreeTexture; -import binnie.extratrees.machines.Press; -import net.minecraft.inventory.Slot; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.IIcon; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import org.lwjgl.opengl.GL11; - -public class ControlFruitPressProgress - extends ControlProgressBase -{ - static Texture PressTexture = new StandardTexture(6, 0, 24, 52, ExtraTreeTexture.Gui); - static Texture PressSlot = new StandardTexture(9, 52, 34, 17, ExtraTreeTexture.Gui); - - public void onRenderBackground() - { - CraftGUI.Render.texture(PressSlot, new IPoint(3.0F, 52.0F)); - - ItemStack input = Window.get(this).getContainer().getSlotFromInventory(Window.get(this).getInventory(), Press.slotCurrent).getStack(); - if ((input == null) || (Press.getOutput(input) == null)) { - return; - } - Fluid fluid = Press.getOutput(input).getFluid(); - - int hex = fluid.getColor(Press.getOutput(input)); - - int r = (hex & 0xFF0000) >> 16; - int g = (hex & 0xFF00) >> 8; - int b = hex & 0xFF; - - IIcon icon = fluid.getIcon(); - - GL11.glColor4f(r / 255.0F, g / 255.0F, b / 255.0F, 1.0F); - - GL11.glEnable(3042); - - GL11.glBlendFunc(770, 771); - - CraftGUI.Render.iconBlock(new IPoint(4.0F, 52.0F), fluid.getIcon()); - - GL11.glDisable(3042); - - icon = input.getIconIndex(); - CraftGUI.Render.iconItem(new IPoint(4.0F, 52.0F), icon); - } - - public void onRenderForeground() - { - CraftGUI.Render.texture(PressTexture, new IPoint(0.0F, 16.0F * this.progress)); - } - - protected ControlFruitPressProgress(IWidget parent, float x, float y) - { - super(parent, x, y, 37.0F, 69.0F); - addAttribute(Attribute.MouseOver); - - addSelfEventHandler(new EventMouse.Down.Handler() - { - public void onEvent(EventMouse.Down event) - { - if (event.getButton() == 0) - { - NBTTagCompound action = new NBTTagCompound(); - Window.get(ControlFruitPressProgress.this.getWidget()).sendClientAction("fruitpress-click", action); - } - else if (event.getButton() == 1) - { - NBTTagCompound action = new NBTTagCompound(); - Window.get(ControlFruitPressProgress.this.getWidget()).sendClientAction("clear-fruit", action); - } - } - }); - } -} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/ControlLumbermillProgress.java b/src/Java/binnie/craftgui/extratrees/dictionary/ControlLumbermillProgress.java deleted file mode 100644 index b315c23927..0000000000 --- a/src/Java/binnie/craftgui/extratrees/dictionary/ControlLumbermillProgress.java +++ /dev/null @@ -1,96 +0,0 @@ -package binnie.craftgui.extratrees.dictionary; - -import binnie.craftgui.core.CraftGUI; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.geometry.IArea; -import binnie.craftgui.core.geometry.IPoint; -import binnie.craftgui.core.renderer.Renderer; -import binnie.craftgui.minecraft.MinecraftGUI.PanelType; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.minecraft.control.ControlProgressBase; -import binnie.craftgui.resource.Texture; -import binnie.craftgui.resource.minecraft.StandardTexture; -import binnie.craftgui.window.Panel; -import binnie.extratrees.core.ExtraTreeTexture; -import binnie.extratrees.machines.Lumbermill; -import net.minecraft.block.Block; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import org.lwjgl.opengl.GL11; - -public class ControlLumbermillProgress - extends ControlProgressBase -{ - public void onUpdateClient() - { - super.onUpdateClient(); - if (this.oldProgress != this.progress) - { - this.oldProgress = this.progress; - this.animation += 5.0F; - } - } - - float oldProgress = 0.0F; - float animation = 0.0F; - static Texture Saw = new StandardTexture(0, 0, 6, 32, ExtraTreeTexture.Gui); - static Texture Saw2 = new StandardTexture(2, 0, 4, 32, ExtraTreeTexture.Gui); - - public void onRenderForeground() - { - GL11.glDisable(2896); - int sawX = (int)(63.0F * this.progress); - - CraftGUI.Render.texture(Saw, new IPoint(sawX, -8.0F + 6.0F * (float)Math.sin(this.animation))); - - ItemStack item = Window.get(this).getInventory().getStackInSlot(Lumbermill.slotWood); - if (item == null) { - return; - } - GL11.glDisable(2896); - - Block block = null; - if ((item.getItem() instanceof ItemBlock)) { - block = ((ItemBlock)item.getItem()).field_150939_a; - } - if (block == null) { - return; - } - IIcon icon = block.getIcon(2, item.getItemDamage()); - for (int i = 0; i < 4; i++) { - CraftGUI.Render.iconBlock(new IPoint(1 + i * 16, 1.0F), icon); - } - ItemStack result = Lumbermill.getPlankProduct(item); - if (result == null) { - return; - } - Block block2 = null; - if ((item.getItem() instanceof ItemBlock)) { - block2 = ((ItemBlock)result.getItem()).field_150939_a; - } - if (block2 == null) { - return; - } - IIcon icon2 = block2.getIcon(2, result.getItemDamage()); - - IPoint size = getSize(); - IPoint pos = getAbsolutePosition(); - CraftGUI.Render.limitArea(new IArea(pos.add(new IPoint(0.0F, 0.0F)), new IPoint(this.progress * 64.0F + 2.0F, 18.0F))); - - GL11.glEnable(3089); - for (int i = 0; i < 4; i++) { - CraftGUI.Render.iconBlock(new IPoint(1 + i * 16, 1.0F), icon2); - } - GL11.glDisable(3089); - - CraftGUI.Render.texture(Saw2, new IPoint(sawX + 2, -8.0F + 6.0F * (float)Math.sin(this.animation))); - } - - protected ControlLumbermillProgress(IWidget parent, float x, float y) - { - super(parent, x, y, 66.0F, 18.0F); - new Panel(this, 0.0F, 0.0F, 66.0F, 18.0F, MinecraftGUI.PanelType.Black); - } -} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/ControlRecipeSlot.java b/src/Java/binnie/craftgui/extratrees/dictionary/ControlRecipeSlot.java deleted file mode 100644 index d65e825cb8..0000000000 --- a/src/Java/binnie/craftgui/extratrees/dictionary/ControlRecipeSlot.java +++ /dev/null @@ -1,42 +0,0 @@ -package binnie.craftgui.extratrees.dictionary; - -import binnie.core.machines.Machine; -import binnie.core.machines.TileEntityMachine; -import binnie.core.machines.component.IComponentRecipe; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.events.EventMouse.Down; -import binnie.craftgui.events.EventMouse.Down.Handler; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.minecraft.control.ControlSlotBase; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.tileentity.TileEntity; - -public class ControlRecipeSlot - extends ControlSlotBase -{ - public ControlRecipeSlot(IWidget parent, int x, int y) - { - super(parent, x, y, 50); - - addSelfEventHandler(new EventMouse.Down.Handler() - { - public void onEvent(EventMouse.Down event) - { - TileEntity tile = (TileEntity)Window.get(ControlRecipeSlot.this.getWidget()).getInventory(); - if ((tile == null) || (!(tile instanceof TileEntityMachine))) { - return; - } - NBTTagCompound nbt = new NBTTagCompound(); - Window.get(ControlRecipeSlot.this.getWidget()).sendClientAction("recipe", nbt); - } - }); - setRotating(); - } - - public ItemStack getItemStack() - { - IComponentRecipe recipe = (IComponentRecipe)Machine.getInterface(IComponentRecipe.class, Window.get(this).getInventory()); - return recipe.isRecipe() ? recipe.getProduct() : null; - } -} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/ControlTileSelect.java b/src/Java/binnie/craftgui/extratrees/dictionary/ControlTileSelect.java deleted file mode 100644 index cc5c79c529..0000000000 --- a/src/Java/binnie/craftgui/extratrees/dictionary/ControlTileSelect.java +++ /dev/null @@ -1,197 +0,0 @@ -package binnie.craftgui.extratrees.dictionary; - -import binnie.Binnie; -import binnie.core.BinnieCore; -import binnie.core.language.ManagerLanguage; -import binnie.core.machines.Machine; -import binnie.core.machines.TileEntityMachine; -import binnie.craftgui.controls.ControlText; -import binnie.craftgui.controls.core.Control; -import binnie.craftgui.controls.core.IControlValue; -import binnie.craftgui.controls.scroll.IControlScrollable; -import binnie.craftgui.core.Attribute; -import binnie.craftgui.core.CraftGUI; -import binnie.craftgui.core.ITooltip; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.Tooltip; -import binnie.craftgui.core.geometry.IArea; -import binnie.craftgui.core.geometry.IPoint; -import binnie.craftgui.core.renderer.Renderer; -import binnie.craftgui.events.EventMouse.Down; -import binnie.craftgui.events.EventMouse.Down.Handler; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.resource.minecraft.CraftGUITexture; -import binnie.extratrees.api.CarpentryManager; -import binnie.extratrees.api.ICarpentryInterface; -import binnie.extratrees.api.IDesign; -import binnie.extratrees.api.IDesignCategory; -import binnie.extratrees.carpentry.EnumDesign; -import binnie.extratrees.machines.Designer.ComponentWoodworkerRecipe; -import binnie.extratrees.machines.DesignerType; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -public class ControlTileSelect - extends Control - implements IControlValue<IDesign>, IControlScrollable -{ - public static class ControlTile - extends Control - implements IControlValue<IDesign>, ITooltip - { - IDesign value; - - protected ControlTile(IWidget parent, float x, float y, IDesign value) - { - super(x, y, 18.0F, 18.0F); - setValue(value); - addAttribute(Attribute.MouseOver); - - addSelfEventHandler(new EventMouse.Down.Handler() - { - public void onEvent(EventMouse.Down event) - { - TileEntityMachine tile = (TileEntityMachine)Window.get(ControlTileSelect.ControlTile.this.getWidget()).getInventory(); - if (tile == null) { - return; - } - Designer.ComponentWoodworkerRecipe recipe = (Designer.ComponentWoodworkerRecipe)tile.getMachine().getComponent(Designer.ComponentWoodworkerRecipe.class); - - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setShort("d", (short)CarpentryManager.carpentryInterface.getDesignIndex(ControlTileSelect.ControlTile.this.getValue())); - - Window.get(ControlTileSelect.ControlTile.this.getWidget()).sendClientAction("design", nbt); - } - }); - } - - public void getTooltip(Tooltip tooltip) - { - tooltip.add(Binnie.Language.localise(BinnieCore.instance, "gui.designer.pattern", new Object[] { getValue().getName() })); - } - - public IDesign getValue() - { - return this.value; - } - - public void onRenderBackground() - { - CraftGUI.Render.texture(CraftGUITexture.Slot, IPoint.ZERO); - } - - public void onRenderForeground() - { - ItemStack image = ((WindowWoodworker)getSuperParent()).getDesignerType().getDisplayStack(getValue()); - CraftGUI.Render.item(new IPoint(1.0F, 1.0F), image); - if (((IControlValue)getParent()).getValue() != getValue()) { - if (Window.get(this).getMousedOverWidget() == this) { - CraftGUI.Render.gradientRect(getArea().inset(1), 1157627903, 1157627903); - } else { - CraftGUI.Render.gradientRect(getArea().inset(1), -1433892728, -1433892728); - } - } - } - - public void setValue(IDesign value) - { - this.value = value; - } - } - - IDesign value = EnumDesign.Blank; - float shownHeight = 92.0F; - - protected ControlTileSelect(IWidget parent, float x, float y) - { - super(parent, x, y, 102.0F, 20 * (CarpentryManager.carpentryInterface.getSortedDesigns().size() / 4) + 22); - - refresh(""); - } - - public float getPercentageIndex() - { - return 0.0F; - } - - public float getPercentageShown() - { - return 0.0F; - } - - public IDesign getValue() - { - return this.value; - } - - public void movePercentage(float percentage) {} - - public void onUpdateClient() - { - super.onUpdateClient(); - TileEntityMachine tile = (TileEntityMachine)Window.get(this).getInventory(); - if (tile == null) { - return; - } - Designer.ComponentWoodworkerRecipe recipe = (Designer.ComponentWoodworkerRecipe)tile.getMachine().getComponent(Designer.ComponentWoodworkerRecipe.class); - - setValue(recipe.getDesign()); - } - - public void refresh(String filterText) - { - deleteAllChildren(); - int cx = 2; - int cy = 2; - - Map<IDesignCategory, List<IDesign>> designs = new HashMap(); - for (IDesignCategory category : CarpentryManager.carpentryInterface.getAllDesignCategories()) - { - designs.put(category, new ArrayList()); - for (IDesign tile : category.getDesigns()) { - if ((filterText == "") || (tile.getName().toLowerCase().contains(filterText))) { - ((List)designs.get(category)).add(tile); - } - } - if (((List)designs.get(category)).isEmpty()) { - designs.remove(category); - } - } - for (IDesignCategory category : designs.keySet()) - { - cx = 2; - new ControlText(this, new IPoint(cx, cy + 3), category.getName()); - cy += 16; - for (IDesign tile : (List)designs.get(category)) - { - if (cx > 90) - { - cx = 2; - cy += 20; - } - new ControlTile(this, cx, cy, tile); - cx += 20; - } - cy += 20; - } - int height = cy; - - setSize(new IPoint(getSize().x(), height)); - } - - public void setPercentageIndex(float index) {} - - public void setValue(IDesign value) - { - this.value = value; - } - - public float getMovementRange() - { - return 0.0F; - } -} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/DialogBreweryRecipe.java b/src/Java/binnie/craftgui/extratrees/dictionary/DialogBreweryRecipe.java deleted file mode 100644 index f761aaea29..0000000000 --- a/src/Java/binnie/craftgui/extratrees/dictionary/DialogBreweryRecipe.java +++ /dev/null @@ -1,17 +0,0 @@ -package binnie.craftgui.extratrees.dictionary; - -import binnie.craftgui.core.IWidget; -import binnie.craftgui.minecraft.Dialog; - -public class DialogBreweryRecipe - extends Dialog -{ - public DialogBreweryRecipe(IWidget parent, float w, float h) - { - super(parent, w, h); - } - - public void initialise() {} - - public void onClose() {} -} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/PageFruit.java b/src/Java/binnie/craftgui/extratrees/dictionary/PageFruit.java deleted file mode 100644 index c6983deef9..0000000000 --- a/src/Java/binnie/craftgui/extratrees/dictionary/PageFruit.java +++ /dev/null @@ -1,47 +0,0 @@ -package binnie.craftgui.extratrees.dictionary; - -import binnie.core.genetics.TreeBreedingSystem; -import binnie.craftgui.controls.ControlText; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.geometry.IArea; -import binnie.craftgui.core.geometry.IPoint; -import binnie.craftgui.core.geometry.TextJustification; -import binnie.craftgui.mod.database.ControlSpeciesBox; -import binnie.craftgui.mod.database.DatabaseTab; -import binnie.craftgui.mod.database.PageAbstract; -import binnie.craftgui.mod.database.WindowAbstractDatabase; -import binnie.extratrees.ExtraTrees; -import binnie.extratrees.proxy.Proxy; -import forestry.api.genetics.IAlleleSpecies; -import java.util.Collection; -import net.minecraft.item.ItemStack; - -public class PageFruit - extends PageAbstract<ItemStack> -{ - boolean treesThatBearFruit; - - public PageFruit(IWidget parent, DatabaseTab tab, boolean treesThatBearFruit) - { - super(parent, tab); - this.treesThatBearFruit = treesThatBearFruit; - } - - public void onValueChanged(ItemStack species) - { - deleteAllChildren(); - WindowAbstractDatabase database = (WindowAbstractDatabase)WindowAbstractDatabase.get(this); - new ControlText(this, new IArea(0.0F, 0.0F, size().x(), 24.0F), ExtraTrees.proxy.localise("gui.database.tab.fruit." + (this.treesThatBearFruit ? "natural" : "potential")), TextJustification.MiddleCenter); - - - Collection<IAlleleSpecies> trees = this.treesThatBearFruit ? ((TreeBreedingSystem)database.getBreedingSystem()).getTreesThatBearFruit(species, database.isNEI(), database.getWorld(), database.getUsername()) : ((TreeBreedingSystem)database.getBreedingSystem()).getTreesThatCanBearFruit(species, database.isNEI(), database.getWorld(), database.getUsername()); - - - - - - - - new ControlSpeciesBox(this, 4.0F, 24.0F, size().x() - 8.0F, size().y() - 4.0F - 24.0F).setOptions(trees); - } -} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/PagePlanksOverview.java b/src/Java/binnie/craftgui/extratrees/dictionary/PagePlanksOverview.java deleted file mode 100644 index f27fa6967b..0000000000 --- a/src/Java/binnie/craftgui/extratrees/dictionary/PagePlanksOverview.java +++ /dev/null @@ -1,103 +0,0 @@ -package binnie.craftgui.extratrees.dictionary; - -import binnie.core.BinnieCore; -import binnie.core.proxy.BinnieProxy; -import binnie.craftgui.controls.ControlText; -import binnie.craftgui.core.CraftGUI; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.geometry.IArea; -import binnie.craftgui.core.geometry.IPoint; -import binnie.craftgui.core.geometry.TextJustification; -import binnie.craftgui.core.renderer.Renderer; -import binnie.craftgui.minecraft.control.ControlItemDisplay; -import binnie.craftgui.mod.database.DatabaseTab; -import binnie.craftgui.mod.database.PageAbstract; -import binnie.craftgui.mod.database.WindowAbstractDatabase; -import binnie.extratrees.ExtraTrees; -import binnie.extratrees.block.DoorType; -import binnie.extratrees.block.IPlankType; -import binnie.extratrees.block.WoodManager; -import binnie.extratrees.block.decor.FenceType; -import binnie.extratrees.proxy.Proxy; -import net.minecraft.item.ItemStack; - -public class PagePlanksOverview - extends PageAbstract<ItemStack> -{ - public PagePlanksOverview(IWidget parent, DatabaseTab tab) - { - super(parent, tab); - } - - public void onValueChanged(ItemStack species) - { - deleteAllChildren(); - WindowAbstractDatabase database = (WindowAbstractDatabase)WindowAbstractDatabase.get(this); - new ControlText(this, new IArea(0.0F, 0.0F, size().x(), 24.0F), species.getDisplayName(), TextJustification.MiddleCenter); - - - - new ControlText(this, new IArea(12.0F, 24.0F, size().x() - 24.0F, 24.0F), ExtraTrees.proxy.localise("gui.database.planks.use"), TextJustification.MiddleLeft); - - - IPlankType type = WoodManager.get(species); - - int x = 12; - if (type != null) - { - ItemStack fence = WoodManager.getFence(type, new FenceType(0), 1); - ItemStack gate = WoodManager.getGate(type); - ItemStack door = WoodManager.getDoor(type, DoorType.Standard); - if (fence != null) - { - new ControlItemDisplay(this, x, 48.0F).setItemStack(fence); - x += 22; - } - if (gate != null) - { - new ControlItemDisplay(this, x, 48.0F).setItemStack(gate); - x += 22; - } - if (door != null) - { - new ControlItemDisplay(this, x, 48.0F).setItemStack(door); - x += 22; - } - } - ControlText controlDescription = new ControlText(this, new IArea(8.0F, 84.0F, getSize().x() - 16.0F, 0.0F), "", TextJustification.MiddleCenter); - - - ControlText controlSignature = new ControlText(this, new IArea(8.0F, 84.0F, getSize().x() - 16.0F, 0.0F), "", TextJustification.BottomRight); - - - - String desc = ""; - if (type != null) { - desc = type.getDescription(); - } - String descBody = "§o"; - String descSig = ""; - if ((desc == null) || (desc.length() == 0)) - { - descBody = descBody + BinnieCore.proxy.localise("gui.database.nodescription"); - } - else - { - String[] descStrings = desc.split("\\|"); - descBody = descBody + descStrings[0]; - for (int i = 1; i < descStrings.length - 1; i++) { - descBody = descBody + " " + descStrings[i]; - } - if (descStrings.length > 1) { - descSig = descSig + descStrings[(descStrings.length - 1)]; - } - } - controlDescription.setValue(descBody + "§r"); - controlSignature.setValue(descSig + "§r"); - - float descHeight = CraftGUI.Render.textHeight(controlDescription.getValue(), controlDescription.getSize().x()); - - - controlSignature.setPosition(new IPoint(controlSignature.pos().x(), controlDescription.getPosition().y() + descHeight + 10.0F)); - } -} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/PagePlanksTrees.java b/src/Java/binnie/craftgui/extratrees/dictionary/PagePlanksTrees.java deleted file mode 100644 index 8702edbe95..0000000000 --- a/src/Java/binnie/craftgui/extratrees/dictionary/PagePlanksTrees.java +++ /dev/null @@ -1,40 +0,0 @@ -package binnie.craftgui.extratrees.dictionary; - -import binnie.core.genetics.TreeBreedingSystem; -import binnie.craftgui.controls.ControlText; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.geometry.IArea; -import binnie.craftgui.core.geometry.IPoint; -import binnie.craftgui.core.geometry.TextJustification; -import binnie.craftgui.mod.database.ControlSpeciesBox; -import binnie.craftgui.mod.database.DatabaseTab; -import binnie.craftgui.mod.database.PageAbstract; -import binnie.craftgui.mod.database.WindowAbstractDatabase; -import forestry.api.genetics.IAlleleSpecies; -import java.util.Collection; -import net.minecraft.item.ItemStack; - -public class PagePlanksTrees - extends PageAbstract<ItemStack> -{ - public PagePlanksTrees(IWidget parent, DatabaseTab tab) - { - super(parent, tab); - } - - public void onValueChanged(ItemStack species) - { - deleteAllChildren(); - WindowAbstractDatabase database = (WindowAbstractDatabase)WindowAbstractDatabase.get(this); - new ControlText(this, new IArea(0.0F, 0.0F, size().x(), 24.0F), species.getDisplayName(), TextJustification.MiddleCenter); - - - - Collection<IAlleleSpecies> trees = ((TreeBreedingSystem)database.getBreedingSystem()).getTreesThatMakePlanks(species, database.isNEI(), database.getWorld(), database.getUsername()); - - - - - new ControlSpeciesBox(this, 4.0F, 24.0F, size().x() - 8.0F, size().y() - 4.0F - 24.0F).setOptions(trees); - } -} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/PageSpeciesImage.java b/src/Java/binnie/craftgui/extratrees/dictionary/PageSpeciesImage.java deleted file mode 100644 index d6fd929447..0000000000 --- a/src/Java/binnie/craftgui/extratrees/dictionary/PageSpeciesImage.java +++ /dev/null @@ -1,31 +0,0 @@ -package binnie.craftgui.extratrees.dictionary; - -import binnie.craftgui.controls.ControlTextCentered; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.minecraft.MinecraftGUI.PanelType; -import binnie.craftgui.mod.database.ControlDatabaseIndividualDisplay; -import binnie.craftgui.mod.database.DatabaseTab; -import binnie.craftgui.mod.database.EnumDiscoveryState; -import binnie.craftgui.mod.database.PageSpecies; -import binnie.craftgui.window.Panel; -import forestry.api.genetics.IAlleleSpecies; - -public class PageSpeciesImage - extends PageSpecies -{ - ControlDatabaseIndividualDisplay display; - - public PageSpeciesImage(IWidget parent, DatabaseTab tab) - { - super(parent, tab); - new Panel(this, 7.0F, 25.0F, 130.0F, 120.0F, MinecraftGUI.PanelType.Gray); - this.display = new ControlDatabaseIndividualDisplay(this, 12.0F, 25.0F, 120.0F); - this.display.hastooltip = false; - new ControlTextCentered(this, 8.0F, ((DatabaseTab)getValue()).toString()); - } - - public void onValueChanged(IAlleleSpecies species) - { - this.display.setSpecies(species, EnumDiscoveryState.Show); - } -} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/PageSpeciesTreeGenome.java b/src/Java/binnie/craftgui/extratrees/dictionary/PageSpeciesTreeGenome.java deleted file mode 100644 index 22a1a67b29..0000000000 --- a/src/Java/binnie/craftgui/extratrees/dictionary/PageSpeciesTreeGenome.java +++ /dev/null @@ -1,175 +0,0 @@ -package binnie.craftgui.extratrees.dictionary; - -import binnie.Binnie; -import binnie.core.BinnieCore; -import binnie.core.genetics.BreedingSystem; -import binnie.core.genetics.ManagerGenetics; -import binnie.core.proxy.BinnieProxy; -import binnie.craftgui.controls.ControlText; -import binnie.craftgui.controls.core.Control; -import binnie.craftgui.controls.scroll.ControlScrollableContent; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.geometry.IArea; -import binnie.craftgui.core.geometry.IPoint; -import binnie.craftgui.core.geometry.TextJustification; -import binnie.craftgui.minecraft.control.ControlItemDisplay; -import binnie.craftgui.mod.database.DatabaseTab; -import binnie.craftgui.mod.database.PageSpecies; -import binnie.extratrees.ExtraTrees; -import binnie.extratrees.proxy.Proxy; -import forestry.api.arboriculture.EnumTreeChromosome; -import forestry.api.arboriculture.IAlleleTreeSpecies; -import forestry.api.arboriculture.IFruitProvider; -import forestry.api.arboriculture.IGrowthProvider; -import forestry.api.arboriculture.ITree; -import forestry.api.arboriculture.ITreeGenome; -import forestry.api.arboriculture.ITreeRoot; -import forestry.api.core.EnumTemperature; -import forestry.api.core.ForestryAPI; -import forestry.api.core.ITextureManager; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IAlleleSpecies; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraftforge.common.EnumPlantType; - -public class PageSpeciesTreeGenome - extends PageSpecies -{ - public PageSpeciesTreeGenome(IWidget parent, DatabaseTab tab) - { - super(parent, tab); - } - - public void onValueChanged(IAlleleSpecies species) - { - deleteAllChildren(); - IAllele[] template = Binnie.Genetics.getTreeRoot().getTemplate(species.getUID()); - if (template == null) { - return; - } - ITree tree = Binnie.Genetics.getTreeRoot().templateAsIndividual(template); - if (tree == null) { - return; - } - ITreeGenome genome = tree.getGenome(); - IAlleleTreeSpecies treeSpecies = genome.getPrimary(); - - int w = 144; - int h = 176; - - new ControlText(this, new IArea(0.0F, 4.0F, w, 16.0F), ((DatabaseTab)getValue()).toString(), TextJustification.MiddleCenter); - - ControlScrollableContent scrollable = new ControlScrollableContent(this, 4.0F, 20.0F, w - 8, h - 8 - 16, 12.0F); - - Control contents = new Control(scrollable, 0.0F, 0.0F, w - 8 - 12, h - 8 - 16); - - int tw = w - 8 - 12; - int w1 = 65; - int w2 = tw - 50; - int y = 0; - int th = 14; - int th2 = 18; - - BreedingSystem syst = Binnie.Genetics.treeBreedingSystem; - - new ControlText(contents, new IArea(0.0F, y, w1, th), syst.getChromosomeShortName(EnumTreeChromosome.PLANT) + " : ", TextJustification.MiddleRight); - new ControlText(contents, new IArea(w1, y, w2, th), treeSpecies.getPlantType().toString(), TextJustification.MiddleLeft); - - y += th; - - new ControlText(contents, new IArea(0.0F, y, w1, th), BinnieCore.proxy.localise("gui.temperature.short") + " : ", TextJustification.MiddleRight); - new ControlText(contents, new IArea(w1, y, w2, th), treeSpecies.getTemperature().getName(), TextJustification.MiddleLeft); - - y += th; - - IIcon leaf = ForestryAPI.textureManager.getIcon(treeSpecies.getLeafIconIndex(tree, false)); - - IIcon fruit = null; - int fruitColour = 16777215; - try - { - fruit = ForestryAPI.textureManager.getIcon(genome.getFruitProvider().getIconIndex(genome, null, 0, 0, 0, 100, false)); - fruitColour = genome.getFruitProvider().getColour(genome, null, 0, 0, 0, 100); - } - catch (Exception e) {} - if (leaf != null) - { - new ControlText(contents, new IArea(0.0F, y, w1, th2), ExtraTrees.proxy.localise("gui.database.leaves") + " : ", TextJustification.MiddleRight); - - new ControlBlockIconDisplay(contents, w1, y, leaf).setColour(treeSpecies.getLeafColour(tree)); - if ((fruit != null) && (!treeSpecies.getUID().equals("forestry.treeOak"))) { - new ControlBlockIconDisplay(contents, w1, y, fruit).setColour(fruitColour); - } - y += th2; - } - ItemStack log = treeSpecies.getLogStacks().length > 0 ? treeSpecies.getLogStacks()[0] : null; - if (log != null) - { - new ControlText(contents, new IArea(0.0F, y, w1, th2), ExtraTrees.proxy.localise("gui.database.log") + " : ", TextJustification.MiddleRight); - - ControlItemDisplay display = new ControlItemDisplay(contents, w1, y); - display.setItemStack(log); - display.setTooltip(); - - y += th2; - } - new ControlText(contents, new IArea(0.0F, y, w1, th), syst.getChromosomeShortName(EnumTreeChromosome.GROWTH) + " : ", TextJustification.MiddleRight); - new ControlText(contents, new IArea(w1, y, w2, th), genome.getGrowthProvider().getDescription(), TextJustification.MiddleLeft); - y += th; - - new ControlText(contents, new IArea(0.0F, y, w1, th), syst.getChromosomeShortName(EnumTreeChromosome.HEIGHT) + " : ", TextJustification.MiddleRight); - new ControlText(contents, new IArea(w1, y, w2, th), genome.getHeight() + "x", TextJustification.MiddleLeft); - y += th; - - new ControlText(contents, new IArea(0.0F, y, w1, th), syst.getChromosomeShortName(EnumTreeChromosome.FERTILITY) + " : ", TextJustification.MiddleRight); - new ControlText(contents, new IArea(w1, y, w2, th), genome.getFertility() + "x", TextJustification.MiddleLeft); - y += th; - - List<ItemStack> fruits = new ArrayList(); - for (ItemStack stack : genome.getFruitProvider().getProducts()) { - fruits.add(stack); - } - if (!fruits.isEmpty()) - { - new ControlText(contents, new IArea(0.0F, y, w1, th2), syst.getChromosomeShortName(EnumTreeChromosome.FRUITS) + " : ", TextJustification.MiddleRight); - for (ItemStack fruitw : fruits) - { - ControlItemDisplay display = new ControlItemDisplay(contents, w1, y); - display.setItemStack(fruitw); - display.setTooltip(); - - y += th2; - } - } - new ControlText(contents, new IArea(0.0F, y, w1, th), syst.getChromosomeShortName(EnumTreeChromosome.YIELD) + " : ", TextJustification.MiddleRight); - new ControlText(contents, new IArea(w1, y, w2, th), genome.getYield() + "x", TextJustification.MiddleLeft); - y += th; - - new ControlText(contents, new IArea(0.0F, y, w1, th), syst.getChromosomeShortName(EnumTreeChromosome.SAPPINESS) + " : ", TextJustification.MiddleRight); - new ControlText(contents, new IArea(w1, y, w2, th), genome.getSappiness() + "x", TextJustification.MiddleLeft); - y += th; - - new ControlText(contents, new IArea(0.0F, y, w1, th), syst.getChromosomeShortName(EnumTreeChromosome.MATURATION) + " : ", TextJustification.MiddleRight); - new ControlText(contents, new IArea(w1, y, w2, th), genome.getMaturationTime() + "x", TextJustification.MiddleLeft); - y += th; - - new ControlText(contents, new IArea(0.0F, y, w1, th), syst.getChromosomeShortName(EnumTreeChromosome.GIRTH) + " : ", TextJustification.MiddleRight); - new ControlText(contents, new IArea(w1, y, w2, th), genome.getGirth() + "x" + genome.getGirth(), TextJustification.MiddleLeft); - y += th; - - contents.setSize(new IPoint(contents.size().x(), y)); - - scrollable.setScrollableContent(contents); - } - - public static String tolerated(boolean t) - { - if (t) { - return BinnieCore.proxy.localise("gui.tolerated"); - } - return BinnieCore.proxy.localise("gui.nottolerated"); - } -} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/PageWood.java b/src/Java/binnie/craftgui/extratrees/dictionary/PageWood.java deleted file mode 100644 index e7e80a1456..0000000000 --- a/src/Java/binnie/craftgui/extratrees/dictionary/PageWood.java +++ /dev/null @@ -1,40 +0,0 @@ -package binnie.craftgui.extratrees.dictionary; - -import binnie.core.genetics.TreeBreedingSystem; -import binnie.craftgui.controls.ControlText; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.geometry.IArea; -import binnie.craftgui.core.geometry.IPoint; -import binnie.craftgui.core.geometry.TextJustification; -import binnie.craftgui.mod.database.ControlSpeciesBox; -import binnie.craftgui.mod.database.DatabaseTab; -import binnie.craftgui.mod.database.PageAbstract; -import binnie.craftgui.mod.database.WindowAbstractDatabase; -import forestry.api.genetics.IAlleleSpecies; -import java.util.Collection; -import net.minecraft.item.ItemStack; - -public class PageWood - extends PageAbstract<ItemStack> -{ - public PageWood(IWidget parent, DatabaseTab tab) - { - super(parent, tab); - } - - public void onValueChanged(ItemStack species) - { - deleteAllChildren(); - WindowAbstractDatabase database = (WindowAbstractDatabase)WindowAbstractDatabase.get(this); - new ControlText(this, new IArea(0.0F, 0.0F, size().x(), 24.0F), ((DatabaseTab)getValue()).toString(), TextJustification.MiddleCenter); - - - - Collection<IAlleleSpecies> trees = ((TreeBreedingSystem)database.getBreedingSystem()).getTreesThatHaveWood(species, database.isNEI(), database.getWorld(), database.getUsername()); - - - - - new ControlSpeciesBox(this, 4.0F, 24.0F, size().x() - 8.0F, size().y() - 4.0F - 24.0F).setOptions(trees); - } -} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/WindowArboristDatabase.java b/src/Java/binnie/craftgui/extratrees/dictionary/WindowArboristDatabase.java deleted file mode 100644 index e8096c6d77..0000000000 --- a/src/Java/binnie/craftgui/extratrees/dictionary/WindowArboristDatabase.java +++ /dev/null @@ -1,133 +0,0 @@ -package binnie.craftgui.extratrees.dictionary; - -import binnie.Binnie; -import binnie.core.AbstractMod; -import binnie.core.genetics.ManagerGenetics; -import binnie.core.genetics.TreeBreedingSystem; -import binnie.craftgui.controls.listbox.ControlList; -import binnie.craftgui.controls.listbox.ControlListBox; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.geometry.IArea; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.mod.database.ControlItemStackOption; -import binnie.craftgui.mod.database.DatabaseTab; -import binnie.craftgui.mod.database.IDatabaseMode; -import binnie.craftgui.mod.database.PageBranchOverview; -import binnie.craftgui.mod.database.PageBranchSpecies; -import binnie.craftgui.mod.database.PageBreeder; -import binnie.craftgui.mod.database.PageSpeciesClassification; -import binnie.craftgui.mod.database.PageSpeciesMutations; -import binnie.craftgui.mod.database.PageSpeciesOverview; -import binnie.craftgui.mod.database.PageSpeciesResultant; -import binnie.craftgui.mod.database.WindowAbstractDatabase; -import binnie.craftgui.mod.database.WindowAbstractDatabase.Mode; -import binnie.craftgui.mod.database.WindowAbstractDatabase.ModeWidgets; -import binnie.extratrees.ExtraTrees; -import binnie.extratrees.proxy.Proxy; -import cpw.mods.fml.relauncher.Side; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.ItemStack; - -public class WindowArboristDatabase - extends WindowAbstractDatabase -{ - ControlListBox<ItemStack> selectionBoxFruit; - ControlListBox<ItemStack> selectionBoxWood; - ControlListBox<ItemStack> selectionBoxPlanks; - - static enum TreeMode - implements IDatabaseMode - { - Fruit, Wood, Planks; - - private TreeMode() {} - - public String getName() - { - return ExtraTrees.proxy.localise("gui.database.mode." + name().toLowerCase()); - } - } - - public WindowArboristDatabase(EntityPlayer player, Side side, boolean nei) - { - super(player, side, nei, Binnie.Genetics.treeBreedingSystem, 120.0F); - } - - public static Window create(EntityPlayer player, Side side, boolean nei) - { - return new WindowArboristDatabase(player, side, nei); - } - - protected void addTabs() - { - new PageSpeciesOverview(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.overview", 0)); - new PageSpeciesTreeGenome(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.genome", 0)); - new PageSpeciesClassification(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.classification", 0)); - new PageSpeciesResultant(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.resultant", 0)); - new PageSpeciesMutations(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraTrees.instance, "species.further", 0)); - - new PageBranchOverview(getInfoPages(WindowAbstractDatabase.Mode.Branches), new DatabaseTab(ExtraTrees.instance, "branches.overview", 0)); - new PageBranchSpecies(getInfoPages(WindowAbstractDatabase.Mode.Branches), new DatabaseTab(ExtraTrees.instance, "branches.species", 0)); - - new PageBreeder(getInfoPages(WindowAbstractDatabase.Mode.Breeder), getUsername(), new DatabaseTab(ExtraTrees.instance, "breeder", 0)); - - createMode(TreeMode.Fruit, new WindowAbstractDatabase.ModeWidgets(TreeMode.Fruit, this) - { - public void createListBox(IArea area) - { - this.listBox = new ControlListBox(this.modePage, area.x(), area.y(), area.w(), area.h(), 12.0F) - { - public IWidget createOption(ItemStack value, int y) - { - return new ControlItemStackOption((ControlList)getContent(), value, y); - } - }; - this.listBox.setOptions(((TreeBreedingSystem)WindowArboristDatabase.this.getBreedingSystem()).allFruits); - } - }); - createMode(TreeMode.Wood, new WindowAbstractDatabase.ModeWidgets(TreeMode.Wood, this) - { - public void createListBox(IArea area) - { - this.listBox = new ControlListBox(this.modePage, area.x(), area.y(), area.w(), area.h(), 12.0F) - { - public IWidget createOption(ItemStack value, int y) - { - return new ControlItemStackOption((ControlList)getContent(), value, y); - } - }; - this.listBox.setOptions(((TreeBreedingSystem)WindowArboristDatabase.this.getBreedingSystem()).allWoods); - } - }); - createMode(TreeMode.Planks, new WindowAbstractDatabase.ModeWidgets(TreeMode.Planks, this) - { - public void createListBox(IArea area) - { - this.listBox = new ControlListBox(this.modePage, area.x(), area.y(), area.w(), area.h(), 12.0F) - { - public IWidget createOption(ItemStack value, int y) - { - return new ControlItemStackOption((ControlList)getContent(), value, y); - } - }; - } - }); - new PageFruit(getInfoPages(TreeMode.Fruit), new DatabaseTab(ExtraTrees.instance, "fruit.natural", 0), true); - new PageFruit(getInfoPages(TreeMode.Fruit), new DatabaseTab(ExtraTrees.instance, "fruit.potential", 0), false); - - new PageWood(getInfoPages(TreeMode.Wood), new DatabaseTab(ExtraTrees.instance, "wood.natural", 0)); - - new PagePlanksOverview(getInfoPages(TreeMode.Planks), new DatabaseTab(ExtraTrees.instance, "planks.overview", 0)); - new PagePlanksTrees(getInfoPages(TreeMode.Planks), new DatabaseTab(ExtraTrees.instance, "planks.natural", 1)); - } - - protected AbstractMod getMod() - { - return ExtraTrees.instance; - } - - protected String getName() - { - return "TreeDatabase"; - } -} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/WindowBrewery.java b/src/Java/binnie/craftgui/extratrees/dictionary/WindowBrewery.java deleted file mode 100644 index 89e4118880..0000000000 --- a/src/Java/binnie/craftgui/extratrees/dictionary/WindowBrewery.java +++ /dev/null @@ -1,61 +0,0 @@ -package binnie.craftgui.extratrees.dictionary; - -import binnie.core.AbstractMod; -import binnie.core.machines.IMachine; -import binnie.core.machines.Machine; -import binnie.core.machines.MachinePackage; -import binnie.craftgui.core.geometry.IPoint; -import binnie.craftgui.core.geometry.Position; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.minecraft.control.ControlEnergyBar; -import binnie.craftgui.minecraft.control.ControlErrorState; -import binnie.craftgui.minecraft.control.ControlLiquidTank; -import binnie.craftgui.minecraft.control.ControlPlayerInventory; -import binnie.craftgui.minecraft.control.ControlSlot; -import binnie.craftgui.minecraft.control.ControlSlotArray; -import binnie.extratrees.ExtraTrees; -import binnie.extratrees.machines.Brewery; -import cpw.mods.fml.relauncher.Side; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; - -public class WindowBrewery - extends Window -{ - public WindowBrewery(EntityPlayer player, IInventory inventory, Side side) - { - super(228.0F, 218.0F, player, inventory, side); - } - - protected AbstractMod getMod() - { - return ExtraTrees.instance; - } - - protected String getName() - { - return "Brewery"; - } - - public void initialiseClient() - { - setTitle(Machine.getMachine(getInventory()).getPackage().getDisplayName()); - new ControlSlotArray(this, 42, 32, 1, 3).create(Brewery.slotRecipeGrains); - new ControlSlot(this, 16.0F, 41.0F).assign(Brewery.slotRecipeInput); - new ControlSlot(this, 105.0F, 77.0F).assign(Brewery.slotRecipeYeast); - new ControlLiquidTank(this, 76, 32).setTankID(Brewery.tankInput); - new ControlLiquidTank(this, 162, 32).setTankID(Brewery.tankOutput); - new ControlEnergyBar(this, 196, 32, 16, 60, Position.Bottom); - new ControlBreweryProgress(this, 110.0F, 32.0F); - - new ControlSlotArray(this, (int)(getSize().x() / 2.0F - 81.0F), 104, 9, 1).create(Brewery.slotInventory); - - new ControlPlayerInventory(this); - new ControlErrorState(this, 133.0F, 79.0F); - } - - public static Window create(EntityPlayer player, IInventory inventory, Side side) - { - return new WindowBrewery(player, inventory, side); - } -} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/WindowDistillery.java b/src/Java/binnie/craftgui/extratrees/dictionary/WindowDistillery.java deleted file mode 100644 index 2d002c2755..0000000000 --- a/src/Java/binnie/craftgui/extratrees/dictionary/WindowDistillery.java +++ /dev/null @@ -1,59 +0,0 @@ -package binnie.craftgui.extratrees.dictionary; - -import binnie.core.AbstractMod; -import binnie.core.machines.IMachine; -import binnie.core.machines.Machine; -import binnie.core.machines.MachinePackage; -import binnie.craftgui.core.geometry.Position; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.minecraft.control.ControlEnergyBar; -import binnie.craftgui.minecraft.control.ControlErrorState; -import binnie.craftgui.minecraft.control.ControlLiquidTank; -import binnie.craftgui.minecraft.control.ControlPlayerInventory; -import binnie.extratrees.ExtraTrees; -import binnie.extratrees.machines.Distillery; -import cpw.mods.fml.relauncher.Side; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; - -public class WindowDistillery - extends Window -{ - public WindowDistillery(EntityPlayer player, IInventory inventory, Side side) - { - super(224.0F, 192.0F, player, inventory, side); - } - - protected AbstractMod getMod() - { - return ExtraTrees.instance; - } - - protected String getName() - { - return "Distillery"; - } - - public void initialiseClient() - { - setTitle(Machine.getMachine(getInventory()).getPackage().getDisplayName()); - - int x = 16; - - new ControlLiquidTank(this, x, 35).setTankID(Distillery.tankInput); - x += 34; - new ControlDistilleryProgress(this, x, 32.0F); - x += 64; - new ControlLiquidTank(this, x, 35).setTankID(Distillery.tankOutput); - x += 34; - new ControlEnergyBar(this, x, 36, 60, 16, Position.Left); - - new ControlPlayerInventory(this); - new ControlErrorState(this, x + 21, 62.0F); - } - - public static Window create(EntityPlayer player, IInventory inventory, Side side) - { - return new WindowDistillery(player, inventory, side); - } -} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/WindowLepidopteristDatabase.java b/src/Java/binnie/craftgui/extratrees/dictionary/WindowLepidopteristDatabase.java deleted file mode 100644 index 5d5b6511ef..0000000000 --- a/src/Java/binnie/craftgui/extratrees/dictionary/WindowLepidopteristDatabase.java +++ /dev/null @@ -1,57 +0,0 @@ -package binnie.craftgui.extratrees.dictionary; - -import binnie.Binnie; -import binnie.core.AbstractMod; -import binnie.core.genetics.ManagerGenetics; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.mod.database.DatabaseTab; -import binnie.craftgui.mod.database.PageBranchOverview; -import binnie.craftgui.mod.database.PageBranchSpecies; -import binnie.craftgui.mod.database.PageBreeder; -import binnie.craftgui.mod.database.PageSpeciesClassification; -import binnie.craftgui.mod.database.PageSpeciesMutations; -import binnie.craftgui.mod.database.PageSpeciesOverview; -import binnie.craftgui.mod.database.PageSpeciesResultant; -import binnie.craftgui.mod.database.WindowAbstractDatabase; -import binnie.craftgui.mod.database.WindowAbstractDatabase.Mode; -import binnie.extratrees.ExtraTrees; -import cpw.mods.fml.relauncher.Side; -import net.minecraft.entity.player.EntityPlayer; - -public class WindowLepidopteristDatabase - extends WindowAbstractDatabase -{ - public WindowLepidopteristDatabase(EntityPlayer player, Side side, boolean nei) - { - super(player, side, nei, Binnie.Genetics.mothBreedingSystem, 160.0F); - } - - public static Window create(EntityPlayer player, Side side, boolean nei) - { - return new WindowLepidopteristDatabase(player, side, nei); - } - - protected void addTabs() - { - new PageSpeciesOverview(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.overview", 0)); - new PageSpeciesClassification(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.classification", 0)); - new PageSpeciesImage(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.specimen", 0)); - new PageSpeciesResultant(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.resultant", 0)); - new PageSpeciesMutations(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraTrees.instance, "butterfly.species.further", 0)); - - new PageBranchOverview(getInfoPages(WindowAbstractDatabase.Mode.Branches), new DatabaseTab(ExtraTrees.instance, "butterfly.branches.overview", 0)); - new PageBranchSpecies(getInfoPages(WindowAbstractDatabase.Mode.Branches), new DatabaseTab(ExtraTrees.instance, "butterfly.branches.species", 0)); - - new PageBreeder(getInfoPages(WindowAbstractDatabase.Mode.Breeder), getUsername(), new DatabaseTab(ExtraTrees.instance, "butterfly.breeder", 0)); - } - - protected AbstractMod getMod() - { - return ExtraTrees.instance; - } - - protected String getName() - { - return "MothDatabase"; - } -} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/WindowLumbermill.java b/src/Java/binnie/craftgui/extratrees/dictionary/WindowLumbermill.java deleted file mode 100644 index dc9bca1253..0000000000 --- a/src/Java/binnie/craftgui/extratrees/dictionary/WindowLumbermill.java +++ /dev/null @@ -1,56 +0,0 @@ -package binnie.craftgui.extratrees.dictionary; - -import binnie.core.AbstractMod; -import binnie.core.machines.IMachine; -import binnie.core.machines.Machine; -import binnie.core.machines.MachinePackage; -import binnie.craftgui.core.geometry.Position; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.minecraft.control.ControlEnergyBar; -import binnie.craftgui.minecraft.control.ControlErrorState; -import binnie.craftgui.minecraft.control.ControlLiquidTank; -import binnie.craftgui.minecraft.control.ControlPlayerInventory; -import binnie.craftgui.minecraft.control.ControlSlot; -import binnie.extratrees.ExtraTrees; -import binnie.extratrees.machines.Lumbermill; -import cpw.mods.fml.relauncher.Side; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; - -public class WindowLumbermill - extends Window -{ - public WindowLumbermill(EntityPlayer player, IInventory inventory, Side side) - { - super(220.0F, 192.0F, player, inventory, side); - } - - protected AbstractMod getMod() - { - return ExtraTrees.instance; - } - - protected String getName() - { - return "Lumbermill"; - } - - public void initialiseClient() - { - setTitle(Machine.getMachine(getInventory()).getPackage().getDisplayName()); - new ControlSlot(this, 42.0F, 43.0F).assign(Lumbermill.slotWood); - new ControlSlot(this, 148.0F, 43.0F).assign(Lumbermill.slotPlanks); - new ControlSlot(this, 172.0F, 28.0F).assign(Lumbermill.slotBark); - new ControlSlot(this, 172.0F, 58.0F).assign(Lumbermill.slotSawdust); - new ControlLumbermillProgress(this, 70.0F, 43.0F); - new ControlLiquidTank(this, 16, 32); - new ControlEnergyBar(this, 8, 112, 16, 60, Position.Bottom); - new ControlPlayerInventory(this); - new ControlErrorState(this, 95.0F, 73.0F); - } - - public static Window create(EntityPlayer player, IInventory inventory, Side side) - { - return new WindowLumbermill(player, inventory, side); - } -} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/WindowPress.java b/src/Java/binnie/craftgui/extratrees/dictionary/WindowPress.java deleted file mode 100644 index 773bc70323..0000000000 --- a/src/Java/binnie/craftgui/extratrees/dictionary/WindowPress.java +++ /dev/null @@ -1,77 +0,0 @@ -package binnie.craftgui.extratrees.dictionary; - -import binnie.core.AbstractMod; -import binnie.core.machines.IMachine; -import binnie.core.machines.Machine; -import binnie.core.machines.MachinePackage; -import binnie.core.machines.power.ErrorState.InsufficientPower; -import binnie.craftgui.core.geometry.Position; -import binnie.craftgui.minecraft.ContainerCraftGUI; -import binnie.craftgui.minecraft.InventoryType; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.minecraft.control.ControlEnergyBar; -import binnie.craftgui.minecraft.control.ControlErrorState; -import binnie.craftgui.minecraft.control.ControlLiquidTank; -import binnie.craftgui.minecraft.control.ControlPlayerInventory; -import binnie.craftgui.minecraft.control.ControlSlot; -import binnie.extratrees.ExtraTrees; -import binnie.extratrees.machines.Press; -import binnie.extratrees.machines.Press.ComponentFruitPressLogic; -import cpw.mods.fml.relauncher.Side; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.nbt.NBTTagCompound; - -public class WindowPress - extends Window -{ - public WindowPress(EntityPlayer player, IInventory inventory, Side side) - { - super(194.0F, 192.0F, player, inventory, side); - } - - protected AbstractMod getMod() - { - return ExtraTrees.instance; - } - - protected String getName() - { - return "Press"; - } - - public void initialiseClient() - { - setTitle(Machine.getMachine(getInventory()).getPackage().getDisplayName()); - new ControlSlot(this, 24.0F, 52.0F).assign(Press.slotFruit); - new ControlLiquidTank(this, 99, 32).setTankID(Press.tankWater); - new ControlEnergyBar(this, 154, 32, 16, 60, Position.Bottom); - new ControlPlayerInventory(this); - new ControlErrorState(this, 128.0F, 54.0F); - new ControlFruitPressProgress(this, 62.0F, 24.0F); - - ((Window)getSuperParent()).getContainer().getOrCreateSlot(InventoryType.Machine, Press.slotCurrent); - } - - public static Window create(EntityPlayer player, IInventory inventory, Side side) - { - return new WindowPress(player, inventory, side); - } - - public void recieveGuiNBT(Side side, EntityPlayer player, String name, NBTTagCompound action) - { - Press.ComponentFruitPressLogic logic = (Press.ComponentFruitPressLogic)Machine.getInterface(Press.ComponentFruitPressLogic.class, getInventory()); - super.recieveGuiNBT(side, player, name, action); - if ((side == Side.SERVER) && (name.equals("fruitpress-click"))) { - if ((logic.canWork() == null) && ((logic.canProgress() == null) || ((logic.canProgress() instanceof ErrorState.InsufficientPower)))) - { - logic.alterProgress(2.0F); - } - else if ((side == Side.SERVER) && (name.equals("clear-fruit"))) - { - logic.setProgress(0.0F); - getInventory().setInventorySlotContents(Press.slotCurrent, null); - } - } - } -} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/WindowSetSquare.java b/src/Java/binnie/craftgui/extratrees/dictionary/WindowSetSquare.java deleted file mode 100644 index ba444d7b0f..0000000000 --- a/src/Java/binnie/craftgui/extratrees/dictionary/WindowSetSquare.java +++ /dev/null @@ -1,35 +0,0 @@ -package binnie.craftgui.extratrees.dictionary; - -import binnie.core.AbstractMod; -import binnie.craftgui.minecraft.Window; -import binnie.extratrees.ExtraTrees; -import cpw.mods.fml.relauncher.Side; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.world.World; - -public class WindowSetSquare - extends Window -{ - public WindowSetSquare(EntityPlayer player, IInventory inventory, Side side) - { - super(150.0F, 150.0F, player, inventory, side); - } - - protected AbstractMod getMod() - { - return ExtraTrees.instance; - } - - protected String getName() - { - return null; - } - - public void initialiseClient() {} - - public static Window create(EntityPlayer player, World world, int x, int y, int z, Side side) - { - return new WindowSetSquare(player, null, side); - } -} diff --git a/src/Java/binnie/craftgui/extratrees/dictionary/WindowWoodworker.java b/src/Java/binnie/craftgui/extratrees/dictionary/WindowWoodworker.java deleted file mode 100644 index 9e9c6fb7d0..0000000000 --- a/src/Java/binnie/craftgui/extratrees/dictionary/WindowWoodworker.java +++ /dev/null @@ -1,110 +0,0 @@ -package binnie.craftgui.extratrees.dictionary; - -import binnie.core.AbstractMod; -import binnie.core.BinnieCore; -import binnie.core.machines.IMachine; -import binnie.core.machines.Machine; -import binnie.core.machines.MachinePackage; -import binnie.core.proxy.BinnieProxy; -import binnie.craftgui.controls.ControlText; -import binnie.craftgui.controls.ControlTextEdit; -import binnie.craftgui.controls.scroll.ControlScrollableContent; -import binnie.craftgui.core.geometry.IArea; -import binnie.craftgui.core.geometry.IPoint; -import binnie.craftgui.core.geometry.TextJustification; -import binnie.craftgui.events.EventHandler.Origin; -import binnie.craftgui.events.EventTextEdit; -import binnie.craftgui.events.EventTextEdit.Handler; -import binnie.craftgui.minecraft.MinecraftGUI.PanelType; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.minecraft.control.ControlErrorState; -import binnie.craftgui.minecraft.control.ControlPlayerInventory; -import binnie.craftgui.minecraft.control.ControlSlot; -import binnie.craftgui.window.Panel; -import binnie.extratrees.ExtraTrees; -import binnie.extratrees.machines.Designer; -import binnie.extratrees.machines.Designer.ComponentWoodworkerRecipe; -import binnie.extratrees.machines.DesignerType; -import cpw.mods.fml.relauncher.Side; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; - -public class WindowWoodworker - extends Window -{ - ControlTextEdit textEdit; - ControlTileSelect tileSelect; - - public void initialiseClient() - { - setTitle(Machine.getMachine(getInventory()).getPackage().getDisplayName()); - - new ControlText(this, new IArea(190.0F, 36.0F, 114.0F, 10.0F), BinnieCore.proxy.localise("gui.design"), TextJustification.TopCenter).setColour(4473924); - - new Panel(this, 188.0F, 48.0F, 118.0F, 126.0F, MinecraftGUI.PanelType.Gray); - - this.textEdit = new ControlTextEdit(this, 188.0F, 178.0F, 118.0F, 12.0F); - - ControlScrollableContent scroll = new ControlScrollableContent(this, 190.0F, 50.0F, 114.0F, 122.0F, 12.0F); - - - - this.tileSelect = new ControlTileSelect(scroll, 0.0F, 0.0F); - - scroll.setScrollableContent(this.tileSelect); - - - - - - new ControlPlayerInventory(this).setPosition(new IPoint(14.0F, 96.0F)); - - new ControlErrorState(this, 76.0F, 65.0F); - ControlRecipeSlot slotFinished; - if (getInventory() != null) - { - ControlSlot slotWood1 = new ControlSlot(this, 22.0F, 34.0F); - slotWood1.assign(Designer.design1Slot); - ControlSlot slotWood2 = new ControlSlot(this, 62.0F, 34.0F); - slotWood2.assign(Designer.design2Slot); - - ControlSlot slotBeeswax = new ControlSlot(this, 42.0F, 64.0F); - slotBeeswax.assign(Designer.beeswaxSlot); - - slotFinished = new ControlRecipeSlot(this, 112, 34); - } - } - - public WindowWoodworker(EntityPlayer player, IInventory inventory, Side side) - { - super(320.0F, 216.0F, player, inventory, side); - - addEventHandler(new EventTextEdit.Handler() - { - public void onEvent(EventTextEdit event) - { - WindowWoodworker.this.tileSelect.refresh((String)event.getValue()); - } - }.setOrigin(EventHandler.Origin.DirectChild, this)); - } - - public static Window create(EntityPlayer player, IInventory inventory, Side side) - { - return new WindowWoodworker(player, inventory, side); - } - - protected AbstractMod getMod() - { - return ExtraTrees.instance; - } - - protected String getName() - { - return "Woodworker"; - } - - public DesignerType getDesignerType() - { - return ((Designer.ComponentWoodworkerRecipe)Machine.getInterface(Designer.ComponentWoodworkerRecipe.class, getInventory())).getDesignerType(); - } -} diff --git a/src/Java/binnie/craftgui/extratrees/kitchen/ControlDropDownMenu.java b/src/Java/binnie/craftgui/extratrees/kitchen/ControlDropDownMenu.java deleted file mode 100644 index 0d9c982400..0000000000 --- a/src/Java/binnie/craftgui/extratrees/kitchen/ControlDropDownMenu.java +++ /dev/null @@ -1,18 +0,0 @@ -package binnie.craftgui.extratrees.kitchen; - -import binnie.craftgui.core.Attribute; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.minecraft.MinecraftGUI.PanelType; -import binnie.craftgui.window.Panel; - -public class ControlDropDownMenu - extends Panel -{ - public ControlDropDownMenu(IWidget parent, float x, float y, float width, float height) - { - super(parent, x, y, width, 2.0F, MinecraftGUI.PanelType.Gray); - addAttribute(Attribute.CanFocus); - } - - public boolean stayOpenOnChildClick = false; -} diff --git a/src/Java/binnie/craftgui/extratrees/kitchen/ControlDropdownButton.java b/src/Java/binnie/craftgui/extratrees/kitchen/ControlDropdownButton.java deleted file mode 100644 index 069272b82a..0000000000 --- a/src/Java/binnie/craftgui/extratrees/kitchen/ControlDropdownButton.java +++ /dev/null @@ -1,36 +0,0 @@ -package binnie.craftgui.extratrees.kitchen; - -import binnie.craftgui.controls.button.ControlButton; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.events.EventMouse.Down; -import binnie.craftgui.events.EventMouse.Down.Handler; -import binnie.craftgui.minecraft.Window; - -public abstract class ControlDropdownButton - extends ControlButton -{ - public ControlDropdownButton(IWidget parent, float x, float y, float width, float height, String text) - { - super(parent, x, y, width, height, text); - - addSelfEventHandler(new EventMouse.Down.Handler() - { - public void onEvent(EventMouse.Down event) - { - ControlDropDownMenu menu = (ControlDropDownMenu)ControlDropdownButton.this.getWidget(ControlDropDownMenu.class); - ControlDropdownButton.this.deleteChild((IWidget)ControlDropdownButton.this.getWidget(ControlDropDownMenu.class)); - if (ControlDropdownButton.this.getWidget(ControlDropDownMenu.class) == null) - { - menu = ControlDropdownButton.this.createDropDownMenu(); - Window.get(ControlDropdownButton.this.getWidget()).setFocusedWidget(menu); - } - else - { - ControlDropdownButton.this.deleteChild((IWidget)ControlDropdownButton.this.getWidget(ControlDropDownMenu.class)); - } - } - }); - } - - public abstract ControlDropDownMenu createDropDownMenu(); -} diff --git a/src/Java/binnie/craftgui/extratrees/kitchen/ControlFluidDisplay.java b/src/Java/binnie/craftgui/extratrees/kitchen/ControlFluidDisplay.java deleted file mode 100644 index 7ec1124226..0000000000 --- a/src/Java/binnie/craftgui/extratrees/kitchen/ControlFluidDisplay.java +++ /dev/null @@ -1,103 +0,0 @@ -package binnie.craftgui.extratrees.kitchen; - -import binnie.craftgui.controls.core.Control; -import binnie.craftgui.core.Attribute; -import binnie.craftgui.core.CraftGUI; -import binnie.craftgui.core.ITooltip; -import binnie.craftgui.core.ITopLevelWidget; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.Tooltip; -import binnie.craftgui.core.geometry.IPoint; -import binnie.craftgui.core.renderer.Renderer; -import binnie.craftgui.minecraft.Window; -import net.minecraft.util.IIcon; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; -import org.lwjgl.opengl.GL11; - -public class ControlFluidDisplay - extends Control - implements ITooltip -{ - FluidStack itemStack = null; - public boolean hastooltip = false; - - public void setTooltip() - { - this.hastooltip = true; - addAttribute(Attribute.MouseOver); - } - - public ControlFluidDisplay(IWidget parent, float f, float y) - { - this(parent, f, y, 16.0F); - } - - public ControlFluidDisplay(IWidget parent, float f, float y, FluidStack stack, boolean tooltip) - { - this(parent, f, y, 16.0F); - setItemStack(stack); - if (tooltip) { - setTooltip(); - } - } - - public ControlFluidDisplay(IWidget parent, float x, float y, float size) - { - super(parent, x, y, size, size); - } - - public void onRenderForeground() - { - if (this.itemStack == null) { - return; - } - IPoint relativeToWindow = getAbsolutePosition().sub(getSuperParent().getPosition()); - if ((relativeToWindow.x() > Window.get(this).getSize().x() + 100.0F) || (relativeToWindow.y() > Window.get(this).getSize().y() + 100.0F)) { - return; - } - if (this.itemStack != null) - { - Fluid fluid = this.itemStack.getFluid(); - - int hex = fluid.getColor(this.itemStack); - - int r = (hex & 0xFF0000) >> 16; - int g = (hex & 0xFF00) >> 8; - int b = hex & 0xFF; - - IIcon icon = this.itemStack.getFluid().getIcon(this.itemStack); - - GL11.glColor4f(r / 255.0F, g / 255.0F, b / 255.0F, 1.0F); - - GL11.glEnable(3042); - - GL11.glBlendFunc(770, 771); - if (getSize().x() != 16.0F) - { - GL11.glPushMatrix(); - float scale = getSize().x() / 16.0F; - GL11.glScalef(scale, scale, 1.0F); - CraftGUI.Render.iconBlock(IPoint.ZERO, this.itemStack.getFluid().getIcon(this.itemStack)); - GL11.glPopMatrix(); - } - else - { - CraftGUI.Render.iconBlock(IPoint.ZERO, this.itemStack.getFluid().getIcon(this.itemStack)); - } - GL11.glDisable(3042); - } - } - - public void setItemStack(FluidStack itemStack) - { - this.itemStack = itemStack; - } - - public void getTooltip(Tooltip tooltip) - { - if ((this.hastooltip) && (this.itemStack != null)) { - tooltip.add(this.itemStack.getLocalizedName()); - } - } -} diff --git a/src/Java/binnie/craftgui/extratrees/kitchen/ControlSlotFluid.java b/src/Java/binnie/craftgui/extratrees/kitchen/ControlSlotFluid.java deleted file mode 100644 index 5cd82c39de..0000000000 --- a/src/Java/binnie/craftgui/extratrees/kitchen/ControlSlotFluid.java +++ /dev/null @@ -1,77 +0,0 @@ -package binnie.craftgui.extratrees.kitchen; - -import binnie.craftgui.controls.core.Control; -import binnie.craftgui.core.Attribute; -import binnie.craftgui.core.CraftGUI; -import binnie.craftgui.core.ITooltip; -import binnie.craftgui.core.ITopLevelWidget; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.Tooltip; -import binnie.craftgui.core.geometry.IArea; -import binnie.craftgui.core.geometry.IPoint; -import binnie.craftgui.core.renderer.Renderer; -import binnie.craftgui.events.EventWidget.ChangeSize; -import binnie.craftgui.events.EventWidget.ChangeSize.Handler; -import binnie.craftgui.resource.minecraft.CraftGUITexture; -import net.minecraftforge.fluids.Fluid; -import net.minecraftforge.fluids.FluidStack; - -public class ControlSlotFluid - extends Control - implements ITooltip -{ - ControlFluidDisplay itemDisplay; - FluidStack fluidStack; - - public ControlSlotFluid(IWidget parent, int x, int y, FluidStack fluid) - { - this(parent, x, y, 18, fluid); - } - - public ControlSlotFluid(IWidget parent, int x, int y, int size, FluidStack fluid) - { - super(parent, x, y, size, size); - addAttribute(Attribute.MouseOver); - this.itemDisplay = new ControlFluidDisplay(this, 1.0F, 1.0F, size - 2); - this.fluidStack = fluid; - - addSelfEventHandler(new EventWidget.ChangeSize.Handler() - { - public void onEvent(EventWidget.ChangeSize event) - { - if (ControlSlotFluid.this.itemDisplay != null) { - ControlSlotFluid.this.itemDisplay.setSize(ControlSlotFluid.this.getSize().sub(new IPoint(2.0F, 2.0F))); - } - } - }); - } - - public void onRenderBackground() - { - int size = (int)getSize().x(); - CraftGUI.Render.texture(CraftGUITexture.Slot, getArea()); - if (getSuperParent().getMousedOverWidget() == this) { - CraftGUI.Render.gradientRect(new IArea(new IPoint(1.0F, 1.0F), getArea().size().sub(new IPoint(2.0F, 2.0F))), -2130706433, -2130706433); - } - } - - public void onUpdateClient() - { - super.onUpdateClient(); - this.itemDisplay.setItemStack(getFluidStack()); - } - - public void getTooltip(Tooltip tooltip) - { - FluidStack item = getFluidStack(); - if (item == null) { - return; - } - tooltip.add(item.getFluid().getLocalizedName()); - } - - public FluidStack getFluidStack() - { - return this.fluidStack; - } -} diff --git a/src/Java/binnie/craftgui/extratrees/kitchen/ControlSlotGlassware.java b/src/Java/binnie/craftgui/extratrees/kitchen/ControlSlotGlassware.java deleted file mode 100644 index fa7cd3df84..0000000000 --- a/src/Java/binnie/craftgui/extratrees/kitchen/ControlSlotGlassware.java +++ /dev/null @@ -1,35 +0,0 @@ -package binnie.craftgui.extratrees.kitchen; - -import binnie.craftgui.controls.core.IControlValue; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.minecraft.control.ControlSlotBase; -import binnie.extratrees.alcohol.Glassware; -import net.minecraft.item.ItemStack; - -public class ControlSlotGlassware - extends ControlSlotBase - implements IControlValue<Glassware> -{ - Glassware glassware; - - public ControlSlotGlassware(IWidget parent, int x, int y, Glassware glassware) - { - super(parent, x, y); - this.glassware = glassware; - } - - public Glassware getValue() - { - return this.glassware; - } - - public void setValue(Glassware value) - { - this.glassware = value; - } - - public ItemStack getItemStack() - { - return this.glassware.get(1); - } -} diff --git a/src/Java/binnie/craftgui/extratrees/kitchen/ControlTankSlot.java b/src/Java/binnie/craftgui/extratrees/kitchen/ControlTankSlot.java deleted file mode 100644 index c1caf1772f..0000000000 --- a/src/Java/binnie/craftgui/extratrees/kitchen/ControlTankSlot.java +++ /dev/null @@ -1,49 +0,0 @@ -package binnie.craftgui.extratrees.kitchen; - -import binnie.core.machines.power.TankInfo; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.geometry.IArea; -import binnie.craftgui.events.EventMouse.Down; -import binnie.craftgui.events.EventMouse.Down.Handler; -import binnie.craftgui.minecraft.ContainerCraftGUI; -import binnie.craftgui.minecraft.Window; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraftforge.fluids.FluidStack; - -public class ControlTankSlot - extends ControlSlotFluid -{ - int tankID = 0; - - public ControlTankSlot(IWidget parent, int x, int y, int i) - { - super(parent, x, y, null); - this.tankID = i; - - addSelfEventHandler(new EventMouse.Down.Handler() - { - public void onEvent(EventMouse.Down event) - { - if (event.getButton() == 0) - { - NBTTagCompound nbt = new NBTTagCompound(); - nbt.setByte("id", (byte)ControlTankSlot.this.tankID); - Window.get(ControlTankSlot.this.getWidget()).sendClientAction("tank-click", nbt); - } - } - }); - } - - public void onUpdateClient() - { - this.fluidStack = Window.get(this).getContainer().getTankInfo(this.tankID).liquid; - int height = (int)(16.0F * ((this.fluidStack == null ? 0 : this.fluidStack.amount) / 1000.0F)); - this.itemDisplay.setCroppedZone(this.itemDisplay, new IArea(0.0F, 16 - height, 16.0F, 16.0F)); - super.onUpdateClient(); - } - - public void onRenderBackground() - { - super.onRenderBackground(); - } -} diff --git a/src/Java/binnie/craftgui/extratrees/kitchen/WindowBottleRack.java b/src/Java/binnie/craftgui/extratrees/kitchen/WindowBottleRack.java deleted file mode 100644 index 8fffff9ed2..0000000000 --- a/src/Java/binnie/craftgui/extratrees/kitchen/WindowBottleRack.java +++ /dev/null @@ -1,48 +0,0 @@ -package binnie.craftgui.extratrees.kitchen; - -import binnie.core.AbstractMod; -import binnie.core.machines.IMachine; -import binnie.core.machines.Machine; -import binnie.core.machines.MachinePackage; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.minecraft.control.ControlPlayerInventory; -import binnie.extratrees.ExtraTrees; -import cpw.mods.fml.relauncher.Side; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; - -public class WindowBottleRack - extends Window -{ - public WindowBottleRack(EntityPlayer player, IInventory inventory, Side side) - { - super(248.0F, 180.0F, player, inventory, side); - } - - public static Window create(EntityPlayer player, IInventory inventory, Side side) - { - return new WindowBottleRack(player, inventory, side); - } - - protected AbstractMod getMod() - { - return ExtraTrees.instance; - } - - protected String getName() - { - return "BottleBank"; - } - - public void initialiseClient() - { - setTitle(Machine.getMachine(getInventory()).getPackage().getDisplayName()); - for (int i = 0; i < 36; i++) - { - int x = i % 12; - int y = i / 12; - new ControlTankSlot(this, 16 + x * 18, 32 + y * 18, i); - } - new ControlPlayerInventory(this); - } -} diff --git a/src/Java/binnie/craftgui/genetics/machine/ControlGene.java b/src/Java/binnie/craftgui/genetics/machine/ControlGene.java deleted file mode 100644 index a5c830154e..0000000000 --- a/src/Java/binnie/craftgui/genetics/machine/ControlGene.java +++ /dev/null @@ -1,101 +0,0 @@ -package binnie.craftgui.genetics.machine; - -import binnie.Binnie; -import binnie.core.genetics.BreedingSystem; -import binnie.core.genetics.ManagerGenetics; -import binnie.core.resource.BinnieIcon; -import binnie.craftgui.controls.core.Control; -import binnie.craftgui.controls.core.IControlValue; -import binnie.craftgui.core.Attribute; -import binnie.craftgui.core.CraftGUI; -import binnie.craftgui.core.ITooltip; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.Tooltip; -import binnie.craftgui.core.geometry.IArea; -import binnie.craftgui.core.geometry.IPoint; -import binnie.craftgui.core.renderer.Renderer; -import binnie.craftgui.events.EventMouse.Down; -import binnie.craftgui.events.EventMouse.Down.Handler; -import binnie.craftgui.minecraft.Window; -import binnie.genetics.api.IGene; -import binnie.genetics.core.GeneticsTexture; -import binnie.genetics.genetics.Engineering; -import forestry.api.genetics.IChromosomeType; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -public class ControlGene - extends Control - implements IControlValue<IGene>, ITooltip -{ - IGene gene; - - public void getTooltip(Tooltip tooltip) - { - String cName = Binnie.Genetics.getSystem(this.gene.getSpeciesRoot()).getChromosomeName(this.gene.getChromosome()); - tooltip.add(cName + ": " + this.gene.getName()); - if ((isMouseOver()) && (canFill(Window.get(this).getHeldItemStack()))) - { - tooltip.add("Left click to assign gene"); - IGene existingGene = Engineering.getGene(Window.get(this).getHeldItemStack(), this.gene.getChromosome().ordinal()); - if (existingGene == null) { - return; - } - String dName = Binnie.Genetics.getSystem(this.gene.getSpeciesRoot()).getChromosomeName(this.gene.getChromosome()); - tooltip.add("Will replace " + dName + ": " + existingGene.getName()); - } - } - - private boolean canFill(ItemStack stack) - { - return (stack != null) && (stack.stackSize == 1) && (Engineering.isGeneAcceptor(stack)) && (Engineering.canAcceptGene(stack, getValue())); - } - - protected ControlGene(IWidget parent, float x, float y) - { - super(parent, x, y, 16.0F, 16.0F); - addAttribute(Attribute.MouseOver); - - addSelfEventHandler(new EventMouse.Down.Handler() - { - public void onEvent(EventMouse.Down event) - { - if (ControlGene.this.canFill(Window.get(ControlGene.this.getWidget()).getHeldItemStack())) - { - NBTTagCompound action = new NBTTagCompound(); - - NBTTagCompound geneNBT = new NBTTagCompound(); - ControlGene.this.getValue().writeToNBT(geneNBT); - - action.setTag("gene", geneNBT); - - Window.get(ControlGene.this.getWidget()).sendClientAction("gene-select", action); - } - } - }); - } - - public IGene getValue() - { - return this.gene; - } - - public void setValue(IGene value) - { - this.gene = value; - } - - public void onRenderForeground() {} - - public void onRenderBackground() - { - if ((isMouseOver()) && (canFill(Window.get(this).getHeldItemStack()))) - { - CraftGUI.Render.solid(getArea(), -1); - CraftGUI.Render.solid(getArea().inset(1), -12303292); - } - CraftGUI.Render.colour(-1); - - CraftGUI.Render.iconItem(IPoint.ZERO, GeneticsTexture.dnaIcon.getIcon()); - } -} diff --git a/src/Java/binnie/craftgui/genetics/machine/ControlGeneScroll.java b/src/Java/binnie/craftgui/genetics/machine/ControlGeneScroll.java deleted file mode 100644 index a779933050..0000000000 --- a/src/Java/binnie/craftgui/genetics/machine/ControlGeneScroll.java +++ /dev/null @@ -1,97 +0,0 @@ -package binnie.craftgui.genetics.machine; - -import binnie.Binnie; -import binnie.core.genetics.BreedingSystem; -import binnie.core.genetics.Gene; -import binnie.core.genetics.ManagerGenetics; -import binnie.craftgui.controls.ControlText; -import binnie.craftgui.controls.core.Control; -import binnie.craftgui.controls.core.IControlValue; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.geometry.IPoint; -import binnie.craftgui.minecraft.Window; -import binnie.genetics.genetics.GeneTracker; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IChromosomeType; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; - -public class ControlGeneScroll - extends Control - implements IControlValue<BreedingSystem> -{ - protected ControlGeneScroll(IWidget parent, float x, float y, float w, float h) - { - super(parent, x, y, w, h); - } - - private String filter = ""; - private BreedingSystem system = null; - - public void setFilter(String filter) - { - this.filter = filter.toLowerCase(); - refresh(); - } - - public void setGenes(BreedingSystem system) - { - this.system = system; - refresh(); - } - - public void refresh() - { - deleteAllChildren(); - - GeneTracker tracker = GeneTracker.getTracker(Window.get(this).getWorld(), Window.get(this).getUsername()); - - Map<IChromosomeType, List<IAllele>> genes = Binnie.Genetics.getChromosomeMap(this.system.getSpeciesRoot()); - - int x = 0; - int y = 0; - - boolean isNEI = ((WindowGeneBank)Window.get(this)).isNei; - for (Map.Entry<IChromosomeType, List<IAllele>> entry : genes.entrySet()) - { - List<IAllele> discovered = new ArrayList(); - for (IAllele allele : (List)entry.getValue()) - { - Gene gene = new Gene(allele, (IChromosomeType)entry.getKey(), this.system.getSpeciesRoot()); - if (((isNEI) || (tracker.isSequenced(new Gene(allele, (IChromosomeType)entry.getKey(), this.system.getSpeciesRoot())))) && (gene.getName().toLowerCase().contains(this.filter))) { - discovered.add(allele); - } - } - if (discovered.size() != 0) - { - x = 0; - new ControlText(this, new IPoint(x, y), this.system.getChromosomeName((IChromosomeType)entry.getKey())); - y += 12; - for (IAllele allele : discovered) - { - if (x + 18 > getSize().x()) - { - y += 20; - x = 0; - } - new ControlGene(this, x, y).setValue(new Gene(allele, (IChromosomeType)entry.getKey(), this.system.getSpeciesRoot())); - x += 18; - } - y += 24; - } - } - setSize(new IPoint(getSize().x(), y)); - } - - public void setValue(BreedingSystem system) - { - setGenes(system); - } - - public BreedingSystem getValue() - { - return this.system; - } -} diff --git a/src/Java/binnie/craftgui/genetics/machine/ControlProcessTemporary.java b/src/Java/binnie/craftgui/genetics/machine/ControlProcessTemporary.java deleted file mode 100644 index 43e32dc9ad..0000000000 --- a/src/Java/binnie/craftgui/genetics/machine/ControlProcessTemporary.java +++ /dev/null @@ -1,27 +0,0 @@ -package binnie.craftgui.genetics.machine; - -import binnie.craftgui.core.CraftGUI; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.geometry.IArea; -import binnie.craftgui.core.geometry.IPoint; -import binnie.craftgui.core.renderer.Renderer; -import binnie.craftgui.minecraft.control.ControlMachineProgress; - -public class ControlProcessTemporary - extends ControlMachineProgress -{ - public ControlProcessTemporary(IWidget parent, int x, int y, int width, int height) - { - super(parent, x, y, null, null, null); - setSize(new IPoint(width, height)); - } - - public void onRenderBackground() - { - CraftGUI.Render.solid(getArea(), -4868683); - - float w = getSize().y() * this.progress / 100.0F; - - CraftGUI.Render.solid(new IArea(getArea().x(), getArea().y(), w, getArea().h()), -65536); - } -} diff --git a/src/Java/binnie/craftgui/genetics/machine/ControlSequencerProgress.java b/src/Java/binnie/craftgui/genetics/machine/ControlSequencerProgress.java deleted file mode 100644 index 1a80f71676..0000000000 --- a/src/Java/binnie/craftgui/genetics/machine/ControlSequencerProgress.java +++ /dev/null @@ -1,64 +0,0 @@ -package binnie.craftgui.genetics.machine; - -import binnie.core.machines.IMachine; -import binnie.core.machines.Machine; -import binnie.core.machines.MachineUtil; -import binnie.craftgui.controls.ControlText; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.geometry.IArea; -import binnie.craftgui.core.geometry.TextJustification; -import binnie.craftgui.minecraft.MinecraftGUI.PanelType; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.minecraft.control.ControlProgressBase; -import binnie.craftgui.window.Panel; -import java.util.Random; -import net.minecraft.item.ItemStack; - -public class ControlSequencerProgress - extends ControlProgressBase -{ - ControlText textControl; - - public ControlSequencerProgress(IWidget parent, int x, int y) - { - super(parent, x, y, 100.0F, 52.0F); - - Panel panel = new Panel(this, 0.0F, 0.0F, 100.0F, 52.0F, MinecraftGUI.PanelType.Gray); - - this.textControl = new ControlText(panel, new IArea(4.0F, 4.0F, 92.0F, 44.0F), "", TextJustification.MiddleCenter); - } - - public void onUpdateClient() - { - super.onUpdateClient(); - - ItemStack stack = Machine.getMachine(Window.get(this).getInventory()).getMachineUtil().getStack(5); - if (stack == null) - { - this.textControl.setValue(""); - } - else - { - Random rand = new Random(stack.getDisplayName().length()); - - String text = ""; - String[] codes = { "A", "T", "G", "C" }; - String[] colors = { "a", "d", "b", "c" }; - for (int i = 0; i < 65; i++) - { - int k = rand.nextInt(4); - String code = codes[k]; - if (rand.nextFloat() < this.progress) - { - String col = "§" + colors[k]; - text = text + "§r" + col + "§l" + code; - } - else - { - text = text + "§r§7§k§l" + code; - } - } - this.textControl.setValue(text); - } - } -} diff --git a/src/Java/binnie/craftgui/genetics/machine/ControlSplicerProgress.java b/src/Java/binnie/craftgui/genetics/machine/ControlSplicerProgress.java deleted file mode 100644 index 7afa16f31f..0000000000 --- a/src/Java/binnie/craftgui/genetics/machine/ControlSplicerProgress.java +++ /dev/null @@ -1,60 +0,0 @@ -package binnie.craftgui.genetics.machine; - -import binnie.core.machines.power.ProcessInfo; -import binnie.craftgui.core.CraftGUI; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.geometry.IArea; -import binnie.craftgui.core.renderer.Renderer; -import binnie.craftgui.minecraft.control.ControlProgressBase; - -public class ControlSplicerProgress - extends ControlProgressBase -{ - float strength = 0.0F; - - public ControlSplicerProgress(IWidget parent, float x, float y, float w, float h) - { - super(parent, x, y, w, h); - this.strength = 0.0F; - } - - public void onRenderBackground() - { - float progress = getProcess().getCurrentProgress() / 100.0F; - - float n = getProcess().getProcessTime() / 12.0F; - float spacing = 10.0F; - float range = w(); - float h = 8.0F; - - float ooy = -((n - 1.0F) * spacing) - range / 2.0F; - float ddy = (n - 1.0F) * spacing + range; - float oy = ooy + ddy * progress; - for (int i = 0; i < n; i++) - { - int seed = 432523; - int[] colours = { 10027008, 30464, 255, 10057472 }; - int c1 = colours[((int)Math.abs(13.0D * Math.sin(i) + 48.0D * Math.cos(i) + 25.0D * Math.sin(7 * i)) % 4)]; - int c2 = colours[((int)Math.abs(23.0D * Math.sin(i) + 28.0D * Math.cos(i) + 15.0D * Math.sin(7 * i)) % 4)]; - int c3 = colours[((int)Math.abs(43.0D * Math.sin(i) + 38.0D * Math.cos(i) + 55.0D * Math.sin(7 * i)) % 4)]; - int c4 = colours[((int)Math.abs(3.0D * Math.sin(i) + 18.0D * Math.cos(i) + 35.0D * Math.sin(7 * i)) % 4)]; - - float y = oy + i * spacing; - if ((y > -range / 2.0F) && (y < range / 2.0F)) - { - float percentView = (float)Math.sqrt(1.0F - Math.abs(2.0F * y / range)); - float offMovement = (h() - 2.0F * h) / 2.0F; - int alpha = 16777216 * (int)(255.0F * percentView); - c1 += alpha; - c2 += alpha; - c3 += alpha; - c4 += alpha; - CraftGUI.Render.solidAlpha(new IArea(w() / 2.0F + y, offMovement * percentView, 4.0F, h / 2.0F), c1); - CraftGUI.Render.solidAlpha(new IArea(w() / 2.0F + y, offMovement * percentView + 4.0F, 4.0F, h / 2.0F), y < 0.0F ? c2 : c3); - - CraftGUI.Render.solidAlpha(new IArea(w() / 2.0F + y, h() - offMovement * percentView - 8.0F, 4.0F, h / 2.0F), y < 0.0F ? c3 : c2); - CraftGUI.Render.solidAlpha(new IArea(w() / 2.0F + y, h() - offMovement * percentView - 4.0F, 4.0F, h / 2.0F), c4); - } - } - } -} diff --git a/src/Java/binnie/craftgui/genetics/machine/WindowAcclimatiser.java b/src/Java/binnie/craftgui/genetics/machine/WindowAcclimatiser.java deleted file mode 100644 index 8ed95dd0ef..0000000000 --- a/src/Java/binnie/craftgui/genetics/machine/WindowAcclimatiser.java +++ /dev/null @@ -1,80 +0,0 @@ -package binnie.craftgui.genetics.machine; - -import binnie.core.AbstractMod; -import binnie.craftgui.core.geometry.Position; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.minecraft.control.ControlEnergyBar; -import binnie.craftgui.minecraft.control.ControlErrorState; -import binnie.craftgui.minecraft.control.ControlPlayerInventory; -import binnie.craftgui.minecraft.control.ControlSlot; -import binnie.craftgui.minecraft.control.ControlSlotArray; -import binnie.craftgui.resource.Texture; -import binnie.craftgui.resource.minecraft.StandardTexture; -import binnie.extrabees.core.ExtraBeeTexture; -import binnie.genetics.Genetics; -import binnie.genetics.machine.Acclimatiser; -import cpw.mods.fml.relauncher.Side; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; - -public class WindowAcclimatiser - extends WindowMachine -{ - public static Window create(EntityPlayer player, IInventory inventory, Side side) - { - return new WindowAcclimatiser(player, inventory, side); - } - - public WindowAcclimatiser(EntityPlayer player, IInventory inventory, Side side) - { - super(280, 198, player, inventory, side); - } - - static Texture ProgressBase = new StandardTexture(64, 0, 130, 21, ExtraBeeTexture.GUIProgress.getTexture()); - static Texture Progress = new StandardTexture(64, 21, 130, 21, ExtraBeeTexture.GUIProgress.getTexture()); - public static final int[] slotReserve = { 0, 1, 2, 3 }; - public static final int slotTarget = 4; - public static final int[] slotAcclimatiser = { 5, 6, 7 }; - public static final int[] slotDone = { 8, 9, 10, 11 }; - - public void initialiseClient() - { - setTitle("Acclimatiser"); - - int x = 16; - int y = 32; - - new ControlSlotArray(this, x, y, 2, 2).create(Acclimatiser.slotReserve); - - x += 54; - - new ControlSlot(this, x + 18, y).assign(4); - new ControlSlotArray(this, x, y + 18 + 18, 3, 1).create(Acclimatiser.slotAcclimatiser); - - x += 72; - - new ControlSlotArray(this, x, y, 2, 2).create(Acclimatiser.slotDone); - - - new ControlEnergyBar(this, 21, 115, 16, 60, Position.Bottom); - - new ControlErrorState(this, 181.0F, 83.0F); - - new ControlPlayerInventory(this); - } - - public String getTitle() - { - return "Acclimatiser"; - } - - protected AbstractMod getMod() - { - return Genetics.instance; - } - - protected String getName() - { - return "Acclimatiser"; - } -} diff --git a/src/Java/binnie/craftgui/genetics/machine/WindowAnalyser.java b/src/Java/binnie/craftgui/genetics/machine/WindowAnalyser.java deleted file mode 100644 index c1a2ac5305..0000000000 --- a/src/Java/binnie/craftgui/genetics/machine/WindowAnalyser.java +++ /dev/null @@ -1,110 +0,0 @@ -package binnie.craftgui.genetics.machine; - -import binnie.core.AbstractMod; -import binnie.craftgui.core.geometry.Position; -import binnie.craftgui.minecraft.GUIIcon; -import binnie.craftgui.minecraft.MinecraftGUI.PanelType; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.minecraft.control.ControlEnergyBar; -import binnie.craftgui.minecraft.control.ControlErrorState; -import binnie.craftgui.minecraft.control.ControlIconDisplay; -import binnie.craftgui.minecraft.control.ControlPlayerInventory; -import binnie.craftgui.minecraft.control.ControlProgress; -import binnie.craftgui.minecraft.control.ControlSlot; -import binnie.craftgui.minecraft.control.ControlSlotArray; -import binnie.craftgui.minecraft.control.ControlSlotCharge; -import binnie.craftgui.resource.Texture; -import binnie.craftgui.resource.minecraft.StandardTexture; -import binnie.craftgui.window.Panel; -import binnie.extrabees.core.ExtraBeeTexture; -import binnie.genetics.Genetics; -import binnie.genetics.core.GeneticsTexture; -import binnie.genetics.machine.Analyser; -import cpw.mods.fml.relauncher.Side; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; - -public class WindowAnalyser - extends WindowMachine -{ - public static Window create(EntityPlayer player, IInventory inventory, Side side) - { - return new WindowAnalyser(player, inventory, side); - } - - static Texture ProgressBase = new StandardTexture(0, 218, 142, 17, ExtraBeeTexture.GUIProgress.getTexture()); - static Texture Progress = new StandardTexture(0, 201, 142, 17, ExtraBeeTexture.GUIProgress.getTexture()); - - public WindowAnalyser(EntityPlayer player, IInventory inventory, Side side) - { - super(220, 210, player, inventory, side); - } - - public void initialiseClient() - { - ProgressBase = new StandardTexture(0, 51, 66, 40, GeneticsTexture.GUIProcess.getTexture()); - Progress = new StandardTexture(66, 51, 66, 40, GeneticsTexture.GUIProcess.getTexture()); - - - - - int x = 16; - int y = 32; - - new ControlSlotArray(this, x, y, 2, 3).create(Analyser.slotReserve); - - - x += 28; - - new ControlSlot(this, x, y + 54 + 8).assign(13); - new ControlSlotCharge(this, x + 20, y + 54 + 8, 13).setColour(10040319); - new ControlEnergyBar(this, x + 24 + 16, y + 54 + 8 + 1, 60, 16, Position.Left); - new ControlErrorState(this, x + 24 + 16 + 60 + 16, y + 54 + 8 + 1); - - - x -= 28; - - new ControlIconDisplay(this, x + 36 + 2, y + 18, GUIIcon.ArrowRight.getIcon()); - - - x += 56; - - new Panel(this, x, y, 76.0F, 50.0F, MinecraftGUI.PanelType.Tinted); - - new ControlProgress(this, x + 5, y + 5, ProgressBase, Progress, Position.Left); - - new ControlSlot(this, x + 38 - 9, y + 25 - 9).assign(6); - - new ControlIconDisplay(this, x + 76 + 2, y + 18, GUIIcon.ArrowRight.getIcon()); - - - x += 96; - - - - new ControlSlotArray(this, x, y, 2, 3).create(Analyser.slotFinished); - - - x += 52; - - setTitle("Analyser"); - - - new ControlPlayerInventory(this); - } - - public String getTitle() - { - return "Analyser"; - } - - protected AbstractMod getMod() - { - return Genetics.instance; - } - - protected String getName() - { - return "Analyser"; - } -} diff --git a/src/Java/binnie/craftgui/genetics/machine/WindowGeneBank.java b/src/Java/binnie/craftgui/genetics/machine/WindowGeneBank.java deleted file mode 100644 index e13bca4ce5..0000000000 --- a/src/Java/binnie/craftgui/genetics/machine/WindowGeneBank.java +++ /dev/null @@ -1,256 +0,0 @@ -package binnie.craftgui.genetics.machine; - -import binnie.Binnie; -import binnie.core.AbstractMod; -import binnie.core.genetics.BreedingSystem; -import binnie.core.genetics.Gene; -import binnie.core.genetics.ManagerGenetics; -import binnie.craftgui.controls.ControlText; -import binnie.craftgui.controls.ControlTextEdit; -import binnie.craftgui.controls.scroll.ControlScrollableContent; -import binnie.craftgui.controls.tab.ControlTab; -import binnie.craftgui.controls.tab.ControlTabBar; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.Tooltip; -import binnie.craftgui.core.geometry.IPoint; -import binnie.craftgui.core.geometry.Position; -import binnie.craftgui.events.EventHandler.Origin; -import binnie.craftgui.events.EventTextEdit; -import binnie.craftgui.events.EventTextEdit.Handler; -import binnie.craftgui.events.EventValueChanged; -import binnie.craftgui.events.EventValueChanged.Handler; -import binnie.craftgui.minecraft.MinecraftGUI.PanelType; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.minecraft.control.ControlPlayerInventory; -import binnie.craftgui.minecraft.control.ControlTabIcon; -import binnie.craftgui.window.Panel; -import binnie.genetics.Genetics; -import binnie.genetics.genetics.Engineering; -import binnie.genetics.genetics.GeneTracker; -import cpw.mods.fml.relauncher.Side; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IChromosomeType; -import java.util.Arrays; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Set; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.player.EntityPlayerMP; -import net.minecraft.entity.player.InventoryPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.util.IIcon; - -public class WindowGeneBank - extends WindowMachine -{ - public static IIcon[] iconsDNA; - public boolean isNei; - ControlGeneScroll genes; - - public void recieveGuiNBT(Side side, EntityPlayer player, String name, NBTTagCompound action) - { - super.recieveGuiNBT(side, player, name, action); - if ((side == Side.SERVER) && (name.equals("gene-select"))) - { - Gene gene = new Gene(action.getCompoundTag("gene")); - if ((gene != null) && (!gene.isCorrupted())) - { - ItemStack held = getHeldItemStack(); - - ItemStack converted = Engineering.addGene(held, gene); - - getPlayer().inventory.setItemStack(converted); - - getPlayer().inventory.markDirty(); - if ((getPlayer() instanceof EntityPlayerMP)) { - ((EntityPlayerMP)getPlayer()).sendContainerToPlayer(player.inventoryContainer); - } - } - } - } - - public static Window create(EntityPlayer player, IInventory inventory, Side side) - { - return new WindowGeneBank(player, inventory, side, false); - } - - public WindowGeneBank(EntityPlayer player, IInventory inventory, Side side, boolean isNEI) - { - super(320, 224, player, inventory, side); - this.isNei = isNEI; - } - - public void initialiseServer() - { - GeneTracker tracker = GeneTracker.getTracker(getWorld(), getUsername()); - if (tracker != null) { - tracker.synchToPlayer(getPlayer()); - } - } - - public void initialiseClient() - { - setTitle("Gene Bank"); - - addEventHandler(new EventValueChanged.Handler() - { - public void onEvent(EventValueChanged event) - { - if ((event.value instanceof BreedingSystem)) { - WindowGeneBank.this.genes.setValue((BreedingSystem)event.value); - } - } - }); - int boxX = 100; - - int x = 16; - int y = 32; - - new ControlPlayerInventory(this, x, y); - - x += 124; - - boxX = x; - - int geneBoxWidth = 120; - - new Panel(this, boxX + 24, 32.0F, geneBoxWidth, 120.0F, MinecraftGUI.PanelType.Black); - new Panel(this, boxX + 24 + geneBoxWidth, 32.0F, 14.0F, 120.0F, MinecraftGUI.PanelType.Gray); - ControlScrollableContent scroll = new ControlScrollableContent(this, boxX + 24 + 2, 34.0F, geneBoxWidth + 10, 116.0F, 12.0F); - - ControlTextEdit edit = new ControlTextEdit(this, boxX + 27 + geneBoxWidth - 70, 18.0F, 80.0F, 12.0F); - - addEventHandler(new EventTextEdit.Handler() - { - public void onEvent(EventTextEdit event) - { - WindowGeneBank.this.genes.setFilter((String)event.getValue()); - } - }.setOrigin(EventHandler.Origin.Self, edit)); - - - - this.genes = new ControlGeneScroll(scroll, 1.0F, 1.0F, geneBoxWidth, 116.0F); - scroll.setScrollableContent(this.genes); - - - - - - this.genes.setGenes(Binnie.Genetics.beeBreedingSystem); - - ControlTabBar<BreedingSystem> tabBar = new ControlTabBar(this, boxX, 32.0F, 24.0F, 120.0F, Position.Left) - { - public ControlTab<BreedingSystem> createTab(float x, float y, float w, float h, BreedingSystem value) - { - new ControlTabIcon(this, x, y, w, h, value) - { - public void getTooltip(Tooltip tooltip) - { - tooltip.add(((BreedingSystem)getValue()).toString()); - - int totalGenes = 0; - int seqGenes = 0; - - GeneTracker tracker = GeneTracker.getTracker(WindowGeneBank.this.getWorld(), WindowGeneBank.this.getUsername()); - - Map<IChromosomeType, List<IAllele>> genes = Binnie.Genetics.getChromosomeMap(((BreedingSystem)getValue()).getSpeciesRoot()); - for (Iterator i$ = genes.entrySet().iterator(); i$.hasNext();) - { - entry = (Map.Entry)i$.next(); - totalGenes += ((List)entry.getValue()).size(); - for (IAllele allele : (List)entry.getValue()) - { - Gene gene = new Gene(allele, (IChromosomeType)entry.getKey(), ((BreedingSystem)getValue()).getSpeciesRoot()); - if (tracker.isSequenced(gene)) { - seqGenes++; - } - } - } - Map.Entry<IChromosomeType, List<IAllele>> entry; - tooltip.add("" + seqGenes + "/" + totalGenes + " Genes"); - } - }; - } - }; - tabBar.setValues(Binnie.Genetics.getActiveSystems()); - - tabBar.setValue(Binnie.Genetics.beeBreedingSystem); - - boxX -= 8; - - ControlTabBar<String> infoTabs = new ControlTabBar(this, boxX + 8, 160.0F, 16.0F, 50.0F, Position.Left); - - infoTabs.setValues(Arrays.asList(new String[] { "Stats", "Ranking" })); - - infoTabs.setValue("Info"); - - Panel panelProject = new Panel(this, boxX + 24, 160.0F, geneBoxWidth + 20, 50.0F, MinecraftGUI.PanelType.Black); - - int totalGenes = 0; - int seqGenes = 0; - for (Iterator i$ = Binnie.Genetics.getActiveSystems().iterator(); i$.hasNext();) - { - system = (BreedingSystem)i$.next(); - - tracker = GeneTracker.getTracker(getWorld(), getUsername()); - - Map<IChromosomeType, List<IAllele>> genes = Binnie.Genetics.getChromosomeMap(system.getSpeciesRoot()); - for (i$ = genes.entrySet().iterator(); i$.hasNext();) - { - entry = (Map.Entry)i$.next(); - totalGenes += ((List)entry.getValue()).size(); - for (IAllele allele : (List)entry.getValue()) - { - Gene gene = new Gene(allele, (IChromosomeType)entry.getKey(), system.getSpeciesRoot()); - if (tracker.isSequenced(gene)) { - seqGenes++; - } - } - } - } - BreedingSystem system; - GeneTracker tracker; - Iterator i$; - Map.Entry<IChromosomeType, List<IAllele>> entry; - new ControlText(panelProject, new IPoint(4.0F, 4.0F), "§nFull Genome Project"); - new ControlText(panelProject, new IPoint(4.0F, 18.0F), "§oSequenced §r" + seqGenes + "/" + totalGenes + " §oGenes"); - } - - public String getTitle() - { - return "Gene Bank"; - } - - public static class ChromosomeType - { - IChromosomeType chromosome; - BreedingSystem system; - - public ChromosomeType(IChromosomeType chromosome, BreedingSystem system) - { - this.chromosome = chromosome; - this.system = system; - } - - public String toString() - { - return this.system.getChromosomeName(this.chromosome); - } - } - - protected AbstractMod getMod() - { - return Genetics.instance; - } - - protected String getName() - { - return "GeneBank"; - } -} diff --git a/src/Java/binnie/craftgui/genetics/machine/WindowGeneBankNEI.java b/src/Java/binnie/craftgui/genetics/machine/WindowGeneBankNEI.java deleted file mode 100644 index 08e680c68d..0000000000 --- a/src/Java/binnie/craftgui/genetics/machine/WindowGeneBankNEI.java +++ /dev/null @@ -1,14 +0,0 @@ -package binnie.craftgui.genetics.machine; - -import binnie.craftgui.minecraft.Window; -import cpw.mods.fml.relauncher.Side; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; - -public class WindowGeneBankNEI -{ - public static Window create(EntityPlayer player, IInventory inventory, Side side) - { - return new WindowGeneBank(player, inventory, side, true); - } -} diff --git a/src/Java/binnie/craftgui/genetics/machine/WindowGeneProject.java b/src/Java/binnie/craftgui/genetics/machine/WindowGeneProject.java deleted file mode 100644 index c79e6f7d0c..0000000000 --- a/src/Java/binnie/craftgui/genetics/machine/WindowGeneProject.java +++ /dev/null @@ -1,32 +0,0 @@ -package binnie.craftgui.genetics.machine; - -import binnie.core.AbstractMod; -import binnie.craftgui.minecraft.Window; -import binnie.genetics.Genetics; -import cpw.mods.fml.relauncher.Side; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; - -public class WindowGeneProject - extends Window -{ - public WindowGeneProject(EntityPlayer player, IInventory inventory, Side side) - { - super(100.0F, 100.0F, player, inventory, side); - } - - protected AbstractMod getMod() - { - return Genetics.instance; - } - - protected String getName() - { - return "GeneProjects"; - } - - public void initialiseClient() - { - setTitle("Gene Projects"); - } -} diff --git a/src/Java/binnie/craftgui/genetics/machine/WindowGenepool.java b/src/Java/binnie/craftgui/genetics/machine/WindowGenepool.java deleted file mode 100644 index c91b95c0bb..0000000000 --- a/src/Java/binnie/craftgui/genetics/machine/WindowGenepool.java +++ /dev/null @@ -1,96 +0,0 @@ -package binnie.craftgui.genetics.machine; - -import binnie.core.AbstractMod; -import binnie.craftgui.core.geometry.Position; -import binnie.craftgui.minecraft.GUIIcon; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.minecraft.control.ControlEnergyBar; -import binnie.craftgui.minecraft.control.ControlErrorState; -import binnie.craftgui.minecraft.control.ControlIconDisplay; -import binnie.craftgui.minecraft.control.ControlLiquidTank; -import binnie.craftgui.minecraft.control.ControlMachineProgress; -import binnie.craftgui.minecraft.control.ControlPlayerInventory; -import binnie.craftgui.minecraft.control.ControlSlot; -import binnie.craftgui.minecraft.control.ControlSlotArray; -import binnie.craftgui.minecraft.control.ControlSlotCharge; -import binnie.craftgui.resource.Texture; -import binnie.craftgui.resource.minecraft.StandardTexture; -import binnie.extrabees.core.ExtraBeeTexture; -import binnie.genetics.Genetics; -import binnie.genetics.machine.Genepool; -import cpw.mods.fml.relauncher.Side; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; - -public class WindowGenepool - extends WindowMachine -{ - public static Window create(EntityPlayer player, IInventory inventory, Side side) - { - return new WindowGenepool(player, inventory, side); - } - - public WindowGenepool(EntityPlayer player, IInventory inventory, Side side) - { - super(280, 198, player, inventory, side); - } - - static Texture ProgressBase = new StandardTexture(64, 0, 130, 21, ExtraBeeTexture.GUIProgress.getTexture()); - static Texture Progress = new StandardTexture(64, 21, 130, 21, ExtraBeeTexture.GUIProgress.getTexture()); - - public void initialiseClient() - { - setTitle("Genepool"); - - int x = 16; - int y = 32; - - new ControlLiquidTank(this, x, y).setTankID(1); - - x += 26; - - new ControlSlotArray(this, x, y + 3, 2, 3).create(Genepool.slotReserve); - - x += 38; - - new ControlIconDisplay(this, x, y + 3 + 18 + 1, GUIIcon.ArrowRight.getIcon()); - - x += 18; - - new ControlSlot(this, x, y + 3 + 18).assign(0); - - x += 18; - - new ControlMachineProgress(this, x, y + 19, ProgressBase, Progress, Position.Left); - - x += 130; - - new ControlLiquidTank(this, x, y).setTankID(0); - - - new ControlEnergyBar(this, 21, 115, 16, 60, Position.Bottom); - - new ControlSlot(this, 121.0F, 82.0F).assign(7); - new ControlSlotCharge(this, 143, 82, 7).setColour(15722671); - - - new ControlErrorState(this, 181.0F, 83.0F); - - new ControlPlayerInventory(this); - } - - public String getTitle() - { - return "Genepool"; - } - - protected AbstractMod getMod() - { - return Genetics.instance; - } - - protected String getName() - { - return "Genepool"; - } -} diff --git a/src/Java/binnie/craftgui/genetics/machine/WindowGenomeAssembler.java b/src/Java/binnie/craftgui/genetics/machine/WindowGenomeAssembler.java deleted file mode 100644 index d6e31c3c69..0000000000 --- a/src/Java/binnie/craftgui/genetics/machine/WindowGenomeAssembler.java +++ /dev/null @@ -1,37 +0,0 @@ -package binnie.craftgui.genetics.machine; - -import binnie.core.AbstractMod; -import binnie.craftgui.minecraft.Window; -import binnie.genetics.Genetics; -import cpw.mods.fml.relauncher.Side; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; - -public class WindowGenomeAssembler - extends WindowMachine -{ - public static Window create(EntityPlayer player, IInventory inventory, Side side) - { - return new WindowGenomeAssembler(player, inventory, side); - } - - public WindowGenomeAssembler(EntityPlayer player, IInventory inventory, Side side) - { - super(320, 240, player, inventory, side); - } - - public String getTitle() - { - return "Genome Assembler"; - } - - protected AbstractMod getMod() - { - return Genetics.instance; - } - - protected String getName() - { - return "GenomeAssembler"; - } -} diff --git a/src/Java/binnie/craftgui/genetics/machine/WindowIncubator.java b/src/Java/binnie/craftgui/genetics/machine/WindowIncubator.java deleted file mode 100644 index f52a0b1717..0000000000 --- a/src/Java/binnie/craftgui/genetics/machine/WindowIncubator.java +++ /dev/null @@ -1,99 +0,0 @@ -package binnie.craftgui.genetics.machine; - -import binnie.core.AbstractMod; -import binnie.craftgui.core.geometry.Position; -import binnie.craftgui.minecraft.GUIIcon; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.minecraft.control.ControlEnergyBar; -import binnie.craftgui.minecraft.control.ControlErrorState; -import binnie.craftgui.minecraft.control.ControlIconDisplay; -import binnie.craftgui.minecraft.control.ControlLiquidTank; -import binnie.craftgui.minecraft.control.ControlMachineProgress; -import binnie.craftgui.minecraft.control.ControlPlayerInventory; -import binnie.craftgui.minecraft.control.ControlSlot; -import binnie.craftgui.minecraft.control.ControlSlotArray; -import binnie.craftgui.resource.Texture; -import binnie.craftgui.resource.minecraft.StandardTexture; -import binnie.genetics.Genetics; -import binnie.genetics.core.GeneticsTexture; -import binnie.genetics.machine.Incubator; -import cpw.mods.fml.relauncher.Side; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; - -public class WindowIncubator - extends WindowMachine -{ - public static Window create(EntityPlayer player, IInventory inventory, Side side) - { - return new WindowIncubator(player, inventory, side); - } - - public WindowIncubator(EntityPlayer player, IInventory inventory, Side side) - { - super(228, 196, player, inventory, side); - } - - static Texture ProgressBase = new StandardTexture(0, 91, 38, 32, GeneticsTexture.GUIProcess); - static Texture Progress = new StandardTexture(38, 91, 38, 32, GeneticsTexture.GUIProcess); - - public void initialiseClient() - { - setTitle("Incubator"); - - int x = 16; - int y = 32; - - - new ControlLiquidTank(this, x, y).setTankID(0); - - x += 26; - - new ControlSlotArray(this, x, y + 3, 1, 3).create(Incubator.slotQueue); - - x += 20; - - new ControlIconDisplay(this, x, y + 3 + 10, GUIIcon.ArrowRight.getIcon()); - - x += 18; - - new ControlMachineProgress(this, x, y + 6, ProgressBase, Progress, Position.Left); - - new ControlSlot(this, x + 11, y + 3 + 10).assign(3); - - x += 40; - - new ControlIconDisplay(this, x, y + 3 + 10, GUIIcon.ArrowRight.getIcon()); - - x += 18; - - new ControlSlotArray(this, x, y + 3, 1, 3).create(Incubator.slotOutput); - - x += 26; - - new ControlLiquidTank(this, x, y).setTankID(1); - - x += 34; - - new ControlEnergyBar(this, x, y + 3, 16, 54, Position.Bottom); - - new ControlErrorState(this, 91.0F, 82.0F); - - new ControlPlayerInventory(this); - } - - public String getTitle() - { - return "Incubator"; - } - - protected AbstractMod getMod() - { - return Genetics.instance; - } - - protected String getName() - { - return "Incubator"; - } -} diff --git a/src/Java/binnie/craftgui/genetics/machine/WindowInoculator.java b/src/Java/binnie/craftgui/genetics/machine/WindowInoculator.java deleted file mode 100644 index 894170efd0..0000000000 --- a/src/Java/binnie/craftgui/genetics/machine/WindowInoculator.java +++ /dev/null @@ -1,107 +0,0 @@ -package binnie.craftgui.genetics.machine; - -import binnie.core.AbstractMod; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.geometry.CraftGUIUtil; -import binnie.craftgui.core.geometry.Position; -import binnie.craftgui.core.geometry.TextJustification; -import binnie.craftgui.minecraft.GUIIcon; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.minecraft.control.ControlEnergyBar; -import binnie.craftgui.minecraft.control.ControlErrorState; -import binnie.craftgui.minecraft.control.ControlIconDisplay; -import binnie.craftgui.minecraft.control.ControlLiquidTank; -import binnie.craftgui.minecraft.control.ControlMachineProgress; -import binnie.craftgui.minecraft.control.ControlPlayerInventory; -import binnie.craftgui.minecraft.control.ControlSlot; -import binnie.craftgui.minecraft.control.ControlSlotArray; -import binnie.craftgui.resource.Texture; -import binnie.craftgui.resource.minecraft.StandardTexture; -import binnie.genetics.Genetics; -import binnie.genetics.core.GeneticsTexture; -import binnie.genetics.machine.Inoculator; -import cpw.mods.fml.relauncher.Side; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; - -public class WindowInoculator - extends WindowMachine -{ - public static Window create(EntityPlayer player, IInventory inventory, Side side) - { - return new WindowInoculator(player, inventory, side); - } - - public WindowInoculator(EntityPlayer player, IInventory inventory, Side side) - { - super(266, 240, player, inventory, side); - } - - static Texture ProgressBase = new StandardTexture(0, 72, 142, 72, GeneticsTexture.GUIProcess2.getTexture()); - static Texture Progress = new StandardTexture(0, 0, 142, 72, GeneticsTexture.GUIProcess2.getTexture()); - - public void initialiseClient() - { - setTitle("Inoculator"); - - int x = 16; - int y = 32; - - - new ControlLiquidTank(this, x, y + 18 + 16).setTankID(0); - - - CraftGUIUtil.horizontalGrid(x, y, new IWidget[] { new ControlSlotArray(this, 0, 0, 2, 1).create(Inoculator.slotSerumReserve), new ControlIconDisplay(this, 0.0F, 0.0F, GUIIcon.ArrowRight.getIcon()), new ControlSlot(this, 0.0F, 0.0F).assign(0), new ControlIconDisplay(this, 0.0F, 0.0F, GUIIcon.ArrowRight.getIcon()), new ControlSlotArray(this, 0, 0, 2, 1).create(Inoculator.slotSerumExpended) }); - - - - - - - - - x += 18; - - new ControlMachineProgress(this, x, y + 24, ProgressBase, Progress, Position.Left); - - - new ControlEnergyBar(this, 91, 118, 60, 16, Position.Left); - new ControlErrorState(this, 161.0F, 118.0F); - - - x += 142; - - - CraftGUIUtil.verticalGrid(x, y, TextJustification.MiddleLeft, 8.0F, new IWidget[] { new ControlSlotArray(this, x, y, 4, 1).create(Inoculator.slotReserve), new ControlSlot(this, x, y + 18 + 8).assign(9), new ControlSlotArray(this, x, y + 18 + 8 + 18 + 8, 4, 1).create(Inoculator.slotFinished) }); - - - - - - new ControlIconDisplay(this, x + 18, y + 18 + 2, GUIIcon.ArrowUpLeft.getIcon()); - new ControlIconDisplay(this, x + 18, y + 18 + 18, GUIIcon.ArrowLeftDown.getIcon()); - - - - - - - - new ControlPlayerInventory(this); - } - - public String getTitle() - { - return "Inoculator"; - } - - protected AbstractMod getMod() - { - return Genetics.instance; - } - - protected String getName() - { - return "Inoculator"; - } -} diff --git a/src/Java/binnie/craftgui/genetics/machine/WindowIsolator.java b/src/Java/binnie/craftgui/genetics/machine/WindowIsolator.java deleted file mode 100644 index 6d494250ee..0000000000 --- a/src/Java/binnie/craftgui/genetics/machine/WindowIsolator.java +++ /dev/null @@ -1,116 +0,0 @@ -package binnie.craftgui.genetics.machine; - -import binnie.core.AbstractMod; -import binnie.craftgui.core.geometry.Position; -import binnie.craftgui.minecraft.GUIIcon; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.minecraft.control.ControlEnergyBar; -import binnie.craftgui.minecraft.control.ControlErrorState; -import binnie.craftgui.minecraft.control.ControlIconDisplay; -import binnie.craftgui.minecraft.control.ControlLiquidTank; -import binnie.craftgui.minecraft.control.ControlPlayerInventory; -import binnie.craftgui.minecraft.control.ControlProgress; -import binnie.craftgui.minecraft.control.ControlSlot; -import binnie.craftgui.minecraft.control.ControlSlotArray; -import binnie.craftgui.minecraft.control.ControlSlotCharge; -import binnie.craftgui.resource.Texture; -import binnie.craftgui.resource.minecraft.StandardTexture; -import binnie.extrabees.core.ExtraBeeTexture; -import binnie.genetics.Genetics; -import binnie.genetics.machine.Isolator; -import cpw.mods.fml.relauncher.Side; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; - -public class WindowIsolator - extends WindowMachine -{ - public static Window create(EntityPlayer player, IInventory inventory, Side side) - { - return new WindowIsolator(player, inventory, side); - } - - static Texture ProgressBase = new StandardTexture(0, 218, 142, 17, ExtraBeeTexture.GUIProgress.getTexture()); - static Texture Progress = new StandardTexture(0, 201, 142, 17, ExtraBeeTexture.GUIProgress.getTexture()); - - public WindowIsolator(EntityPlayer player, IInventory inventory, Side side) - { - super(330, 208, player, inventory, side); - } - - public void initialiseClient() - { - setTitle("Isolator"); - - int x = 16; - int y = 32; - - new ControlLiquidTank(this, x, y).setTankID(0); - - x += 26; - - new ControlSlotArray(this, x, y + 3, 1, 3).create(Isolator.slotReserve); - - x += 20; - - new ControlIconDisplay(this, x, y + 3 + 1, GUIIcon.ArrowRight.getIcon()); - - x += 18; - - new ControlSlot(this, x, y + 3).assign(5); - - new ControlSlot(this, x, y + 36 + 3).assign(0); - new ControlSlotCharge(this, x + 18 + 2, y + 36 + 3, 0).setColour(15722671); - - - - x += 18; - - new ControlProgress(this, x, y + 3, ProgressBase, Progress, Position.Left); - - x += 142; - - new ControlSlot(this, x, y + 3).assign(6); - - new ControlSlot(this, x, y + 3 + 36).assign(1); - - new ControlIconDisplay(this, x + 1, y + 3 + 19, GUIIcon.ArrowUp.getIcon()); - - x += 20; - - - new ControlIconDisplay(this, x, y + 3 + 1, GUIIcon.ArrowRight.getIcon()); - - x += 18; - - new ControlSlotArray(this, x, y + 3, 2, 3).create(Isolator.slotFinished); - - - new ControlEnergyBar(this, 260, 130, 16, 60, Position.Bottom); - - - - - - - - new ControlErrorState(this, 153.0F, 81.0F); - - new ControlPlayerInventory(this); - } - - public String getTitle() - { - return "Incubator"; - } - - protected AbstractMod getMod() - { - return Genetics.instance; - } - - protected String getName() - { - return "Isolator"; - } -} diff --git a/src/Java/binnie/craftgui/genetics/machine/WindowMachine.java b/src/Java/binnie/craftgui/genetics/machine/WindowMachine.java deleted file mode 100644 index 6b357a36d7..0000000000 --- a/src/Java/binnie/craftgui/genetics/machine/WindowMachine.java +++ /dev/null @@ -1,22 +0,0 @@ -package binnie.craftgui.genetics.machine; - -import binnie.craftgui.minecraft.Window; -import cpw.mods.fml.relauncher.Side; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; - -public abstract class WindowMachine - extends Window -{ - public WindowMachine(int width, int height, EntityPlayer player, IInventory inventory, Side side) - { - super(width, height, player, inventory, side); - } - - public abstract String getTitle(); - - public void initialiseClient() - { - setTitle(getTitle()); - } -} diff --git a/src/Java/binnie/craftgui/genetics/machine/WindowPolymeriser.java b/src/Java/binnie/craftgui/genetics/machine/WindowPolymeriser.java deleted file mode 100644 index edf9e371f7..0000000000 --- a/src/Java/binnie/craftgui/genetics/machine/WindowPolymeriser.java +++ /dev/null @@ -1,101 +0,0 @@ -package binnie.craftgui.genetics.machine; - -import binnie.core.AbstractMod; -import binnie.craftgui.core.geometry.Position; -import binnie.craftgui.minecraft.GUIIcon; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.minecraft.control.ControlEnergyBar; -import binnie.craftgui.minecraft.control.ControlErrorState; -import binnie.craftgui.minecraft.control.ControlIconDisplay; -import binnie.craftgui.minecraft.control.ControlLiquidTank; -import binnie.craftgui.minecraft.control.ControlMachineProgress; -import binnie.craftgui.minecraft.control.ControlPlayerInventory; -import binnie.craftgui.minecraft.control.ControlSlot; -import binnie.craftgui.minecraft.control.ControlSlotArray; -import binnie.craftgui.minecraft.control.ControlSlotCharge; -import binnie.craftgui.resource.Texture; -import binnie.craftgui.resource.minecraft.StandardTexture; -import binnie.genetics.Genetics; -import binnie.genetics.core.GeneticsTexture; -import binnie.genetics.machine.Polymeriser; -import cpw.mods.fml.relauncher.Side; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; - -public class WindowPolymeriser - extends WindowMachine -{ - public static Window create(EntityPlayer player, IInventory inventory, Side side) - { - return new WindowPolymeriser(player, inventory, side); - } - - public WindowPolymeriser(EntityPlayer player, IInventory inventory, Side side) - { - super(278, 212, player, inventory, side); - } - - static Texture ProgressBase = new StandardTexture(76, 170, 160, 79, GeneticsTexture.GUIProcess.getTexture()); - static Texture Progress = new StandardTexture(76, 91, 160, 79, GeneticsTexture.GUIProcess.getTexture()); - - public void initialiseClient() - { - super.initialiseClient(); - - int x = 16; - int y = 38; - - - - - - new ControlSlotArray(this, x, y, 1, 4).create(Polymeriser.slotSerumReserve); - new ControlIconDisplay(this, x + 18, y + 1, GUIIcon.ArrowRight.getIcon()); - - x += 34; - - new ControlMachineProgress(this, x + 18, y - 6, ProgressBase, Progress, Position.Left); - - - new ControlSlot(this, x, y).assign(0); - - - new ControlLiquidTank(this, x, y + 18 + 16, true).setTankID(0); - - new ControlLiquidTank(this, x, y + 18 + 16 + 18 + 8, true).setTankID(1); - - new ControlEnergyBar(this, x + 120, 96, 64, 16, Position.Left); - - x += 40; - - new ControlSlot(this, x + 30, y + 18 + 8).assign(1); - new ControlSlotCharge(this, x + 30 + 20, y + 18 + 8, 1).setColour(16766976); - - - - - x += 138; - - new ControlSlotArray(this, x, y + 9, 2, 2).create(Polymeriser.slotSerumFinished); - - ControlErrorState errorState = new ControlErrorState(this, 244.0F, 97.0F); - - - new ControlPlayerInventory(this); - } - - public String getTitle() - { - return "Polymeriser"; - } - - protected AbstractMod getMod() - { - return Genetics.instance; - } - - protected String getName() - { - return "Polymeriser"; - } -} diff --git a/src/Java/binnie/craftgui/genetics/machine/WindowSequencer.java b/src/Java/binnie/craftgui/genetics/machine/WindowSequencer.java deleted file mode 100644 index 9e2f580b53..0000000000 --- a/src/Java/binnie/craftgui/genetics/machine/WindowSequencer.java +++ /dev/null @@ -1,116 +0,0 @@ -package binnie.craftgui.genetics.machine; - -import binnie.core.AbstractMod; -import binnie.craftgui.controls.ControlText; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.geometry.CraftGUIUtil; -import binnie.craftgui.core.geometry.IArea; -import binnie.craftgui.core.geometry.Position; -import binnie.craftgui.core.geometry.TextJustification; -import binnie.craftgui.minecraft.GUIIcon; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.minecraft.control.ControlEnergyBar; -import binnie.craftgui.minecraft.control.ControlErrorState; -import binnie.craftgui.minecraft.control.ControlIconDisplay; -import binnie.craftgui.minecraft.control.ControlPlayerInventory; -import binnie.craftgui.minecraft.control.ControlSlot; -import binnie.craftgui.minecraft.control.ControlSlotArray; -import binnie.craftgui.minecraft.control.ControlSlotCharge; -import binnie.craftgui.resource.Texture; -import binnie.craftgui.resource.minecraft.StandardTexture; -import binnie.extrabees.core.ExtraBeeTexture; -import binnie.genetics.Genetics; -import binnie.genetics.machine.Sequencer; -import cpw.mods.fml.relauncher.Side; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; -import net.minecraft.nbt.NBTTagCompound; - -public class WindowSequencer - extends WindowMachine -{ - public static Window create(EntityPlayer player, IInventory inventory, Side side) - { - return new WindowSequencer(player, inventory, side); - } - - public WindowSequencer(EntityPlayer player, IInventory inventory, Side side) - { - super(226, 224, player, inventory, side); - } - - static Texture ProgressBase = new StandardTexture(64, 114, 98, 9, ExtraBeeTexture.GUIProgress.getTexture()); - static Texture Progress = new StandardTexture(64, 123, 98, 9, ExtraBeeTexture.GUIProgress.getTexture()); - ControlText slotText; - - public void recieveGuiNBT(Side side, EntityPlayer player, String name, NBTTagCompound action) - { - if ((side == Side.CLIENT) && (name.equals("username"))) { - this.slotText.setValue("§8Genes will be sequenced by " + action.getString("username")); - } - super.recieveGuiNBT(side, player, name, action); - } - - public void initialiseClient() - { - setTitle("Sequencer"); - - - int x = 16; - int y = 32; - - - - - CraftGUIUtil.horizontalGrid(x, y, TextJustification.MiddleCenter, 2.0F, new IWidget[] { new ControlSlotArray(this, 0, 0, 2, 2).create(Sequencer.slotReserve), new ControlIconDisplay(this, 0.0F, 0.0F, GUIIcon.ArrowRight.getIcon()), new ControlSequencerProgress(this, 0, 0), new ControlIconDisplay(this, 0.0F, 0.0F, GUIIcon.ArrowRight.getIcon()), new ControlSlot(this, 0.0F, 0.0F).assign(6) }); - - - - - - - - - ControlSlot slotTarget = new ControlSlot(this, x + 96, y + 16); - slotTarget.assign(5); - - x = 34; - y = 92; - - this.slotText = new ControlText(this, new IArea(0.0F, y, w(), 12.0F), "§8Userless. Will not save sequences", TextJustification.MiddleCenter); - - - - y += 20; - - ControlSlot slotDye = new ControlSlot(this, x, y); - slotDye.assign(0); - x += 20; - new ControlSlotCharge(this, x, y, 0).setColour(16750848); - - x += 32; - new ControlEnergyBar(this, x, y, 60, 16, Position.Left); - - x += 92; - ControlErrorState errorState = new ControlErrorState(this, x, y + 1); - - - - new ControlPlayerInventory(this); - } - - public String getTitle() - { - return "Incubator"; - } - - protected AbstractMod getMod() - { - return Genetics.instance; - } - - protected String getName() - { - return "Sequencer"; - } -} diff --git a/src/Java/binnie/craftgui/genetics/machine/WindowSplicer.java b/src/Java/binnie/craftgui/genetics/machine/WindowSplicer.java deleted file mode 100644 index 23d7cd8015..0000000000 --- a/src/Java/binnie/craftgui/genetics/machine/WindowSplicer.java +++ /dev/null @@ -1,93 +0,0 @@ -package binnie.craftgui.genetics.machine; - -import binnie.core.AbstractMod; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.geometry.CraftGUIUtil; -import binnie.craftgui.core.geometry.Position; -import binnie.craftgui.core.geometry.TextJustification; -import binnie.craftgui.minecraft.GUIIcon; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.minecraft.control.ControlEnergyBar; -import binnie.craftgui.minecraft.control.ControlErrorState; -import binnie.craftgui.minecraft.control.ControlIconDisplay; -import binnie.craftgui.minecraft.control.ControlPlayerInventory; -import binnie.craftgui.minecraft.control.ControlSlot; -import binnie.craftgui.minecraft.control.ControlSlotArray; -import binnie.craftgui.resource.Texture; -import binnie.craftgui.resource.minecraft.StandardTexture; -import binnie.genetics.Genetics; -import binnie.genetics.core.GeneticsTexture; -import binnie.genetics.machine.Inoculator; -import binnie.genetics.machine.Splicer; -import cpw.mods.fml.relauncher.Side; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; - -public class WindowSplicer - extends WindowMachine -{ - public static Window create(EntityPlayer player, IInventory inventory, Side side) - { - return new WindowSplicer(player, inventory, side); - } - - public WindowSplicer(EntityPlayer player, IInventory inventory, Side side) - { - super(280, 240, player, inventory, side); - } - - static Texture ProgressBase = new StandardTexture(0, 72, 142, 72, GeneticsTexture.GUIProcess2.getTexture()); - static Texture Progress = new StandardTexture(0, 0, 142, 72, GeneticsTexture.GUIProcess2.getTexture()); - - public void initialiseClient() - { - setTitle("Splicer"); - - int x = 16; - - - - - new ControlSplicerProgress(this, 84.0F, 32.0F, w() - 172.0F, 102.0F); - - CraftGUIUtil.horizontalGrid(x, 62.0F, new IWidget[] { new ControlSlotArray(this, 0, 0, 2, 1).create(Splicer.slotSerumReserve), new ControlIconDisplay(this, 0.0F, 0.0F, GUIIcon.ArrowRight.getIcon()), new ControlSlot(this, 0.0F, 0.0F).assign(0) }); - - - - - new ControlSlotArray(this, x + 12, 84, 2, 1).create(Splicer.slotSerumExpended); - - new ControlIconDisplay(this, x + 12 + 36 + 4, 86.0F, GUIIcon.ArrowUpLeft.getIcon()); - - - - new ControlEnergyBar(this, 196, 64, 60, 16, Position.Left); - new ControlErrorState(this, 218.0F, 86.0F); - - x += 142; - - CraftGUIUtil.verticalGrid((w() - 72.0F) / 2.0F, 32.0F, TextJustification.MiddleCenter, 4.0F, new IWidget[] { new ControlSlotArray(this, 0, 0, 4, 1).create(Inoculator.slotReserve), new ControlIconDisplay(this, 0.0F, 0.0F, GUIIcon.ArrowDown.getIcon()), new ControlSlot(this, 0.0F, 0.0F).assign(9), new ControlIconDisplay(this, 0.0F, 0.0F, GUIIcon.ArrowDown.getIcon()), new ControlSlotArray(this, 0, 0, 4, 1).create(Inoculator.slotFinished) }); - - - - - - - new ControlPlayerInventory(this); - } - - public String getTitle() - { - return "Inoculator"; - } - - protected AbstractMod getMod() - { - return Genetics.instance; - } - - protected String getName() - { - return "Inoculator"; - } -} diff --git a/src/Java/binnie/extrabees/genetics/ExtraBeeMutation.java b/src/Java/binnie/extrabees/genetics/ExtraBeeMutation.java deleted file mode 100644 index c3a849c9e5..0000000000 --- a/src/Java/binnie/extrabees/genetics/ExtraBeeMutation.java +++ /dev/null @@ -1,478 +0,0 @@ -package binnie.extrabees.genetics; - -import binnie.Binnie; -import binnie.core.genetics.ForestryAllele.BeeSpecies; -import binnie.core.genetics.ManagerGenetics; -import com.mojang.authlib.GameProfile; -import forestry.api.apiculture.IAlleleBeeSpecies; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeHousing; -import forestry.api.apiculture.IBeeMutation; -import forestry.api.apiculture.IBeeRoot; -import forestry.api.apiculture.IBeekeepingMode; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IGenome; -import java.util.ArrayList; -import java.util.Collection; -import java.util.List; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.BiomeDictionary.Type; - -public class ExtraBeeMutation - implements IBeeMutation -{ - public static void doInit() - { - 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 (IBeeMutation mutation : mutations) { - Binnie.Genetics.getBeeRoot().registerMutation(mutation); - } - } - - public static List<IBeeMutation> mutations = new ArrayList(); - MutationRequirement req; - - public ExtraBeeMutation(IAlleleBeeSpecies allele0, IAlleleBeeSpecies allele1, ExtraBeesSpecies mutation, int chance) - { - this(allele0, allele1, mutation.getTemplate(), chance, null); - } - - public ExtraBeeMutation(IAlleleBeeSpecies allele0, IAlleleBeeSpecies allele1, ExtraBeesSpecies mutation, int chance, MutationRequirement req) - { - this(allele0, allele1, mutation.getTemplate(), chance, req); - } - - public ExtraBeeMutation(IAlleleBeeSpecies allele0, IAlleleBeeSpecies allele1, IAllele[] mutation, int chance) - { - this(allele0, allele1, mutation, chance, null); - } - - public ExtraBeeMutation(IAlleleBeeSpecies allele0, IAlleleBeeSpecies allele1, IAllele[] mutation, int chance, MutationRequirement req) - { - 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)) { - mutations.add(this); - } - } - - IAlleleBeeSpecies species0 = null; - IAlleleBeeSpecies species1 = null; - IAllele[] template = new IAllele[0]; - int chance = 80; - - public IAllele getAllele0() - { - return this.species0; - } - - public IAllele getAllele1() - { - return this.species1; - } - - public IAllele[] getTemplate() - { - return this.template; - } - - public float getBaseChance() - { - return this.chance; - } - - public boolean isPartner(IAllele allele) - { - return (allele.getUID().equals(this.species0.getUID())) || (allele.getUID().equals(this.species1.getUID())); - } - - public IAllele getPartner(IAllele allele) - { - return allele.getUID().equals(this.species0.getUID()) ? this.species1 : this.species0; - } - - public boolean isSecret() - { - return false; - } - - public float getChance(IBeeHousing housing, IAlleleBeeSpecies allele0, IAlleleBeeSpecies allele1, IBeeGenome genome0, IBeeGenome genome1) - { - return getChance(housing, allele0, allele1, genome0, genome1); - } - - public float getChance(IBeeHousing housing, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1) - { - if ((this.species0 == null) || (this.species1 == null) || (allele0 == null) || (allele1 == null)) { - return 0.0F; - } - World world = housing.getWorld(); - int x = housing.getXCoord(); - int y = housing.getYCoord(); - int z = housing.getZCoord(); - BiomeGenBase biome = housing.getBiome(); - if ((this.req != null) && (!this.req.fufilled(housing, allele0, allele1, genome0, genome1))) { - return 0.0F; - } - int processedChance = Math.round(this.chance * housing.getMutationModifier((IBeeGenome)genome0, (IBeeGenome)genome1, 1.0F) * Binnie.Genetics.getBeeRoot().getBeekeepingMode(world).getMutationModifier((IBeeGenome)genome0, (IBeeGenome)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; - } - - public Collection<String> getSpecialConditions() - { - List<String> conditions = new ArrayList(); - if (this.req != null) { - for (String s : this.req.tooltip()) { - conditions.add(s); - } - } - return conditions; - } - - public IBeeRoot getRoot() - { - return Binnie.Genetics.getBeeRoot(); - } - - static abstract class MutationRequirement - { - public abstract String[] tooltip(); - - public abstract boolean fufilled(IBeeHousing paramIBeeHousing, IAllele paramIAllele1, IAllele paramIAllele2, IGenome paramIGenome1, IGenome paramIGenome2); - } - - static class RequirementBiomeType - extends ExtraBeeMutation.MutationRequirement - { - BiomeDictionary.Type type; - - public RequirementBiomeType(BiomeDictionary.Type type) - { - this.type = type; - } - - public String[] tooltip() - { - return new String[] { "Is restricted to " + this.type + "-like biomes." }; - } - - public boolean fufilled(IBeeHousing housing, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1) - { - return BiomeDictionary.isBiomeOfType(housing.getBiome(), this.type); - } - } - - static class RequirementPerson - extends ExtraBeeMutation.MutationRequirement - { - String name; - - public RequirementPerson(String name) - { - this.name = name; - } - - public String[] tooltip() - { - return new String[] { "Can only be bred by " + this.name }; - } - - public boolean fufilled(IBeeHousing housing, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1) - { - return (housing.getOwnerName() != null) && (housing.getOwnerName().equals(this.name)); - } - } -} diff --git a/src/Java/binnie/extrabees/genetics/ExtraBeesBranch.java b/src/Java/binnie/extrabees/genetics/ExtraBeesBranch.java deleted file mode 100644 index de978231c6..0000000000 --- a/src/Java/binnie/extrabees/genetics/ExtraBeesBranch.java +++ /dev/null @@ -1,313 +0,0 @@ -package binnie.extrabees.genetics; - -import binnie.extrabees.ExtraBees; -import binnie.extrabees.proxy.ExtraBeesProxy; -import forestry.api.apiculture.IAlleleBeeSpecies; -import forestry.api.genetics.AlleleManager; -import forestry.api.genetics.IAlleleRegistry; -import forestry.api.genetics.IAlleleSpecies; -import forestry.api.genetics.IClassification; -import forestry.api.genetics.IClassification.EnumClassLevel; -import java.util.LinkedHashSet; -import java.util.Set; - -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 = new LinkedHashSet(); - IClassification parent; - - public String getUID() - { - return "extrabees.genus." + this.uid; - } - - public String getName() - { - return ExtraBees.proxy.localise("branch." + toString().toLowerCase() + ".name"); - } - - public String getScientific() - { - return this.scientific; - } - - public String getDescription() - { - return ExtraBees.proxy.localiseOrBlank("branch." + toString().toLowerCase() + ".desc"); - } - - private ExtraBeesBranch(String scientific) - { - this.scientific = scientific; - this.uid = toString().toLowerCase(); - } - - public void register() - { - if (!this.speciesSet.isEmpty()) - { - AlleleManager.alleleRegistry.registerClassification(this); - IClassification parent = AlleleManager.alleleRegistry.getClassification("family.apidae"); - if (parent != null) - { - parent.addMemberGroup(this); - setParent(parent); - } - } - } - - public static void doInit() - { - 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); - } - 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); - } - 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); - } - IClassification festiveBranch = AlleleManager.alleleRegistry.getClassification("genus.bees.festive"); - if (festiveBranch != null) - { - festiveBranch.addMemberSpecies(ExtraBeesSpecies.CELEBRATORY); - ExtraBeesSpecies.CELEBRATORY.setBranch(festiveBranch); - } - IClassification austereBranch = AlleleManager.alleleRegistry.getClassification("genus.bees.austere"); - if (austereBranch != null) - { - austereBranch.addMemberSpecies(ExtraBeesSpecies.HAZARDOUS); - ExtraBeesSpecies.HAZARDOUS.setBranch(austereBranch); - } - FARMING.addMemberSpecies(ExtraBeesSpecies.ALCOHOL); - FARMING.addMemberSpecies(ExtraBeesSpecies.MILK); - FARMING.addMemberSpecies(ExtraBeesSpecies.COFFEE); - FARMING.addMemberSpecies(ExtraBeesSpecies.CITRUS); - FARMING.addMemberSpecies(ExtraBeesSpecies.MINT); - FARMING.register(); - - BARREN.addMemberSpecies(ExtraBeesSpecies.ARID); - BARREN.addMemberSpecies(ExtraBeesSpecies.BARREN); - BARREN.addMemberSpecies(ExtraBeesSpecies.DESOLATE); - BARREN.addMemberSpecies(ExtraBeesSpecies.DECOMPOSING); - BARREN.addMemberSpecies(ExtraBeesSpecies.GNAWING); - BARREN.register(); - - HOSTILE.addMemberSpecies(ExtraBeesSpecies.ROTTEN); - HOSTILE.addMemberSpecies(ExtraBeesSpecies.BONE); - HOSTILE.addMemberSpecies(ExtraBeesSpecies.CREEPER); - HOSTILE.register(); - - ROCKY.addMemberSpecies(ExtraBeesSpecies.ROCK); - ROCKY.addMemberSpecies(ExtraBeesSpecies.STONE); - ROCKY.addMemberSpecies(ExtraBeesSpecies.GRANITE); - ROCKY.addMemberSpecies(ExtraBeesSpecies.MINERAL); - ROCKY.register(); - - METALLIC.addMemberSpecies(ExtraBeesSpecies.IRON); - METALLIC.addMemberSpecies(ExtraBeesSpecies.COPPER); - METALLIC.addMemberSpecies(ExtraBeesSpecies.TIN); - METALLIC.addMemberSpecies(ExtraBeesSpecies.LEAD); - METALLIC.register(); - - METALLIC2.addMemberSpecies(ExtraBeesSpecies.NICKEL); - METALLIC2.addMemberSpecies(ExtraBeesSpecies.ZINC); - METALLIC2.addMemberSpecies(ExtraBeesSpecies.TUNGSTATE); - METALLIC2.addMemberSpecies(ExtraBeesSpecies.TITANIUM); - METALLIC2.register(); - - ALLOY.addMemberSpecies(ExtraBeesSpecies.BRONZE); - ALLOY.addMemberSpecies(ExtraBeesSpecies.BRASS); - ALLOY.addMemberSpecies(ExtraBeesSpecies.STEEL); - ALLOY.addMemberSpecies(ExtraBeesSpecies.INVAR); - ALLOY.register(); - - PRECIOUS.addMemberSpecies(ExtraBeesSpecies.SILVER); - PRECIOUS.addMemberSpecies(ExtraBeesSpecies.GOLD); - PRECIOUS.addMemberSpecies(ExtraBeesSpecies.ELECTRUM); - PRECIOUS.addMemberSpecies(ExtraBeesSpecies.PLATINUM); - PRECIOUS.register(); - - MINERAL.addMemberSpecies(ExtraBeesSpecies.LAPIS); - MINERAL.addMemberSpecies(ExtraBeesSpecies.SODALITE); - MINERAL.addMemberSpecies(ExtraBeesSpecies.PYRITE); - MINERAL.addMemberSpecies(ExtraBeesSpecies.BAUXITE); - MINERAL.addMemberSpecies(ExtraBeesSpecies.CINNABAR); - MINERAL.addMemberSpecies(ExtraBeesSpecies.SPHALERITE); - MINERAL.register(); - - GEMSTONE.addMemberSpecies(ExtraBeesSpecies.EMERALD); - GEMSTONE.addMemberSpecies(ExtraBeesSpecies.RUBY); - GEMSTONE.addMemberSpecies(ExtraBeesSpecies.SAPPHIRE); - GEMSTONE.addMemberSpecies(ExtraBeesSpecies.OLIVINE); - GEMSTONE.addMemberSpecies(ExtraBeesSpecies.DIAMOND); - GEMSTONE.register(); - - NUCLEAR.addMemberSpecies(ExtraBeesSpecies.UNSTABLE); - NUCLEAR.addMemberSpecies(ExtraBeesSpecies.NUCLEAR); - NUCLEAR.addMemberSpecies(ExtraBeesSpecies.RADIOACTIVE); - NUCLEAR.addMemberSpecies(ExtraBeesSpecies.YELLORIUM); - NUCLEAR.addMemberSpecies(ExtraBeesSpecies.CYANITE); - NUCLEAR.addMemberSpecies(ExtraBeesSpecies.BLUTONIUM); - NUCLEAR.register(); - - HISTORIC.addMemberSpecies(ExtraBeesSpecies.ANCIENT); - HISTORIC.addMemberSpecies(ExtraBeesSpecies.PRIMEVAL); - HISTORIC.addMemberSpecies(ExtraBeesSpecies.PREHISTORIC); - HISTORIC.addMemberSpecies(ExtraBeesSpecies.RELIC); - HISTORIC.register(); - - FOSSILIZED.addMemberSpecies(ExtraBeesSpecies.COAL); - FOSSILIZED.addMemberSpecies(ExtraBeesSpecies.RESIN); - FOSSILIZED.addMemberSpecies(ExtraBeesSpecies.OIL); - FOSSILIZED.addMemberSpecies(ExtraBeesSpecies.PEAT); - FOSSILIZED.register(); - - REFINED.addMemberSpecies(ExtraBeesSpecies.DISTILLED); - REFINED.addMemberSpecies(ExtraBeesSpecies.FUEL); - REFINED.addMemberSpecies(ExtraBeesSpecies.CREOSOTE); - REFINED.addMemberSpecies(ExtraBeesSpecies.LATEX); - REFINED.register(); - - AQUATIC.addMemberSpecies(ExtraBeesSpecies.WATER); - AQUATIC.addMemberSpecies(ExtraBeesSpecies.RIVER); - AQUATIC.addMemberSpecies(ExtraBeesSpecies.OCEAN); - AQUATIC.addMemberSpecies(ExtraBeesSpecies.INK); - AQUATIC.register(); - - SACCHARINE.addMemberSpecies(ExtraBeesSpecies.SWEET); - SACCHARINE.addMemberSpecies(ExtraBeesSpecies.SUGAR); - SACCHARINE.addMemberSpecies(ExtraBeesSpecies.FRUIT); - SACCHARINE.addMemberSpecies(ExtraBeesSpecies.RIPENING); - SACCHARINE.register(); - - CLASSICAL.addMemberSpecies(ExtraBeesSpecies.MARBLE); - CLASSICAL.addMemberSpecies(ExtraBeesSpecies.ROMAN); - CLASSICAL.addMemberSpecies(ExtraBeesSpecies.GREEK); - CLASSICAL.addMemberSpecies(ExtraBeesSpecies.CLASSICAL); - CLASSICAL.register(); - - VOLCANIC.addMemberSpecies(ExtraBeesSpecies.BASALT); - VOLCANIC.addMemberSpecies(ExtraBeesSpecies.TEMPERED); - VOLCANIC.addMemberSpecies(ExtraBeesSpecies.ANGRY); - VOLCANIC.addMemberSpecies(ExtraBeesSpecies.VOLCANIC); - VOLCANIC.addMemberSpecies(ExtraBeesSpecies.GLOWSTONE); - VOLCANIC.register(); - - VISCOUS.addMemberSpecies(ExtraBeesSpecies.VISCOUS); - VISCOUS.addMemberSpecies(ExtraBeesSpecies.GLUTINOUS); - VISCOUS.addMemberSpecies(ExtraBeesSpecies.STICKY); - VISCOUS.register(); - - VIRULENT.addMemberSpecies(ExtraBeesSpecies.MALICIOUS); - VIRULENT.addMemberSpecies(ExtraBeesSpecies.INFECTIOUS); - VIRULENT.addMemberSpecies(ExtraBeesSpecies.VIRULENT); - VIRULENT.register(); - - CAUSTIC.addMemberSpecies(ExtraBeesSpecies.CORROSIVE); - CAUSTIC.addMemberSpecies(ExtraBeesSpecies.CAUSTIC); - CAUSTIC.addMemberSpecies(ExtraBeesSpecies.ACIDIC); - CAUSTIC.register(); - - ENERGETIC.addMemberSpecies(ExtraBeesSpecies.EXCITED); - ENERGETIC.addMemberSpecies(ExtraBeesSpecies.ENERGETIC); - ENERGETIC.addMemberSpecies(ExtraBeesSpecies.ECSTATIC); - ENERGETIC.register(); - - SHADOW.addMemberSpecies(ExtraBeesSpecies.SHADOW); - SHADOW.addMemberSpecies(ExtraBeesSpecies.DARKENED); - SHADOW.addMemberSpecies(ExtraBeesSpecies.ABYSS); - SHADOW.register(); - - PRIMARY.addMemberSpecies(ExtraBeesSpecies.RED); - PRIMARY.addMemberSpecies(ExtraBeesSpecies.YELLOW); - PRIMARY.addMemberSpecies(ExtraBeesSpecies.BLUE); - PRIMARY.addMemberSpecies(ExtraBeesSpecies.GREEN); - PRIMARY.addMemberSpecies(ExtraBeesSpecies.BLACK); - PRIMARY.addMemberSpecies(ExtraBeesSpecies.WHITE); - PRIMARY.addMemberSpecies(ExtraBeesSpecies.BROWN); - PRIMARY.register(); - - SECONDARY.addMemberSpecies(ExtraBeesSpecies.ORANGE); - SECONDARY.addMemberSpecies(ExtraBeesSpecies.CYAN); - SECONDARY.addMemberSpecies(ExtraBeesSpecies.PURPLE); - SECONDARY.addMemberSpecies(ExtraBeesSpecies.GRAY); - SECONDARY.addMemberSpecies(ExtraBeesSpecies.LIGHTBLUE); - SECONDARY.addMemberSpecies(ExtraBeesSpecies.PINK); - SECONDARY.addMemberSpecies(ExtraBeesSpecies.LIMEGREEN); - SECONDARY.register(); - - TERTIARY.addMemberSpecies(ExtraBeesSpecies.MAGENTA); - TERTIARY.addMemberSpecies(ExtraBeesSpecies.LIGHTGRAY); - TERTIARY.register(); - - FTB.addMemberSpecies(ExtraBeesSpecies.JADED); - FTB.register(); - - QUANTUM.addMemberSpecies(ExtraBeesSpecies.UNUSUAL); - QUANTUM.addMemberSpecies(ExtraBeesSpecies.SPATIAL); - QUANTUM.addMemberSpecies(ExtraBeesSpecies.QUANTUM); - QUANTUM.register(); - - BOTANIA.addMemberSpecies(ExtraBeesSpecies.MYSTICAL); - BOTANIA.register(); - } - - public IClassification.EnumClassLevel getLevel() - { - return IClassification.EnumClassLevel.GENUS; - } - - public IClassification[] getMemberGroups() - { - return null; - } - - public void addMemberGroup(IClassification group) {} - - public IAlleleSpecies[] getMemberSpecies() - { - return (IAlleleSpecies[])this.speciesSet.toArray(new IAlleleSpecies[0]); - } - - public void addMemberSpecies(IAlleleSpecies species) - { - this.speciesSet.add((IAlleleBeeSpecies)species); - if ((species instanceof ExtraBeesSpecies)) { - ((ExtraBeesSpecies)species).setBranch(this); - } - } - - public IClassification getParent() - { - return this.parent; - } - - public void setParent(IClassification parent) - { - this.parent = parent; - } -} diff --git a/src/Java/binnie/extrabees/genetics/ExtraBeesFlowers.java b/src/Java/binnie/extrabees/genetics/ExtraBeesFlowers.java deleted file mode 100644 index 743c7a55a8..0000000000 --- a/src/Java/binnie/extrabees/genetics/ExtraBeesFlowers.java +++ /dev/null @@ -1,202 +0,0 @@ -package binnie.extrabees.genetics; - -import binnie.core.Mods; -import binnie.core.Mods.Mod; -import binnie.extrabees.ExtraBees; -import binnie.extrabees.proxy.ExtraBeesProxy; -import forestry.api.genetics.AlleleManager; -import forestry.api.genetics.IAlleleFlowers; -import forestry.api.genetics.IAlleleRegistry; -import forestry.api.genetics.IFlower; -import forestry.api.genetics.IFlowerProvider; -import forestry.api.genetics.IFruitBearer; -import forestry.api.genetics.IIndividual; -import forestry.api.genetics.IPollinatable; -import java.util.ArrayList; -import java.util.EnumSet; -import java.util.List; -import java.util.Random; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; -import net.minecraftforge.common.EnumPlantType; - -public enum ExtraBeesFlowers - implements IFlowerProvider, IAlleleFlowers -{ - WATER, SUGAR, ROCK, BOOK, DEAD, REDSTONE, WOOD, LEAVES, Sapling, Fruit, Mystical; - - boolean dominant = true; - - private ExtraBeesFlowers() {} - - public String getUID() - { - return "extrabees.flower." + toString().toLowerCase(); - } - - public boolean isDominant() - { - return this.dominant; - } - - public IFlowerProvider getProvider() - { - return this; - } - - public String getDescription() - { - return ExtraBees.proxy.localise("flowers." + name().toString().toLowerCase() + ".name"); - } - - public void register() - { - AlleleManager.alleleRegistry.registerAllele(this); - } - - public static void doInit() - { - for (ExtraBeesFlowers effect : ) { - effect.register(); - } - } - - public ItemStack[] getItemStacks() - { - switch (1.$SwitchMap$binnie$extrabees$genetics$ExtraBeesFlowers[ordinal()]) - { - case 1: - return new ItemStack[] { new ItemStack(Blocks.waterlily) }; - case 2: - return new ItemStack[] { new ItemStack(Blocks.reeds) }; - case 3: - return new ItemStack[] { new ItemStack(Blocks.cobblestone) }; - case 4: - return new ItemStack[] { new ItemStack(Blocks.bookshelf) }; - case 5: - return new ItemStack[] { new ItemStack(Blocks.redstone_torch) }; - case 6: - return new ItemStack[] { new ItemStack(Blocks.deadbush) }; - case 7: - return new ItemStack[] { new ItemStack(Items.apple) }; - case 8: - return new ItemStack[] { new ItemStack(Blocks.leaves) }; - case 9: - return new ItemStack[] { new ItemStack(Blocks.sapling) }; - case 10: - return new ItemStack[] { new ItemStack(Blocks.log) }; - } - return new ItemStack[0]; - } - - public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) - { - EnumSet<EnumPlantType> types = pollinatable.getPlantType(); - return (types.size() > 1) || (!types.contains(EnumPlantType.Nether)); - } - - public boolean isAcceptedFlower(World world, IIndividual individual, int x, int y, int z) - { - Block block = world.getBlock(x, y, z); - if (block == null) { - return false; - } - switch (1.$SwitchMap$binnie$extrabees$genetics$ExtraBeesFlowers[ordinal()]) - { - case 1: - return block == Blocks.waterlily; - case 3: - return block.getMaterial() == Material.rock; - case 2: - return block == Blocks.reeds; - case 4: - return block == Blocks.bookshelf; - case 5: - return block == Blocks.redstone_torch; - case 6: - return block == Blocks.deadbush; - case 10: - return block.isWood(world, x, y, z); - case 7: - return world.getTileEntity(x, y, z) instanceof IFruitBearer; - case 8: - return block.isLeaves(world, x, y, z); - case 9: - return block.getClass().getName().toLowerCase().contains("sapling"); - case 11: - return block == Mods.Botania.block("flower"); - } - return false; - } - - public boolean growFlower(World world, IIndividual individual, int x, int y, int z) - { - switch (1.$SwitchMap$binnie$extrabees$genetics$ExtraBeesFlowers[ordinal()]) - { - case 1: - if ((world.isAirBlock(x, y, z)) && (world.getBlock(x, y - 1, z) == Blocks.water)) { - return world.setBlock(x, y, z, Blocks.waterlily, 0, 2); - } - return false; - case 2: - if ((world.getBlock(x, y - 1, z) == Blocks.reeds) && (world.isAirBlock(x, y, z))) { - return world.setBlock(x, y, z, Blocks.reeds, 0, 0); - } - return false; - } - return false; - } - - public ItemStack[] affectProducts(World world, IIndividual individual, int x, int y, int z, ItemStack[] products) - { - if (this == Mystical) - { - List<ItemStack> prods = new ArrayList(); - for (ItemStack stack : products) { - prods.add(stack); - } - for (int k = 0; k < 50; k++) - { - int tX = 7; - int tY = 7; - int tZ = 3; - int x2 = x - tX + world.rand.nextInt(1 + 2 * tX); - int y2 = y - tY + world.rand.nextInt(1 + 2 * tY); - int z2 = z - tZ + world.rand.nextInt(1 + 2 * tZ); - Block block = world.getBlock(x2, y2, z2); - if (block != null) { - if (block == Mods.Botania.block("flower")) - { - int meta = world.getBlockMetadata(x2, y2, z2); - Item item = Mods.Botania.item("petal"); - if (item != null) { - prods.add(new ItemStack(item, 1, meta)); - } - } - } - } - return (ItemStack[])prods.toArray(new ItemStack[0]); - } - return products; - } - - public String getName() - { - return getDescription(); - } - - public String getUnlocalizedName() - { - return getUID(); - } - - public List<IFlower> getFlowers() - { - return new ArrayList(); - } -} diff --git a/src/Java/binnie/extrabees/genetics/ExtraBeesSpecies.java b/src/Java/binnie/extrabees/genetics/ExtraBeesSpecies.java deleted file mode 100644 index cc166a3644..0000000000 --- a/src/Java/binnie/extrabees/genetics/ExtraBeesSpecies.java +++ /dev/null @@ -1,1139 +0,0 @@ -package binnie.extrabees.genetics; - -import binnie.Binnie; -import binnie.core.BinnieCore; -import binnie.core.Mods; -import binnie.core.Mods.Mod; -import binnie.core.genetics.ForestryAllele.BeeSpecies; -import binnie.core.genetics.ForestryAllele.Fertility; -import binnie.core.genetics.ForestryAllele.Flowering; -import binnie.core.genetics.ForestryAllele.Lifespan; -import binnie.core.genetics.ForestryAllele.Speed; -import binnie.core.genetics.ForestryAllele.Territory; -import binnie.core.genetics.ManagerGenetics; -import binnie.core.genetics.Tolerance; -import binnie.core.item.IItemEnum; -import binnie.core.proxy.BinnieProxy; -import binnie.extrabees.ExtraBees; -import binnie.extrabees.genetics.effect.ExtraBeesEffect; -import binnie.extrabees.products.EnumHoneyComb; -import binnie.extrabees.products.ItemHoneyComb.VanillaComb; -import binnie.extrabees.proxy.ExtraBeesProxy; -import com.mojang.authlib.GameProfile; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.apiculture.EnumBeeChromosome; -import forestry.api.apiculture.EnumBeeType; -import forestry.api.apiculture.IAlleleBeeEffect; -import forestry.api.apiculture.IAlleleBeeSpecies; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeHousing; -import forestry.api.apiculture.IBeeRoot; -import forestry.api.core.EnumHumidity; -import forestry.api.core.EnumTemperature; -import forestry.api.core.IIconProvider; -import forestry.api.genetics.AlleleManager; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IAlleleFlowers; -import forestry.api.genetics.IAlleleRegistry; -import forestry.api.genetics.IAlleleSpecies; -import forestry.api.genetics.IClassification; -import forestry.api.genetics.IIndividual; -import forestry.api.genetics.IMutation; -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Locale; -import java.util.Map; -import java.util.Map.Entry; -import java.util.Random; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.stats.Achievement; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; - -public enum ExtraBeesSpecies - implements IAlleleBeeSpecies, IIconProvider -{ - ARID("aridus", 12511316), BARREN("infelix", 14733923), DESOLATE("desolo", 13744272), GNAWING("apica", 15234224), ROTTEN("caries", 12574902), BONE("os", 15330792), CREEPER("erepo", 2942485), DECOMPOSING("aegrus", 5388049), ROCK("saxum", 11053224), STONE("lapis", 7697781), GRANITE("granum", 6903125), MINERAL("minerale", 7239037), COPPER("cuprous", 13722376), TIN("stannus", 12431805), IRON("ferrous", 11038808), LEAD("plumbous", 11373483), ZINC("spelta", 15592447), TITANIUM("titania", 11578083), BRONZE, BRASS, STEEL, TUNGSTATE("wolfram", 1249812), GOLD("aureus", 15125515), SILVER("argentus", 14408667), ELECTRUM, PLATINUM("platina", 14408667), LAPIS("lazuli", 4009179), SODALITE, PYRITE, BAUXITE, CINNABAR, SPHALERITE, EMERALD("emerala", 1900291), RUBY("ruba", 14024704), SAPPHIRE("saphhira", 673791), OLIVINE, DIAMOND("diama", 8371706), UNSTABLE("levis", 4099124), NUCLEAR("nucleus", 4312111), RADIOACTIVE("fervens", 2031360), ANCIENT("antiquus", 15915919), PRIMEVAL("priscus", 11773563), PREHISTORIC("pristinus", 7232064), RELIC("sapiens", 5062166), COAL("carbo", 8025672), RESIN("lacrima", 10908443), OIL("lubricus", 5719920), PEAT, DISTILLED("distilli", 3498838), FUEL("refina", 16760835), CREOSOTE("creosota", 9936403), LATEX("latex", 4803134), WATER("aqua", 9741055), RIVER("flumen", 8631252), OCEAN("mare", 1912493), INK("atramentum", 922695), GROWING("tyrelli", 6024152), THRIVING("thriva", 3466109), BLOOMING("blooma", 704308), SWEET("mellitus", 16536049), SUGAR("dulcis", 15127520), RIPENING("ripa", 11716445), FRUIT("pomum", 14375030), ALCOHOL("vinum", 15239777), FARM("ager", 7723872), MILK("lacteus", 14936296), COFFEE("arabica", 9199152), CITRUS, MINT, SWAMP("paludis", 3500339), BOGGY("lama", 7887913), FUNGAL("boletus", 13722112), MARBLE, ROMAN, GREEK, CLASSICAL, BASALT("aceri", 9202025), TEMPERED("iratus", 9062472), ANGRY, VOLCANIC("volcano", 5049356), MALICIOUS("acerbus", 7875191), INFECTIOUS("contagio", 12070581), VIRULENT("morbus", 15733740), VISCOUS("liquidus", 608014), GLUTINOUS("glutina", 1936423), STICKY("lentesco", 1565480), CORROSIVE("corrumpo", 4873227), CAUSTIC("torrens", 8691997), ACIDIC("acidus", 12644374), EXCITED("excita", 16729413), ENERGETIC("energia", 15218119), ECSTATIC("ecstatica", 11482600), ARTIC("artica", 11395296), FREEZING("glacia", 8119267), SHADOW("shadowa", 5855577), DARKENED("darka", 3354163), ABYSS("abyssba", 2164769), RED("rubra", 16711680), YELLOW("fulvus", 16768256), BLUE("caeruleus", 8959), GREEN("prasinus", 39168), BLACK("niger", 5723991), WHITE("albus", 16777215), BROWN("fuscus", 6042895), ORANGE("flammeus", 16751872), CYAN("cyana", 65509), PURPLE("purpureus", 11403519), GRAY("ravus", 12237498), LIGHTBLUE("aqua", 40447), PINK("rosaceus", 16744671), LIMEGREEN("lima", 65288), MAGENTA("fuchsia", 16711884), LIGHTGRAY("canus", 13224393), CELEBRATORY("celeba", 16386666), JADED("jadeca", 16386666), GLOWSTONE("glowia", 14730779), HAZARDOUS("infensus", 11562024), NICKEL("claro", 16768764), INVAR, QUANTUM("quanta", 3655131), SPATIAL("spatia", 4987872), UNUSUAL("daniella", 5874874), YELLORIUM("yellori", 14019840), CYANITE("cyanita", 34541), BLUTONIUM("caruthus", 1769702), MYSTICAL("mystica", 4630306); - - private ExtraBeesSpecies(String binomial, int colour) - { - this.uid = toString().toLowerCase(); - this.binomial = binomial; - this.primaryColor = colour; - } - - private ExtraBeesSpecies() - { - this.state = State.Deprecated; - } - - private int primaryColor = 16777215; - private int secondaryColor = 16768022; - private EnumTemperature temperature = EnumTemperature.NORMAL; - private EnumHumidity humidity = EnumHumidity.NORMAL; - private boolean hasEffect = false; - private boolean isSecret = true; - private boolean isCounted = true; - private String binomial = ""; - private IClassification branch = null; - private String uid = ""; - private Achievement achievement = null; - private boolean dominant = true; - private HashMap<ItemStack, Integer> products = new LinkedHashMap(); - private HashMap<ItemStack, Integer> specialties = new LinkedHashMap(); - public HashMap<ItemStack, Integer> allProducts = new LinkedHashMap(); - public HashMap<ItemStack, Integer> allSpecialties = new LinkedHashMap(); - private IAllele[] template; - - public static enum State - { - Active, Inactive, Deprecated; - - private State() {} - } - - public State state = State.Active; - @SideOnly(Side.CLIENT) - private IIcon[][] icons; - - public String getName() - { - return ExtraBees.proxy.localise("species." + name().toLowerCase() + ".name"); - } - - public String getDescription() - { - return ExtraBees.proxy.localiseOrBlank("species." + name().toLowerCase() + ".desc"); - } - - public EnumTemperature getTemperature() - { - return this.temperature; - } - - public EnumHumidity getHumidity() - { - return this.humidity; - } - - public boolean hasEffect() - { - return this.hasEffect; - } - - public boolean isSecret() - { - return this.isSecret; - } - - public boolean isCounted() - { - return this.isCounted; - } - - public String getBinomial() - { - return this.binomial; - } - - public String getAuthority() - { - return "Binnie"; - } - - public IClassification getBranch() - { - return this.branch; - } - - public String getUID() - { - return "extrabees.species." + this.uid; - } - - public boolean isDominant() - { - return this.dominant; - } - - public HashMap<ItemStack, Integer> getProducts() - { - return this.products; - } - - public HashMap<ItemStack, Integer> getSpecialty() - { - return this.specialties; - } - - private void setState(State state) - { - this.state = state; - } - - public void registerTemplate() - { - Binnie.Genetics.getBeeRoot().registerTemplate(getTemplate()); - if (this.state != State.Active) { - AlleleManager.alleleRegistry.blacklistAllele(getUID()); - } - } - - public void addProduct(ItemStack product, int chance) - { - if (product == null) - { - setState(State.Inactive); - } - else - { - this.products.put(product, Integer.valueOf(chance)); - this.allProducts.put(product, Integer.valueOf(chance)); - } - } - - public void addProduct(IItemEnum product, int chance) - { - if (product.isActive()) - { - addProduct(product.get(1), chance); - } - else - { - this.allProducts.put(product.get(1), Integer.valueOf(chance)); - setState(State.Inactive); - } - } - - public void addSpecialty(ItemStack product, int chance) - { - if (product == null) - { - setState(State.Inactive); - } - else - { - this.specialties.put(product, Integer.valueOf(chance)); - this.allSpecialties.put(product, Integer.valueOf(chance)); - } - } - - private void addSpecialty(IItemEnum product, int chance) - { - if (product.isActive()) - { - addSpecialty(product.get(1), chance); - } - else - { - setState(State.Inactive); - this.allSpecialties.put(product.get(1), Integer.valueOf(chance)); - } - } - - private void setHumidity(EnumHumidity humidity) - { - this.humidity = humidity; - } - - private void setTemperature(EnumTemperature temperature) - { - this.temperature = temperature; - } - - public static IAllele[] getDefaultTemplate() - { - return Binnie.Genetics.getBeeRoot().getDefaultTemplate(); - } - - public IAllele[] getTemplate() - { - this.template[EnumBeeChromosome.SPECIES.ordinal()] = this; - return this.template; - } - - public void importTemplate(ForestryAllele.BeeSpecies species) - { - importTemplate(species.getTemplate()); - } - - public void importTemplate(ExtraBeesSpecies species) - { - importTemplate(species.getTemplate()); - } - - public void importTemplate(IAllele[] template) - { - this.template = ((IAllele[])template.clone()); - setHumidity(((IAlleleSpecies)template[0]).getHumidity()); - setTemperature(((IAlleleSpecies)template[0]).getTemperature()); - setSecondaryColor(((IAlleleSpecies)template[0]).getIconColour(1)); - this.template[EnumBeeChromosome.SPECIES.ordinal()] = this; - } - - public void recessive() - { - this.dominant = false; - } - - public void setIsSecret(boolean secret) - { - this.isSecret = secret; - } - - public void setHasEffect(boolean effect) - { - this.hasEffect = effect; - } - - public void setSecondaryColor(int colour) - { - this.secondaryColor = colour; - } - - public static void doInit() - { - for (ExtraBeesSpecies species : ) { - species.template = getDefaultTemplate(); - } - int aridBody = 13362036; - int rockBody = 10066329; - int endBody = 14278302; - - ARID.importTemplate(ForestryAllele.BeeSpecies.Modest); - ARID.addProduct(EnumHoneyComb.BARREN, 30); - ARID.setHumidity(EnumHumidity.ARID); - ARID.setFlowerProvider(ExtraBeesFlowers.DEAD.getUID()); - ARID.setTemperatureTolerance(Tolerance.Up1); - ARID.setSecondaryColor(aridBody); - - BARREN.importTemplate(ARID); - BARREN.setFertility(ForestryAllele.Fertility.Low); - BARREN.addProduct(EnumHoneyComb.BARREN, 30); - - DESOLATE.addProduct(EnumHoneyComb.BARREN, 30); - DESOLATE.importTemplate(BARREN); - DESOLATE.setEffect(ExtraBeesEffect.HUNGER.getUID()); - DESOLATE.recessive(); - DESOLATE.setNocturnal(); - DESOLATE.setHasEffect(true); - - GNAWING.importTemplate(BARREN); - GNAWING.setFlowerProvider(ExtraBeesFlowers.WOOD.getUID()); - GNAWING.addProduct(EnumHoneyComb.BARREN, 25); - GNAWING.addSpecialty(EnumHoneyComb.SAWDUST, 25); - - ROTTEN.importTemplate(DESOLATE); - ROTTEN.setNocturnal(); - ROTTEN.setCaveDwelling(); - ROTTEN.setTolerantFlyer(); - ROTTEN.setEffect(ExtraBeesEffect.SPAWN_ZOMBIE.getUID()); - ROTTEN.addProduct(EnumHoneyComb.BARREN, 30); - ROTTEN.addSpecialty(EnumHoneyComb.ROTTEN, 10); - - BONE.importTemplate(ROTTEN); - BONE.addProduct(EnumHoneyComb.BARREN, 30); - BONE.addSpecialty(EnumHoneyComb.BONE, 10); - BONE.setEffect(ExtraBeesEffect.SPAWN_SKELETON.getUID()); - - CREEPER.importTemplate(ROTTEN); - CREEPER.setAllDay(); - CREEPER.addProduct(EnumHoneyComb.BARREN, 30); - CREEPER.addSpecialty(ItemHoneyComb.VanillaComb.POWDERY.get(), 8); - CREEPER.setEffect(ExtraBeesEffect.SPAWN_CREEPER.getUID()); - - DECOMPOSING.importTemplate(BARREN); - DECOMPOSING.addProduct(EnumHoneyComb.BARREN, 30); - DECOMPOSING.addSpecialty(EnumHoneyComb.COMPOST, 8); - - ROCK.addProduct(EnumHoneyComb.STONE, 30); - ROCK.setIsSecret(false); - ROCK.setAllDay(); - ROCK.setCaveDwelling(); - ROCK.setTolerantFlyer(); - ROCK.setTemperatureTolerance(Tolerance.Both1); - ROCK.setHumidityTolerance(Tolerance.Both1); - ROCK.setFlowerProvider(ExtraBeesFlowers.ROCK.getUID()); - ROCK.setFertility(ForestryAllele.Fertility.Low); - ROCK.setLifespan(ForestryAllele.Lifespan.Short); - ROCK.setSecondaryColor(rockBody); - - STONE.addProduct(EnumHoneyComb.STONE, 30); - STONE.importTemplate(ROCK); - STONE.recessive(); - STONE.setSecondaryColor(rockBody); - - GRANITE.addProduct(EnumHoneyComb.STONE, 30); - GRANITE.importTemplate(STONE); - GRANITE.setTemperatureTolerance(Tolerance.Both2); - GRANITE.setHumidityTolerance(Tolerance.Both2); - GRANITE.setSecondaryColor(rockBody); - - MINERAL.addProduct(EnumHoneyComb.STONE, 30); - MINERAL.importTemplate(GRANITE); - MINERAL.setSecondaryColor(rockBody); - - - - COPPER.addProduct(EnumHoneyComb.STONE, 20); - COPPER.addSpecialty(EnumHoneyComb.COPPER, 6); - COPPER.importTemplate(MINERAL); - COPPER.setSecondaryColor(rockBody); - - TIN.addProduct(EnumHoneyComb.STONE, 20); - TIN.addSpecialty(EnumHoneyComb.TIN, 6); - TIN.importTemplate(MINERAL); - TIN.setSecondaryColor(rockBody); - - IRON.addProduct(EnumHoneyComb.STONE, 20); - IRON.addSpecialty(EnumHoneyComb.IRON, 5); - IRON.importTemplate(MINERAL); - IRON.recessive(); - IRON.setSecondaryColor(rockBody); - - LEAD.addProduct(EnumHoneyComb.STONE, 20); - LEAD.addSpecialty(EnumHoneyComb.LEAD, 5); - LEAD.importTemplate(MINERAL); - LEAD.setSecondaryColor(rockBody); - - NICKEL.addProduct(EnumHoneyComb.STONE, 20); - NICKEL.addSpecialty(EnumHoneyComb.NICKEL, 5); - NICKEL.importTemplate(MINERAL); - NICKEL.setSecondaryColor(rockBody); - - - - ZINC.addProduct(EnumHoneyComb.STONE, 20); - ZINC.addSpecialty(EnumHoneyComb.ZINC, 5); - ZINC.importTemplate(MINERAL); - ZINC.setSecondaryColor(rockBody); - - TITANIUM.addProduct(EnumHoneyComb.STONE, 20); - TITANIUM.addSpecialty(EnumHoneyComb.TITANIUM, 2); - TITANIUM.importTemplate(MINERAL); - TITANIUM.setSecondaryColor(rockBody); - - TUNGSTATE.addProduct(EnumHoneyComb.STONE, 20); - TUNGSTATE.addSpecialty(EnumHoneyComb.TUNGSTEN, 1); - TUNGSTATE.importTemplate(MINERAL); - TUNGSTATE.setSecondaryColor(rockBody); - - - - - GOLD.addProduct(EnumHoneyComb.STONE, 20); - GOLD.addSpecialty(EnumHoneyComb.GOLD, 2); - GOLD.importTemplate(MINERAL); - GOLD.setSecondaryColor(rockBody); - - SILVER.addProduct(EnumHoneyComb.STONE, 20); - SILVER.addSpecialty(EnumHoneyComb.SILVER, 2); - SILVER.importTemplate(MINERAL); - SILVER.recessive(); - SILVER.recessive(); - SILVER.setSecondaryColor(rockBody); - - PLATINUM.addProduct(EnumHoneyComb.STONE, 20); - PLATINUM.addSpecialty(EnumHoneyComb.PLATINUM, 1); - PLATINUM.importTemplate(MINERAL); - PLATINUM.recessive(); - PLATINUM.setSecondaryColor(rockBody); - - - LAPIS.addProduct(EnumHoneyComb.STONE, 20); - LAPIS.addSpecialty(EnumHoneyComb.LAPIS, 5); - LAPIS.importTemplate(MINERAL); - LAPIS.setSecondaryColor(rockBody); - - EMERALD.addProduct(EnumHoneyComb.STONE, 20); - EMERALD.addSpecialty(EnumHoneyComb.EMERALD, 4); - EMERALD.importTemplate(MINERAL); - EMERALD.setSecondaryColor(rockBody); - - RUBY.addProduct(EnumHoneyComb.STONE, 20); - RUBY.addSpecialty(EnumHoneyComb.RUBY, 3); - RUBY.importTemplate(MINERAL); - RUBY.setSecondaryColor(rockBody); - - SAPPHIRE.addProduct(EnumHoneyComb.STONE, 20); - SAPPHIRE.addSpecialty(EnumHoneyComb.SAPPHIRE, 3); - SAPPHIRE.importTemplate(MINERAL); - SAPPHIRE.setSecondaryColor(rockBody); - - DIAMOND.addProduct(EnumHoneyComb.STONE, 20); - DIAMOND.addSpecialty(EnumHoneyComb.DIAMOND, 1); - DIAMOND.importTemplate(MINERAL); - DIAMOND.setSecondaryColor(rockBody); - - UNSTABLE.importTemplate(MINERAL); - UNSTABLE.addProduct(EnumHoneyComb.BARREN, 20); - UNSTABLE.setEffect(ExtraBeesEffect.RADIOACTIVE.getUID()); - UNSTABLE.setFertility(ForestryAllele.Fertility.Low); - UNSTABLE.setLifespan(ForestryAllele.Lifespan.Shortest); - UNSTABLE.recessive(); - - NUCLEAR.importTemplate(UNSTABLE); - NUCLEAR.addProduct(EnumHoneyComb.BARREN, 20); - NUCLEAR.recessive(); - - RADIOACTIVE.importTemplate(NUCLEAR); - RADIOACTIVE.addProduct(EnumHoneyComb.BARREN, 20); - RADIOACTIVE.addSpecialty(EnumHoneyComb.URANIUM, 2); - RADIOACTIVE.setHasEffect(true); - RADIOACTIVE.recessive(); - - ANCIENT.importTemplate(ForestryAllele.BeeSpecies.Noble); - ANCIENT.addProduct(EnumHoneyComb.OLD, 30); - ANCIENT.setLifespan(ForestryAllele.Lifespan.Elongated); - - PRIMEVAL.importTemplate(ANCIENT); - PRIMEVAL.addProduct(EnumHoneyComb.OLD, 30); - PRIMEVAL.setLifespan(ForestryAllele.Lifespan.Long); - - PREHISTORIC.importTemplate(ANCIENT); - PREHISTORIC.addProduct(EnumHoneyComb.OLD, 30); - PREHISTORIC.setLifespan(ForestryAllele.Lifespan.Longer); - PREHISTORIC.setFertility(ForestryAllele.Fertility.Low); - PREHISTORIC.recessive(); - - RELIC.importTemplate(ANCIENT); - RELIC.addProduct(EnumHoneyComb.OLD, 30); - RELIC.setHasEffect(true); - RELIC.setLifespan(ForestryAllele.Lifespan.Longest); - - COAL.importTemplate(ANCIENT); - COAL.setLifespan(ForestryAllele.Lifespan.Normal); - COAL.addProduct(EnumHoneyComb.OLD, 20); - COAL.addSpecialty(EnumHoneyComb.COAL, 8); - - RESIN.importTemplate(COAL); - RESIN.addProduct(EnumHoneyComb.OLD, 20); - RESIN.addSpecialty(EnumHoneyComb.RESIN, 5); - RESIN.recessive(); - - OIL.importTemplate(COAL); - OIL.addProduct(EnumHoneyComb.OLD, 20); - OIL.addSpecialty(EnumHoneyComb.OIL, 5); - - - - - - - DISTILLED.importTemplate(OIL); - DISTILLED.addProduct(EnumHoneyComb.OIL, 10); - DISTILLED.recessive(); - - FUEL.importTemplate(OIL); - FUEL.addProduct(EnumHoneyComb.OIL, 10); - FUEL.addSpecialty(EnumHoneyComb.FUEL, 4); - FUEL.setHasEffect(true); - - CREOSOTE.importTemplate(COAL); - CREOSOTE.addProduct(EnumHoneyComb.COAL, 10); - CREOSOTE.addSpecialty(EnumHoneyComb.CREOSOTE, 7); - CREOSOTE.setHasEffect(true); - - LATEX.importTemplate(RESIN); - LATEX.addProduct(EnumHoneyComb.RESIN, 10); - LATEX.addSpecialty(EnumHoneyComb.LATEX, 5); - LATEX.setHasEffect(true); - - WATER.addProduct(EnumHoneyComb.WATER, 30); - WATER.setIsSecret(false); - WATER.setTolerantFlyer(); - WATER.setHumidityTolerance(Tolerance.Both1); - WATER.setFlowerProvider(ExtraBeesFlowers.WATER.getUID()); - WATER.setFlowering(ForestryAllele.Flowering.Slow); - WATER.setEffect(ExtraBeesEffect.WATER.getUID()); - WATER.setHumidity(EnumHumidity.DAMP); - - RIVER.importTemplate(WATER); - RIVER.addProduct(EnumHoneyComb.WATER, 30); - RIVER.addSpecialty(EnumHoneyComb.CLAY, 20); - RIVER.importTemplate(WATER); - - OCEAN.importTemplate(WATER); - OCEAN.addProduct(EnumHoneyComb.WATER, 30); - OCEAN.importTemplate(WATER); - OCEAN.recessive(); - - INK.importTemplate(OCEAN); - INK.addProduct(EnumHoneyComb.WATER, 30); - INK.addSpecialty(new ItemStack(Items.dye, 1, 0), 10); - - GROWING.importTemplate(ForestryAllele.BeeSpecies.Forest); - GROWING.addProduct(ItemHoneyComb.VanillaComb.HONEY.get(), 35); - GROWING.setFlowering(ForestryAllele.Flowering.Average); - GROWING.setFlowerProvider(ExtraBeesFlowers.LEAVES.getUID()); - - THRIVING.importTemplate(GROWING); - THRIVING.addProduct(ItemHoneyComb.VanillaComb.HONEY.get(), 35); - THRIVING.setFlowering(ForestryAllele.Flowering.Fast); - - BLOOMING.importTemplate(THRIVING); - BLOOMING.setFlowering(ForestryAllele.Flowering.Fastest); - BLOOMING.addProduct(ItemHoneyComb.VanillaComb.HONEY.get(), 35); - BLOOMING.setFlowerProvider(ExtraBeesFlowers.Sapling.getUID()); - BLOOMING.setEffect(ExtraBeesEffect.BonemealSapling.getUID()); - - SWEET.importTemplate(ForestryAllele.BeeSpecies.Rural); - SWEET.addProduct(ItemHoneyComb.VanillaComb.HONEY.get(), 40); - SWEET.addProduct(new ItemStack(Items.sugar, 1, 0), 10); - SWEET.setFlowerProvider(ExtraBeesFlowers.SUGAR.getUID()); - - SUGAR.addProduct(ItemHoneyComb.VanillaComb.HONEY.get(), 40); - SUGAR.addProduct(new ItemStack(Items.sugar, 1, 0), 20); - SUGAR.importTemplate(SWEET); - - RIPENING.addProduct(ItemHoneyComb.VanillaComb.HONEY.get(), 30); - RIPENING.addProduct(new ItemStack(Items.sugar, 1, 0), 10); - RIPENING.addSpecialty(EnumHoneyComb.FRUIT, 10); - RIPENING.setFlowerProvider(ExtraBeesFlowers.Fruit.getUID()); - RIPENING.importTemplate(SUGAR); - - FRUIT.importTemplate(RIPENING); - FRUIT.addProduct(ItemHoneyComb.VanillaComb.HONEY.get(), 30); - FRUIT.addProduct(new ItemStack(Items.sugar, 1, 0), 15); - FRUIT.addSpecialty(EnumHoneyComb.FRUIT, 20); - FRUIT.setEffect(ExtraBeesEffect.BonemealFruit.getUID()); - FRUIT.setHasEffect(true); - - ALCOHOL.importTemplate(SWEET); - ALCOHOL.addProduct(ItemHoneyComb.VanillaComb.WHEATEN.get(), 30); - ALCOHOL.addSpecialty(EnumHoneyComb.ALCOHOL, 10); - ALCOHOL.setEffect("forestry.effectDrunkard"); - ALCOHOL.recessive(); - - FARM.addProduct(ItemHoneyComb.VanillaComb.WHEATEN.get(), 30); - FARM.addSpecialty(EnumHoneyComb.SEED, 10); - FARM.importTemplate(ForestryAllele.BeeSpecies.Rural); - - MILK.addProduct(ItemHoneyComb.VanillaComb.WHEATEN.get(), 30); - MILK.addSpecialty(EnumHoneyComb.MILK, 10); - MILK.importTemplate(ForestryAllele.BeeSpecies.Rural); - - COFFEE.addProduct(ItemHoneyComb.VanillaComb.WHEATEN.get(), 30); - COFFEE.addSpecialty(EnumHoneyComb.COFFEE, 8); - COFFEE.importTemplate(ForestryAllele.BeeSpecies.Rural); - - - - - - - - - - SWAMP.addProduct(ItemHoneyComb.VanillaComb.MOSSY.get(), 30); - SWAMP.importTemplate(ForestryAllele.BeeSpecies.Marshy); - SWAMP.setHumidity(EnumHumidity.DAMP); - SWAMP.setEffect(ExtraBeesEffect.SLOW.getUID()); - - BOGGY.importTemplate(SWAMP); - BOGGY.addProduct(ItemHoneyComb.VanillaComb.MOSSY.get(), 30); - BOGGY.importTemplate(SWAMP); - BOGGY.recessive(); - - FUNGAL.importTemplate(BOGGY); - FUNGAL.addProduct(ItemHoneyComb.VanillaComb.MOSSY.get(), 30); - FUNGAL.addSpecialty(EnumHoneyComb.FUNGAL, 15); - FUNGAL.importTemplate(BOGGY); - FUNGAL.setEffect(ExtraBeesEffect.BonemealMushroom.getUID()); - FUNGAL.setHasEffect(true); - - BASALT.addProduct(ItemHoneyComb.VanillaComb.SIMMERING.get(), 25); - BASALT.importTemplate(ForestryAllele.BeeSpecies.Sinister); - BASALT.setEffect("forestry.effectAggressive"); - BASALT.setSecondaryColor(10101539); - BASALT.setHumidity(EnumHumidity.ARID); - BASALT.setTemperature(EnumTemperature.HELLISH); - - TEMPERED.addProduct(ItemHoneyComb.VanillaComb.SIMMERING.get(), 25); - TEMPERED.importTemplate(BASALT); - TEMPERED.setEffect(ExtraBeesEffect.METEOR.getUID()); - TEMPERED.recessive(); - TEMPERED.setSecondaryColor(10101539); - - VOLCANIC.importTemplate(TEMPERED); - VOLCANIC.addProduct(ItemHoneyComb.VanillaComb.SIMMERING.get(), 25); - VOLCANIC.addSpecialty(EnumHoneyComb.BLAZE, 10); - VOLCANIC.setHasEffect(true); - VOLCANIC.setSecondaryColor(10101539); - - MALICIOUS.importTemplate(ForestryAllele.BeeSpecies.Tropical); - MALICIOUS.addProduct(ItemHoneyComb.VanillaComb.SILKY.get(), 25); - MALICIOUS.setSecondaryColor(431972); - MALICIOUS.setHumidity(EnumHumidity.DAMP); - MALICIOUS.setTemperature(EnumTemperature.WARM); - - INFECTIOUS.importTemplate(MALICIOUS); - INFECTIOUS.addProduct(ItemHoneyComb.VanillaComb.SILKY.get(), 25); - INFECTIOUS.setFlowering(ForestryAllele.Flowering.Slow); - INFECTIOUS.setSecondaryColor(431972); - - VIRULENT.importTemplate(INFECTIOUS); - VIRULENT.addProduct(ItemHoneyComb.VanillaComb.SILKY.get(), 25); - VIRULENT.addSpecialty(EnumHoneyComb.VENOMOUS, 12); - VIRULENT.setFlowering(ForestryAllele.Flowering.Average); - VIRULENT.recessive(); - VIRULENT.setHasEffect(true); - VIRULENT.setSecondaryColor(431972); - - VISCOUS.importTemplate(ForestryAllele.BeeSpecies.Tropical); - VISCOUS.setEffect(ExtraBeesEffect.ECTOPLASM.getUID()); - VISCOUS.addProduct(ItemHoneyComb.VanillaComb.SILKY.get(), 25); - VISCOUS.setSecondaryColor(431972); - VISCOUS.setHumidity(EnumHumidity.DAMP); - VISCOUS.setSpeed(ForestryAllele.Speed.Slow); - VISCOUS.setTemperature(EnumTemperature.WARM); - - GLUTINOUS.importTemplate(VISCOUS); - GLUTINOUS.addProduct(ItemHoneyComb.VanillaComb.SILKY.get(), 25); - GLUTINOUS.setSpeed(ForestryAllele.Speed.Norm); - GLUTINOUS.setSecondaryColor(431972); - - STICKY.importTemplate(GLUTINOUS); - STICKY.addProduct(ItemHoneyComb.VanillaComb.SILKY.get(), 25); - STICKY.addSpecialty(EnumHoneyComb.SLIME, 12); - STICKY.setSpeed(ForestryAllele.Speed.Fast); - STICKY.setHasEffect(true); - STICKY.setSecondaryColor(431972); - - CORROSIVE.importTemplate(STICKY); - CORROSIVE.setHumidity(EnumHumidity.DAMP); - CORROSIVE.setTemperature(EnumTemperature.WARM); - CORROSIVE.setEffect(ExtraBeesEffect.ACID.getUID()); - CORROSIVE.setFlowering(ForestryAllele.Flowering.Average); - CORROSIVE.addProduct(ItemHoneyComb.VanillaComb.SILKY.get(), 20); - CORROSIVE.recessive(); - CORROSIVE.setSecondaryColor(431972); - - CAUSTIC.importTemplate(CORROSIVE); - CAUSTIC.addProduct(ItemHoneyComb.VanillaComb.SILKY.get(), 25); - CAUSTIC.addSpecialty(EnumHoneyComb.ACIDIC, 3); - CAUSTIC.setSecondaryColor(431972); - - ACIDIC.importTemplate(CAUSTIC); - ACIDIC.addProduct(ItemHoneyComb.VanillaComb.SILKY.get(), 20); - ACIDIC.addSpecialty(EnumHoneyComb.ACIDIC, 16); - ACIDIC.setHasEffect(true); - ACIDIC.setSecondaryColor(431972); - - EXCITED.setEffect(ExtraBeesEffect.LIGHTNING.getUID()); - EXCITED.addProduct(EnumHoneyComb.REDSTONE, 10); - EXCITED.setCaveDwelling(); - EXCITED.setFlowerProvider(ExtraBeesFlowers.REDSTONE.getUID()); - - ENERGETIC.importTemplate(EXCITED); - ENERGETIC.setEffect(ExtraBeesEffect.LIGHTNING.getUID()); - ENERGETIC.addProduct(EnumHoneyComb.REDSTONE, 12); - ENERGETIC.recessive(); - - ECSTATIC.importTemplate(ENERGETIC); - ECSTATIC.setEffect(ExtraBeesEffect.Power.getUID()); - ECSTATIC.addProduct(EnumHoneyComb.REDSTONE, 20); - ECSTATIC.addSpecialty(EnumHoneyComb.IC2ENERGY, 8); - ECSTATIC.setHasEffect(true); - - ARTIC.importTemplate(ForestryAllele.BeeSpecies.Wintry); - ARTIC.addProduct(ItemHoneyComb.VanillaComb.FROZEN.get(), 25); - ARTIC.setTemperature(EnumTemperature.ICY); - ARTIC.setSecondaryColor(14349811); - - FREEZING.importTemplate(ARTIC); - FREEZING.addProduct(ItemHoneyComb.VanillaComb.FROZEN.get(), 20); - FREEZING.addSpecialty(EnumHoneyComb.GLACIAL, 10); - FREEZING.setSecondaryColor(14349811); - - SHADOW.importTemplate(BASALT); - SHADOW.setNocturnal(); - SHADOW.addProduct(EnumHoneyComb.SHADOW, 5); - SHADOW.setEffect(ExtraBeesEffect.BLINDNESS.getUID()); - SHADOW.setAllDay(false); - SHADOW.recessive(); - SHADOW.setSecondaryColor(3355443); - - DARKENED.addProduct(EnumHoneyComb.SHADOW, 10); - DARKENED.setNocturnal(); - DARKENED.importTemplate(SHADOW); - DARKENED.setSecondaryColor(3355443); - - ABYSS.importTemplate(DARKENED); - ABYSS.setNocturnal(); - ABYSS.addProduct(EnumHoneyComb.SHADOW, 25); - ABYSS.setEffect(ExtraBeesEffect.WITHER.getUID()); - ABYSS.setHasEffect(true); - ABYSS.setSecondaryColor(3355443); - - CELEBRATORY.importTemplate(ForestryAllele.BeeSpecies.Merry); - CELEBRATORY.setEffect(ExtraBeesEffect.FIREWORKS.getUID()); - - GLOWSTONE.importTemplate(BASALT); - GLOWSTONE.addProduct(EnumHoneyComb.GLOWSTONE, 15); - GLOWSTONE.setSecondaryColor(10101539); - - HAZARDOUS.importTemplate(ForestryAllele.BeeSpecies.Austere); - HAZARDOUS.addProduct(EnumHoneyComb.SALTPETER, 12); - - JADED.importTemplate(ForestryAllele.BeeSpecies.Imperial); - JADED.setFertility(ForestryAllele.Fertility.Maximum); - JADED.setFlowering(ForestryAllele.Flowering.Maximum); - JADED.setTerritory(ForestryAllele.Territory.Largest); - JADED.addProduct(ItemHoneyComb.VanillaComb.HONEY.get(), 30); - JADED.addSpecialty(Mods.Forestry.stack("pollen"), 20); - JADED.setHasEffect(true); - JADED.setSecondaryColor(14453483); - - UNUSUAL.importTemplate(ForestryAllele.BeeSpecies.Ended); - UNUSUAL.setEffect(ExtraBeesEffect.GRAVITY.getUID()); - UNUSUAL.setSecondaryColor(12231403); - UNUSUAL.addProduct(ItemHoneyComb.VanillaComb.QUARTZ.get(), 25); - - SPATIAL.importTemplate(UNUSUAL); - SPATIAL.setEffect(ExtraBeesEffect.GRAVITY.getUID()); - SPATIAL.setSecondaryColor(10768076); - SPATIAL.addProduct(ItemHoneyComb.VanillaComb.QUARTZ.get(), 25); - SPATIAL.addSpecialty(EnumHoneyComb.CERTUS, 5); - - QUANTUM.importTemplate(QUANTUM); - QUANTUM.setEffect(ExtraBeesEffect.TELEPORT.getUID()); - QUANTUM.setSecondaryColor(13963227); - QUANTUM.addProduct(ItemHoneyComb.VanillaComb.QUARTZ.get(), 25); - QUANTUM.addSpecialty(EnumHoneyComb.CERTUS, 15); - QUANTUM.addSpecialty(EnumHoneyComb.ENDERPEARL, 15); - - JADED.addSpecialty(EnumHoneyComb.PURPLE, 15); - JADED.isCounted = false; - - YELLORIUM.importTemplate(NUCLEAR); - YELLORIUM.addProduct(EnumHoneyComb.BARREN, 20); - YELLORIUM.addSpecialty(EnumHoneyComb.YELLORIUM, 2); - YELLORIUM.setEffect(ExtraBeesEffect.RADIOACTIVE.getUID()); - YELLORIUM.setFertility(ForestryAllele.Fertility.Low); - YELLORIUM.setLifespan(ForestryAllele.Lifespan.Shortest); - - CYANITE.importTemplate(YELLORIUM); - CYANITE.addProduct(EnumHoneyComb.BARREN, 20); - CYANITE.addSpecialty(EnumHoneyComb.CYANITE, 1); - - BLUTONIUM.importTemplate(CYANITE); - BLUTONIUM.addProduct(EnumHoneyComb.BARREN, 20); - BLUTONIUM.addSpecialty(EnumHoneyComb.BLUTONIUM, 1); - - MYSTICAL.importTemplate(ForestryAllele.BeeSpecies.Noble); - for (Map.Entry<ItemStack, Integer> entry : ForestryAllele.BeeSpecies.Noble.getAllele().getProducts().entrySet()) { - MYSTICAL.addProduct((ItemStack)entry.getKey(), ((Integer)entry.getValue()).intValue()); - } - MYSTICAL.setFlowerProvider(ExtraBeesFlowers.Mystical.getUID()); - for (ExtraBeesSpecies species : values()) - { - if (species.state != State.Active) { - AlleleManager.alleleRegistry.blacklistAllele(species.getUID()); - } - for (EnumBeeChromosome chromo : EnumBeeChromosome.values()) { - if (chromo != EnumBeeChromosome.HUMIDITY) - { - IAllele allele = species.template[chromo.ordinal()]; - if ((allele == null) || (!chromo.getAlleleClass().isInstance(allele))) { - throw new RuntimeException(species.getName() + " has an invalid " + chromo.toString() + " chromosome!"); - } - } - } - } - for (int i = 0; i < 16; i++) - { - ExtraBeesSpecies species = values()[(RED.ordinal() + i)]; - EnumHoneyComb comb = EnumHoneyComb.values()[(EnumHoneyComb.RED.ordinal() + i)]; - species.addProduct(ItemHoneyComb.VanillaComb.HONEY.get(), 75); - species.addSpecialty(comb, 25); - species.setSecondaryColor(9240320); - } - for (ExtraBeesSpecies species : values()) { - species.registerTemplate(); - } - } - - void setBranch(IClassification branch) - { - this.branch = branch; - } - - public boolean isJubilant(World world, int biomeid, int x, int y, int z) - { - return true; - } - - public boolean isJubilant(IBeeGenome genome, IBeeHousing housing) - { - return true; - } - - public int getIconColour(int renderPass) - { - return renderPass == 1 ? this.secondaryColor : renderPass == 0 ? this.primaryColor : 16777215; - } - - public IIconProvider getIconProvider() - { - return this; - } - - public IIcon getIcon(short texUID) - { - return null; - } - - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister register) - { - String iconType = "default"; - String mod = "forestry"; - if (this == JADED) - { - iconType = "jaded"; - mod = "extrabees"; - } - this.icons = new IIcon[EnumBeeType.values().length][3]; - - IIcon body1 = BinnieCore.proxy.getIcon(register, mod, "bees/" + iconType + "/body1"); - for (int i = 0; i < EnumBeeType.values().length; i++) { - if (EnumBeeType.values()[i] != EnumBeeType.NONE) - { - this.icons[i][0] = BinnieCore.proxy.getIcon(register, mod, "bees/" + iconType + "/" + EnumBeeType.values()[i].toString().toLowerCase(Locale.ENGLISH) + ".outline"); - - - this.icons[i][1] = (EnumBeeType.values()[i] != EnumBeeType.LARVAE ? body1 : BinnieCore.proxy.getIcon(register, mod, "bees/" + iconType + "/" + EnumBeeType.values()[i].toString().toLowerCase(Locale.ENGLISH) + ".body")); - - this.icons[i][2] = BinnieCore.proxy.getIcon(register, mod, "bees/" + iconType + "/" + EnumBeeType.values()[i].toString().toLowerCase(Locale.ENGLISH) + ".body2"); - } - } - } - - @SideOnly(Side.CLIENT) - public IIcon getIcon(EnumBeeType type, int renderPass) - { - if (this.icons == null) { - return ARID.getIcon(type, renderPass); - } - return this.icons[type.ordinal()][renderPass]; - } - - public IBeeRoot getRoot() - { - return Binnie.Genetics.getBeeRoot(); - } - - boolean nocturnal = false; - - public boolean isNocturnal() - { - return this.nocturnal; - } - - public void setNocturnal() - { - this.nocturnal = true; - } - - public void setAllDay() - { - setAllDay(true); - } - - public void setAllDay(boolean allDay) - { - if (allDay) { - this.template[EnumBeeChromosome.NOCTURNAL.ordinal()] = AlleleManager.alleleRegistry.getAllele("forestry.boolTrue"); - } else { - this.template[EnumBeeChromosome.NOCTURNAL.ordinal()] = AlleleManager.alleleRegistry.getAllele("forestry.boolFalse"); - } - } - - public void setCaveDwelling() - { - this.template[EnumBeeChromosome.CAVE_DWELLING.ordinal()] = AlleleManager.alleleRegistry.getAllele("forestry.boolTrue"); - } - - public void setTolerantFlyer() - { - this.template[EnumBeeChromosome.TOLERANT_FLYER.ordinal()] = AlleleManager.alleleRegistry.getAllele("forestry.boolTrue"); - } - - public void setFlowerProvider(String uid) - { - IAllele allele = AlleleManager.alleleRegistry.getAllele(uid); - if ((allele instanceof IAlleleFlowers)) { - this.template[EnumBeeChromosome.FLOWER_PROVIDER.ordinal()] = allele; - } - } - - public void setEffect(String uid) - { - IAllele allele = AlleleManager.alleleRegistry.getAllele(uid); - if ((allele instanceof IAlleleBeeEffect)) { - this.template[EnumBeeChromosome.EFFECT.ordinal()] = AlleleManager.alleleRegistry.getAllele(uid); - } - } - - private void setFertility(ForestryAllele.Fertility fert) - { - this.template[EnumBeeChromosome.FERTILITY.ordinal()] = fert.getAllele(); - } - - private void setLifespan(ForestryAllele.Lifespan fert) - { - this.template[EnumBeeChromosome.LIFESPAN.ordinal()] = fert.getAllele(); - } - - private void setSpeed(ForestryAllele.Speed fert) - { - this.template[EnumBeeChromosome.SPEED.ordinal()] = fert.getAllele(); - } - - private void setTerritory(ForestryAllele.Territory fert) - { - this.template[EnumBeeChromosome.TERRITORY.ordinal()] = fert.getAllele(); - } - - private void setFlowering(ForestryAllele.Flowering fert) - { - this.template[EnumBeeChromosome.FLOWERING.ordinal()] = fert.getAllele(); - } - - private void setHumidityTolerance(Tolerance fert) - { - this.template[EnumBeeChromosome.HUMIDITY_TOLERANCE.ordinal()] = fert.getAllele(); - } - - private void setTemperatureTolerance(Tolerance both1) - { - this.template[EnumBeeChromosome.TEMPERATURE_TOLERANCE.ordinal()] = both1.getAllele(); - } - - public float getResearchSuitability(ItemStack itemstack) - { - if (itemstack == null) { - return 0.0F; - } - for (ItemStack stack : this.products.keySet()) { - if (stack.isItemEqual(itemstack)) { - return 1.0F; - } - } - for (ItemStack stack : this.specialties.keySet()) { - if (stack.isItemEqual(itemstack)) { - return 1.0F; - } - } - if (itemstack.getItem() == Items.glass_bottle) { - return 0.9F; - } - if (itemstack.getItem() == Mods.Forestry.item("honeyDrop")) { - return 0.5F; - } - if (itemstack.getItem() == Mods.Forestry.item("honeydew")) { - return 0.7F; - } - if (itemstack.getItem() == Mods.Forestry.item("beeComb")) { - return 0.4F; - } - if (AlleleManager.alleleRegistry.isIndividual(itemstack)) { - return 1.0F; - } - for (Map.Entry<ItemStack, Float> entry : getRoot().getResearchCatalysts().entrySet()) { - if (((ItemStack)entry.getKey()).isItemEqual(itemstack)) { - return ((Float)entry.getValue()).floatValue(); - } - } - return 0.0F; - } - - public ItemStack[] getResearchBounty(World world, GameProfile researcher, IIndividual individual, int bountyLevel) - { - ArrayList<ItemStack> bounty = new ArrayList(); - ItemStack research = null; - if (world.rand.nextFloat() < 10.0F / bountyLevel) - { - Collection<? extends IMutation> combinations = getRoot().getCombinations(this); - if (combinations.size() > 0) - { - IMutation[] candidates = (IMutation[])combinations.toArray(new IMutation[0]); - research = AlleleManager.alleleRegistry.getMutationNoteStack(researcher, candidates[world.rand.nextInt(candidates.length)]); - } - } - if (research != null) { - bounty.add(research); - } - if (bountyLevel > 10) { - for (ItemStack stack : this.specialties.keySet()) - { - ItemStack stack2 = stack.copy(); - stack2.stackSize = (world.rand.nextInt((int)(bountyLevel / 2.0F)) + 1); - bounty.add(stack2); - } - } - for (ItemStack stack : this.products.keySet()) - { - ItemStack stack2 = stack.copy(); - stack2.stackSize = (world.rand.nextInt((int)(bountyLevel / 2.0F)) + 1); - bounty.add(stack2); - } - return (ItemStack[])bounty.toArray(new ItemStack[0]); - } - - public String getEntityTexture() - { - return "/gfx/forestry/entities/bees/honeyBee.png"; - } - - public int getComplexity() - { - return 1 + getGeneticAdvancement(this, new ArrayList()); - } - - private int getGeneticAdvancement(IAllele species, ArrayList<IAllele> exclude) - { - int own = 1; - int highest = 0; - exclude.add(species); - for (IMutation mutation : getRoot().getPaths(species, EnumBeeChromosome.SPECIES)) - { - if (!exclude.contains(mutation.getAllele0())) - { - int otherAdvance = getGeneticAdvancement(mutation.getAllele0(), exclude); - if (otherAdvance > highest) { - highest = otherAdvance; - } - } - if (!exclude.contains(mutation.getAllele1())) - { - int otherAdvance = getGeneticAdvancement(mutation.getAllele1(), exclude); - if (otherAdvance > highest) { - highest = otherAdvance; - } - } - } - return own + (highest < 0 ? 0 : highest); - } - - public String getUnlocalizedName() - { - return getUID(); - } - - public Map<ItemStack, Float> getProductChances() - { - return null; - } - - public Map<ItemStack, Float> getSpecialtyChances() - { - return null; - } -} diff --git a/src/Java/binnie/extrabees/genetics/ModuleGenetics.java b/src/Java/binnie/extrabees/genetics/ModuleGenetics.java deleted file mode 100644 index 626796266d..0000000000 --- a/src/Java/binnie/extrabees/genetics/ModuleGenetics.java +++ /dev/null @@ -1,88 +0,0 @@ -package binnie.extrabees.genetics; - -import binnie.Binnie; -import binnie.core.BinnieCore; -import binnie.core.IInitializable; -import binnie.core.genetics.ManagerGenetics; -import binnie.core.liquid.ManagerLiquid; -import binnie.core.proxy.BinnieProxy; -import binnie.extrabees.ExtraBees; -import binnie.extrabees.genetics.effect.BlockEctoplasm; -import binnie.extrabees.genetics.effect.ExtraBeesEffect; -import binnie.extrabees.genetics.items.ItemDictionary; -import cpw.mods.fml.common.registry.GameRegistry; -import forestry.api.apiculture.EnumBeeType; -import forestry.api.apiculture.IAlleleBeeSpecies; -import forestry.api.apiculture.IBee; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeRoot; -import forestry.api.genetics.AlleleManager; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IAlleleRegistry; -import forestry.api.genetics.IGenome; -import forestry.api.recipes.ICarpenterManager; -import forestry.api.recipes.RecipeManagers; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; - -public class ModuleGenetics - implements IInitializable -{ - public void preInit() - { - for (ExtraBeesSpecies species : ) { - AlleleManager.alleleRegistry.registerAllele(species); - } - ExtraBees.dictionary = new ItemDictionary(); - ExtraBees.ectoplasm = new BlockEctoplasm(); - - GameRegistry.registerBlock(ExtraBees.ectoplasm, "ectoplasm"); - } - - public void init() - { - ExtraBeesEffect.doInit(); - ExtraBeesFlowers.doInit(); - ExtraBeesSpecies.doInit(); - ExtraBeeMutation.doInit(); - ExtraBeesBranch.doInit(); - } - - public void postInit() - { - int ebSpeciesCount = 0; - int ebTotalSpeciesCount = 0; - for (ExtraBeesSpecies species : ExtraBeesSpecies.values()) - { - ebTotalSpeciesCount++; - if (!AlleleManager.alleleRegistry.isBlacklisted(species.getUID())) { - ebSpeciesCount++; - } - } - RecipeManagers.carpenterManager.addRecipe(100, Binnie.Liquid.getLiquidStack("water", 2000), null, new ItemStack(ExtraBees.dictionary), new Object[] { "X#X", "YEY", "RDR", Character.valueOf('#'), Blocks.glass_pane, Character.valueOf('X'), Items.gold_ingot, Character.valueOf('Y'), "ingotTin", Character.valueOf('R'), Items.redstone, Character.valueOf('D'), Items.diamond, Character.valueOf('E'), Items.emerald }); - } - - public static IGenome getGenome(IAlleleBeeSpecies allele0) - { - return Binnie.Genetics.getBeeRoot().templateAsGenome(Binnie.Genetics.getBeeRoot().getTemplate(allele0.getUID())); - } - - public static ItemStack getBeeIcon(IAlleleBeeSpecies species) - { - if (species == null) { - return null; - } - IAllele[] template = Binnie.Genetics.getBeeRoot().getTemplate(species.getUID()); - if (template == null) { - return null; - } - IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(template); - - IBee bee = Binnie.Genetics.getBeeRoot().getBee(BinnieCore.proxy.getWorld(), genome); - - ItemStack item = Binnie.Genetics.getBeeRoot().getMemberStack(bee, EnumBeeType.PRINCESS.ordinal()); - - return item; - } -} diff --git a/src/Java/binnie/extrabees/genetics/effect/BlockEctoplasm.java b/src/Java/binnie/extrabees/genetics/effect/BlockEctoplasm.java deleted file mode 100644 index 2baf9ba2f1..0000000000 --- a/src/Java/binnie/extrabees/genetics/effect/BlockEctoplasm.java +++ /dev/null @@ -1,42 +0,0 @@ -package binnie.extrabees.genetics.effect; - -import binnie.extrabees.ExtraBees; -import binnie.extrabees.proxy.ExtraBeesProxy; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import java.util.Random; -import net.minecraft.block.BlockWeb; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Items; -import net.minecraft.item.Item; - -public class BlockEctoplasm - extends BlockWeb -{ - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister register) - { - this.blockIcon = ExtraBees.proxy.getIcon(register, "ectoplasm"); - } - - public BlockEctoplasm() - { - setLightOpacity(1); - setHardness(0.5F); - } - - public int quantityDropped(Random rand) - { - return rand.nextInt(5) == 0 ? 1 : 0; - } - - public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) - { - return Items.slime_ball; - } - - public String getUnlocalizedName() - { - return "extrabees.block.ectoplasm"; - } -} diff --git a/src/Java/binnie/extrabees/genetics/effect/EntityBeeLightning.java b/src/Java/binnie/extrabees/genetics/effect/EntityBeeLightning.java deleted file mode 100644 index eef4f27a6b..0000000000 --- a/src/Java/binnie/extrabees/genetics/effect/EntityBeeLightning.java +++ /dev/null @@ -1,68 +0,0 @@ -package binnie.extrabees.genetics.effect; - -import java.util.List; -import java.util.Random; -import net.minecraft.block.BlockFire; -import net.minecraft.entity.Entity; -import net.minecraft.entity.effect.EntityLightningBolt; -import net.minecraft.init.Blocks; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.MathHelper; -import net.minecraft.world.World; - -public class EntityBeeLightning - extends EntityLightningBolt -{ - int lightningState = 2; - int boltLivingTime; - - public EntityBeeLightning(World par1World, double par2, double par4, double par6) - { - super(par1World, par2, par4, par6); - this.boltLivingTime = (this.rand.nextInt(3) + 1); - } - - public void onUpdate() - { - onEntityUpdate(); - - this.lightningState -= 1; - if (this.lightningState < 0) { - if (this.boltLivingTime == 0) - { - setDead(); - } - else if (this.lightningState < -this.rand.nextInt(10)) - { - this.boltLivingTime -= 1; - 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))) - { - int i = MathHelper.floor_double(this.posX); - int j = MathHelper.floor_double(this.posY); - 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 - { - double d0 = 3.0D; - List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getBoundingBox(this.posX - d0, this.posY - d0, this.posZ - d0, this.posX + d0, this.posY + 6.0D + d0, this.posZ + d0)); - for (int l = 0; l < list.size(); l++) - { - Entity entity = (Entity)list.get(l); - entity.onStruckByLightning(this); - } - } - } - } -} diff --git a/src/Java/binnie/extrabees/genetics/effect/ExtraBeesEffect.java b/src/Java/binnie/extrabees/genetics/effect/ExtraBeesEffect.java deleted file mode 100644 index b36091ce91..0000000000 --- a/src/Java/binnie/extrabees/genetics/effect/ExtraBeesEffect.java +++ /dev/null @@ -1,585 +0,0 @@ -package binnie.extrabees.genetics.effect; - -import binnie.Binnie; -import binnie.core.liquid.ManagerLiquid; -import binnie.extrabees.ExtraBees; -import binnie.extrabees.genetics.ExtraBeesFlowers; -import binnie.extrabees.proxy.ExtraBeesProxy; -import cofh.api.energy.IEnergyReceiver; -import forestry.api.apiculture.IAlleleBeeEffect; -import forestry.api.apiculture.IAlleleBeeSpecies; -import forestry.api.apiculture.IArmorApiarist; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeHousing; -import forestry.api.genetics.AlleleManager; -import forestry.api.genetics.IAlleleRegistry; -import forestry.api.genetics.IEffectData; -import forestry.apiculture.proxy.ProxyApiculture; -import forestry.plugins.PluginApiculture; -import java.util.ArrayList; -import java.util.Calendar; -import java.util.List; -import java.util.Random; -import net.minecraft.block.Block; -import net.minecraft.entity.Entity; -import net.minecraft.entity.EntityList; -import net.minecraft.entity.EntityLiving; -import net.minecraft.entity.EntityLivingBase; -import net.minecraft.entity.item.EntityFireworkRocket; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.entity.projectile.EntitySmallFireball; -import net.minecraft.init.Blocks; -import net.minecraft.item.ItemDye; -import net.minecraft.item.ItemStack; -import net.minecraft.potion.Potion; -import net.minecraft.potion.PotionEffect; -import net.minecraft.tileentity.TileEntity; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.util.DamageSource; -import net.minecraft.util.FoodStats; -import net.minecraft.world.World; -import net.minecraft.world.WorldServer; -import net.minecraftforge.common.util.ForgeDirection; -import net.minecraftforge.fluids.IFluidHandler; - -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; - - private ExtraBeesEffect() - { - this.uid = toString().toLowerCase(); - this.combinable = false; - this.dominant = true; - } - - String fx = ""; - public boolean combinable; - public boolean dominant; - public int id; - private String uid; - static List<Birthday> birthdays; - - public static void doInit() - { - BLINDNESS.setFX("blindness"); - FOOD.setFX("food"); - GRAVITY.setFX("gravity"); - THIEF.setFX("gravity"); - TELEPORT.setFX("gravity"); - LIGHTNING.setFX("lightning"); - METEOR.setFX("meteor"); - RADIOACTIVE.setFX("radioactive"); - WATER.setFX("water"); - WITHER.setFX("wither"); - for (ExtraBeesEffect effect : values()) { - effect.register(); - } - } - - private void setFX(String string) - { - this.fx = ("particles/" + string); - } - - public void register() - { - AlleleManager.alleleRegistry.registerAllele(this); - } - - public boolean isCombinable() - { - return this.combinable; - } - - public IEffectData validateStorage(IEffectData storedData) - { - return storedData; - } - - public String getName() - { - return ExtraBees.proxy.localise("effect." + name().toString().toLowerCase() + ".name"); - } - - public boolean isDominant() - { - return this.dominant; - } - - public void spawnMob(World world, int x, int y, int z, String name) - { - if (anyPlayerInRange(world, x, y, z, 16)) - { - double var1 = x + world.rand.nextFloat(); - double var3 = y + world.rand.nextFloat(); - double var5 = z + world.rand.nextFloat(); - world.spawnParticle("smoke", var1, var3, var5, 0.0D, 0.0D, 0.0D); - world.spawnParticle("flame", var1, var3, var5, 0.0D, 0.0D, 0.0D); - EntityLiving var9 = (EntityLiving)EntityList.createEntityByName(name, world); - if (var9 == null) { - return; - } - int var10 = world.getEntitiesWithinAABB(var9.getClass(), AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1).expand(8.0D, 4.0D, 8.0D)).size(); - if (var10 >= 6) { - return; - } - if (var9 != null) - { - double var11 = x + (world.rand.nextDouble() - world.rand.nextDouble()) * 4.0D; - - - double var13 = y + world.rand.nextInt(3) - 1; - double var15 = z + (world.rand.nextDouble() - world.rand.nextDouble()) * 4.0D; - - - var9.setLocationAndAngles(var11, var13, var15, world.rand.nextFloat() * 360.0F, 0.0F); - if (var9.getCanSpawnHere()) - { - world.spawnEntityInWorld(var9); - world.playAuxSFX(2004, x, y, z, 0); - var9.spawnExplosionParticle(); - } - } - } - } - - private boolean anyPlayerInRange(World world, int x, int y, int z, int distance) - { - return world.getClosestPlayer(x + 0.5D, y + 0.5D, z + 0.5D, distance) != null; - } - - public static void doAcid(World world, int x, int y, int z) - { - 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 ? 1 : 0) | (block == Blocks.grass ? 1 : 0)) != 0) { - world.setBlock(x, y, z, Blocks.sand, 0, 0); - } - } - - public String getUID() - { - return "extrabees.effect." + this.uid; - } - - public IEffectData doEffect(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) - { - World world = housing.getWorld(); - int xHouse = housing.getXCoord(); - int yHouse = housing.getYCoord(); - int zHouse = housing.getZCoord(); - - int[] area = getModifiedArea(genome, housing); - - int xd = 1 + area[0] / 2; - int yd = 1 + area[1] / 2; - int zd = 1 + area[2] / 2; - int x1 = xHouse - xd + world.rand.nextInt(2 * xd + 1); - int y1 = yHouse - yd + world.rand.nextInt(2 * yd + 1); - int z1 = zHouse - zd + world.rand.nextInt(2 * zd + 1); - switch (1.$SwitchMap$binnie$extrabees$genetics$effect$ExtraBeesEffect[ordinal()]) - { - case 4: - 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 5: - if (world.rand.nextInt(100) < 6) { - doAcid(world, x1, y1, z1); - } - break; - case 6: - if (world.rand.nextInt(200) < 2) { - spawnMob(world, x1, y1, z1, "Zombie"); - } - break; - case 7: - if (world.rand.nextInt(200) < 2) { - spawnMob(world, x1, y1, z1, "Skeleton"); - } - break; - case 8: - if (world.rand.nextInt(200) < 2) { - spawnMob(world, x1, y1, z1, "Creeper"); - } - break; - case 9: - if (world.rand.nextInt(100) < 1) { - if ((world.canBlockSeeTheSky(x1, y1, z1)) && - ((world instanceof WorldServer))) { - ((WorldServer)world).addWeatherEffect(new EntityBeeLightning(world, x1, y1, z1)); - } - } - break; - case 10: - if (world.rand.nextInt(100) < 1) { - if (world.canBlockSeeTheSky(x1, y1, z1)) { - ((WorldServer)world).spawnEntityInWorld(new EntitySmallFireball(world, x1, y1 + 64, z1, 0.0D, -0.6D, 0.0D)); - } - } - break; - case 11: - for (EntityLivingBase entity : getEntities(EntityLivingBase.class, genome, housing)) - { - int damage = 4; - if ((entity instanceof EntityPlayer)) - { - 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 12: - for (EntityLivingBase entity : getEntities(EntityLivingBase.class, genome, housing)) { - if ((entity instanceof EntityPlayer)) - { - EntityPlayer player = (EntityPlayer)entity; - player.getFoodStats().addStats(2, 0.2F); - } - } - break; - case 13: - for (EntityLivingBase entity : getEntities(EntityLivingBase.class, genome, housing)) { - if ((entity instanceof EntityPlayer)) - { - EntityPlayer player = (EntityPlayer)entity; - if (world.rand.nextInt(4) >= wearsItems(player)) - { - player.getFoodStats().addExhaustion(4.0F); - player.addPotionEffect(new PotionEffect(Potion.hunger.id, 100)); - } - } - } - break; - case 14: - for (EntityLivingBase entity : getEntities(EntityLivingBase.class, genome, housing)) { - if ((entity instanceof EntityPlayer)) - { - EntityPlayer player = (EntityPlayer)entity; - if (world.rand.nextInt(4) >= wearsItems(player)) { - player.addPotionEffect(new PotionEffect(Potion.blindness.id, 200)); - } - } - } - break; - case 15: - for (EntityLivingBase entity : getEntities(EntityLivingBase.class, genome, housing)) { - if ((entity instanceof EntityPlayer)) - { - EntityPlayer player = (EntityPlayer)entity; - if (world.rand.nextInt(4) >= wearsItems(player)) { - player.addPotionEffect(new PotionEffect(Potion.weakness.id, 200)); - } - } - } - break; - case 16: - for (EntityLivingBase entity : getEntities(EntityLivingBase.class, genome, housing)) { - if ((entity instanceof EntityPlayer)) - { - EntityPlayer player = (EntityPlayer)entity; - if (world.rand.nextInt(4) >= wearsItems(player)) { - player.addPotionEffect(new PotionEffect(Potion.confusion.id, 200)); - } - } - } - break; - case 1: - case 2: - case 3: - if (world.rand.nextInt(this == FIREWORKS ? 8 : 12) < 1) - { - FireworkCreator.Firework firework = new FireworkCreator.Firework(); - switch (1.$SwitchMap$binnie$extrabees$genetics$effect$ExtraBeesEffect[ordinal()]) - { - case 1: - firework.setShape(FireworkCreator.Shape.Star); - firework.addColor(16768256); - for (Birthday birthday : birthdays) { - if (birthday.isToday()) - { - firework.addColor(16711680); - firework.addColor(65280); - firework.addColor(255); - firework.setTrail(); - break; - } - } - break; - case 2: - break; - case 3: - 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; - } - EntityFireworkRocket var11 = new EntityFireworkRocket(world, x1, y1, z1, firework.getFirework()); - if (world.canBlockSeeTheSky(x1, y1, z1)) { - ((WorldServer)world).spawnEntityInWorld(var11); - } - } - break; - case 17: - List<Entity> entities2 = getEntities(Entity.class, genome, housing); - for (Entity entity : entities2) - { - float entityStrength = 1.0F; - if ((entity instanceof EntityPlayer)) { - entityStrength *= 100.0F; - } - double dx = x1 - entity.posX; - double dy = y1 - entity.posY; - double dz = z1 - entity.posZ; - if (dx * dx + dy * dy + dz * dz < 2.0D) { - return null; - } - double strength = 0.5D / (dx * dx + dy * dy + dz * dz) * entityStrength; - entity.addVelocity(dx * strength, dy * strength, dz * strength); - } - break; - case 18: - List<EntityPlayer> entities3 = getEntities(EntityPlayer.class, genome, housing); - for (EntityPlayer entity : entities3) - { - double dx = x1 - entity.posX; - double dy = y1 - entity.posY; - double dz = z1 - entity.posZ; - if (dx * dx + dy * dy + dz * dz < 2.0D) { - return null; - } - double strength = 0.5D / (dx * dx + dy * dy + dz * dz); - entity.addVelocity(-dx * strength, -dy * strength, -dz * strength); - } - break; - case 19: - if (world.rand.nextInt(80) > 1) { - return null; - } - List<Entity> entities = getEntities(Entity.class, genome, housing); - if (entities.size() == 0) { - return null; - } - Entity entity = (Entity)entities.get(world.rand.nextInt(entities.size())); - if (!(entity instanceof EntityLiving)) { - return null; - } - float jumpDist = 5.0F; - if (y1 < 4) { - y1 = 4; - } - if ((!world.isAirBlock(x1, y1, z1)) || (!world.isAirBlock(x1, y1 + 1, z1))) { - return null; - } - ((EntityLiving)entity).setPositionAndUpdate(x1, y1, z1); - - - - - ((EntityLiving)entity).addPotionEffect(new PotionEffect(Potion.confusion.id, 160, 10)); - - - break; - case 20: - if (world.rand.nextInt(120) > 1) { - return null; - } - TileEntity tile = world.getTileEntity(x1, y1, z1); - if ((tile instanceof IFluidHandler)) { - ((IFluidHandler)tile).fill(ForgeDirection.UP, Binnie.Liquid.getLiquidStack("water", 100), true); - } - break; - case 21: - 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, null); - } - break; - case 22: - 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, null); - } - break; - case 23: - 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, null); - } - break; - case 24: - TileEntity tile2 = world.getTileEntity(x1, y1, z1); - if ((tile2 instanceof IEnergyReceiver)) { - ((IEnergyReceiver)tile2).receiveEnergy(ForgeDirection.getOrientation(0), 5, true); - } - break; - case 25: - break; - } - return null; - } - - protected int[] getModifiedArea(IBeeGenome genome, IBeeHousing housing) - { - int[] area = genome.getTerritory(); int - tmp9_8 = 0; int[] tmp9_7 = area;tmp9_7[tmp9_8] = ((int)(tmp9_7[tmp9_8] * (housing.getTerritoryModifier(genome, 1.0F) * 3.0F))); int - tmp29_28 = 1; int[] tmp29_27 = area;tmp29_27[tmp29_28] = ((int)(tmp29_27[tmp29_28] * (housing.getTerritoryModifier(genome, 1.0F) * 3.0F))); int - tmp49_48 = 2; int[] tmp49_47 = area;tmp49_47[tmp49_48] = ((int)(tmp49_47[tmp49_48] * (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; - } - - public IEffectData doFX(IBeeGenome genome, IEffectData storedData, IBeeHousing housing) - { - int[] area = genome.getTerritory(); int - tmp11_10 = 0; int[] tmp11_8 = area;tmp11_8[tmp11_10] = ((int)(tmp11_8[tmp11_10] * housing.getTerritoryModifier(genome, 1.0F))); int - tmp28_27 = 1; int[] tmp28_25 = area;tmp28_25[tmp28_27] = ((int)(tmp28_25[tmp28_27] * housing.getTerritoryModifier(genome, 1.0F))); int - tmp45_44 = 2; int[] tmp45_42 = area;tmp45_42[tmp45_44] = ((int)(tmp45_42[tmp45_44] * housing.getTerritoryModifier(genome, 1.0F))); - if (area[0] < 1) { - area[0] = 1; - } - if (area[1] < 1) { - area[1] = 1; - } - if (area[2] < 1) { - area[2] = 1; - } - PluginApiculture.proxy.addBeeHiveFX("particles/swarm_bee", housing.getWorld(), housing.getXCoord(), housing.getYCoord(), housing.getZCoord(), genome.getPrimary().getIconColour(0), area[0], area[1], area[2]); - - return storedData; - } - - public String getFX() - { - return this.fx; - } - - public <T extends Entity> List<T> getEntities(Class<T> eClass, IBeeGenome genome, IBeeHousing housing) - { - int[] area = genome.getTerritory(); - int[] offset = { -Math.round(area[0] / 2), -Math.round(area[1] / 2), -Math.round(area[2] / 2) }; - - - int[] min = { housing.getXCoord() + offset[0], housing.getYCoord() + offset[1], housing.getZCoord() + offset[2] }; - int[] max = { housing.getXCoord() + offset[0] + area[0], housing.getYCoord() + offset[1] + area[1], housing.getZCoord() + offset[2] + area[2] }; - - 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(EntityPlayer player) - { - ItemStack armorItem = player.inventory.armorInventory[3]; - return (armorItem != null) && ((armorItem.getItem() instanceof IArmorApiarist)); - } - - public static boolean wearsChest(EntityPlayer player) - { - ItemStack armorItem = player.inventory.armorInventory[2]; - return (armorItem != null) && ((armorItem.getItem() instanceof IArmorApiarist)); - } - - public static boolean wearsLegs(EntityPlayer player) - { - ItemStack armorItem = player.inventory.armorInventory[1]; - return (armorItem != null) && ((armorItem.getItem() instanceof IArmorApiarist)); - } - - public static boolean wearsBoots(EntityPlayer player) - { - ItemStack armorItem = player.inventory.armorInventory[0]; - return (armorItem != null) && ((armorItem.getItem() instanceof IArmorApiarist)); - } - - public static int wearsItems(EntityPlayer player) - { - int count = 0; - if (wearsHelmet(player)) { - count++; - } - if (wearsChest(player)) { - count++; - } - if (wearsLegs(player)) { - count++; - } - if (wearsBoots(player)) { - count++; - } - return count; - } - - 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(int day, int month, String name) - { - this.day = day; - this.month = (month + 1); - this.name = name; - } - } - - static - { - birthdays = new ArrayList(); - - - birthdays.add(new Birthday(3, 10, "Binnie", null)); - } - - public String getUnlocalizedName() - { - return getUID(); - } -} diff --git a/src/Java/binnie/extrabees/genetics/effect/FireworkCreator.java b/src/Java/binnie/extrabees/genetics/effect/FireworkCreator.java deleted file mode 100644 index 29e5e42ada..0000000000 --- a/src/Java/binnie/extrabees/genetics/effect/FireworkCreator.java +++ /dev/null @@ -1,83 +0,0 @@ -package binnie.extrabees.genetics.effect; - -import java.util.ArrayList; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; - -public class FireworkCreator -{ - public static enum Shape - { - Ball, LargeBall, Star, Creeper, Burst; - - private Shape() {} - } - - public static class Firework - { - boolean flicker = false; - boolean trail = false; - ArrayList<Integer> colors = new ArrayList(); - byte shape = 0; - - public void setFlicker() - { - this.flicker = true; - } - - public void setTrail() - { - this.trail = true; - } - - public void setShape(FireworkCreator.Shape shape) - { - this.shape = ((byte)shape.ordinal()); - } - - public void addColor(int color) - { - this.colors.add(Integer.valueOf(color)); - } - - NBTTagCompound getNBT() - { - NBTTagCompound nbt = new NBTTagCompound(); - if (this.flicker) { - nbt.setBoolean("Flicker", true); - } - if (this.trail) { - nbt.setBoolean("Trail", true); - } - if (this.colors.size() == 0) { - addColor(16777215); - } - int[] array = new int[this.colors.size()]; - for (int i = 0; i < this.colors.size(); i++) { - array[i] = ((Integer)this.colors.get(i)).intValue(); - } - nbt.setIntArray("Colors", array); - nbt.setByte("Type", this.shape); - return nbt; - } - - public ItemStack getFirework() - { - NBTTagCompound var15 = new NBTTagCompound(); - - NBTTagCompound var18 = new NBTTagCompound(); - NBTTagList var25 = new NBTTagList(); - var25.appendTag(getNBT()); - - var18.setTag("Explosions", var25); - var18.setByte("Flight", (byte)0); - var15.setTag("Fireworks", var18); - - ItemStack item = new ItemStack(Items.fireworks); - item.setTagCompound(var15); - return item; - } - } -} diff --git a/src/Java/binnie/extrabees/genetics/items/ItemDictionary.java b/src/Java/binnie/extrabees/genetics/items/ItemDictionary.java deleted file mode 100644 index 82e5754484..0000000000 --- a/src/Java/binnie/extrabees/genetics/items/ItemDictionary.java +++ /dev/null @@ -1,73 +0,0 @@ -package binnie.extrabees.genetics.items; - -import binnie.extrabees.ExtraBees; -import binnie.extrabees.core.ExtraBeeGUID; -import binnie.extrabees.proxy.ExtraBeesProxy; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.core.Tabs; -import java.util.List; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; - -public class ItemDictionary - extends Item -{ - IIcon iconMaster; - - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister register) - { - this.itemIcon = ExtraBees.proxy.getIcon(register, "apiaristDatabase"); - this.iconMaster = ExtraBees.proxy.getIcon(register, "masterApiaristDatabase"); - } - - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamage(int par1) - { - return par1 == 0 ? this.itemIcon : this.iconMaster; - } - - @SideOnly(Side.CLIENT) - public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) - { - super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4); - if (par1ItemStack.getItemDamage() > 0) { - par3List.add("Flora-in-a-box"); - } - } - - @SideOnly(Side.CLIENT) - public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) - { - super.getSubItems(par1, par2CreativeTabs, par3List); - par3List.add(new ItemStack(par1, 1, 1)); - } - - public ItemDictionary() - { - setCreativeTab(Tabs.tabApiculture); - setUnlocalizedName("dictionary"); - setMaxStackSize(1); - } - - public ItemStack onItemRightClick(ItemStack itemstack, World world, 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; - } - - public String getItemStackDisplayName(ItemStack i) - { - return i.getItemDamage() == 0 ? "Apiarist Database" : "Master Apiarist Database"; - } -} diff --git a/src/Java/binnie/extrabees/genetics/items/ItemPunnettSquare.java b/src/Java/binnie/extrabees/genetics/items/ItemPunnettSquare.java deleted file mode 100644 index 7534802687..0000000000 --- a/src/Java/binnie/extrabees/genetics/items/ItemPunnettSquare.java +++ /dev/null @@ -1,41 +0,0 @@ -package binnie.extrabees.genetics.items; - -import binnie.extrabees.ExtraBees; -import binnie.extrabees.core.ExtraBeeGUID; -import binnie.extrabees.proxy.ExtraBeesProxy; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -public class ItemPunnettSquare - extends Item -{ - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister register) - { - this.itemIcon = ExtraBees.proxy.getIcon(register, ""); - } - - public ItemPunnettSquare() - { - setCreativeTab(CreativeTabs.tabTools); - setMaxStackSize(1); - } - - public String getItemStackDisplayName(ItemStack itemstack) - { - return "Punnett Square"; - } - - public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) - { - ExtraBees.proxy.openGui(ExtraBeeGUID.PunnettSquare, player, (int)player.posX, (int)player.posY, (int)player.posZ); - - return itemstack; - } -} diff --git a/src/Java/binnie/extrabees/gui/database/ControlBiomes.java b/src/Java/binnie/extrabees/gui/database/ControlBiomes.java deleted file mode 100644 index 1299df72ca..0000000000 --- a/src/Java/binnie/extrabees/gui/database/ControlBiomes.java +++ /dev/null @@ -1,75 +0,0 @@ -package binnie.extrabees.gui.database; - -import binnie.Binnie; -import binnie.core.BinnieCore; -import binnie.core.genetics.ManagerGenetics; -import binnie.core.proxy.BinnieProxy; -import binnie.craftgui.controls.core.Control; -import binnie.craftgui.core.Attribute; -import binnie.craftgui.core.CraftGUI; -import binnie.craftgui.core.ITooltip; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.Tooltip; -import binnie.craftgui.core.geometry.IArea; -import binnie.craftgui.core.geometry.IPoint; -import binnie.craftgui.core.renderer.Renderer; -import binnie.craftgui.resource.minecraft.CraftGUITexture; -import forestry.api.apiculture.IAlleleBeeSpecies; -import forestry.api.apiculture.IBee; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeRoot; -import java.util.ArrayList; -import java.util.List; -import net.minecraft.world.biome.BiomeGenBase; - -public class ControlBiomes - extends Control - implements ITooltip -{ - public ControlBiomes(IWidget parent, int x, int y, int width, int height) - { - super(parent, x, y, width * 16, height * 16); - addAttribute(Attribute.MouseOver); - } - - List<Integer> tolerated = new ArrayList(); - - public void getTooltip(Tooltip list) - { - if (this.tolerated.isEmpty()) { - return; - } - int x = (int)(getRelativeMousePosition().x() / 16.0F); - int y = (int)(getRelativeMousePosition().y() / 16.0F); - - int i = x + y * 8; - if (i < this.tolerated.size()) { - list.add(BiomeGenBase.getBiome(((Integer)this.tolerated.get(i)).intValue()).biomeName); - } - } - - public void onRenderForeground() - { - for (int i = 0; i < this.tolerated.size(); i++) - { - int x = i % 8 * 16; - 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(IAlleleBeeSpecies species) - { - this.tolerated.clear(); - if (species == null) { - return; - } - IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(Binnie.Genetics.getBeeRoot().getTemplate(species.getUID())); - - - IBee bee = Binnie.Genetics.getBeeRoot().getBee(BinnieCore.proxy.getWorld(), genome); - } -} diff --git a/src/Java/binnie/extrabees/gui/database/ControlClimateBar.java b/src/Java/binnie/extrabees/gui/database/ControlClimateBar.java deleted file mode 100644 index 688bbd40c5..0000000000 --- a/src/Java/binnie/extrabees/gui/database/ControlClimateBar.java +++ /dev/null @@ -1,153 +0,0 @@ -package binnie.extrabees.gui.database; - -import binnie.Binnie; -import binnie.core.genetics.ManagerGenetics; -import binnie.craftgui.controls.core.Control; -import binnie.craftgui.core.Attribute; -import binnie.craftgui.core.CraftGUI; -import binnie.craftgui.core.ITooltip; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.Tooltip; -import binnie.craftgui.core.geometry.IArea; -import binnie.craftgui.core.geometry.IPoint; -import binnie.craftgui.core.renderer.Renderer; -import binnie.craftgui.resource.minecraft.CraftGUITexture; -import forestry.api.apiculture.IAlleleBeeSpecies; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeRoot; -import forestry.api.core.EnumHumidity; -import forestry.api.core.EnumTemperature; -import forestry.api.genetics.EnumTolerance; -import java.util.ArrayList; -import java.util.List; - -public class ControlClimateBar - extends Control - implements ITooltip -{ - public ControlClimateBar(IWidget parent, int x, int y, int width, int height) - { - super(parent, x, y, width, height); - addAttribute(Attribute.MouseOver); - } - - public ControlClimateBar(IWidget parent, int x, int y, int width, int height, boolean humidity) - { - super(parent, x, y, width, height); - addAttribute(Attribute.MouseOver); - this.isHumidity = true; - } - - boolean isHumidity = false; - List<Integer> tolerated = new ArrayList(); - - public void getTooltip(Tooltip list) - { - if (this.tolerated.isEmpty()) { - return; - } - int types = this.isHumidity ? 3 : 6; - - int type = (int)((int)(getRelativeMousePosition().x() - 1.0F) / ((getSize().x() - 2.0F) / types)); - if (!this.tolerated.contains(Integer.valueOf(type))) { - return; - } - if (type < types) { - if (this.isHumidity) { - list.add(EnumHumidity.values()[type].name); - } else { - list.add(EnumTemperature.values()[(type + 1)].name); - } - } - } - - int[] tempColours = { 65531, 7912447, 5242672, 16776960, 16753152, 16711680 }; - int[] humidColours = { 16770979, 1769216, 3177727 }; - - public void onRenderBackground() - { - CraftGUI.Render.texture(CraftGUITexture.EnergyBarBack, getArea()); - - int types = this.isHumidity ? 3 : 6; - int w = (int)((getSize().x() - 2.0F) / types); - for (int i = 0; i < types; i++) - { - int x = i * w; - if (this.tolerated.contains(Integer.valueOf(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, getSize().y() - 2.0F), colour); - } - } - CraftGUI.Render.texture(CraftGUITexture.EnergyBarGlass, getArea()); - } - - public void setSpecies(IAlleleBeeSpecies species) - { - this.tolerated.clear(); - if (species == null) { - return; - } - EnumTolerance tolerance; - int main; - EnumTolerance tolerance; - if (!this.isHumidity) - { - int main = species.getTemperature().ordinal() - 1; - IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(Binnie.Genetics.getBeeRoot().getTemplate(species.getUID())); - - - tolerance = genome.getToleranceTemp(); - } - else - { - main = species.getHumidity().ordinal(); - IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(Binnie.Genetics.getBeeRoot().getTemplate(species.getUID())); - - - tolerance = genome.getToleranceHumid(); - } - this.tolerated.add(Integer.valueOf(main)); - switch (1.$SwitchMap$forestry$api$genetics$EnumTolerance[tolerance.ordinal()]) - { - case 1: - case 2: - this.tolerated.add(Integer.valueOf(main + 5)); - case 3: - case 4: - this.tolerated.add(Integer.valueOf(main + 4)); - case 5: - case 6: - this.tolerated.add(Integer.valueOf(main + 3)); - case 7: - case 8: - this.tolerated.add(Integer.valueOf(main + 2)); - case 9: - case 10: - this.tolerated.add(Integer.valueOf(main + 1)); - } - switch (1.$SwitchMap$forestry$api$genetics$EnumTolerance[tolerance.ordinal()]) - { - case 1: - case 11: - this.tolerated.add(Integer.valueOf(main - 5)); - case 3: - case 12: - this.tolerated.add(Integer.valueOf(main - 4)); - case 5: - case 13: - this.tolerated.add(Integer.valueOf(main - 3)); - case 7: - case 14: - this.tolerated.add(Integer.valueOf(main - 2)); - case 9: - case 15: - this.tolerated.add(Integer.valueOf(main - 1)); - } - } -} diff --git a/src/Java/binnie/extrabees/gui/database/ControlProductsBox.java b/src/Java/binnie/extrabees/gui/database/ControlProductsBox.java deleted file mode 100644 index f6103f9bba..0000000000 --- a/src/Java/binnie/extrabees/gui/database/ControlProductsBox.java +++ /dev/null @@ -1,92 +0,0 @@ -package binnie.extrabees.gui.database; - -import binnie.Binnie; -import binnie.core.BinnieCore; -import binnie.core.genetics.ManagerGenetics; -import binnie.core.proxy.BinnieProxy; -import binnie.craftgui.controls.listbox.ControlList; -import binnie.craftgui.controls.listbox.ControlListBox; -import binnie.craftgui.core.IWidget; -import forestry.api.apiculture.IAlleleBeeSpecies; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeRoot; -import forestry.api.apiculture.IBeekeepingMode; -import forestry.api.genetics.IAllele; -import java.util.ArrayList; -import java.util.List; -import java.util.Map; -import java.util.Map.Entry; -import net.minecraft.item.ItemStack; - -public class ControlProductsBox - extends ControlListBox<Product> -{ - private int index; - private Type type; - - public IWidget createOption(Product value, int y) - { - return new ControlProductsItem((ControlList)getContent(), value, y); - } - - static enum Type - { - Products, Specialties; - - private Type() {} - } - - class Product - { - ItemStack item; - float chance; - - public Product(ItemStack item, float chance) - { - this.item = item; - this.chance = chance; - } - } - - public ControlProductsBox(IWidget parent, int x, int y, int width, int height, Type type) - { - super(parent, x, y, width, height, 12.0F); - this.type = type; - } - - IAlleleBeeSpecies species = null; - - public void setSpecies(IAlleleBeeSpecies species) - { - if (species != this.species) - { - this.species = species; - if (species != null) - { - IAllele[] template = Binnie.Genetics.getBeeRoot().getTemplate(species.getUID()); - if (template == null) { - return; - } - IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(template); - - float speed = genome.getSpeed(); - - float modeSpeed = Binnie.Genetics.getBeeRoot().getBeekeepingMode(BinnieCore.proxy.getWorld()).getProductionModifier(genome, 1.0F); - - - - List<Product> strings = new ArrayList(); - if (this.type == Type.Products) { - for (Map.Entry<ItemStack, Integer> entry : species.getProducts().entrySet()) { - strings.add(new Product((ItemStack)entry.getKey(), speed * modeSpeed * ((Integer)entry.getValue()).intValue())); - } - } else { - for (Map.Entry<ItemStack, Integer> entry : species.getSpecialty().entrySet()) { - strings.add(new Product((ItemStack)entry.getKey(), speed * modeSpeed * ((Integer)entry.getValue()).intValue())); - } - } - setOptions(strings); - } - } - } -} diff --git a/src/Java/binnie/extrabees/gui/database/ControlProductsItem.java b/src/Java/binnie/extrabees/gui/database/ControlProductsItem.java deleted file mode 100644 index 4f449e3558..0000000000 --- a/src/Java/binnie/extrabees/gui/database/ControlProductsItem.java +++ /dev/null @@ -1,44 +0,0 @@ -package binnie.extrabees.gui.database; - -import binnie.craftgui.controls.ControlText; -import binnie.craftgui.controls.ControlTextCentered; -import binnie.craftgui.controls.listbox.ControlList; -import binnie.craftgui.controls.listbox.ControlOption; -import binnie.craftgui.core.geometry.CraftGUIUtil; -import binnie.craftgui.core.geometry.IPoint; -import binnie.craftgui.minecraft.control.ControlItemDisplay; -import java.text.DecimalFormat; - -public class ControlProductsItem - extends ControlOption<ControlProductsBox.Product> -{ - ControlItemDisplay item; - - public ControlProductsItem(ControlList<ControlProductsBox.Product> controlList, ControlProductsBox.Product value, int y) - { - super(controlList, value, y); - this.item = new ControlItemDisplay(this, 4.0F, 4.0F); - this.item.setTooltip(); - - ControlText textWidget = new ControlTextCentered(this, 2.0F, ""); - CraftGUIUtil.moveWidget(textWidget, new IPoint(12.0F, 0.0F)); - if (value != null) - { - this.item.setItemStack(value.item); - float time = (int)(55000.0D / value.chance); - - float seconds = time / 20.0F; - float minutes = seconds / 60.0F; - float hours = minutes / 60.0F; - - 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."); - } - } - } -} diff --git a/src/Java/binnie/extrabees/gui/database/PageSpeciesClimate.java b/src/Java/binnie/extrabees/gui/database/PageSpeciesClimate.java deleted file mode 100644 index 3b93ff1b3c..0000000000 --- a/src/Java/binnie/extrabees/gui/database/PageSpeciesClimate.java +++ /dev/null @@ -1,36 +0,0 @@ -package binnie.extrabees.gui.database; - -import binnie.craftgui.controls.ControlTextCentered; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.mod.database.DatabaseTab; -import binnie.craftgui.mod.database.PageSpecies; -import forestry.api.apiculture.IAlleleBeeSpecies; -import forestry.api.genetics.IAlleleSpecies; - -public class PageSpeciesClimate - extends PageSpecies -{ - ControlClimateBar tempBar; - ControlClimateBar humidBar; - ControlBiomes biomes; - - public PageSpeciesClimate(IWidget parent, 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); - } - - public void onValueChanged(IAlleleSpecies species) - { - this.tempBar.setSpecies((IAlleleBeeSpecies)species); - this.humidBar.setSpecies((IAlleleBeeSpecies)species); - this.biomes.setSpecies((IAlleleBeeSpecies)species); - } -} diff --git a/src/Java/binnie/extrabees/gui/database/PageSpeciesGenome.java b/src/Java/binnie/extrabees/gui/database/PageSpeciesGenome.java deleted file mode 100644 index a69e528d51..0000000000 --- a/src/Java/binnie/extrabees/gui/database/PageSpeciesGenome.java +++ /dev/null @@ -1,206 +0,0 @@ -package binnie.extrabees.gui.database; - -import binnie.Binnie; -import binnie.core.BinnieCore; -import binnie.core.genetics.ManagerGenetics; -import binnie.core.proxy.BinnieProxy; -import binnie.craftgui.controls.ControlText; -import binnie.craftgui.controls.ControlTextCentered; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.geometry.IArea; -import binnie.craftgui.core.geometry.TextJustification; -import binnie.craftgui.mod.database.DatabaseTab; -import binnie.craftgui.mod.database.PageSpecies; -import forestry.api.apiculture.IAlleleBeeEffect; -import forestry.api.apiculture.IAlleleBeeSpecies; -import forestry.api.apiculture.IBee; -import forestry.api.apiculture.IBeeGenome; -import forestry.api.apiculture.IBeeRoot; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IAlleleSpecies; -import forestry.api.genetics.IFlowerProvider; - -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(IWidget parent, 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); - - 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); - } - - public void onValueChanged(IAlleleSpecies species) - { - IAllele[] template = Binnie.Genetics.getBeeRoot().getTemplate(species.getUID()); - if (template != null) - { - IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(template); - - 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())); - 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(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(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(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(boolean t) - { - if (t) { - return "Tolerated"; - } - return "Not Tolerated"; - } -} diff --git a/src/Java/binnie/extrabees/gui/database/PageSpeciesProducts.java b/src/Java/binnie/extrabees/gui/database/PageSpeciesProducts.java deleted file mode 100644 index f8af0ef3bd..0000000000 --- a/src/Java/binnie/extrabees/gui/database/PageSpeciesProducts.java +++ /dev/null @@ -1,38 +0,0 @@ -package binnie.extrabees.gui.database; - -import binnie.craftgui.controls.ControlText; -import binnie.craftgui.controls.ControlTextCentered; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.mod.database.DatabaseTab; -import binnie.craftgui.mod.database.PageSpecies; -import forestry.api.apiculture.IAlleleBeeSpecies; -import forestry.api.genetics.IAlleleSpecies; - -public class PageSpeciesProducts - extends PageSpecies -{ - ControlText pageSpeciesProducts_Title; - ControlProductsBox pageSpeciesProducts_Products; - ControlText pageSpeciesProducts_Title2; - ControlProductsBox pageSpeciesProducts_Specialties; - - public PageSpeciesProducts(IWidget parent, 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); - } - - public void onValueChanged(IAlleleSpecies species) - { - this.pageSpeciesProducts_Products.setSpecies((IAlleleBeeSpecies)species); - this.pageSpeciesProducts_Specialties.setSpecies((IAlleleBeeSpecies)species); - } -} diff --git a/src/Java/binnie/extrabees/gui/database/WindowApiaristDatabase.java b/src/Java/binnie/extrabees/gui/database/WindowApiaristDatabase.java deleted file mode 100644 index d77ee87251..0000000000 --- a/src/Java/binnie/extrabees/gui/database/WindowApiaristDatabase.java +++ /dev/null @@ -1,83 +0,0 @@ -package binnie.extrabees.gui.database; - -import binnie.Binnie; -import binnie.core.AbstractMod; -import binnie.core.genetics.ManagerGenetics; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.mod.database.DatabaseTab; -import binnie.craftgui.mod.database.PageBranchOverview; -import binnie.craftgui.mod.database.PageBranchSpecies; -import binnie.craftgui.mod.database.PageBreeder; -import binnie.craftgui.mod.database.PageSpeciesClassification; -import binnie.craftgui.mod.database.PageSpeciesMutations; -import binnie.craftgui.mod.database.PageSpeciesOverview; -import binnie.craftgui.mod.database.PageSpeciesResultant; -import binnie.craftgui.mod.database.WindowAbstractDatabase; -import binnie.craftgui.mod.database.WindowAbstractDatabase.Mode; -import binnie.extrabees.ExtraBees; -import cpw.mods.fml.relauncher.Side; -import net.minecraft.entity.player.EntityPlayer; - -public class WindowApiaristDatabase - extends WindowAbstractDatabase -{ - static enum SpeciesTab - { - Overview(255), Genome(16776960), Productivity(65535), Climate(16711680), ResultantMutations(16711935), FurtherMutations(65280); - - public int colour; - - private SpeciesTab(int colour) - { - this.colour = colour; - } - } - - static enum BranchesTab - { - Overview(255), Species(16711680); - - public int colour; - - private BranchesTab(int colour) - { - this.colour = colour; - } - } - - protected void addTabs() - { - new PageSpeciesOverview(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraBees.instance, "species.overview", 0)); - new PageSpeciesClassification(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraBees.instance, "species.classification", 0)); - new PageSpeciesGenome(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraBees.instance, "species.genome", 0)); - new PageSpeciesProducts(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraBees.instance, "species.products", 0)); - new PageSpeciesClimate(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraBees.instance, "species.climate", 0)); - new PageSpeciesResultant(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraBees.instance, "species.resultant", 0)); - new PageSpeciesMutations(getInfoPages(WindowAbstractDatabase.Mode.Species), new DatabaseTab(ExtraBees.instance, "species.further", 0)); - - new PageBranchOverview(getInfoPages(WindowAbstractDatabase.Mode.Branches), new DatabaseTab(ExtraBees.instance, "branches.overview", 0)); - new PageBranchSpecies(getInfoPages(WindowAbstractDatabase.Mode.Branches), new DatabaseTab(ExtraBees.instance, "branches.species", 0)); - - new PageBreeder(getInfoPages(WindowAbstractDatabase.Mode.Breeder), getUsername(), new DatabaseTab(ExtraBees.instance, "breeder", 0)); - } - - public WindowApiaristDatabase(EntityPlayer player, Side side, boolean nei) - { - super(player, side, nei, Binnie.Genetics.beeBreedingSystem, 110.0F); - } - - public static Window create(EntityPlayer player, Side side, boolean nei) - { - return new WindowApiaristDatabase(player, side, nei); - } - - public AbstractMod getMod() - { - return ExtraBees.instance; - } - - public String getName() - { - return "Database"; - } -} diff --git a/src/Java/binnie/extrabees/gui/punnett/ControlChromosome.java b/src/Java/binnie/extrabees/gui/punnett/ControlChromosome.java deleted file mode 100644 index f4a7ffc507..0000000000 --- a/src/Java/binnie/extrabees/gui/punnett/ControlChromosome.java +++ /dev/null @@ -1,49 +0,0 @@ -package binnie.extrabees.gui.punnett; - -import binnie.craftgui.controls.core.Control; -import binnie.craftgui.controls.core.IControlValue; -import binnie.craftgui.core.Attribute; -import binnie.craftgui.core.CraftGUI; -import binnie.craftgui.core.ITooltip; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.Tooltip; -import binnie.craftgui.core.renderer.Renderer; -import forestry.api.genetics.IChromosomeType; - -public class ControlChromosome - extends Control - implements IControlValue<IChromosomeType>, ITooltip -{ - IChromosomeType value; - - protected ControlChromosome(IWidget parent, float x, float y, IChromosomeType type) - { - super(parent, x, y, 16.0F, 16.0F); - setValue(type); - addAttribute(Attribute.MouseOver); - } - - public IChromosomeType getValue() - { - return this.value; - } - - public void setValue(IChromosomeType value) - { - this.value = value; - } - - public void onRenderBackground() - { - CraftGUI.Render.texture(ExtraBeeGUITexture.Chromosome, getArea()); - CraftGUI.Render.colour(16711680); - CraftGUI.Render.texture(ExtraBeeGUITexture.Chromosome2, getArea()); - } - - public void getTooltip(Tooltip tooltip) - { - if (this.value != null) { - tooltip.add(this.value.getName()); - } - } -} diff --git a/src/Java/binnie/extrabees/gui/punnett/ControlPunnett.java b/src/Java/binnie/extrabees/gui/punnett/ControlPunnett.java deleted file mode 100644 index 56b2f6c916..0000000000 --- a/src/Java/binnie/extrabees/gui/punnett/ControlPunnett.java +++ /dev/null @@ -1,86 +0,0 @@ -package binnie.extrabees.gui.punnett; - -import binnie.craftgui.controls.ControlText; -import binnie.craftgui.controls.core.Control; -import binnie.craftgui.core.CraftGUI; -import binnie.craftgui.core.IWidget; -import binnie.craftgui.core.geometry.IArea; -import binnie.craftgui.core.geometry.TextJustification; -import binnie.craftgui.core.renderer.Renderer; -import forestry.api.genetics.IAllele; -import forestry.api.genetics.IChromosomeType; -import forestry.api.genetics.IGenome; -import forestry.api.genetics.IIndividual; -import forestry.api.genetics.ISpeciesRoot; -import java.util.LinkedList; -import java.util.List; - -public class ControlPunnett - extends Control -{ - protected ControlPunnett(IWidget parent, float x, float y) - { - super(parent, x, y, boxWidth * 3, boxWidth * 3); - } - - static int boxWidth = 80; - static int boxHeight = 28; - - public void onRenderBackground() - { - CraftGUI.Render.solid(new IArea(0.0F, boxHeight, boxWidth * 3, 1.0F), 11184810); - CraftGUI.Render.solid(new IArea(boxWidth / 2.0F, boxHeight * 2, boxWidth * 2.5F, 1.0F), 11184810); - - CraftGUI.Render.solid(new IArea(boxWidth, 0.0F, 1.0F, boxHeight * 3), 11184810); - CraftGUI.Render.solid(new IArea(boxWidth * 2, boxHeight / 2.0F, 1.0F, boxHeight * 2.5F), 11184810); - } - - public void setup(IChromosomeType chromosome, IIndividual ind1, IIndividual ind2, ISpeciesRoot root) - { - deleteAllChildren(); - if ((chromosome == null) || (ind1 == null) || (ind2 == null) || (root == null)) { - return; - } - IAllele primary1 = ind1.getGenome().getActiveAllele(chromosome); - IAllele primary2 = ind2.getGenome().getActiveAllele(chromosome); - IAllele secondary1 = ind1.getGenome().getInactiveAllele(chromosome); - IAllele secondary2 = ind2.getGenome().getInactiveAllele(chromosome); - - int x = 1; - int y = 1; - for (IAllele allele1 : new IAllele[] { primary1, secondary1 }) - { - y = 1; - for (IAllele allele2 : new IAllele[] { primary2, secondary2 }) - { - List<IAllele> alleles = new LinkedList(); - 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 (IAllele allele : alleles) { - text = text + allele.getName() + ": " + 25.0F / alleles.size() + "%\n"; - } - new ControlText(this, new IArea(x * boxWidth, boxHeight * y, boxWidth, boxHeight), text, TextJustification.TopCenter).setColour(11184810); - y++; - } - x++; - } - new ControlText(this, new IArea(boxWidth, 0.0F, boxWidth, boxHeight), "\n" + primary1.getName(), TextJustification.TopCenter).setColour(11184810); - new ControlText(this, new IArea(boxWidth * 2, 0.0F, boxWidth, boxHeight), "\n" + secondary1.getName(), TextJustification.TopCenter).setColour(11184810); - new ControlText(this, new IArea(0.0F, boxHeight, boxWidth, boxHeight), primary2.getName(), TextJustification.TopCenter).setColour(11184810); - new ControlText(this, new IArea(0.0F, boxHeight * 2, boxWidth, boxHeight), primary2.getName(), TextJustification.TopCenter).setColour(11184810); - } -} diff --git a/src/Java/binnie/extrabees/gui/punnett/ExtraBeeGUITexture.java b/src/Java/binnie/extrabees/gui/punnett/ExtraBeeGUITexture.java deleted file mode 100644 index eac77aabf9..0000000000 --- a/src/Java/binnie/extrabees/gui/punnett/ExtraBeeGUITexture.java +++ /dev/null @@ -1,8 +0,0 @@ -package binnie.extrabees.gui.punnett; - -public enum ExtraBeeGUITexture -{ - Chromosome, Chromosome2; - - private ExtraBeeGUITexture() {} -} diff --git a/src/Java/binnie/extrabees/gui/punnett/WindowPunnettSquare.java b/src/Java/binnie/extrabees/gui/punnett/WindowPunnettSquare.java deleted file mode 100644 index 488f2b6922..0000000000 --- a/src/Java/binnie/extrabees/gui/punnett/WindowPunnettSquare.java +++ /dev/null @@ -1,67 +0,0 @@ -package binnie.extrabees.gui.punnett; - -import binnie.core.AbstractMod; -import binnie.craftgui.core.CraftGUI; -import binnie.craftgui.core.renderer.Renderer; -import binnie.craftgui.minecraft.Window; -import binnie.craftgui.minecraft.control.ControlSlot; -import binnie.craftgui.resource.StyleSheet; -import binnie.craftgui.resource.minecraft.CraftGUITexture; -import binnie.craftgui.resource.minecraft.PaddedTexture; -import binnie.craftgui.resource.minecraft.StandardTexture; -import binnie.extrabees.ExtraBees; -import binnie.extrabees.core.ExtraBeeTexture; -import cpw.mods.fml.relauncher.Side; -import forestry.api.genetics.ISpeciesRoot; -import java.util.Map; -import net.minecraft.entity.player.EntityPlayer; -import net.minecraft.inventory.IInventory; - -public class WindowPunnettSquare - extends Window -{ - ControlSlot bee1; - ControlSlot bee2; - ControlPunnett punnett; - - public static Window create(EntityPlayer player, IInventory inventory, Side side) - { - return new WindowPunnettSquare(player, inventory, side); - } - - public WindowPunnettSquare(EntityPlayer player, IInventory inventory, Side side) - { - super(245.0F, 205.0F, player, inventory, side); - } - - public AbstractMod getMod() - { - return ExtraBees.instance; - } - - public String getName() - { - return "Punnett"; - } - - public void initialiseClient() - { - setTitle("Punnett Square"); - - CraftGUI.Render.stylesheet(new StyleSheetPunnett()); - } - - ISpeciesRoot root = null; - - 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)); - } - } -} diff --git a/src/Java/binnie/extrabees/products/EnumHoneyComb.java b/src/Java/binnie/extrabees/products/EnumHoneyComb.java deleted file mode 100644 index 5c480d0a04..0000000000 --- a/src/Java/binnie/extrabees/products/EnumHoneyComb.java +++ /dev/null @@ -1,109 +0,0 @@ -package binnie.extrabees.products; - -import binnie.core.item.IItemEnum; -import binnie.extrabees.ExtraBees; -import binnie.extrabees.proxy.ExtraBeesProxy; -import forestry.api.recipes.ICentrifugeManager; -import forestry.api.recipes.RecipeManagers; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Map.Entry; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - -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 = new int[0]; - public Map<ItemStack, Integer> products = new LinkedHashMap(); - boolean active = true; - public boolean deprecated = false; - - private EnumHoneyComb() - { - this(16777215, 16777215); - this.active = false; - this.deprecated = true; - } - - private EnumHoneyComb(int colour, int colour2) - { - this.colour = new int[] { colour, colour2 }; - } - - public void addRecipe() - { - int[] chancesI = new int[this.products.size()]; - ItemStack[] productsI = new ItemStack[this.products.size()]; - - int i = 0; - for (Map.Entry<ItemStack, Integer> entry : this.products.entrySet()) - { - chancesI[i] = ((Integer)entry.getValue()).intValue(); - productsI[i] = ((ItemStack)entry.getKey()); - i++; - } - RecipeManagers.centrifugeManager.addRecipe(20, get(1), productsI, chancesI); - } - - public boolean isActive() - { - return this.active; - } - - public static EnumHoneyComb get(ItemStack itemStack) - { - int i = itemStack.getItemDamage(); - if ((i >= 0) && (i < values().length)) { - return values()[i]; - } - return values()[0]; - } - - public ItemStack get(int size) - { - return new ItemStack(ExtraBees.comb, size, ordinal()); - } - - public String getName(ItemStack stack) - { - return ExtraBees.proxy.localise("item.comb." + name().toLowerCase()); - } - - public boolean addProduct(ItemStack item, int chance) - { - if (item == null) { - return false; - } - this.products.put(item.copy(), Integer.valueOf(chance)); - return true; - } - - public void tryAddProduct(ItemStack item, int chance) - { - this.active = addProduct(item, chance); - } - - public void tryAddProduct(String oreDict, int chance) - { - if (!OreDictionary.getOres(oreDict).isEmpty()) { - tryAddProduct((ItemStack)OreDictionary.getOres(oreDict).get(0), chance); - } else { - this.active = false; - } - } - - public void tryAddProduct(IItemEnum type, int chance) - { - tryAddProduct(type.get(1), chance); - this.active = ((this.active) && (type.isActive())); - } - - public void copyProducts(EnumHoneyComb comb) - { - this.products.putAll(comb.products); - } -} diff --git a/src/Java/binnie/extrabees/products/EnumHoneyDrop.java b/src/Java/binnie/extrabees/products/EnumHoneyDrop.java deleted file mode 100644 index c3ea6c2cdd..0000000000 --- a/src/Java/binnie/extrabees/products/EnumHoneyDrop.java +++ /dev/null @@ -1,72 +0,0 @@ -package binnie.extrabees.products; - -import binnie.Binnie; -import binnie.core.item.IItemEnum; -import binnie.core.liquid.ManagerLiquid; -import binnie.extrabees.ExtraBees; -import binnie.extrabees.proxy.ExtraBeesProxy; -import forestry.api.recipes.ISqueezerManager; -import forestry.api.recipes.RecipeManagers; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidRegistry; -import net.minecraftforge.fluids.FluidStack; - -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 = null; - public boolean deprecated = false; - - public void addRemenant(ItemStack stack) - { - this.remenant = stack; - this.deprecated = true; - } - - private EnumHoneyDrop() - { - this(16777215, 16777215, ""); - } - - private EnumHoneyDrop(int colour, int colour2, String liquid) - { - this.colour = new int[] { colour, colour2 }; - this.liquidName = liquid; - } - - public void addRecipe() - { - FluidStack liquid = Binnie.Liquid.getLiquidStack(this.liquidName, 200); - if (liquid != null) { - RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[] { get(1) }, liquid, this.remenant, 100); - } - } - - public boolean isActive() - { - return (!this.deprecated) && ((this.liquidName == null) || (FluidRegistry.isFluidRegistered(this.liquidName))); - } - - public static EnumHoneyDrop get(ItemStack itemStack) - { - int i = itemStack.getItemDamage(); - if ((i >= 0) && (i < values().length)) { - return values()[i]; - } - return values()[0]; - } - - public ItemStack get(int size) - { - return new ItemStack(ExtraBees.honeyDrop, size, ordinal()); - } - - public String getName(ItemStack stack) - { - return ExtraBees.proxy.localise("item.honeydrop." + name().toLowerCase()); - } -} diff --git a/src/Java/binnie/extrabees/products/EnumPropolis.java b/src/Java/binnie/extrabees/products/EnumPropolis.java deleted file mode 100644 index 0e8a11f18b..0000000000 --- a/src/Java/binnie/extrabees/products/EnumPropolis.java +++ /dev/null @@ -1,65 +0,0 @@ -package binnie.extrabees.products; - -import binnie.Binnie; -import binnie.core.item.IItemEnum; -import binnie.core.liquid.ManagerLiquid; -import binnie.extrabees.ExtraBees; -import binnie.extrabees.proxy.ExtraBeesProxy; -import forestry.api.recipes.ISqueezerManager; -import forestry.api.recipes.RecipeManagers; -import net.minecraft.item.ItemStack; -import net.minecraftforge.fluids.FluidStack; - -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 = new int[0]; - String liquidName; - boolean active = true; - - private EnumPropolis() - { - this(16777215, 16777215, ""); - this.active = false; - } - - private EnumPropolis(int colour, int colour2, String liquid) - { - this.colour = new int[] { colour, colour2 }; - this.liquidName = liquid; - } - - public void addRecipe() - { - FluidStack liquid = Binnie.Liquid.getLiquidStack(this.liquidName, 500); - if (liquid != null) { - RecipeManagers.squeezerManager.addRecipe(20, new ItemStack[] { get(1) }, liquid, null, 0); - } - } - - public boolean isActive() - { - return (this.active) && (Binnie.Liquid.getLiquidStack(this.liquidName, 100) != null); - } - - public static EnumPropolis get(ItemStack itemStack) - { - int i = itemStack.getItemDamage(); - if ((i >= 0) && (i < values().length)) { - return values()[i]; - } - return values()[0]; - } - - public ItemStack get(int size) - { - return new ItemStack(ExtraBees.propolis, size, ordinal()); - } - - public String getName(ItemStack stack) - { - return ExtraBees.proxy.localise("item.propolis." + name().toLowerCase()); - } -} diff --git a/src/Java/binnie/extrabees/products/ItemHoneyComb.java b/src/Java/binnie/extrabees/products/ItemHoneyComb.java deleted file mode 100644 index 5cbbf8fe63..0000000000 --- a/src/Java/binnie/extrabees/products/ItemHoneyComb.java +++ /dev/null @@ -1,335 +0,0 @@ -package binnie.extrabees.products; - -import binnie.core.BinnieCore; -import binnie.core.Mods; -import binnie.core.Mods.Mod; -import binnie.core.proxy.BinnieProxy; -import binnie.extrabees.ExtraBees; -import binnie.extrabees.core.ExtraBeeItems; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.core.Tabs; -import java.util.ArrayList; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraftforge.oredict.OreDictionary; - -public class ItemHoneyComb - extends ItemProduct -{ - IIcon icon1; - IIcon icon2; - - @SideOnly(Side.CLIENT) - public boolean requiresMultipleRenderPasses() - { - return true; - } - - public ItemHoneyComb() - { - super(EnumHoneyComb.values()); - setCreativeTab(Tabs.tabApiculture); - setUnlocalizedName("honeyComb"); - } - - public static void addSubtypes() - { - ItemStack beeswax = Mods.Forestry.stack("beeswax"); - 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, 100); - EnumHoneyComb.BARREN.addProduct(honeyDrop, 50); - - EnumHoneyComb.ROTTEN.addProduct(beeswax, 20); - EnumHoneyComb.ROTTEN.addProduct(honeyDrop, 20); - EnumHoneyComb.ROTTEN.addProduct(new ItemStack(Items.rotten_flesh, 1, 0), 80); - - EnumHoneyComb.BONE.addProduct(beeswax, 20); - EnumHoneyComb.BONE.addProduct(honeyDrop, 20); - EnumHoneyComb.BONE.addProduct(new ItemStack(Items.dye, 1, 15), 80); - - EnumHoneyComb.OIL.tryAddProduct(EnumPropolis.OIL, 60); - EnumHoneyComb.OIL.addProduct(honeyDrop, 75); - - EnumHoneyComb.COAL.addProduct(beeswax, 80); - EnumHoneyComb.COAL.addProduct(honeyDrop, 75); - EnumHoneyComb.COAL.tryAddProduct(ExtraBeeItems.CoalDust, 100); - - EnumHoneyComb.WATER.tryAddProduct(EnumPropolis.WATER, 100); - EnumHoneyComb.WATER.addProduct(honeyDrop, 90); - - EnumHoneyComb.STONE.addProduct(beeswax, 50); - EnumHoneyComb.STONE.addProduct(honeyDrop, 25); - - EnumHoneyComb.MILK.tryAddProduct(EnumHoneyDrop.MILK, 100); - EnumHoneyComb.MILK.addProduct(honeyDrop, 90); - - EnumHoneyComb.FRUIT.tryAddProduct(EnumHoneyDrop.APPLE, 100); - EnumHoneyComb.FRUIT.addProduct(honeyDrop, 90); - - EnumHoneyComb.SEED.tryAddProduct(EnumHoneyDrop.SEED, 100); - EnumHoneyComb.SEED.addProduct(honeyDrop, 90); - - EnumHoneyComb.ALCOHOL.tryAddProduct(EnumHoneyDrop.ALCOHOL, 100); - EnumHoneyComb.ALCOHOL.addProduct(honeyDrop, 90); - - EnumHoneyComb.FUEL.tryAddProduct(EnumPropolis.FUEL, 60); - EnumHoneyComb.FUEL.addProduct(honeyDrop, 50); - - EnumHoneyComb.CREOSOTE.tryAddProduct(EnumPropolis.CREOSOTE, 70); - EnumHoneyComb.CREOSOTE.addProduct(honeyDrop, 50); - - EnumHoneyComb.LATEX.addProduct(honeyDrop, 50); - EnumHoneyComb.LATEX.addProduct(beeswax, 85); - if (!OreDictionary.getOres("itemRubber").isEmpty()) { - EnumHoneyComb.LATEX.tryAddProduct((ItemStack)OreDictionary.getOres("itemRubber").get(0), 100); - } else { - EnumHoneyComb.LATEX.active = false; - } - EnumHoneyComb.REDSTONE.addProduct(beeswax, 80); - EnumHoneyComb.REDSTONE.addProduct(new ItemStack(Items.redstone, 1, 0), 100); - EnumHoneyComb.REDSTONE.addProduct(honeyDrop, 50); - - EnumHoneyComb.RESIN.addProduct(beeswax, 100); - - EnumHoneyComb.RESIN.tryAddProduct(Mods.IC2.stack("itemHarz"), 100); - EnumHoneyComb.RESIN.tryAddProduct(Mods.IC2.stack("itemHarz"), 50); - - EnumHoneyComb.IC2ENERGY.addProduct(beeswax, 80); - EnumHoneyComb.IC2ENERGY.addProduct(new ItemStack(Items.redstone, 1, 0), 75); - EnumHoneyComb.IC2ENERGY.tryAddProduct(EnumHoneyDrop.ENERGY, 100); - - EnumHoneyComb.IRON.copyProducts(EnumHoneyComb.STONE); - EnumHoneyComb.IRON.tryAddProduct(ExtraBeeItems.IronDust, 100); - - EnumHoneyComb.GOLD.copyProducts(EnumHoneyComb.STONE); - EnumHoneyComb.GOLD.tryAddProduct(ExtraBeeItems.GoldDust, 100); - - EnumHoneyComb.COPPER.copyProducts(EnumHoneyComb.STONE); - EnumHoneyComb.COPPER.tryAddProduct(ExtraBeeItems.CopperDust, 100); - - EnumHoneyComb.TIN.copyProducts(EnumHoneyComb.STONE); - EnumHoneyComb.TIN.tryAddProduct(ExtraBeeItems.TinDust, 100); - - EnumHoneyComb.NICKEL.copyProducts(EnumHoneyComb.STONE); - EnumHoneyComb.NICKEL.tryAddProduct(ExtraBeeItems.NickelDust, 100); - - EnumHoneyComb.SILVER.copyProducts(EnumHoneyComb.STONE); - EnumHoneyComb.SILVER.tryAddProduct(ExtraBeeItems.SilverDust, 100); - - EnumHoneyComb.URANIUM.copyProducts(EnumHoneyComb.STONE); - if (!OreDictionary.getOres("crushedUranium").isEmpty()) { - EnumHoneyComb.URANIUM.tryAddProduct((ItemStack)OreDictionary.getOres("crushedUranium").get(0), 50); - } - EnumHoneyComb.CLAY.addProduct(beeswax, 25); - EnumHoneyComb.CLAY.addProduct(honeyDrop, 80); - EnumHoneyComb.CLAY.addProduct(new ItemStack(Items.clay_ball), 80); - - EnumHoneyComb.OLD.addProduct(beeswax, 100); - EnumHoneyComb.OLD.addProduct(honeyDrop, 90); - - EnumHoneyComb.FUNGAL.addProduct(beeswax, 90); - EnumHoneyComb.FUNGAL.addProduct(new ItemStack(Blocks.brown_mushroom_block, 1, 0), 100); - EnumHoneyComb.FUNGAL.addProduct(new ItemStack(Blocks.red_mushroom_block, 1, 0), 75); - - EnumHoneyComb.ACIDIC.addProduct(beeswax, 80); - EnumHoneyComb.ACIDIC.tryAddProduct(EnumHoneyDrop.ACID, 50); - if (!OreDictionary.getOres("dustSulfur").isEmpty()) { - EnumHoneyComb.ACIDIC.addProduct((ItemStack)OreDictionary.getOres("dustSulfur").get(0), 75); - } - EnumHoneyComb.VENOMOUS.addProduct(beeswax, 80); - EnumHoneyComb.VENOMOUS.tryAddProduct(EnumHoneyDrop.POISON, 80); - - EnumHoneyComb.SLIME.addProduct(beeswax, 100); - EnumHoneyComb.SLIME.addProduct(honeyDrop, 75); - EnumHoneyComb.SLIME.addProduct(new ItemStack(Items.slime_ball, 1, 0), 75); - - EnumHoneyComb.BLAZE.addProduct(beeswax, 75); - EnumHoneyComb.BLAZE.addProduct(new ItemStack(Items.blaze_powder, 1, 0), 100); - - EnumHoneyComb.COFFEE.addProduct(beeswax, 90); - EnumHoneyComb.COFFEE.addProduct(honeyDrop, 75); - EnumHoneyComb.COFFEE.tryAddProduct(Mods.IC2.stack("itemCofeePowder"), 75); - - EnumHoneyComb.GLACIAL.tryAddProduct(EnumHoneyDrop.ICE, 80); - EnumHoneyComb.GLACIAL.addProduct(honeyDrop, 75); - - - - - EnumHoneyComb.SHADOW.addProduct(honeyDrop, 50); - if (!OreDictionary.getOres("dustObsidian").isEmpty()) { - EnumHoneyComb.SHADOW.tryAddProduct((ItemStack)OreDictionary.getOres("dustObsidian").get(0), 75); - } else { - EnumHoneyComb.SHADOW.active = false; - } - EnumHoneyComb.LEAD.copyProducts(EnumHoneyComb.STONE); - EnumHoneyComb.LEAD.tryAddProduct(ExtraBeeItems.LeadDust, 100); - - EnumHoneyComb.ZINC.copyProducts(EnumHoneyComb.STONE); - EnumHoneyComb.ZINC.tryAddProduct(ExtraBeeItems.ZincDust, 100); - - EnumHoneyComb.TITANIUM.copyProducts(EnumHoneyComb.STONE); - EnumHoneyComb.TITANIUM.tryAddProduct(ExtraBeeItems.TitaniumDust, 100); - - EnumHoneyComb.TUNGSTEN.copyProducts(EnumHoneyComb.STONE); - EnumHoneyComb.TUNGSTEN.tryAddProduct(ExtraBeeItems.TungstenDust, 100); - - EnumHoneyComb.PLATINUM.copyProducts(EnumHoneyComb.STONE); - EnumHoneyComb.PLATINUM.tryAddProduct(ExtraBeeItems.PlatinumDust, 100); - - EnumHoneyComb.LAPIS.copyProducts(EnumHoneyComb.STONE); - EnumHoneyComb.LAPIS.addProduct(new ItemStack(Items.dye, 6, 4), 100); - - EnumHoneyComb.EMERALD.copyProducts(EnumHoneyComb.STONE); - EnumHoneyComb.EMERALD.tryAddProduct(ExtraBeeItems.EmeraldShard, 100); - - EnumHoneyComb.RUBY.copyProducts(EnumHoneyComb.STONE); - EnumHoneyComb.RUBY.tryAddProduct(ExtraBeeItems.RubyShard, 100); - - EnumHoneyComb.SAPPHIRE.copyProducts(EnumHoneyComb.STONE); - EnumHoneyComb.SAPPHIRE.tryAddProduct(ExtraBeeItems.SapphireShard, 100); - - EnumHoneyComb.DIAMOND.copyProducts(EnumHoneyComb.STONE); - EnumHoneyComb.DIAMOND.tryAddProduct(ExtraBeeItems.DiamondShard, 100); - - EnumHoneyComb.RED.addProduct(honeyDrop, 80); - EnumHoneyComb.RED.addProduct(beeswax, 80); - - EnumHoneyComb.GLOWSTONE.addProduct(honeyDrop, 25); - EnumHoneyComb.GLOWSTONE.addProduct(new ItemStack(Items.glowstone_dust), 100); - - EnumHoneyComb.SALTPETER.addProduct(honeyDrop, 25); - EnumHoneyComb.SALTPETER.tryAddProduct(getOreDictionary("dustSaltpeter"), 100); - - EnumHoneyComb.COMPOST.addProduct(honeyDrop, 25); - EnumHoneyComb.COMPOST.tryAddProduct(Mods.Forestry.stack("fertilizerBio"), 100); - - EnumHoneyComb.SAWDUST.addProduct(honeyDrop, 25); - if (!OreDictionary.getOres("dustSawdust").isEmpty()) { - EnumHoneyComb.SAWDUST.tryAddProduct((ItemStack)OreDictionary.getOres("dustSawdust").get(0), 100); - } else if (!OreDictionary.getOres("sawdust").isEmpty()) { - EnumHoneyComb.SAWDUST.tryAddProduct((ItemStack)OreDictionary.getOres("sawdust").get(0), 100); - } - EnumHoneyComb.CERTUS.addProduct(honeyDrop, 25); - EnumHoneyComb.CERTUS.addProduct(new ItemStack(Items.quartz), 25); - if (!OreDictionary.getOres("dustCertusQuartz").isEmpty()) { - EnumHoneyComb.CERTUS.tryAddProduct((ItemStack)OreDictionary.getOres("dustCertusQuartz").get(0), 20); - } - EnumHoneyComb.ENDERPEARL.addProduct(honeyDrop, 25); - if (!OreDictionary.getOres("dustEnderPearl").isEmpty()) { - EnumHoneyComb.ENDERPEARL.tryAddProduct((ItemStack)OreDictionary.getOres("dustEnderPearl").get(0), 25); - } - EnumHoneyComb.YELLORIUM.copyProducts(EnumHoneyComb.STONE); - EnumHoneyComb.CYANITE.copyProducts(EnumHoneyComb.STONE); - EnumHoneyComb.BLUTONIUM.copyProducts(EnumHoneyComb.STONE); - - EnumHoneyComb.YELLORIUM.tryAddProduct(ExtraBeeItems.YelloriumDust, 25); - EnumHoneyComb.CYANITE.tryAddProduct(ExtraBeeItems.CyaniteDust, 25); - EnumHoneyComb.BLUTONIUM.tryAddProduct(ExtraBeeItems.BlutoniumDust, 25); - - - OreDictionary.registerOre("beeComb", new ItemStack(ExtraBees.comb, 1, 32767)); - for (int i = 0; i < 16; i++) - { - EnumHoneyComb type = EnumHoneyComb.values()[(EnumHoneyComb.RED.ordinal() + i)]; - if (type != EnumHoneyComb.RED) { - type.copyProducts(EnumHoneyComb.RED); - } - } - for (int i = 0; i < 16; i++) - { - EnumHoneyComb type = EnumHoneyComb.values()[(EnumHoneyComb.RED.ordinal() + i)]; - EnumHoneyDrop drop = EnumHoneyDrop.values()[(EnumHoneyDrop.RED.ordinal() + i)]; - - int[] dyeC = { 1, 11, 4, 2, 0, 15, 3, 14, 6, 5, 8, 12, 9, 10, 13, 7 }; - - 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); - } - type.addProduct(drop.get(1), 100); - drop.addRemenant(dye); - } - } - - private static ItemStack getOreDictionary(String string) - { - if (OreDictionary.getOres(string).size() > 0) { - return (ItemStack)OreDictionary.getOres(string).get(0); - } - return null; - } - - public int getColorFromItemStack(ItemStack itemStack, int j) - { - if (EnumHoneyComb.get(itemStack) == null) { - return 16777215; - } - if (j == 0) { - return EnumHoneyComb.get(itemStack).colour[0]; - } - return EnumHoneyComb.get(itemStack).colour[1]; - } - - public static enum VanillaComb - { - HONEY, COCOA, SIMMERING, STRINGY, FROZEN, DRIPPING, SILKY, PARCHED, MYSTERIOUS, IRRADIATED, POWDERY, REDDENED, DARKENED, OMEGA, WHEATEN, MOSSY, QUARTZ; - - private VanillaComb() {} - - public ItemStack get() - { - return new ItemStack(Mods.Forestry.item("beeCombs"), 1, ordinal()); - } - } - - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamageForRenderPass(int i, int j) - { - if (j > 0) { - return this.icon1; - } - return this.icon2; - } - - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister register) - { - this.icon1 = BinnieCore.proxy.getIcon(register, "forestry", "beeCombs.0"); - this.icon2 = BinnieCore.proxy.getIcon(register, "forestry", "beeCombs.1"); - } -} diff --git a/src/Java/binnie/extrabees/products/ItemHoneyCrystal.java b/src/Java/binnie/extrabees/products/ItemHoneyCrystal.java deleted file mode 100644 index 334342d49a..0000000000 --- a/src/Java/binnie/extrabees/products/ItemHoneyCrystal.java +++ /dev/null @@ -1,51 +0,0 @@ -package binnie.extrabees.products; - -import binnie.extrabees.ExtraBees; -import binnie.extrabees.proxy.ExtraBeesProxy; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.core.Tabs; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.NBTTagCompound; - -public class ItemHoneyCrystal - extends Item -{ - private int maxCharge = 8000; - private int transferLimit = 500; - private int tier = 1; - - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister register) - { - this.itemIcon = ExtraBees.proxy.getIcon(register, "honeyCrystal"); - } - - public ItemHoneyCrystal() - { - setMaxDamage(27); - setMaxStackSize(1); - - setCreativeTab(Tabs.tabApiculture); - setUnlocalizedName("honeyCrystal"); - } - - public String getItemStackDisplayName(ItemStack i) - { - return ExtraBees.proxy.localise("item.honeycrystal"); - } - - public static NBTTagCompound getOrCreateNbtData(ItemStack itemStack) - { - NBTTagCompound ret = itemStack.getTagCompound(); - if (ret == null) - { - ret = new NBTTagCompound(); - - itemStack.setTagCompound(ret); - } - return ret; - } -} diff --git a/src/Java/binnie/extrabees/products/ItemHoneyCrystalEmpty.java b/src/Java/binnie/extrabees/products/ItemHoneyCrystalEmpty.java deleted file mode 100644 index 03dad2115f..0000000000 --- a/src/Java/binnie/extrabees/products/ItemHoneyCrystalEmpty.java +++ /dev/null @@ -1,30 +0,0 @@ -package binnie.extrabees.products; - -import binnie.extrabees.ExtraBees; -import binnie.extrabees.proxy.ExtraBeesProxy; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.item.ItemStack; - -public class ItemHoneyCrystalEmpty - extends ItemHoneyCrystal -{ - public ItemHoneyCrystalEmpty() - { - setMaxDamage(0); - setMaxStackSize(64); - setUnlocalizedName("honeyCrystalEmpty"); - } - - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister register) - { - this.itemIcon = ExtraBees.proxy.getIcon(register, "honeyCrystalEmpty"); - } - - public String getItemStackDisplayName(ItemStack i) - { - return ExtraBees.proxy.localise("item.honeycrystal.empty"); - } -} diff --git a/src/Java/binnie/extrabees/products/ItemHoneyDrop.java b/src/Java/binnie/extrabees/products/ItemHoneyDrop.java deleted file mode 100644 index 67abfed7cb..0000000000 --- a/src/Java/binnie/extrabees/products/ItemHoneyDrop.java +++ /dev/null @@ -1,55 +0,0 @@ -package binnie.extrabees.products; - -import binnie.core.BinnieCore; -import binnie.core.proxy.BinnieProxy; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.core.Tabs; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; - -public class ItemHoneyDrop - extends ItemProduct -{ - IIcon icon1; - IIcon icon2; - - @SideOnly(Side.CLIENT) - public boolean requiresMultipleRenderPasses() - { - return true; - } - - public ItemHoneyDrop() - { - super(EnumHoneyDrop.values()); - setCreativeTab(Tabs.tabApiculture); - setUnlocalizedName("honeyDrop"); - } - - public int getColorFromItemStack(ItemStack itemStack, int j) - { - int i = itemStack.getItemDamage(); - if (j == 0) { - return EnumHoneyDrop.get(itemStack).colour[0]; - } - return EnumHoneyDrop.get(itemStack).colour[1]; - } - - @SideOnly(Side.CLIENT) - public IIcon getIconFromDamageForRenderPass(int i, int j) - { - if (j > 0) { - return this.icon1; - } - return this.icon2; - } - - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister register) - { - this.icon1 = BinnieCore.proxy.getIcon(register, "forestry", "honeyDrop.0"); - this.icon2 = BinnieCore.proxy.getIcon(register, "forestry", "honeyDrop.1"); - } -} diff --git a/src/Java/binnie/extrabees/products/ItemProduct.java b/src/Java/binnie/extrabees/products/ItemProduct.java deleted file mode 100644 index f2d6b16e35..0000000000 --- a/src/Java/binnie/extrabees/products/ItemProduct.java +++ /dev/null @@ -1,44 +0,0 @@ -package binnie.extrabees.products; - -import binnie.core.item.IItemEnum; -import java.util.List; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; - -public class ItemProduct - extends Item -{ - IItemEnum[] types; - - public ItemProduct(IItemEnum[] types) - { - setMaxStackSize(64); - setMaxDamage(0); - setHasSubtypes(true); - this.types = types; - } - - public IItemEnum get(ItemStack stack) - { - int i = stack.getItemDamage(); - if ((i >= 0) && (i < this.types.length)) { - return this.types[i]; - } - return this.types[0]; - } - - public String getItemStackDisplayName(ItemStack itemstack) - { - return get(itemstack).getName(itemstack); - } - - public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List itemList) - { - for (IItemEnum type : this.types) { - if (type.isActive()) { - itemList.add(new ItemStack(this, 1, type.ordinal())); - } - } - } -} diff --git a/src/Java/binnie/extrabees/products/ItemPropolis.java b/src/Java/binnie/extrabees/products/ItemPropolis.java deleted file mode 100644 index a66c10da46..0000000000 --- a/src/Java/binnie/extrabees/products/ItemPropolis.java +++ /dev/null @@ -1,35 +0,0 @@ -package binnie.extrabees.products; - -import binnie.core.BinnieCore; -import binnie.core.proxy.BinnieProxy; -import cpw.mods.fml.relauncher.Side; -import cpw.mods.fml.relauncher.SideOnly; -import forestry.api.core.Tabs; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.item.ItemStack; - -public class ItemPropolis - extends ItemProduct -{ - public ItemPropolis() - { - super(EnumPropolis.values()); - setCreativeTab(Tabs.tabApiculture); - setUnlocalizedName("propolis"); - } - - public int getColorFromItemStack(ItemStack itemStack, int j) - { - int i = itemStack.getItemDamage(); - if (j == 0) { - return EnumPropolis.get(itemStack).colour[0]; - } - return EnumPropolis.get(itemStack).colour[1]; - } - - @SideOnly(Side.CLIENT) - public void registerIcons(IIconRegister register) - { - this.itemIcon = BinnieCore.proxy.getIcon(register, "forestry", "propolis.0"); - } -} diff --git a/src/Java/binnie/extrabees/products/ModuleProducts.java b/src/Java/binnie/extrabees/products/ModuleProducts.java deleted file mode 100644 index 7d2386872a..0000000000 --- a/src/Java/binnie/extrabees/products/ModuleProducts.java +++ /dev/null @@ -1,43 +0,0 @@ -package binnie.extrabees.products; - -import binnie.core.IInitializable; -import binnie.core.Mods; -import binnie.core.Mods.Mod; -import binnie.extrabees.ExtraBees; -import cpw.mods.fml.common.registry.GameRegistry; -import net.minecraft.init.Items; -import net.minecraft.item.ItemStack; -import net.minecraftforge.oredict.OreDictionary; - -public class ModuleProducts - implements IInitializable -{ - 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); - } - - public void init() {} - - public void postInit() - { - GameRegistry.addRecipe(new ItemStack(ExtraBees.honeyCrystalEmpty), new Object[] { "#@#", "@#@", "#@#", Character.valueOf('@'), Mods.Forestry.stack("honeyDrop"), Character.valueOf('#'), EnumHoneyDrop.ENERGY.get(1) }); - for (EnumHoneyComb info : EnumHoneyComb.values()) { - info.addRecipe(); - } - for (EnumHoneyDrop info : EnumHoneyDrop.values()) { - info.addRecipe(); - } - for (EnumPropolis info : EnumPropolis.values()) { - info.addRecipe(); - } - } -} diff --git a/src/Java/binnie/extrabees/worldgen/BlockExtraBeeHive.java b/src/Java/binnie/extrabees/worldgen/BlockExtraBeeHive.java deleted file mode 100644 index 1923c93283..0000000000 --- a/src/Java/binnie/extrabees/worldgen/BlockExtraBeeHive.java +++ /dev/null @@ -1,109 +0,0 @@ -package binnie.extrabees.worldgen; - -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.IHiveDrop; -import forestry.api.core.Tabs; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Random; -import net.minecraft.block.Block; -import net.minecraft.client.renderer.texture.IIconRegister; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.util.IIcon; -import net.minecraft.world.World; - -public class BlockExtraBeeHive - extends Block -{ - IIcon[][] icons; - - public BlockExtraBeeHive() - { - super(ExtraBees.materialBeehive); - setLightLevel(0.2F); - setHardness(1.0F); - setTickRandomly(true); - setBlockName("hive"); - - setCreativeTab(Tabs.tabApiculture); - } - - public String getUnlocalizedName(ItemStack par1ItemStack) - { - return "extrabees.block.hive." + par1ItemStack.getItemDamage(); - } - - public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List itemList) - { - for (int i = 0; i < 4; i++) { - itemList.add(new ItemStack(this, 1, i)); - } - } - - public IIcon getIcon(int side, int metadata) - { - if (metadata >= EnumHiveType.values().length) { - return null; - } - if (side < 2) { - return this.icons[metadata][1]; - } - return this.icons[metadata][0]; - } - - @SideOnly(Side.CLIENT) - public void registerBlockIcons(IIconRegister register) - { - this.icons = new IIcon[EnumHiveType.values().length][2]; - for (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"); - } - } - - public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) - { - ArrayList<ItemStack> ret = new ArrayList(); - - List<IHiveDrop> dropList = EnumHiveType.values()[metadata].drops; - - Collections.shuffle(dropList); - - int tries = 0; - boolean hasPrincess = false; - while ((tries <= 10) && (!hasPrincess)) - { - tries++; - for (IHiveDrop drop : dropList) { - if (world.rand.nextInt(100) < drop.getChance(world, x, y, z)) - { - ret.add(drop.getPrincess(world, x, y, z, fortune)); - hasPrincess = true; - break; - } - } - } - for (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 (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; - } -} diff --git a/src/Java/binnie/extrabees/worldgen/EnumHiveType.java b/src/Java/binnie/extrabees/worldgen/EnumHiveType.java deleted file mode 100644 index d115afb24f..0000000000 --- a/src/Java/binnie/extrabees/worldgen/EnumHiveType.java +++ /dev/null @@ -1,14 +0,0 @@ -package binnie.extrabees.worldgen; - -import forestry.api.apiculture.IHiveDrop; -import java.util.ArrayList; -import java.util.List; - -public enum EnumHiveType -{ - Water, Rock, Nether, Marble; - - public List<IHiveDrop> drops = new ArrayList(); - - private EnumHiveType() {} -} diff --git a/src/Java/binnie/extrabees/worldgen/HiveDrop.java b/src/Java/binnie/extrabees/worldgen/HiveDrop.java deleted file mode 100644 index 10d8db4c26..0000000000 --- a/src/Java/binnie/extrabees/worldgen/HiveDrop.java +++ /dev/null @@ -1,65 +0,0 @@ -package binnie.extrabees.worldgen; - -import binnie.Binnie; -import binnie.core.genetics.ManagerGenetics; -import forestry.api.apiculture.EnumBeeType; -import forestry.api.apiculture.IAlleleBeeSpecies; -import forestry.api.apiculture.IBeeRoot; -import forestry.api.apiculture.IHiveDrop; -import forestry.api.genetics.IAllele; -import java.util.ArrayList; -import net.minecraft.item.ItemStack; -import net.minecraft.world.World; - -public class HiveDrop - implements IHiveDrop -{ - private IAllele[] template; - private ArrayList<ItemStack> additional = new ArrayList(); - private int chance; - - public HiveDrop(IAlleleBeeSpecies species, int chance) - { - this(Binnie.Genetics.getBeeRoot().getTemplate(species.getUID()), new ItemStack[0], chance); - } - - public HiveDrop(IAllele[] template, ItemStack[] bonus, int chance) - { - if (template == null) { - template = Binnie.Genetics.getBeeRoot().getDefaultTemplate(); - } - this.template = template; - this.chance = chance; - for (ItemStack stack : bonus) { - this.additional.add(stack); - } - } - - public ItemStack getPrincess(World world, int x, int y, int z, int fortune) - { - return Binnie.Genetics.getBeeRoot().getMemberStack(Binnie.Genetics.getBeeRoot().getBee(world, Binnie.Genetics.getBeeRoot().templateAsGenome(this.template)), EnumBeeType.PRINCESS.ordinal()); - } - - public ArrayList<ItemStack> getDrones(World world, int x, int y, int z, int fortune) - { - ArrayList<ItemStack> ret = new ArrayList(); - ret.add(Binnie.Genetics.getBeeRoot().getMemberStack(Binnie.Genetics.getBeeRoot().templateAsIndividual(this.template), EnumBeeType.DRONE.ordinal())); - - - return ret; - } - - public ArrayList<ItemStack> getAdditional(World world, int x, int y, int z, int fortune) - { - ArrayList<ItemStack> ret = new ArrayList(); - for (ItemStack stack : this.additional) { - ret.add(stack.copy()); - } - return ret; - } - - public int getChance(World world, int x, int y, int z) - { - return this.chance; - } -} diff --git a/src/Java/binnie/extrabees/worldgen/ItemBeehive.java b/src/Java/binnie/extrabees/worldgen/ItemBeehive.java deleted file mode 100644 index e853a055b3..0000000000 --- a/src/Java/binnie/extrabees/worldgen/ItemBeehive.java +++ /dev/null @@ -1,37 +0,0 @@ -package binnie.extrabees.worldgen; - -import java.util.List; -import net.minecraft.block.Block; -import net.minecraft.creativetab.CreativeTabs; -import net.minecraft.item.Item; -import net.minecraft.item.ItemBlock; -import net.minecraft.item.ItemStack; - -public class ItemBeehive - extends ItemBlock -{ - public ItemBeehive(Block block) - { - super(block); - setMaxDamage(0); - setHasSubtypes(true); - setCreativeTab(CreativeTabs.tabBlock); - } - - public int getMetadata(int i) - { - return i; - } - - public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List itemList) - { - for (int i = 0; i < 4; i++) { - itemList.add(new ItemStack(this, 1, i)); - } - } - - public String getItemStackDisplayName(ItemStack itemStack) - { - return EnumHiveType.values()[itemStack.getItemDamage()].toString() + " Hive"; - } -} diff --git a/src/Java/binnie/extrabees/worldgen/MaterialBeehive.java b/src/Java/binnie/extrabees/worldgen/MaterialBeehive.java deleted file mode 100644 index b94960c494..0000000000 --- a/src/Java/binnie/extrabees/worldgen/MaterialBeehive.java +++ /dev/null @@ -1,20 +0,0 @@ -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); - setRequiresTool(); - setImmovableMobility(); - } - - public boolean isOpaque() - { - return true; - } -} diff --git a/src/Java/binnie/extrabees/worldgen/ModuleGeneration.java b/src/Java/binnie/extrabees/worldgen/ModuleGeneration.java deleted file mode 100644 index 8708ca7bf7..0000000000 --- a/src/Java/binnie/extrabees/worldgen/ModuleGeneration.java +++ /dev/null @@ -1,85 +0,0 @@ -package binnie.extrabees.worldgen; - -import binnie.core.IInitializable; -import binnie.core.genetics.ForestryAllele.BeeSpecies; -import binnie.extrabees.ExtraBees; -import binnie.extrabees.config.ConfigurationMain; -import binnie.extrabees.genetics.ExtraBeesSpecies; -import buildcraft.api.core.BuildCraftAPI; -import cpw.mods.fml.common.IWorldGenerator; -import cpw.mods.fml.common.registry.GameRegistry; -import java.util.List; -import java.util.Random; -import java.util.Set; -import net.minecraft.block.Block; -import net.minecraft.world.World; -import net.minecraft.world.chunk.IChunkProvider; - -public class ModuleGeneration - implements IWorldGenerator, IInitializable -{ - static int waterRate = 2; - static int rockRate = 2; - static int netherRate = 2; - static int marbleRate = 2; - - public void preInit() - { - ExtraBees.materialBeehive = new MaterialBeehive(); - ExtraBees.hive = new BlockExtraBeeHive(); - GameRegistry.registerBlock(ExtraBees.hive, ItemBeehive.class, "hive"); - } - - public void init() - { - waterRate = ConfigurationMain.waterHiveRate; - rockRate = ConfigurationMain.rockHiveRate; - netherRate = ConfigurationMain.netherHiveRate; - GameRegistry.registerWorldGenerator(new ModuleGeneration(), 0); - if (!ConfigurationMain.canQuarryMineHives) { - BuildCraftAPI.softBlocks.add(ExtraBees.hive); - } - } - - 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); - } - - public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) - { - chunkX <<= 4; - chunkZ <<= 4; - for (int i = 0; i < waterRate; i++) - { - int randPosX = chunkX + rand.nextInt(16); - int randPosY = rand.nextInt(50) + 20; - int randPosZ = chunkZ + rand.nextInt(16); - new WorldGenHiveWater().generate(world, rand, randPosX, randPosY, randPosZ); - } - for (int i = 0; i < rockRate; i++) - { - int randPosX = chunkX + rand.nextInt(16); - int randPosY = rand.nextInt(50) + 20; - int randPosZ = chunkZ + rand.nextInt(16); - new WorldGenHiveRock().generate(world, rand, randPosX, randPosY, randPosZ); - } - for (int i = 0; i < netherRate; i++) - { - int randPosX = chunkX + rand.nextInt(16); - int randPosY = rand.nextInt(50) + 20; - int randPosZ = chunkZ + rand.nextInt(16); - new WorldGenHiveNether().generate(world, rand, randPosX, randPosY, randPosZ); - } - } -} diff --git a/src/Java/binnie/extrabees/worldgen/WorldGenHiveNether.java b/src/Java/binnie/extrabees/worldgen/WorldGenHiveNether.java deleted file mode 100644 index 4585adde12..0000000000 --- a/src/Java/binnie/extrabees/worldgen/WorldGenHiveNether.java +++ /dev/null @@ -1,33 +0,0 @@ -package binnie.extrabees.worldgen; - -import binnie.extrabees.ExtraBees; -import java.util.Random; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraft.world.biome.WorldChunkManager; -import net.minecraft.world.gen.feature.WorldGenerator; -import net.minecraftforge.common.BiomeDictionary; -import net.minecraftforge.common.BiomeDictionary.Type; - -public class WorldGenHiveNether - extends WorldGenerator -{ - public boolean generate(World world, Random random, int i, int j, int k) - { - BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(i, k); - if (!BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.NETHER)) { - return true; - } - if (embedInWall(world, Blocks.netherrack, i, j, k)) { - world.setBlock(i, j, k, ExtraBees.hive, 2, 0); - } - return true; - } - - public boolean embedInWall(World world, Block blockID, int i, int j, 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))); - } -} diff --git a/src/Java/binnie/extrabees/worldgen/WorldGenHiveRock.java b/src/Java/binnie/extrabees/worldgen/WorldGenHiveRock.java deleted file mode 100644 index e6598fdcb7..0000000000 --- a/src/Java/binnie/extrabees/worldgen/WorldGenHiveRock.java +++ /dev/null @@ -1,27 +0,0 @@ -package binnie.extrabees.worldgen; - -import binnie.extrabees.ExtraBees; -import java.util.Random; -import net.minecraft.block.Block; -import net.minecraft.init.Blocks; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraft.world.biome.WorldChunkManager; -import net.minecraft.world.gen.feature.WorldGenerator; - -public class WorldGenHiveRock - extends WorldGenerator -{ - public boolean generate(World world, Random random, int i, int j, int k) - { - BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(i, k); - 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; - } -} diff --git a/src/Java/binnie/extrabees/worldgen/WorldGenHiveWater.java b/src/Java/binnie/extrabees/worldgen/WorldGenHiveWater.java deleted file mode 100644 index f672945288..0000000000 --- a/src/Java/binnie/extrabees/worldgen/WorldGenHiveWater.java +++ /dev/null @@ -1,31 +0,0 @@ -package binnie.extrabees.worldgen; - -import binnie.extrabees.ExtraBees; -import java.util.Random; -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.init.Blocks; -import net.minecraft.world.World; -import net.minecraft.world.biome.BiomeGenBase; -import net.minecraft.world.biome.WorldChunkManager; -import net.minecraft.world.gen.feature.WorldGenerator; - -public class WorldGenHiveWater - extends WorldGenerator -{ - public boolean generate(World world, Random random, int i, int j, int k) - { - BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(i, k); - - int i1 = i + random.nextInt(8) - random.nextInt(8); - int j1 = j + random.nextInt(4) - random.nextInt(4); - int k1 = k + random.nextInt(8) - random.nextInt(8); - if ((world.getBlock(i1, j1, k1) != Blocks.water) && (world.getBlock(i1, j1, k1) != Blocks.water)) { - return false; - } - if ((world.getBlock(i1, j1 - 1, k1).getMaterial() == Material.sand) || (world.getBlock(i1, j1 - 1, k1).getMaterial() == Material.clay) || (world.getBlock(i1, j1 - 1, k1).getMaterial() == Material.ground) || (world.getBlock(i1, j1 - 1, k1).getMaterial() == Material.rock)) { - world.setBlock(i1, j1, k1, ExtraBees.hive, 0, 0); - } - return true; - } -} diff --git a/src/Java/miscutil/core/lib/LoadedMods.java b/src/Java/miscutil/core/lib/LoadedMods.java new file mode 100644 index 0000000000..22f9129346 --- /dev/null +++ b/src/Java/miscutil/core/lib/LoadedMods.java @@ -0,0 +1,62 @@ +package miscutil.core.lib; + +import miscutil.core.util.Utils; +import cpw.mods.fml.common.Loader; + +public class LoadedMods { + + //Initialize Variables + public static boolean Gregtech = false; + public static boolean EnderIO = false; + public static boolean Big_Reactors = false; + public static boolean IndustrialCraft2 = false; + public static boolean Simply_Jetpacks = false; + public static boolean RFTools = false; + public static boolean Thaumcraft = false; + public static boolean Extra_Utils = false; + public static boolean PneumaticCraft = false; + private static int totalMods; + + public static void checkLoaded(){ + Utils.LOG_INFO("Looking for optional mod prereqs."); + if (Loader.isModLoaded("gregtech") == true ){ + Gregtech = true; + totalMods++; + } + if (Loader.isModLoaded("EnderIO") == true){ + EnderIO = true; + totalMods++; + } + if (Loader.isModLoaded("BigReactors") == true){ + Big_Reactors = true; + totalMods++; + } + if (Loader.isModLoaded("IC2") == true){ + IndustrialCraft2 = true; + totalMods++; + } + if (Loader.isModLoaded("simplyjetpacks") == true){ + Simply_Jetpacks = true; + totalMods++; + } + if (Loader.isModLoaded("rftools") == true){ + RFTools = true; + totalMods++; + } + if (Loader.isModLoaded("Thaumcraft") == true){ + Thaumcraft = true; + totalMods++; + } + if (Loader.isModLoaded("ExtraUtilities") == true){ + Extra_Utils = true; + totalMods++; + } + if (Loader.isModLoaded("PneumaticCraft") == true){ + PneumaticCraft = true; + totalMods++; + } + + Utils.LOG_INFO("Content found for "+totalMods+" mods"); + + } +} |