mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-17 19:15:24 +00:00
Improve code readability in binnie.extrabees package and other packages
* Improve code readability in binnie.extrabees package and other packages * Fix compile error after refactoring
This commit is contained in:
1 parent
b609d6688f
commit
c09ad04284
95 files changed
+3916
-3900
No files matched your search
@@ -53,8 +53,8 @@ public class ItemMetadata extends ItemBlock {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer player, List par3List, boolean par4) {
|
||||
((IBlockMetadata) field_150939_a).getBlockTooltip(itemStack, par3List);
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||
((IBlockMetadata) field_150939_a).getBlockTooltip(itemStack, tooltip);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -21,7 +21,7 @@ class BinnieFluid extends Fluid {
|
||||
|
||||
@Override
|
||||
public int getColor() {
|
||||
return fluidType.getColour();
|
||||
return fluidType.getColor();
|
||||
}
|
||||
|
||||
public IFluidType getType() {
|
||||
|
||||
@@ -15,7 +15,7 @@ public interface IFluidType {
|
||||
|
||||
FluidStack get(int amount);
|
||||
|
||||
int getColour();
|
||||
int getColor();
|
||||
|
||||
int getContainerColour();
|
||||
|
||||
|
||||
@@ -1,53 +1,48 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.gui.IBinnieGUID;
|
||||
import binnie.core.network.BinniePacketHandler;
|
||||
import binnie.core.proxy.IProxyCore;
|
||||
import binnie.extrabees.apiary.ModuleApiary;
|
||||
import binnie.extrabees.config.ConfigurationMachines;
|
||||
import binnie.extrabees.config.ConfigurationMain;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import binnie.core.gui.IBinnieGUID;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
|
||||
import binnie.extrabees.apiary.ModuleApiary;
|
||||
import binnie.extrabees.liquids.ModuleLiquids;
|
||||
import binnie.extrabees.worldgen.ModuleGeneration;
|
||||
import binnie.extrabees.genetics.ModuleGenetics;
|
||||
import binnie.extrabees.products.ModuleProducts;
|
||||
import binnie.extrabees.core.ModuleCore;
|
||||
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
|
||||
import binnie.extrabees.genetics.ModuleGenetics;
|
||||
import binnie.extrabees.liquids.ModuleLiquids;
|
||||
import binnie.extrabees.products.ModuleProducts;
|
||||
import binnie.extrabees.proxy.ExtraBeesProxy;
|
||||
|
||||
import binnie.extrabees.worldgen.ModuleGeneration;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.SidedProxy;
|
||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import binnie.core.AbstractMod;
|
||||
|
||||
@Mod(modid = "ExtraBees", name = "Extra Bees", useMetadata = true, dependencies = "after:BinnieCore")
|
||||
public class ExtraBees extends AbstractMod
|
||||
{
|
||||
@Mod(
|
||||
modid = "ExtraBees",
|
||||
name = "Extra Bees",
|
||||
useMetadata = true,
|
||||
dependencies = "after:BinnieCore"
|
||||
)
|
||||
public class ExtraBees extends AbstractMod {
|
||||
@Mod.Instance("ExtraBees")
|
||||
public static ExtraBees instance;
|
||||
@SidedProxy(clientSide = "binnie.extrabees.proxy.ExtraBeesProxyClient", serverSide = "binnie.extrabees.proxy.ExtraBeesProxyServer")
|
||||
|
||||
@SidedProxy(
|
||||
clientSide = "binnie.extrabees.proxy.ExtraBeesProxyClient",
|
||||
serverSide = "binnie.extrabees.proxy.ExtraBeesProxyServer"
|
||||
)
|
||||
public static ExtraBeesProxy proxy;
|
||||
|
||||
public static Block hive;
|
||||
public static Material materialBeehive;
|
||||
public static Block ectoplasm;
|
||||
public static Block apiaristMachine;
|
||||
public static Block geneticMachine;
|
||||
public static Block advGeneticMachine;
|
||||
public static Item comb;
|
||||
public static Item propolis;
|
||||
public static Item honeyDrop;
|
||||
@@ -56,31 +51,31 @@ public class ExtraBees extends AbstractMod
|
||||
public static Item dictionary;
|
||||
public static Item itemMisc;
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preInit(final FMLPreInitializationEvent evt) {
|
||||
this.addModule(new ModuleCore());
|
||||
this.addModule(new ModuleProducts());
|
||||
this.addModule(new ModuleGenetics());
|
||||
this.addModule(new ModuleGeneration());
|
||||
this.addModule(new ModuleLiquids());
|
||||
this.addModule(new ModuleApiary());
|
||||
this.preInit();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void init(final FMLInitializationEvent evt) {
|
||||
this.init();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void postInit(final FMLPostInitializationEvent evt) {
|
||||
this.postInit();
|
||||
}
|
||||
|
||||
public ExtraBees() {
|
||||
ExtraBees.instance = this;
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
addModule(new ModuleCore());
|
||||
addModule(new ModuleProducts());
|
||||
addModule(new ModuleGenetics());
|
||||
addModule(new ModuleGeneration());
|
||||
addModule(new ModuleLiquids());
|
||||
addModule(new ModuleApiary());
|
||||
preInit();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void init(FMLInitializationEvent event) {
|
||||
init();
|
||||
}
|
||||
|
||||
@Mod.EventHandler
|
||||
public void postInit(FMLPostInitializationEvent event) {
|
||||
postInit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBinnieGUID[] getGUIDs() {
|
||||
return ExtraBeeGUID.values();
|
||||
@@ -88,7 +83,7 @@ public class ExtraBees extends AbstractMod
|
||||
|
||||
@Override
|
||||
public Class<?>[] getConfigs() {
|
||||
return new Class[] { ConfigurationMain.class, ConfigurationMachines.class };
|
||||
return new Class[]{ConfigurationMain.class, ConfigurationMachines.class};
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -116,8 +111,7 @@ public class ExtraBees extends AbstractMod
|
||||
return BinnieCore.isExtraBeesActive();
|
||||
}
|
||||
|
||||
public static class PacketHandler extends BinniePacketHandler
|
||||
{
|
||||
public static class PacketHandler extends BinniePacketHandler {
|
||||
public PacketHandler() {
|
||||
super(ExtraBees.instance);
|
||||
}
|
||||
|
||||
@@ -1,46 +1,41 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary;
|
||||
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.MachineComponent;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import binnie.core.machines.MachineComponent;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ComponentBeeModifier extends MachineComponent implements IBeeModifier, IBeeListener
|
||||
{
|
||||
public ComponentBeeModifier(final Machine machine) {
|
||||
public class ComponentBeeModifier extends MachineComponent implements IBeeModifier, IBeeListener {
|
||||
public ComponentBeeModifier(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
@@ -64,22 +59,28 @@ public class ComponentBeeModifier extends MachineComponent implements IBeeModifi
|
||||
return false;
|
||||
}
|
||||
|
||||
public void onQueenChange(final ItemStack queen) {
|
||||
// TODO unused method?
|
||||
public void onQueenChange(ItemStack queen) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wearOutEquipment(final int amount) {
|
||||
public void wearOutEquipment(int amount) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
public void onPostQueenDeath(final IBee queen) {
|
||||
// TODO unused method?
|
||||
public void onPostQueenDeath(IBee queen) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
public boolean onEggLaid(final IBee queen) {
|
||||
// TODO unused method?
|
||||
public boolean onEggLaid(IBee queen) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(final IBeeGenome genome, final float currentModifier) {
|
||||
public float getGeneticDecay(IBeeGenome genome, float currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
@@ -90,6 +91,6 @@ public class ComponentBeeModifier extends MachineComponent implements IBeeModifi
|
||||
|
||||
@Override
|
||||
public void onQueenDeath() {
|
||||
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
@@ -1,28 +1,23 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary;
|
||||
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.MachineComponent;
|
||||
import binnie.core.machines.component.IInteraction;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import binnie.core.machines.component.IInteraction;
|
||||
import binnie.core.machines.MachineComponent;
|
||||
|
||||
public class ComponentExtraBeeGUI extends MachineComponent implements IInteraction.RightClick
|
||||
{
|
||||
ExtraBeeGUID id;
|
||||
public class ComponentExtraBeeGUI extends MachineComponent implements IInteraction.RightClick {
|
||||
protected ExtraBeeGUID id;
|
||||
|
||||
public ComponentExtraBeeGUI(final Machine machine, final ExtraBeeGUID id) {
|
||||
public ComponentExtraBeeGUI(Machine machine, ExtraBeeGUID id) {
|
||||
super(machine);
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRightClick(final World world, final EntityPlayer player, final int x, final int y, final int z) {
|
||||
ExtraBees.proxy.openGui(this.id, player, x, y, z);
|
||||
public void onRightClick(World world, EntityPlayer player, int x, int y, int z) {
|
||||
ExtraBees.proxy.openGui(id, player, x, y, z);
|
||||
}
|
||||
}
|
||||
@@ -1,44 +1,36 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.Mods;
|
||||
import binnie.core.genetics.BeeModifierLogic;
|
||||
import binnie.core.genetics.EnumBeeBooleanModifier;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import binnie.core.genetics.EnumBeeModifier;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
|
||||
import forestry.api.apiculture.IHiveFrame;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
|
||||
import binnie.core.Mods;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import binnie.core.genetics.EnumBeeModifier;
|
||||
import binnie.core.genetics.BeeModifierLogic;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import forestry.api.apiculture.IHiveFrame;
|
||||
|
||||
public enum EnumHiveFrame implements IHiveFrame, IBeeModifier
|
||||
{
|
||||
public enum EnumHiveFrame implements IHiveFrame, IBeeModifier {
|
||||
Cocoa,
|
||||
Cage,
|
||||
Soul,
|
||||
Clay,
|
||||
Debug;
|
||||
|
||||
Item item;
|
||||
int maxDamage;
|
||||
BeeModifierLogic logic;
|
||||
protected Item item;
|
||||
protected int maxDamage;
|
||||
protected BeeModifierLogic logic;
|
||||
|
||||
EnumHiveFrame() {
|
||||
maxDamage = 240;
|
||||
logic = new BeeModifierLogic();
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
EnumHiveFrame.Cocoa.logic.setModifier(EnumBeeModifier.Lifespan, 0.75f, 0.25f);
|
||||
@@ -54,27 +46,42 @@ public enum EnumHiveFrame implements IHiveFrame, IBeeModifier
|
||||
EnumHiveFrame.Clay.logic.setModifier(EnumBeeModifier.Mutation, 0.5f, 0.2f);
|
||||
EnumHiveFrame.Clay.logic.setModifier(EnumBeeModifier.Production, 0.75f, 0.2f);
|
||||
EnumHiveFrame.Debug.logic.setModifier(EnumBeeModifier.Lifespan, 1.0E-4f, 1.0E-4f);
|
||||
GameRegistry.addRecipe(new ItemStack(EnumHiveFrame.Cocoa.item), new Object[] { " c ", "cFc", " c ", 'F', Mods.Forestry.stack("frameImpregnated"), 'c', new ItemStack(Items.dye, 1, 3) });
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(EnumHiveFrame.Cage.item), new Object[] { Mods.Forestry.stack("frameImpregnated"), Blocks.iron_bars });
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(EnumHiveFrame.Soul.item), new Object[] { Mods.Forestry.stack("frameImpregnated"), Blocks.soul_sand });
|
||||
GameRegistry.addRecipe(new ItemStack(EnumHiveFrame.Clay.item), new Object[] { " c ", "cFc", " c ", 'F', Mods.Forestry.stack("frameImpregnated"), 'c', Items.clay_ball });
|
||||
|
||||
GameRegistry.addRecipe(
|
||||
new ItemStack(EnumHiveFrame.Cocoa.item),
|
||||
" c ", "cFc", " c ",
|
||||
'F', Mods.Forestry.stack("frameImpregnated"),
|
||||
'c', new ItemStack(Items.dye, 1, 3)
|
||||
);
|
||||
GameRegistry.addShapelessRecipe(
|
||||
new ItemStack(EnumHiveFrame.Cage.item),
|
||||
Mods.Forestry.stack("frameImpregnated"),
|
||||
Blocks.iron_bars
|
||||
);
|
||||
GameRegistry.addShapelessRecipe(
|
||||
new ItemStack(EnumHiveFrame.Soul.item),
|
||||
Mods.Forestry.stack("frameImpregnated"),
|
||||
Blocks.soul_sand
|
||||
);
|
||||
GameRegistry.addRecipe(
|
||||
new ItemStack(EnumHiveFrame.Clay.item),
|
||||
" c ", "cFc", " c ",
|
||||
'F', Mods.Forestry.stack("frameImpregnated"),
|
||||
'c', Items.clay_ball
|
||||
);
|
||||
}
|
||||
|
||||
// TODO unused method?
|
||||
public int getIconIndex() {
|
||||
return 55 + this.ordinal();
|
||||
return 55 + ordinal();
|
||||
}
|
||||
|
||||
public void setMaxDamage(final int damage) {
|
||||
this.maxDamage = damage;
|
||||
}
|
||||
|
||||
private EnumHiveFrame() {
|
||||
this.maxDamage = 240;
|
||||
this.logic = new BeeModifierLogic();
|
||||
public void setMaxDamage(int damage) {
|
||||
maxDamage = damage;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack frameUsed(final IBeeHousing house, final ItemStack frame, final IBee queen, final int wear) {
|
||||
public ItemStack frameUsed(IBeeHousing house, ItemStack frame, IBee queen, int wear) {
|
||||
frame.setItemDamage(frame.getItemDamage() + wear);
|
||||
if (frame.getItemDamage() >= frame.getMaxDamage()) {
|
||||
return null;
|
||||
@@ -83,57 +90,57 @@ public enum EnumHiveFrame implements IHiveFrame, IBeeModifier
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.logic.getModifier(EnumBeeModifier.Territory, currentModifier);
|
||||
public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.Territory, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return this.logic.getModifier(EnumBeeModifier.Mutation, currentModifier);
|
||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.Mutation, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return this.logic.getModifier(EnumBeeModifier.Lifespan, currentModifier);
|
||||
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.Lifespan, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.logic.getModifier(EnumBeeModifier.Production, currentModifier);
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.Production, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.logic.getModifier(EnumBeeModifier.Flowering, currentModifier);
|
||||
public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.Flowering, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.logic.getModifier(EnumBeeModifier.GeneticDecay, currentModifier);
|
||||
public float getGeneticDecay(IBeeGenome genome, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.GeneticDecay, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return this.logic.getModifier(EnumBeeBooleanModifier.Sealed);
|
||||
return logic.getModifier(EnumBeeBooleanModifier.Sealed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return this.logic.getModifier(EnumBeeBooleanModifier.SelfLighted);
|
||||
return logic.getModifier(EnumBeeBooleanModifier.SelfLighted);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
return this.logic.getModifier(EnumBeeBooleanModifier.SunlightStimulated);
|
||||
return logic.getModifier(EnumBeeBooleanModifier.SunlightStimulated);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish() {
|
||||
return this.logic.getModifier(EnumBeeBooleanModifier.Hellish);
|
||||
return logic.getModifier(EnumBeeBooleanModifier.Hellish);
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return ExtraBees.proxy.localise("item.frame." + this.toString().toLowerCase());
|
||||
return ExtraBees.proxy.localise("item.frame." + toString().toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,17 +1,12 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary;
|
||||
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Item;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public enum IndustrialFrame implements IBeeModifier
|
||||
{
|
||||
public enum IndustrialFrame implements IBeeModifier {
|
||||
Empty("Empty", 5, 0),
|
||||
Light("Glowstone Lighting", 2, 4),
|
||||
Rain("Rain Shielding", 2, 4),
|
||||
@@ -29,102 +24,6 @@ public enum IndustrialFrame implements IBeeModifier
|
||||
NetherStar("Immortality Gate", 12, 50),
|
||||
Poison("Mortality Inhibitor", 8, 18);
|
||||
|
||||
String name;
|
||||
float territoryMod;
|
||||
float mutationMod;
|
||||
float lifespanMod;
|
||||
float productionMod;
|
||||
float floweringMod;
|
||||
boolean lighted;
|
||||
boolean sunlight;
|
||||
boolean rain;
|
||||
int wearMod;
|
||||
int power;
|
||||
|
||||
private IndustrialFrame(final String name, final int wear, final int power) {
|
||||
this.territoryMod = 1.0f;
|
||||
this.mutationMod = 1.0f;
|
||||
this.lifespanMod = 1.0f;
|
||||
this.productionMod = 1.0f;
|
||||
this.floweringMod = 1.0f;
|
||||
this.lighted = false;
|
||||
this.sunlight = false;
|
||||
this.rain = false;
|
||||
this.name = name;
|
||||
this.wearMod = wear;
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
public static ItemStack getItemStack(final Item item, final IndustrialFrame frame) {
|
||||
final ItemStack stack = new ItemStack(item);
|
||||
final NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setInteger("frame", frame.ordinal());
|
||||
stack.setTagCompound(nbt);
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.territoryMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return this.mutationMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return this.lifespanMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.productionMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.floweringMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return this.rain;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return this.lighted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
return this.sunlight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public Object getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public int getWearModifier() {
|
||||
return this.wearMod;
|
||||
}
|
||||
|
||||
public int getPowerUsage() {
|
||||
return this.power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(final IBeeGenome genome, final float currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
static {
|
||||
IndustrialFrame.Light.lighted = true;
|
||||
IndustrialFrame.Rain.rain = true;
|
||||
@@ -143,4 +42,102 @@ public enum IndustrialFrame implements IBeeModifier
|
||||
IndustrialFrame.NetherStar.lifespanMod = 20.0f;
|
||||
IndustrialFrame.Poison.lifespanMod = 0.5f;
|
||||
}
|
||||
|
||||
protected String name;
|
||||
protected float territoryMod;
|
||||
protected float mutationMod;
|
||||
protected float lifespanMod;
|
||||
protected float productionMod;
|
||||
protected float floweringMod;
|
||||
protected boolean lighted;
|
||||
protected boolean sunlight;
|
||||
protected boolean rain;
|
||||
protected int wearMod;
|
||||
protected int power;
|
||||
|
||||
IndustrialFrame(String name, int wear, int power) {
|
||||
this.name = name;
|
||||
this.power = power;
|
||||
territoryMod = 1.0f;
|
||||
mutationMod = 1.0f;
|
||||
lifespanMod = 1.0f;
|
||||
productionMod = 1.0f;
|
||||
floweringMod = 1.0f;
|
||||
lighted = false;
|
||||
sunlight = false;
|
||||
rain = false;
|
||||
wearMod = wear;
|
||||
}
|
||||
|
||||
public static ItemStack getItemStack(Item item, IndustrialFrame frame) {
|
||||
ItemStack stack = new ItemStack(item);
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setInteger("frame", frame.ordinal());
|
||||
stack.setTagCompound(nbt);
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
|
||||
return territoryMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return mutationMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return lifespanMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
return productionMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
|
||||
return floweringMod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return rain;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return lighted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
return sunlight;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public Object getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
// TODO unused method?
|
||||
public int getWearModifier() {
|
||||
return wearMod;
|
||||
}
|
||||
|
||||
// TODO unused method?
|
||||
public int getPowerUsage() {
|
||||
return power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(IBeeGenome genome, float currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
}
|
||||
@@ -1,67 +1,56 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.apiculture.IHiveFrame;
|
||||
import forestry.api.core.Tabs;
|
||||
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.apiculture.IHiveFrame;
|
||||
public class ItemHiveFrame extends Item implements IHiveFrame, IBeeModifier {
|
||||
protected EnumHiveFrame frame;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
public class ItemHiveFrame extends Item implements IHiveFrame, IBeeModifier
|
||||
{
|
||||
EnumHiveFrame frame;
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(final ItemStack par1ItemStack) {
|
||||
return this.frame.getName();
|
||||
}
|
||||
|
||||
public ItemHiveFrame(final EnumHiveFrame frame) {
|
||||
public ItemHiveFrame(EnumHiveFrame frame) {
|
||||
this.frame = frame;
|
||||
this.setMaxDamage(frame.maxDamage);
|
||||
this.setCreativeTab(Tabs.tabApiculture);
|
||||
this.setMaxStackSize(1);
|
||||
this.setUnlocalizedName("hiveFrame");
|
||||
setMaxDamage(frame.maxDamage);
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("hiveFrame");
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.frame.getTerritoryModifier(genome, currentModifier);
|
||||
public String getItemStackDisplayName(ItemStack par1ItemStack) {
|
||||
return frame.getName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return this.frame.getMutationModifier(genome, mate, currentModifier);
|
||||
public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
|
||||
return frame.getTerritoryModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return this.frame.getLifespanModifier(genome, mate, currentModifier);
|
||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return frame.getMutationModifier(genome, mate, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.frame.getProductionModifier(genome, currentModifier);
|
||||
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return frame.getLifespanModifier(genome, mate, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack frameUsed(final IBeeHousing housing, final ItemStack frame, final IBee queen, final int wear) {
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
return frame.getProductionModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack frameUsed(IBeeHousing housing, ItemStack frame, IBee queen, int wear) {
|
||||
frame.setItemDamage(frame.getItemDamage() + wear);
|
||||
if (frame.getItemDamage() >= frame.getMaxDamage()) {
|
||||
return null;
|
||||
@@ -70,7 +59,7 @@ public class ItemHiveFrame extends Item implements IHiveFrame, IBeeModifier
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
@@ -96,12 +85,12 @@ public class ItemHiveFrame extends Item implements IHiveFrame, IBeeModifier
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister register) {
|
||||
this.itemIcon = ExtraBees.proxy.getIcon(register, "frame" + this.frame.toString());
|
||||
public void registerIcons(IIconRegister register) {
|
||||
itemIcon = ExtraBees.proxy.getIcon(register, "frame" + frame.toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(final IBeeGenome genome, final float currentModifier) {
|
||||
public float getGeneticDecay(IBeeGenome genome, float currentModifier) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +1,31 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import java.util.List;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
// TODO unused class?
|
||||
public class ItemIndustrialFrame extends Item {
|
||||
public ItemIndustrialFrame() {
|
||||
setCreativeTab(CreativeTabs.tabMisc);
|
||||
setMaxDamage(400);
|
||||
setMaxStackSize(1);
|
||||
setUnlocalizedName("industrialFrame");
|
||||
}
|
||||
|
||||
public static IndustrialFrame getFrame(ItemStack stack) {
|
||||
if (stack == null || !stack.hasTagCompound() || !stack.getTagCompound().hasKey("frame")) {
|
||||
return null;
|
||||
}
|
||||
return IndustrialFrame.values()[stack.getTagCompound().getInteger("frame")];
|
||||
}
|
||||
|
||||
public class ItemIndustrialFrame extends Item
|
||||
{
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses() {
|
||||
@@ -23,10 +34,10 @@ public class ItemIndustrialFrame extends Item
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List) {
|
||||
for (final IndustrialFrame frame : IndustrialFrame.values()) {
|
||||
final ItemStack stack = new ItemStack(this);
|
||||
final NBTTagCompound nbt = new NBTTagCompound();
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List par3List) {
|
||||
for (IndustrialFrame frame : IndustrialFrame.values()) {
|
||||
ItemStack stack = new ItemStack(this);
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
nbt.setInteger("frame", frame.ordinal());
|
||||
stack.setTagCompound(nbt);
|
||||
par3List.add(stack);
|
||||
@@ -35,33 +46,18 @@ public class ItemIndustrialFrame extends Item
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(final ItemStack par1ItemStack, final EntityPlayer par2EntityPlayer, final List par3List, final boolean par4) {
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
|
||||
final IndustrialFrame frame = getFrame(par1ItemStack);
|
||||
IndustrialFrame frame = getFrame(par1ItemStack);
|
||||
if (frame == null) {
|
||||
par3List.add("Invalid Contents");
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
par3List.add(frame.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(final ItemStack par1ItemStack) {
|
||||
public String getItemStackDisplayName(ItemStack par1ItemStack) {
|
||||
return "Industrial Frame";
|
||||
}
|
||||
|
||||
public ItemIndustrialFrame() {
|
||||
this.setCreativeTab(CreativeTabs.tabMisc);
|
||||
this.setMaxDamage(400);
|
||||
this.setMaxStackSize(1);
|
||||
this.setUnlocalizedName("industrialFrame");
|
||||
}
|
||||
|
||||
public static IndustrialFrame getFrame(final ItemStack stack) {
|
||||
if (stack == null || !stack.hasTagCompound() || !stack.getTagCompound().hasKey("frame")) {
|
||||
return null;
|
||||
}
|
||||
return IndustrialFrame.values()[stack.getTagCompound().getInteger("frame")];
|
||||
}
|
||||
}
|
||||
@@ -1,36 +1,30 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary;
|
||||
|
||||
import forestry.api.circuits.ICircuitLayout;
|
||||
import binnie.extrabees.apiary.machine.AlvearyStimulator;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.init.Items;
|
||||
import binnie.core.Mods;
|
||||
import binnie.extrabees.apiary.machine.AlvearyMutator;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.init.Blocks;
|
||||
import binnie.core.BinnieCore;
|
||||
import forestry.api.core.Tabs;
|
||||
import binnie.core.machines.MachineGroup;
|
||||
import binnie.extrabees.apiary.machine.AlvearyMachine;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.circuits.BinnieCircuitLayout;
|
||||
import net.minecraft.block.Block;
|
||||
import binnie.core.IInitializable;
|
||||
import binnie.core.Mods;
|
||||
import binnie.core.circuits.BinnieCircuitLayout;
|
||||
import binnie.core.machines.MachineGroup;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.apiary.machine.AlvearyMachine;
|
||||
import binnie.extrabees.apiary.machine.AlvearyMutator;
|
||||
import binnie.extrabees.apiary.machine.AlvearyStimulator;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import forestry.api.core.Tabs;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
public class ModuleApiary implements IInitializable
|
||||
{
|
||||
public class ModuleApiary implements IInitializable {
|
||||
public static Block blockComponent;
|
||||
BinnieCircuitLayout stimulatorLayout;
|
||||
|
||||
protected BinnieCircuitLayout stimulatorLayout;
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
final MachineGroup machineGroup = new MachineGroup(ExtraBees.instance, "alveay", "alveary", AlvearyMachine.values());
|
||||
MachineGroup machineGroup = new MachineGroup(ExtraBees.instance, "alveay", "alveary", AlvearyMachine.values());
|
||||
machineGroup.setCreativeTab(Tabs.tabApiculture);
|
||||
BinnieCore.proxy.registerTileEntity(TileExtraBeeAlveary.class, "extrabees.tile.alveary", BinnieCore.proxy.createObject("binnie.core.machines.RendererMachine"));
|
||||
ModuleApiary.blockComponent = machineGroup.getBlock();
|
||||
@@ -44,7 +38,8 @@ public class ModuleApiary implements IInitializable
|
||||
AlvearyMutator.addMutationItem(Mods.IC2.stack("Uran238"), 2.0f);
|
||||
AlvearyMutator.addMutationItem(new ItemStack(Items.ender_pearl), 2.0f);
|
||||
AlvearyMutator.addMutationItem(new ItemStack(Items.ender_eye), 4.0f);
|
||||
for (final EnumHiveFrame frame : EnumHiveFrame.values()) {
|
||||
|
||||
for (EnumHiveFrame frame : EnumHiveFrame.values()) {
|
||||
GameRegistry.registerItem(frame.item = new ItemHiveFrame(frame), "hiveFrame." + frame.name().toLowerCase());
|
||||
}
|
||||
}
|
||||
@@ -52,20 +47,72 @@ public class ModuleApiary implements IInitializable
|
||||
@Override
|
||||
public void postInit() {
|
||||
EnumHiveFrame.init();
|
||||
GameRegistry.addRecipe(AlvearyMachine.Mutator.get(1), new Object[] { "g g", " a ", "t t", 'g', Items.gold_ingot, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 5) });
|
||||
GameRegistry.addRecipe(AlvearyMachine.Frame.get(1), new Object[] { "iii", "tat", " t ", 'i', Items.iron_ingot, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4) });
|
||||
GameRegistry.addRecipe(AlvearyMachine.RainShield.get(1), new Object[] { " b ", "bab", "t t", 'b', Items.brick, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4) });
|
||||
GameRegistry.addRecipe(AlvearyMachine.Lighting.get(1), new Object[] { "iii", "iai", " t ", 'i', Items.glowstone_dust, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4) });
|
||||
GameRegistry.addRecipe(AlvearyMachine.Stimulator.get(1), new Object[] { "kik", "iai", " t ", 'i', Items.gold_nugget, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4), 'k', new ItemStack(Mods.Forestry.item("chipsets"), 1, 2) });
|
||||
GameRegistry.addRecipe(AlvearyMachine.Hatchery.get(1), new Object[] { "i i", " a ", "iti", 'i', Blocks.glass_pane, 'a', Mods.Forestry.block("alveary"), 't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 5) });
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(AlvearyMachine.Transmission.get(1), new Object[] { " t ", "tat", " t ", 'a', Mods.Forestry.block("alveary"), 't', "gearTin" }));
|
||||
for (final AlvearyStimulator.CircuitType type : AlvearyStimulator.CircuitType.values()) {
|
||||
type.createCircuit(this.stimulatorLayout);
|
||||
GameRegistry.addRecipe(
|
||||
AlvearyMachine.Mutator.get(1),
|
||||
"g g", " a ", "t t",
|
||||
'g', Items.gold_ingot,
|
||||
'a', Mods.Forestry.block("alveary"),
|
||||
't',
|
||||
new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 5)
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(
|
||||
AlvearyMachine.Frame.get(1),
|
||||
"iii", "tat", " t ",
|
||||
'i', Items.iron_ingot,
|
||||
'a', Mods.Forestry.block("alveary"),
|
||||
't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4)
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(
|
||||
AlvearyMachine.RainShield.get(1),
|
||||
" b ", "bab", "t t",
|
||||
'b', Items.brick,
|
||||
'a', Mods.Forestry.block("alveary"),
|
||||
't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4)
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(
|
||||
AlvearyMachine.Lighting.get(1),
|
||||
"iii", "iai", " t ",
|
||||
'i', Items.glowstone_dust,
|
||||
'a', Mods.Forestry.block("alveary"),
|
||||
't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4)
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(
|
||||
AlvearyMachine.Stimulator.get(1),
|
||||
"kik", "iai", " t ",
|
||||
'i', Items.gold_nugget,
|
||||
'a', Mods.Forestry.block("alveary"),
|
||||
't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 4),
|
||||
'k', new ItemStack(Mods.Forestry.item("chipsets"), 1, 2)
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(
|
||||
AlvearyMachine.Hatchery.get(1),
|
||||
"i i", " a ", "iti",
|
||||
'i', Blocks.glass_pane,
|
||||
'a', Mods.Forestry.block("alveary"),
|
||||
't', new ItemStack(Mods.Forestry.item("thermionicTubes"), 1, 5)
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
AlvearyMachine.Transmission.get(1),
|
||||
new Object[]{
|
||||
" t ", "tat", " t ",
|
||||
'a', Mods.Forestry.block("alveary"),
|
||||
't', "gearTin"
|
||||
}
|
||||
));
|
||||
|
||||
for (AlvearyStimulator.CircuitType type : AlvearyStimulator.CircuitType.values()) {
|
||||
type.createCircuit(stimulatorLayout);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
this.stimulatorLayout = new BinnieCircuitLayout(ExtraBees.instance, "Stimulator");
|
||||
stimulatorLayout = new BinnieCircuitLayout(ExtraBees.instance, "Stimulator");
|
||||
}
|
||||
}
|
||||
@@ -1,44 +1,36 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary;
|
||||
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.extrabees.apiary.machine.AlvearyMachine;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.multiblock.IAlvearyComponent;
|
||||
import forestry.api.multiblock.IMultiblockComponent;
|
||||
import forestry.api.multiblock.IMultiblockController;
|
||||
import forestry.api.multiblock.IMultiblockLogicAlveary;
|
||||
import forestry.api.multiblock.MultiblockManager;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import java.util.LinkedList;
|
||||
import binnie.extrabees.apiary.machine.AlvearyMachine;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChunkCoordinates;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.authlib.GameProfile;
|
||||
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
|
||||
public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyComponent.Active, IAlvearyComponent.BeeModifier, IAlvearyComponent.BeeListener, IBeeListener, IBeeModifier
|
||||
{
|
||||
IMultiblockLogicAlveary structureLogic;
|
||||
ChunkCoordinates min;
|
||||
ChunkCoordinates max;
|
||||
public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyComponent.Active, IAlvearyComponent.BeeModifier, IAlvearyComponent.BeeListener, IBeeListener, IBeeModifier {
|
||||
protected IMultiblockLogicAlveary structureLogic;
|
||||
protected ChunkCoordinates min;
|
||||
protected ChunkCoordinates max;
|
||||
|
||||
public TileExtraBeeAlveary() {
|
||||
this.structureLogic = MultiblockManager.logicFactory.createAlvearyLogic();
|
||||
structureLogic = MultiblockManager.logicFactory.createAlvearyLogic();
|
||||
}
|
||||
|
||||
public TileExtraBeeAlveary(final AlvearyMachine.AlvearyPackage alvearyPackage) {
|
||||
public TileExtraBeeAlveary(AlvearyMachine.AlvearyPackage alvearyPackage) {
|
||||
super(alvearyPackage);
|
||||
this.structureLogic = MultiblockManager.logicFactory.createAlvearyLogic();
|
||||
structureLogic = MultiblockManager.logicFactory.createAlvearyLogic();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -57,7 +49,7 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyCo
|
||||
for (int x = min.posX; x <= max.posX; ++x) {
|
||||
for (int z = min.posZ; z <= max.posZ; ++z) {
|
||||
for (int y = min.posY; y <= max.posY; ++y) {
|
||||
TileEntity tile = this.getWorldObj().getTileEntity(x, y, z);
|
||||
TileEntity tile = getWorldObj().getTileEntity(x, y, z);
|
||||
if (tile instanceof IMultiblockComponent) {
|
||||
tiles.add(tile);
|
||||
}
|
||||
@@ -76,8 +68,8 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyCo
|
||||
|
||||
@Override
|
||||
public void onMachineBroken() {
|
||||
this.min = null;
|
||||
this.max = null;
|
||||
min = null;
|
||||
max = null;
|
||||
|
||||
}
|
||||
|
||||
@@ -122,70 +114,89 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyCo
|
||||
|
||||
@Override
|
||||
public IBeeModifier getBeeModifier() {
|
||||
return this.getMachine().getInterface(IBeeModifier.class);
|
||||
return getMachine().getInterface(IBeeModifier.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IBeeListener getBeeListener() {
|
||||
return this.getMachine().getInterface(IBeeListener.class);
|
||||
return getMachine().getInterface(IBeeListener.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return (this.getBeeModifier() == null) ? 1.0f : this.getBeeModifier().getTerritoryModifier(genome, currentModifier);
|
||||
public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
|
||||
if (getBeeModifier() == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
return getBeeModifier().getTerritoryModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return (this.getBeeModifier() == null) ? 1.0f : this.getBeeModifier().getMutationModifier(genome, mate, currentModifier);
|
||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
if (getBeeModifier() == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
return getBeeModifier().getMutationModifier(genome, mate, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return (this.getBeeModifier() == null) ? 1.0f : this.getBeeModifier().getLifespanModifier(genome, mate, currentModifier);
|
||||
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
if (getBeeModifier() == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
return getBeeModifier().getLifespanModifier(genome, mate, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return (this.getBeeModifier() == null) ? 1.0f : this.getBeeModifier().getProductionModifier(genome, currentModifier);
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
if (getBeeModifier() == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
return getBeeModifier().getProductionModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return (this.getBeeModifier() == null) ? 1.0f : this.getBeeModifier().getFloweringModifier(genome, currentModifier);
|
||||
public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
|
||||
if (getBeeModifier() == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
return getBeeModifier().getFloweringModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return this.getBeeModifier() != null && this.getBeeModifier().isSealed();
|
||||
return getBeeModifier() != null
|
||||
&& getBeeModifier().isSealed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return this.getBeeModifier() != null && this.getBeeModifier().isSelfLighted();
|
||||
return getBeeModifier() != null
|
||||
&& getBeeModifier().isSelfLighted();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
return this.getBeeModifier() != null && this.getBeeModifier().isSunlightSimulated();
|
||||
return getBeeModifier() != null
|
||||
&& getBeeModifier().isSunlightSimulated();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish() {
|
||||
return this.getBeeModifier() != null && this.getBeeModifier().isHellish();
|
||||
return getBeeModifier() != null
|
||||
&& getBeeModifier().isHellish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wearOutEquipment(int amount) {
|
||||
if (this.getBeeListener() != null) {
|
||||
this.getBeeListener().wearOutEquipment(amount);
|
||||
if (getBeeListener() != null) {
|
||||
getBeeListener().wearOutEquipment(amount);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onQueenDeath() {
|
||||
if (this.getBeeListener() != null) {
|
||||
this.getBeeListener().onQueenDeath();
|
||||
if (getBeeListener() != null) {
|
||||
getBeeListener().onQueenDeath();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -216,6 +227,7 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyCo
|
||||
}
|
||||
}
|
||||
|
||||
// TODO why its commented?
|
||||
// boolean init;
|
||||
// //IStructureLogic structureLogic;
|
||||
// private boolean isMaster;
|
||||
@@ -234,7 +246,7 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyCo
|
||||
// if (!this.isIntegratedIntoStructure() || this.isMaster()) {
|
||||
// // this.validateStructure();
|
||||
// }
|
||||
// // final IMultiblockComponent master = this.getCentralTE();
|
||||
// // IMultiblockComponent master = this.getCentralTE();
|
||||
// // if (master == null) {
|
||||
// // return;
|
||||
// // }
|
||||
@@ -251,7 +263,7 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyCo
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void readFromNBT(final NBTTagCompound nbttagcompound) {
|
||||
// public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
// super.readFromNBT(nbttagcompound);
|
||||
// this.isMaster = nbttagcompound.getBoolean("IsMaster");
|
||||
// this.masterX = nbttagcompound.getInteger("MasterX");
|
||||
@@ -266,7 +278,7 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyCo
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public void writeToNBT(final NBTTagCompound nbttagcompound) {
|
||||
// public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
// super.writeToNBT(nbttagcompound);
|
||||
// nbttagcompound.setBoolean("IsMaster", this.isMaster);
|
||||
// nbttagcompound.setInteger("MasterX", this.masterX);
|
||||
@@ -287,7 +299,7 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyCo
|
||||
// Binnie.Genetics.getBeeRoot().createAlvearyStructureLogic((IAlvearyComponent)this);
|
||||
// }
|
||||
//
|
||||
// public TileExtraBeeAlveary(final AlvearyMachine.AlvearyPackage
|
||||
// public TileExtraBeeAlveary(AlvearyMachine.AlvearyPackage
|
||||
// alvearyPackage) {
|
||||
// super(alvearyPackage);
|
||||
// this.init = false;
|
||||
@@ -316,12 +328,12 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyCo
|
||||
// // if (this.isMaster()) {
|
||||
// // return (IMultiblockComponent)this;
|
||||
// // }
|
||||
// // final TileEntity tile = this.worldObj.getTileEntity(this.masterX,
|
||||
// // TileEntity tile = this.worldObj.getTileEntity(this.masterX,
|
||||
// this.masterY, this.masterZ);
|
||||
// // if (!(tile instanceof IMultiblockComponent)) {
|
||||
// // return null;
|
||||
// // }
|
||||
// // final IMultiblockComponent master =
|
||||
// // IMultiblockComponent master =
|
||||
// (IMultiblockComponent)this.worldObj.getTileEntity(this.masterX,
|
||||
// this.masterY, this.masterZ);
|
||||
// // if (master.isMaster()) {
|
||||
@@ -335,14 +347,14 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyCo
|
||||
// // this.updateAlvearyBlocks();
|
||||
// // }
|
||||
//
|
||||
// private boolean isSameTile(final TileEntity tile) {
|
||||
// private boolean isSameTile(TileEntity tile) {
|
||||
// return tile.xCoord == this.xCoord && tile.yCoord == this.yCoord &&
|
||||
// tile.zCoord == this.zCoord;
|
||||
// }
|
||||
//
|
||||
// // public void setCentralTE(final TileEntity tile) {
|
||||
// // public void setCentralTE(TileEntity tile) {
|
||||
// // if (tile == null || tile == this || this.isSameTile(tile)) {
|
||||
// // final boolean b = false;
|
||||
// // boolean b = false;
|
||||
// // this.masterZ = (b ? 1 : 0);
|
||||
// // this.masterX = (b ? 1 : 0);
|
||||
// // this.masterY = -99;
|
||||
@@ -375,18 +387,18 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyCo
|
||||
// return this.isMaster || this.masterY >= 0;
|
||||
// }
|
||||
//
|
||||
// public void registerBeeModifier(final IBeeModifier modifier) {
|
||||
// public void registerBeeModifier(IBeeModifier modifier) {
|
||||
// }
|
||||
//
|
||||
// public void removeBeeModifier(final IBeeModifier modifier) {
|
||||
// public void removeBeeModifier(IBeeModifier modifier) {
|
||||
// }
|
||||
//
|
||||
// public void addTemperatureChange(final float change, final float
|
||||
// boundaryDown, final float boundaryUp) {
|
||||
// public void addTemperatureChange(float change, float
|
||||
// boundaryDown, float boundaryUp) {
|
||||
// }
|
||||
//
|
||||
// public void addHumidityChange(final float change, final float
|
||||
// boundaryDown, final float boundaryUp) {
|
||||
// public void addHumidityChange(float change, float
|
||||
// boundaryDown, float boundaryUp) {
|
||||
// }
|
||||
//
|
||||
// public boolean hasFunction() {
|
||||
@@ -401,31 +413,31 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyCo
|
||||
// return this.getMachine().getInterface(IBeeListener.class);
|
||||
// }
|
||||
//
|
||||
// public float getTerritoryModifier(final IBeeGenome genome, final float
|
||||
// public float getTerritoryModifier(IBeeGenome genome, float
|
||||
// currentModifier) {
|
||||
// return (this.getBeeModifier() == null) ? 1.0f :
|
||||
// this.getBeeModifier().getTerritoryModifier(genome, currentModifier);
|
||||
// }
|
||||
//
|
||||
// public float getMutationModifier(final IBeeGenome genome, final
|
||||
// IBeeGenome mate, final float currentModifier) {
|
||||
// public float getMutationModifier(IBeeGenome genome, final
|
||||
// IBeeGenome mate, float currentModifier) {
|
||||
// return (this.getBeeModifier() == null) ? 1.0f :
|
||||
// this.getBeeModifier().getMutationModifier(genome, mate, currentModifier);
|
||||
// }
|
||||
//
|
||||
// public float getLifespanModifier(final IBeeGenome genome, final
|
||||
// IBeeGenome mate, final float currentModifier) {
|
||||
// public float getLifespanModifier(IBeeGenome genome, final
|
||||
// IBeeGenome mate, float currentModifier) {
|
||||
// return (this.getBeeModifier() == null) ? 1.0f :
|
||||
// this.getBeeModifier().getLifespanModifier(genome, mate, currentModifier);
|
||||
// }
|
||||
//
|
||||
// public float getProductionModifier(final IBeeGenome genome, final float
|
||||
// public float getProductionModifier(IBeeGenome genome, float
|
||||
// currentModifier) {
|
||||
// return (this.getBeeModifier() == null) ? 1.0f :
|
||||
// this.getBeeModifier().getProductionModifier(genome, currentModifier);
|
||||
// }
|
||||
//
|
||||
// public float getFloweringModifier(final IBeeGenome genome, final float
|
||||
// public float getFloweringModifier(IBeeGenome genome, float
|
||||
// currentModifier) {
|
||||
// return (this.getBeeModifier() == null) ? 1.0f :
|
||||
// this.getBeeModifier().getFloweringModifier(genome, currentModifier);
|
||||
@@ -450,46 +462,46 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyCo
|
||||
// this.getBeeModifier().isHellish();
|
||||
// }
|
||||
//
|
||||
// public void registerBeeListener(final IBeeListener event) {
|
||||
// public void registerBeeListener(IBeeListener event) {
|
||||
// }
|
||||
//
|
||||
// public void removeBeeListener(final IBeeListener event) {
|
||||
// public void removeBeeListener(IBeeListener event) {
|
||||
// }
|
||||
//
|
||||
// // public void onQueenChange(final ItemStack queen) {
|
||||
// // public void onQueenChange(ItemStack queen) {
|
||||
// // if (this.getBeeListener() != null) {
|
||||
// // this.getBeeListener().onQueenChange(queen);
|
||||
// // }
|
||||
// // }
|
||||
// //
|
||||
// public void wearOutEquipment(final int amount) {
|
||||
// public void wearOutEquipment(int amount) {
|
||||
// if (this.getBeeListener() != null) {
|
||||
// this.getBeeListener().wearOutEquipment(amount);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// // public void onQueenDeath(final IBee queen) {
|
||||
// // public void onQueenDeath(IBee queen) {
|
||||
// // if (this.getBeeListener() != null) {
|
||||
// // this.getBeeListener().onQueenDeath(queen);
|
||||
// // }
|
||||
// // }
|
||||
// //
|
||||
// // public void onPostQueenDeath(final IBee queen) {
|
||||
// // public void onPostQueenDeath(IBee queen) {
|
||||
// // if (this.getBeeListener() != null) {
|
||||
// // this.getBeeListener().onPostQueenDeath(queen);
|
||||
// // }
|
||||
// // }
|
||||
//
|
||||
// public boolean onPollenRetrieved(final IBee queen, final IIndividual
|
||||
// pollen, final boolean isHandled) {
|
||||
// public boolean onPollenRetrieved(IBee queen, IIndividual
|
||||
// pollen, boolean isHandled) {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// public boolean onEggLaid(final IBee queen) {
|
||||
// public boolean onEggLaid(IBee queen) {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// public float getGeneticDecay(final IBeeGenome genome, final float
|
||||
// public float getGeneticDecay(IBeeGenome genome, float
|
||||
// currentModifier) {
|
||||
// return 1.0f;
|
||||
// }
|
||||
@@ -507,15 +519,15 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyCo
|
||||
// // private void updateAlvearyBlocks() {
|
||||
// // this.tiles.clear();
|
||||
// // if (this.getCentralTE() != null) {
|
||||
// // final IMultiblockComponent struct = this.getCentralTE();
|
||||
// // IMultiblockComponent struct = this.getCentralTE();
|
||||
// // if (!struct.isIntegratedIntoStructure()) {
|
||||
// // return;
|
||||
// // }
|
||||
// // final TileEntity central = (TileEntity)struct;
|
||||
// // TileEntity central = (TileEntity)struct;
|
||||
// // for (int x = -2; x <= 2; ++x) {
|
||||
// // for (int z = -2; z <= 2; ++z) {
|
||||
// // for (int y = -2; y <= 2; ++y) {
|
||||
// // final TileEntity tile = this.getWorldObj().getTileEntity(this.xCoord +
|
||||
// // TileEntity tile = this.getWorldObj().getTileEntity(this.xCoord +
|
||||
// x, this.yCoord + y, this.zCoord + z);
|
||||
// // if (tile != null && tile instanceof IMultiblockComponent &&
|
||||
// ((IMultiblockComponent)tile).getMultiblockLogic().getCentralTE() ==
|
||||
|
||||
@@ -1,61 +1,49 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.apiculture.IHiveFrame;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.extrabees.apiary.ComponentExtraBeeGUI;
|
||||
import binnie.extrabees.apiary.TileExtraBeeAlveary;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.apiculture.IHiveFrame;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class AlvearyFrame
|
||||
{
|
||||
public static int slotFrame;
|
||||
public class AlvearyFrame {
|
||||
public static int slotFrame = 0;
|
||||
|
||||
static {
|
||||
AlvearyFrame.slotFrame = 0;
|
||||
}
|
||||
|
||||
public static class PackageAlvearyFrame extends AlvearyMachine.AlvearyPackage implements IMachineInformation
|
||||
{
|
||||
public static class PackageAlvearyFrame extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public PackageAlvearyFrame() {
|
||||
super("frame", ExtraBeeTexture.AlvearyFrame.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(final Machine machine) {
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyFrame);
|
||||
final ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
inventory.addSlot(AlvearyFrame.slotFrame, "frame");
|
||||
inventory.getSlot(AlvearyFrame.slotFrame).setValidator(new SlotValidatorFrame());
|
||||
new ComponentFrameModifier(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class SlotValidatorFrame extends SlotValidator
|
||||
{
|
||||
public static class SlotValidatorFrame extends SlotValidator {
|
||||
public SlotValidatorFrame() {
|
||||
super(SlotValidator.IconFrame);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(final ItemStack itemStack) {
|
||||
return itemStack != null && itemStack.getItem() instanceof IHiveFrame;
|
||||
public boolean isValid(ItemStack itemStack) {
|
||||
return itemStack != null
|
||||
&& itemStack.getItem() instanceof IHiveFrame;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -64,52 +52,72 @@ public class AlvearyFrame
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentFrameModifier extends ComponentBeeModifier implements IBeeModifier, IBeeListener
|
||||
{
|
||||
public ComponentFrameModifier(final Machine machine) {
|
||||
public static class ComponentFrameModifier extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public ComponentFrameModifier(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wearOutEquipment(final int amount) {
|
||||
if (this.getHiveFrame() == null) {
|
||||
public void wearOutEquipment(int amount) {
|
||||
if (getHiveFrame() == null) {
|
||||
return;
|
||||
}
|
||||
final World world = this.getMachine().getTileEntity().getWorldObj();
|
||||
final int wear = Math.round(amount * 5 * Binnie.Genetics.getBeeRoot().getBeekeepingMode(world).getWearModifier());
|
||||
this.getInventory().setInventorySlotContents(AlvearyFrame.slotFrame, this.getHiveFrame().frameUsed(((TileExtraBeeAlveary) this.getMachine().getTileEntity()).getMultiblockLogic().getController(), this.getInventory().getStackInSlot(AlvearyFrame.slotFrame), (IBee) null, wear));
|
||||
|
||||
World world = getMachine().getTileEntity().getWorldObj();
|
||||
int wear = Math.round(amount * 5 * Binnie.Genetics.getBeeRoot().getBeekeepingMode(world).getWearModifier());
|
||||
getInventory().setInventorySlotContents(AlvearyFrame.slotFrame, getHiveFrame().frameUsed(((TileExtraBeeAlveary) getMachine().getTileEntity()).getMultiblockLogic().getController(), getInventory().getStackInSlot(AlvearyFrame.slotFrame), null, wear));
|
||||
}
|
||||
|
||||
public IHiveFrame getHiveFrame() {
|
||||
if (this.getInventory().getStackInSlot(AlvearyFrame.slotFrame) != null) {
|
||||
return (IHiveFrame) this.getInventory().getStackInSlot(AlvearyFrame.slotFrame).getItem();
|
||||
if (getInventory().getStackInSlot(AlvearyFrame.slotFrame) != null) {
|
||||
return (IHiveFrame) getInventory().getStackInSlot(AlvearyFrame.slotFrame).getItem();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return (this.getHiveFrame() == null) ? 1.0f : this.getHiveFrame().getBeeModifier().getTerritoryModifier(genome, currentModifier);
|
||||
public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
|
||||
IHiveFrame frame = getHiveFrame();
|
||||
if (frame == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
return frame.getBeeModifier().getTerritoryModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return (this.getHiveFrame() == null) ? 1.0f : this.getHiveFrame().getBeeModifier().getMutationModifier(genome, mate, currentModifier);
|
||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
IHiveFrame frame = getHiveFrame();
|
||||
if (frame == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
return frame.getBeeModifier().getMutationModifier(genome, mate, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return (this.getHiveFrame() == null) ? 1.0f : this.getHiveFrame().getBeeModifier().getLifespanModifier(genome, mate, currentModifier);
|
||||
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
IHiveFrame frame = getHiveFrame();
|
||||
if (getHiveFrame() == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
return frame.getBeeModifier().getLifespanModifier(genome, mate, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return (this.getHiveFrame() == null) ? 1.0f : this.getHiveFrame().getBeeModifier().getProductionModifier(genome, currentModifier);
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
IHiveFrame frame = getHiveFrame();
|
||||
if (frame == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
return frame.getBeeModifier().getProductionModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return (this.getHiveFrame() == null) ? 1.0f : this.getHiveFrame().getBeeModifier().getFloweringModifier(genome, currentModifier);
|
||||
public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
|
||||
IHiveFrame frame = getHiveFrame();
|
||||
if (frame == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
return frame.getBeeModifier().getFloweringModifier(genome, currentModifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,65 +1,54 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.InventorySlot;
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
import binnie.core.machines.transfer.TransferRequest;
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.extrabees.apiary.ComponentExtraBeeGUI;
|
||||
import binnie.extrabees.apiary.TileExtraBeeAlveary;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.apiculture.IBeeRoot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class AlvearyHatchery
|
||||
{
|
||||
public static int[] slotLarvae;
|
||||
import java.util.Random;
|
||||
|
||||
static {
|
||||
AlvearyHatchery.slotLarvae = new int[] { 0, 1, 2, 3, 4 };
|
||||
}
|
||||
public class AlvearyHatchery {
|
||||
public static int[] slotLarvae = new int[]{0, 1, 2, 3, 4};
|
||||
|
||||
public static class PackageAlvearyHatchery extends AlvearyMachine.AlvearyPackage implements IMachineInformation
|
||||
{
|
||||
public static class PackageAlvearyHatchery extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public PackageAlvearyHatchery() {
|
||||
super("hatchery", ExtraBeeTexture.AlvearyHatchery.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(final Machine machine) {
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyHatchery);
|
||||
final ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
for (final InventorySlot slot : inventory.addSlotArray(AlvearyHatchery.slotLarvae, "hatchery")) {
|
||||
ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
for (InventorySlot slot : inventory.addSlotArray(AlvearyHatchery.slotLarvae, "hatchery")) {
|
||||
slot.setValidator(new SlotValidatorLarvae());
|
||||
}
|
||||
new ComponentFrameModifier(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class SlotValidatorLarvae extends SlotValidator
|
||||
{
|
||||
public static class SlotValidatorLarvae extends SlotValidator {
|
||||
public SlotValidatorLarvae() {
|
||||
super(SlotValidator.IconBee);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(final ItemStack itemStack) {
|
||||
public boolean isValid(ItemStack itemStack) {
|
||||
return Binnie.Genetics.getBeeRoot().isMember(itemStack) && Binnie.Genetics.getBeeRoot().getType(itemStack) == EnumBeeType.LARVAE;
|
||||
}
|
||||
|
||||
@@ -69,28 +58,36 @@ public class AlvearyHatchery
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentFrameModifier extends ComponentBeeModifier implements IBeeModifier, IBeeListener
|
||||
{
|
||||
public ComponentFrameModifier(final Machine machine) {
|
||||
public static class ComponentFrameModifier extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public ComponentFrameModifier(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
if (new Random().nextInt(2400) == 0) {
|
||||
final TileEntity tile = this.getMachine().getTileEntity();
|
||||
if (tile instanceof TileExtraBeeAlveary) {
|
||||
final IBeeHousing house = ((TileExtraBeeAlveary) tile).getMultiblockLogic().getController();
|
||||
if (house != null && !house.getErrorLogic().hasErrors()) {
|
||||
final ItemStack queenStack = house.getBeeInventory().getQueen();
|
||||
final IBee queen = (queenStack == null) ? null : Binnie.Genetics.getBeeRoot().getMember(queenStack);
|
||||
if (queen != null) {
|
||||
final ItemStack larvae = Binnie.Genetics.getBeeRoot().getMemberStack(Binnie.Genetics.getBeeRoot().getBee(this.getMachine().getWorld(), queen.getGenome()), EnumBeeType.LARVAE.ordinal());
|
||||
new TransferRequest(larvae, this.getInventory()).transfer(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (new Random().nextInt(2400) != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
TileEntity tile = getMachine().getTileEntity();
|
||||
if (!(tile instanceof TileExtraBeeAlveary)) {
|
||||
return;
|
||||
}
|
||||
|
||||
IBeeHousing house = ((TileExtraBeeAlveary) tile).getMultiblockLogic().getController();
|
||||
if (house == null || house.getErrorLogic().hasErrors()) {
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack queenStack = house.getBeeInventory().getQueen();
|
||||
IBee queen = (queenStack == null) ? null : Binnie.Genetics.getBeeRoot().getMember(queenStack);
|
||||
if (queen == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
IBeeRoot beeRoot = Binnie.Genetics.getBeeRoot();
|
||||
ItemStack larvae = beeRoot.getMemberStack(beeRoot.getBee(getMachine().getWorld(), queen.getGenome()), EnumBeeType.LARVAE.ordinal());
|
||||
new TransferRequest(larvae, getInventory()).transfer(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,33 +1,26 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
|
||||
public class AlvearyLighting
|
||||
{
|
||||
public static class PackageAlvearyLighting extends AlvearyMachine.AlvearyPackage implements IMachineInformation
|
||||
{
|
||||
public class AlvearyLighting {
|
||||
public static class PackageAlvearyLighting extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public PackageAlvearyLighting() {
|
||||
super("lighting", ExtraBeeTexture.AlvearyLighting.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(final Machine machine) {
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentLighting(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentLighting extends ComponentBeeModifier implements IBeeModifier, IBeeListener
|
||||
{
|
||||
public ComponentLighting(final Machine machine) {
|
||||
public static class ComponentLighting extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public ComponentLighting(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,22 +1,17 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
import binnie.core.machines.MachineRendererBlock;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import binnie.extrabees.apiary.TileExtraBeeAlveary;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import binnie.core.machines.IMachineType;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.MachinePackage;
|
||||
import binnie.core.machines.MachineRendererBlock;
|
||||
import binnie.core.resource.BinnieResource;
|
||||
import binnie.extrabees.apiary.ModuleApiary;
|
||||
import binnie.extrabees.apiary.TileExtraBeeAlveary;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import binnie.core.machines.MachinePackage;
|
||||
import binnie.core.machines.IMachineType;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public enum AlvearyMachine implements IMachineType
|
||||
{
|
||||
public enum AlvearyMachine implements IMachineType {
|
||||
Mutator(AlvearyMutator.PackageAlvearyMutator.class),
|
||||
Frame(AlvearyFrame.PackageAlvearyFrame.class),
|
||||
RainShield(AlvearyRainShield.PackageAlvearyRainShield.class),
|
||||
@@ -25,19 +20,19 @@ public enum AlvearyMachine implements IMachineType
|
||||
Hatchery(AlvearyHatchery.PackageAlvearyHatchery.class),
|
||||
Transmission(AlvearyTransmission.PackageAlvearyTransmission.class);
|
||||
|
||||
Class<? extends MachinePackage> clss;
|
||||
protected Class<? extends MachinePackage> cls;
|
||||
|
||||
private AlvearyMachine(final Class<? extends MachinePackage> clss) {
|
||||
this.clss = clss;
|
||||
AlvearyMachine(Class<? extends MachinePackage> cls) {
|
||||
this.cls = cls;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Class<? extends MachinePackage> getPackageClass() {
|
||||
return this.clss;
|
||||
return cls;
|
||||
}
|
||||
|
||||
public ItemStack get(final int size) {
|
||||
return new ItemStack(ModuleApiary.blockComponent, size, this.ordinal());
|
||||
public ItemStack get(int size) {
|
||||
return new ItemStack(ModuleApiary.blockComponent, size, ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -45,17 +40,17 @@ public enum AlvearyMachine implements IMachineType
|
||||
return true;
|
||||
}
|
||||
|
||||
public abstract static class AlvearyPackage extends MachinePackage
|
||||
{
|
||||
BinnieResource machineTexture;
|
||||
public abstract static class AlvearyPackage extends MachinePackage {
|
||||
protected BinnieResource machineTexture;
|
||||
|
||||
public AlvearyPackage(final String id, final BinnieResource machineTexture, final boolean powered) {
|
||||
public AlvearyPackage(String id, BinnieResource machineTexture, boolean powered) {
|
||||
super(id, powered);
|
||||
this.machineTexture = machineTexture;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(final Machine machine) {
|
||||
public void createMachine(Machine machine) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -64,8 +59,8 @@ public enum AlvearyMachine implements IMachineType
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderMachine(final Machine machine, final double x, final double y, final double z, final float partialTick, final RenderBlocks renderer) {
|
||||
MachineRendererBlock.instance.renderMachine(this.machineTexture, x, y, z, partialTick);
|
||||
public void renderMachine(Machine machine, double x, double y, double z, float partialTick, RenderBlocks renderer) {
|
||||
MachineRendererBlock.instance.renderMachine(machineTexture, x, y, z, partialTick);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,44 +1,45 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
import binnie.core.machines.inventory.ValidatorIcon;
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.extrabees.apiary.ComponentExtraBeeGUI;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class AlvearyMutator
|
||||
{
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class AlvearyMutator {
|
||||
public static int slotMutator;
|
||||
static Map<ItemStack, Float> mutations;
|
||||
|
||||
public static boolean isMutationItem(final ItemStack item) {
|
||||
protected static Map<ItemStack, Float> mutations;
|
||||
|
||||
static {
|
||||
AlvearyMutator.slotMutator = 0;
|
||||
AlvearyMutator.mutations = new HashMap<>();
|
||||
}
|
||||
|
||||
public static boolean isMutationItem(ItemStack item) {
|
||||
return getMutationMult(item) > 0.0f;
|
||||
}
|
||||
|
||||
public static float getMutationMult(final ItemStack item) {
|
||||
public static float getMutationMult(ItemStack item) {
|
||||
if (item == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
for (final ItemStack comp : AlvearyMutator.mutations.keySet()) {
|
||||
|
||||
for (ItemStack comp : AlvearyMutator.mutations.keySet()) {
|
||||
if (ItemStack.areItemStackTagsEqual(item, comp) && item.isItemEqual(comp)) {
|
||||
return AlvearyMutator.mutations.get(comp);
|
||||
}
|
||||
@@ -46,7 +47,7 @@ public class AlvearyMutator
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
public static void addMutationItem(final ItemStack item, final float chance) {
|
||||
public static void addMutationItem(ItemStack item, float chance) {
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
@@ -57,35 +58,28 @@ public class AlvearyMutator
|
||||
return AlvearyMutator.mutations.keySet();
|
||||
}
|
||||
|
||||
static {
|
||||
AlvearyMutator.slotMutator = 0;
|
||||
AlvearyMutator.mutations = new HashMap<ItemStack, Float>();
|
||||
}
|
||||
|
||||
public static class PackageAlvearyMutator extends AlvearyMachine.AlvearyPackage implements IMachineInformation
|
||||
{
|
||||
public static class PackageAlvearyMutator extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public PackageAlvearyMutator() {
|
||||
super("mutator", ExtraBeeTexture.AlvearyMutator.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(final Machine machine) {
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyMutator);
|
||||
final ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
inventory.addSlot(AlvearyMutator.slotMutator, "mutator");
|
||||
inventory.getSlot(AlvearyMutator.slotMutator).setValidator(new SlotValidatorMutator());
|
||||
new ComponentMutatorModifier(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class SlotValidatorMutator extends SlotValidator
|
||||
{
|
||||
public static class SlotValidatorMutator extends SlotValidator {
|
||||
public SlotValidatorMutator() {
|
||||
super(new ValidatorIcon(ExtraBees.instance, "validator/mutator.0", "validator/mutator.1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(final ItemStack itemStack) {
|
||||
public boolean isValid(ItemStack itemStack) {
|
||||
return AlvearyMutator.isMutationItem(itemStack);
|
||||
}
|
||||
|
||||
@@ -95,24 +89,24 @@ public class AlvearyMutator
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentMutatorModifier extends ComponentBeeModifier implements IBeeModifier, IBeeListener
|
||||
{
|
||||
public ComponentMutatorModifier(final Machine machine) {
|
||||
public static class ComponentMutatorModifier extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public ComponentMutatorModifier(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
if (this.getUtil().isSlotEmpty(AlvearyMutator.slotMutator)) {
|
||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
if (getUtil().isSlotEmpty(AlvearyMutator.slotMutator)) {
|
||||
return 1.0f;
|
||||
}
|
||||
final float mult = AlvearyMutator.getMutationMult(this.getUtil().getStack(AlvearyMutator.slotMutator));
|
||||
|
||||
float mult = AlvearyMutator.getMutationMult(getUtil().getStack(AlvearyMutator.slotMutator));
|
||||
return Math.min(mult, 15.0f / currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostQueenDeath(final IBee queen) {
|
||||
this.getUtil().decreaseStack(AlvearyMutator.slotMutator, 1);
|
||||
public void onPostQueenDeath(IBee queen) {
|
||||
getUtil().decreaseStack(AlvearyMutator.slotMutator, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,33 +1,26 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
|
||||
public class AlvearyRainShield
|
||||
{
|
||||
public static class PackageAlvearyRainShield extends AlvearyMachine.AlvearyPackage implements IMachineInformation
|
||||
{
|
||||
public class AlvearyRainShield {
|
||||
public static class PackageAlvearyRainShield extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public PackageAlvearyRainShield() {
|
||||
super("rainShield", ExtraBeeTexture.AlvearyRainShield.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(final Machine machine) {
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentRainShield(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentRainShield extends ComponentBeeModifier implements IBeeModifier, IBeeListener
|
||||
{
|
||||
public ComponentRainShield(final Machine machine) {
|
||||
public static class ComponentRainShield extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public ComponentRainShield(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,23 +1,8 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.circuits.ChipsetManager;
|
||||
import forestry.api.circuits.ICircuit;
|
||||
import forestry.api.circuits.ICircuitBoard;
|
||||
import forestry.api.circuits.ICircuitLayout;
|
||||
import binnie.core.Mods;
|
||||
import binnie.core.circuits.BinnieCircuit;
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.genetics.BeeModifierLogic;
|
||||
import binnie.core.genetics.EnumBeeBooleanModifier;
|
||||
import binnie.core.genetics.EnumBeeModifier;
|
||||
@@ -25,296 +10,26 @@ import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
import binnie.core.machines.power.ComponentPowerReceptor;
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.extrabees.apiary.ComponentExtraBeeGUI;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.circuits.ChipsetManager;
|
||||
import forestry.api.circuits.ICircuit;
|
||||
import forestry.api.circuits.ICircuitBoard;
|
||||
import forestry.api.circuits.ICircuitLayout;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class AlvearyStimulator
|
||||
{
|
||||
public static int slotCircuit;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
static {
|
||||
AlvearyStimulator.slotCircuit = 0;
|
||||
}
|
||||
public class AlvearyStimulator {
|
||||
public static int slotCircuit = 0;
|
||||
|
||||
public static class PackageAlvearyStimulator extends AlvearyMachine.AlvearyPackage implements IMachineInformation
|
||||
{
|
||||
public PackageAlvearyStimulator() {
|
||||
super("stimulator", ExtraBeeTexture.AlvearyStimulator.getTexture(), true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(final Machine machine) {
|
||||
new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyStimulator);
|
||||
final ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
inventory.addSlot(AlvearyStimulator.slotCircuit, "circuit");
|
||||
inventory.getSlot(AlvearyStimulator.slotCircuit).setValidator(new SlotValidatorCircuit());
|
||||
final ComponentPowerReceptor power = new ComponentPowerReceptor(machine);
|
||||
new ComponentStimulatorModifier(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class SlotValidatorCircuit extends SlotValidator
|
||||
{
|
||||
public SlotValidatorCircuit() {
|
||||
super(SlotValidator.IconCircuit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(final ItemStack itemStack) {
|
||||
return itemStack != null && ChipsetManager.circuitRegistry.isChipset(itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return "Forestry Circuits";
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentStimulatorModifier extends ComponentBeeModifier implements IBeeModifier, IBeeListener
|
||||
{
|
||||
float powerUsage;
|
||||
boolean powered;
|
||||
StimulatorCircuit[] modifiers;
|
||||
|
||||
public ComponentStimulatorModifier(final Machine machine) {
|
||||
super(machine);
|
||||
this.powerUsage = 0.0f;
|
||||
this.powered = false;
|
||||
this.modifiers = new StimulatorCircuit[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
this.modifiers = this.getCircuits();
|
||||
this.powerUsage = 0.0f;
|
||||
for (final StimulatorCircuit beeMod : this.modifiers) {
|
||||
this.powerUsage += beeMod.getPowerUsage();
|
||||
}
|
||||
this.powered = this.getUtil().hasEnergyMJ(this.powerUsage);
|
||||
}
|
||||
|
||||
public ICircuitBoard getHiveFrame() {
|
||||
if (!this.getUtil().isSlotEmpty(AlvearyStimulator.slotCircuit)) {
|
||||
return ChipsetManager.circuitRegistry.getCircuitboard(this.getUtil().getStack(AlvearyStimulator.slotCircuit));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public StimulatorCircuit[] getCircuits() {
|
||||
final ICircuitBoard board = this.getHiveFrame();
|
||||
if (board == null) {
|
||||
return new StimulatorCircuit[0];
|
||||
}
|
||||
final ICircuit[] circuits = board.getCircuits();
|
||||
final List<IBeeModifier> mod = new ArrayList<IBeeModifier>();
|
||||
for (final ICircuit circuit : circuits) {
|
||||
if (circuit instanceof StimulatorCircuit) {
|
||||
mod.add((IBeeModifier) circuit);
|
||||
}
|
||||
}
|
||||
return mod.toArray(new StimulatorCircuit[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
float mod = 1.0f;
|
||||
if (!this.powered) {
|
||||
return mod;
|
||||
}
|
||||
for (final IBeeModifier beeMod : this.modifiers) {
|
||||
mod *= beeMod.getTerritoryModifier(genome, mod);
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
float mod = 1.0f;
|
||||
if (!this.powered) {
|
||||
return mod;
|
||||
}
|
||||
for (final IBeeModifier beeMod : this.modifiers) {
|
||||
mod *= beeMod.getMutationModifier(genome, mate, mod);
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
float mod = 1.0f;
|
||||
if (!this.powered) {
|
||||
return mod;
|
||||
}
|
||||
for (final IBeeModifier beeMod : this.modifiers) {
|
||||
mod *= beeMod.getLifespanModifier(genome, mate, mod);
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
float mod = 1.0f;
|
||||
if (!this.powered) {
|
||||
return mod;
|
||||
}
|
||||
for (final IBeeModifier beeMod : this.modifiers) {
|
||||
mod *= beeMod.getProductionModifier(genome, mod);
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
float mod = 1.0f;
|
||||
if (!this.powered) {
|
||||
return mod;
|
||||
}
|
||||
for (final IBeeModifier beeMod : this.modifiers) {
|
||||
mod *= beeMod.getFloweringModifier(genome, mod);
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(final IBeeGenome genome, final float currentModifier) {
|
||||
float mod = 1.0f;
|
||||
if (!this.powered) {
|
||||
return mod;
|
||||
}
|
||||
for (final IBeeModifier beeMod : this.modifiers) {
|
||||
mod *= beeMod.getGeneticDecay(genome, mod);
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
if (!this.powered) {
|
||||
return false;
|
||||
}
|
||||
for (final IBeeModifier beeMod : this.modifiers) {
|
||||
if (beeMod.isSealed()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
if (!this.powered) {
|
||||
return false;
|
||||
}
|
||||
for (final IBeeModifier beeMod : this.modifiers) {
|
||||
if (beeMod.isSelfLighted()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
if (!this.powered) {
|
||||
return false;
|
||||
}
|
||||
for (final IBeeModifier beeMod : this.modifiers) {
|
||||
if (beeMod.isSunlightSimulated()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish() {
|
||||
if (!this.powered) {
|
||||
return false;
|
||||
}
|
||||
for (final IBeeModifier beeMod : this.modifiers) {
|
||||
if (beeMod.isHellish()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wearOutEquipment(final int amount) {
|
||||
this.getUtil().useEnergyMJ(this.powerUsage);
|
||||
}
|
||||
}
|
||||
|
||||
public static class StimulatorCircuit extends BinnieCircuit implements IBeeModifier
|
||||
{
|
||||
CircuitType type;
|
||||
|
||||
public StimulatorCircuit(final CircuitType type, final ICircuitLayout layout) {
|
||||
super("stimulator." + type.toString().toLowerCase(), 4, layout, Mods.Forestry.item("thermionicTubes"), type.recipe);
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getPowerUsage() {
|
||||
return this.type.power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.type.getTerritoryModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return this.type.getMutationModifier(genome, mate, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return this.type.getLifespanModifier(genome, mate, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.type.getProductionModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.type.getFloweringModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return this.type.isSealed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return this.type.isSelfLighted();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
return this.type.isSunlightSimulated();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish() {
|
||||
return this.type.isHellish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.type.getGeneticDecay(genome, currentModifier);
|
||||
}
|
||||
}
|
||||
|
||||
public enum CircuitType implements IBeeModifier
|
||||
{
|
||||
public enum CircuitType implements IBeeModifier {
|
||||
LowVoltage(3, 10),
|
||||
HighVoltage(5, 20),
|
||||
Plant(10, 10),
|
||||
@@ -325,83 +40,6 @@ public class AlvearyStimulator
|
||||
Inhibitor(1, 10),
|
||||
Territory(2, 10);
|
||||
|
||||
public int recipe;
|
||||
public int power;
|
||||
BeeModifierLogic logic;
|
||||
|
||||
private CircuitType(final int recipe, final int power) {
|
||||
this.logic = new BeeModifierLogic();
|
||||
this.recipe = recipe;
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
public void createCircuit(final ICircuitLayout layout) {
|
||||
final StimulatorCircuit circuit = new StimulatorCircuit(this, layout);
|
||||
for (final EnumBeeModifier modifier : EnumBeeModifier.values()) {
|
||||
final float mod = this.logic.getModifier(modifier, 1.0f);
|
||||
if (mod != 1.0f) {
|
||||
if (mod > 1.0f) {
|
||||
final int increase = (int) ((mod - 1.0f) * 100.0f);
|
||||
circuit.addTooltipString("Increases " + modifier.getName() + " by " + increase + "%");
|
||||
}
|
||||
else {
|
||||
final int decrease = (int) ((1.0f - mod) * 100.0f);
|
||||
circuit.addTooltipString("Decreases " + modifier.getName() + " by " + decrease + "%");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.logic.getModifier(EnumBeeModifier.Territory, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return this.logic.getModifier(EnumBeeModifier.Mutation, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(final IBeeGenome genome, final IBeeGenome mate, final float currentModifier) {
|
||||
return this.logic.getModifier(EnumBeeModifier.Lifespan, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.logic.getModifier(EnumBeeModifier.Production, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.logic.getModifier(EnumBeeModifier.Flowering, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(final IBeeGenome genome, final float currentModifier) {
|
||||
return this.logic.getModifier(EnumBeeModifier.GeneticDecay, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return this.logic.getModifier(EnumBeeBooleanModifier.Sealed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return this.logic.getModifier(EnumBeeBooleanModifier.SelfLighted);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
return this.logic.getModifier(EnumBeeBooleanModifier.SunlightStimulated);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish() {
|
||||
return this.logic.getModifier(EnumBeeBooleanModifier.Hellish);
|
||||
}
|
||||
|
||||
static {
|
||||
CircuitType.LowVoltage.logic.setModifier(EnumBeeModifier.Production, 1.5f, 5.0f);
|
||||
CircuitType.HighVoltage.logic.setModifier(EnumBeeModifier.Production, 2.5f, 10.0f);
|
||||
@@ -413,9 +51,369 @@ public class AlvearyStimulator
|
||||
CircuitType.Inhibitor.logic.setModifier(EnumBeeModifier.Territory, 0.4f, 0.1f);
|
||||
CircuitType.Inhibitor.logic.setModifier(EnumBeeModifier.Production, 0.9f, 0.5f);
|
||||
CircuitType.Territory.logic.setModifier(EnumBeeModifier.Territory, 1.5f, 5.0f);
|
||||
for (final CircuitType type : values()) {
|
||||
for (CircuitType type : values()) {
|
||||
type.logic.setModifier(EnumBeeModifier.GeneticDecay, 1.5f, 10.0f);
|
||||
}
|
||||
}
|
||||
|
||||
public int recipe;
|
||||
public int power;
|
||||
|
||||
protected BeeModifierLogic logic;
|
||||
|
||||
CircuitType(int recipe, int power) {
|
||||
logic = new BeeModifierLogic();
|
||||
this.recipe = recipe;
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
public void createCircuit(ICircuitLayout layout) {
|
||||
StimulatorCircuit circuit = new StimulatorCircuit(this, layout);
|
||||
for (EnumBeeModifier modifier : EnumBeeModifier.values()) {
|
||||
float mod = logic.getModifier(modifier, 1.0f);
|
||||
if (mod == 1.0f) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (mod > 1.0f) {
|
||||
int increase = (int) ((mod - 1.0f) * 100.0f);
|
||||
circuit.addTooltipString("Increases " + modifier.getName() + " by " + increase + "%");
|
||||
} else {
|
||||
int decrease = (int) ((1.0f - mod) * 100.0f);
|
||||
circuit.addTooltipString("Decreases " + modifier.getName() + " by " + decrease + "%");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.Territory, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.Mutation, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.Lifespan, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.Production, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.Flowering, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(IBeeGenome genome, float currentModifier) {
|
||||
return logic.getModifier(EnumBeeModifier.GeneticDecay, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return logic.getModifier(EnumBeeBooleanModifier.Sealed);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return logic.getModifier(EnumBeeBooleanModifier.SelfLighted);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
return logic.getModifier(EnumBeeBooleanModifier.SunlightStimulated);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish() {
|
||||
return logic.getModifier(EnumBeeBooleanModifier.Hellish);
|
||||
}
|
||||
}
|
||||
|
||||
public static class PackageAlvearyStimulator extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public PackageAlvearyStimulator() {
|
||||
super("stimulator", ExtraBeeTexture.AlvearyStimulator.getTexture(), true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyStimulator);
|
||||
ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
inventory.addSlot(AlvearyStimulator.slotCircuit, "circuit");
|
||||
inventory.getSlot(AlvearyStimulator.slotCircuit).setValidator(new SlotValidatorCircuit());
|
||||
ComponentPowerReceptor power = new ComponentPowerReceptor(machine);
|
||||
new ComponentStimulatorModifier(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class SlotValidatorCircuit extends SlotValidator {
|
||||
public SlotValidatorCircuit() {
|
||||
super(SlotValidator.IconCircuit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(ItemStack itemStack) {
|
||||
return itemStack != null && ChipsetManager.circuitRegistry.isChipset(itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return "Forestry Circuits";
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentStimulatorModifier extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
protected float powerUsage;
|
||||
protected boolean powered;
|
||||
protected StimulatorCircuit[] modifiers;
|
||||
|
||||
public ComponentStimulatorModifier(Machine machine) {
|
||||
super(machine);
|
||||
powerUsage = 0.0f;
|
||||
powered = false;
|
||||
modifiers = new StimulatorCircuit[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
modifiers = getCircuits();
|
||||
powerUsage = 0.0f;
|
||||
for (StimulatorCircuit beeMod : modifiers) {
|
||||
powerUsage += beeMod.getPowerUsage();
|
||||
}
|
||||
powered = getUtil().hasEnergyMJ(powerUsage);
|
||||
}
|
||||
|
||||
public ICircuitBoard getHiveFrame() {
|
||||
if (!getUtil().isSlotEmpty(AlvearyStimulator.slotCircuit)) {
|
||||
return ChipsetManager.circuitRegistry.getCircuitboard(getUtil().getStack(AlvearyStimulator.slotCircuit));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public StimulatorCircuit[] getCircuits() {
|
||||
ICircuitBoard board = getHiveFrame();
|
||||
if (board == null) {
|
||||
return new StimulatorCircuit[0];
|
||||
}
|
||||
|
||||
ICircuit[] circuits = board.getCircuits();
|
||||
List<IBeeModifier> mod = new ArrayList<>();
|
||||
for (ICircuit circuit : circuits) {
|
||||
if (circuit instanceof StimulatorCircuit) {
|
||||
mod.add((IBeeModifier) circuit);
|
||||
}
|
||||
}
|
||||
return mod.toArray(new StimulatorCircuit[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
|
||||
float mod = 1.0f;
|
||||
if (!powered) {
|
||||
return mod;
|
||||
}
|
||||
|
||||
for (IBeeModifier beeMod : modifiers) {
|
||||
mod *= beeMod.getTerritoryModifier(genome, mod);
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
float mod = 1.0f;
|
||||
if (!powered) {
|
||||
return mod;
|
||||
}
|
||||
|
||||
for (IBeeModifier beeMod : modifiers) {
|
||||
mod *= beeMod.getMutationModifier(genome, mate, mod);
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
float mod = 1.0f;
|
||||
if (!powered) {
|
||||
return mod;
|
||||
}
|
||||
|
||||
for (IBeeModifier beeMod : modifiers) {
|
||||
mod *= beeMod.getLifespanModifier(genome, mate, mod);
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
float mod = 1.0f;
|
||||
if (!powered) {
|
||||
return mod;
|
||||
}
|
||||
|
||||
for (IBeeModifier beeMod : modifiers) {
|
||||
mod *= beeMod.getProductionModifier(genome, mod);
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
|
||||
float mod = 1.0f;
|
||||
if (!powered) {
|
||||
return mod;
|
||||
}
|
||||
|
||||
for (IBeeModifier beeMod : modifiers) {
|
||||
mod *= beeMod.getFloweringModifier(genome, mod);
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(IBeeGenome genome, float currentModifier) {
|
||||
float mod = 1.0f;
|
||||
if (!powered) {
|
||||
return mod;
|
||||
}
|
||||
|
||||
for (IBeeModifier beeMod : modifiers) {
|
||||
mod *= beeMod.getGeneticDecay(genome, mod);
|
||||
}
|
||||
return mod;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
if (!powered) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (IBeeModifier beeMod : modifiers) {
|
||||
if (beeMod.isSealed()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
if (!powered) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (IBeeModifier beeMod : modifiers) {
|
||||
if (beeMod.isSelfLighted()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
if (!powered) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (IBeeModifier beeMod : modifiers) {
|
||||
if (beeMod.isSunlightSimulated()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish() {
|
||||
if (!powered) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (IBeeModifier beeMod : modifiers) {
|
||||
if (beeMod.isHellish()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wearOutEquipment(int amount) {
|
||||
getUtil().useEnergyMJ(powerUsage);
|
||||
}
|
||||
}
|
||||
|
||||
public static class StimulatorCircuit extends BinnieCircuit implements IBeeModifier {
|
||||
protected CircuitType type;
|
||||
|
||||
public StimulatorCircuit(CircuitType type, ICircuitLayout layout) {
|
||||
super("stimulator." + type.toString().toLowerCase(), 4, layout, Mods.Forestry.item("thermionicTubes"), type.recipe);
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public int getPowerUsage() {
|
||||
return type.power;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getTerritoryModifier(IBeeGenome genome, float currentModifier) {
|
||||
return type.getTerritoryModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return type.getMutationModifier(genome, mate, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getLifespanModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
return type.getLifespanModifier(genome, mate, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getProductionModifier(IBeeGenome genome, float currentModifier) {
|
||||
return type.getProductionModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
|
||||
return type.getFloweringModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return type.isSealed();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return type.isSelfLighted();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
return type.isSunlightSimulated();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish() {
|
||||
return type.isHellish();
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGeneticDecay(IBeeGenome genome, float currentModifier) {
|
||||
return type.getGeneticDecay(genome, currentModifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,77 +1,70 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.power.ComponentPowerReceptor;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.extrabees.apiary.TileExtraBeeAlveary;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import cofh.api.energy.IEnergyHandler;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cofh.api.energy.IEnergyHandler;
|
||||
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.power.ComponentPowerReceptor;
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.extrabees.apiary.TileExtraBeeAlveary;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
|
||||
public class AlvearyTransmission
|
||||
{
|
||||
public static class PackageAlvearyTransmission extends AlvearyMachine.AlvearyPackage implements IMachineInformation
|
||||
{
|
||||
public class AlvearyTransmission {
|
||||
public static class PackageAlvearyTransmission extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public PackageAlvearyTransmission() {
|
||||
super("transmission", ExtraBeeTexture.AlvearyTransmission.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(final Machine machine) {
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentPowerReceptor(machine, 1000);
|
||||
new ComponentTransmission(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentTransmission extends ComponentBeeModifier implements IBeeModifier, IBeeListener
|
||||
{
|
||||
public ComponentTransmission(final Machine machine) {
|
||||
public static class ComponentTransmission extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public ComponentTransmission(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
int energy = this.getUtil().getPoweredMachine().getEnergyStored(ForgeDirection.NORTH);
|
||||
int energy = getUtil().getPoweredMachine().getEnergyStored(ForgeDirection.NORTH);
|
||||
if (energy == 0) {
|
||||
return;
|
||||
}
|
||||
final TileExtraBeeAlveary tile = (TileExtraBeeAlveary) this.getMachine().getTileEntity();
|
||||
final List<IEnergyHandler> handlers = new ArrayList<IEnergyHandler>();
|
||||
for (final TileEntity alvearyTile : tile.getAlvearyBlocks()) {
|
||||
|
||||
TileExtraBeeAlveary tile = (TileExtraBeeAlveary) getMachine().getTileEntity();
|
||||
List<IEnergyHandler> handlers = new ArrayList<IEnergyHandler>();
|
||||
for (TileEntity alvearyTile : tile.getAlvearyBlocks()) {
|
||||
if (alvearyTile instanceof IEnergyHandler && alvearyTile != tile) {
|
||||
handlers.add((IEnergyHandler) alvearyTile);
|
||||
}
|
||||
}
|
||||
|
||||
if (handlers.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
final int maxOutput = 500;
|
||||
|
||||
int maxOutput = 500;
|
||||
int output = energy / handlers.size();
|
||||
if (output > maxOutput) {
|
||||
output = maxOutput;
|
||||
}
|
||||
if (output < 1) {
|
||||
} else if (output < 1) {
|
||||
output = 1;
|
||||
}
|
||||
for (final IEnergyHandler handler : handlers) {
|
||||
final int recieved = handler.receiveEnergy(ForgeDirection.NORTH, output, false);
|
||||
this.getUtil().getPoweredMachine().receiveEnergy(ForgeDirection.NORTH, -recieved, false);
|
||||
energy = this.getUtil().getPoweredMachine().getEnergyStored(ForgeDirection.NORTH);
|
||||
|
||||
for (IEnergyHandler handler : handlers) {
|
||||
int recieved = handler.receiveEnergy(ForgeDirection.NORTH, output, false);
|
||||
getUtil().getPoweredMachine().receiveEnergy(ForgeDirection.NORTH, -recieved, false);
|
||||
energy = getUtil().getPoweredMachine().getEnergyStored(ForgeDirection.NORTH);
|
||||
if (energy <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1,26 +1,26 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.config;
|
||||
|
||||
import binnie.core.mod.config.ConfigFile;
|
||||
import binnie.core.mod.config.ConfigProperty;
|
||||
import binnie.core.mod.config.PropDouble;
|
||||
import binnie.core.mod.config.PropPercentage;
|
||||
import binnie.core.mod.config.ConfigProperty;
|
||||
import binnie.core.mod.config.ConfigFile;
|
||||
|
||||
@ConfigFile(filename = "/config/forestry/extrabees/machines.conf")
|
||||
public class ConfigurationMachines
|
||||
{
|
||||
@ConfigProperty(key = "isolatorConsumptionChance", comment = { "Percentage chance of Isolator consuming bee, in x%." })
|
||||
public class ConfigurationMachines {
|
||||
@ConfigProperty(
|
||||
key = "isolatorConsumptionChance",
|
||||
comment = {"Percentage chance of Isolator consuming bee, in x%."}
|
||||
)
|
||||
@PropPercentage
|
||||
public static int isolatorConsumptionChance;
|
||||
@ConfigProperty(key = "geneticErrorModifier", comment = { "Modifier that changes how severe splicer/inoculator erros are.", "0 would result in no errors, even for awful serums.", "2.0 would result in twice as severe errors" })
|
||||
@PropDouble
|
||||
public static double geneticErrorModifier;
|
||||
public static int isolatorConsumptionChance = 30;
|
||||
|
||||
static {
|
||||
ConfigurationMachines.isolatorConsumptionChance = 30;
|
||||
ConfigurationMachines.geneticErrorModifier = 1.0;
|
||||
}
|
||||
@ConfigProperty(
|
||||
key = "geneticErrorModifier",
|
||||
comment = {
|
||||
"Modifier that changes how severe splicer/inoculator erros are.",
|
||||
"0 would result in no errors, even for awful serums.",
|
||||
"2.0 would result in twice as severe errors"
|
||||
})
|
||||
@PropDouble
|
||||
public static double geneticErrorModifier = 1.0;
|
||||
}
|
||||
@@ -1,38 +1,29 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.config;
|
||||
|
||||
import binnie.core.mod.config.PropInteger;
|
||||
import binnie.core.mod.config.PropBoolean;
|
||||
import binnie.core.mod.config.ConfigProperty;
|
||||
import binnie.core.mod.config.ConfigFile;
|
||||
import binnie.core.mod.config.ConfigProperty;
|
||||
import binnie.core.mod.config.PropBoolean;
|
||||
import binnie.core.mod.config.PropInteger;
|
||||
|
||||
@ConfigFile(filename = "/config/forestry/extrabees/main.conf")
|
||||
public class ConfigurationMain
|
||||
{
|
||||
public class ConfigurationMain {
|
||||
@ConfigProperty(key = "canQuarryMineHives")
|
||||
@PropBoolean
|
||||
public static boolean canQuarryMineHives;
|
||||
public static boolean canQuarryMineHives = true;
|
||||
|
||||
@ConfigProperty(key = "waterHiveRate")
|
||||
@PropInteger
|
||||
public static int waterHiveRate;
|
||||
public static int waterHiveRate = 1;
|
||||
|
||||
@ConfigProperty(key = "rockHiveRate")
|
||||
@PropInteger
|
||||
public static int rockHiveRate;
|
||||
public static int rockHiveRate = 2;
|
||||
|
||||
@ConfigProperty(key = "netherHiveRate")
|
||||
@PropInteger
|
||||
public static int netherHiveRate;
|
||||
public static int netherHiveRate = 2;
|
||||
|
||||
@ConfigProperty(key = "marbleHiveRate")
|
||||
@PropInteger
|
||||
public static int marbleHiveRate;
|
||||
|
||||
static {
|
||||
ConfigurationMain.canQuarryMineHives = true;
|
||||
ConfigurationMain.waterHiveRate = 1;
|
||||
ConfigurationMain.rockHiveRate = 2;
|
||||
ConfigurationMain.netherHiveRate = 2;
|
||||
ConfigurationMain.marbleHiveRate = 2;
|
||||
}
|
||||
public static int marbleHiveRate = 2;
|
||||
}
|
||||
@@ -1,24 +1,19 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.core;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import binnie.extrabees.gui.WindowAlvearyHatchery;
|
||||
import binnie.extrabees.gui.WindowAlvearyStimulator;
|
||||
import binnie.extrabees.gui.WindowAlvearyFrame;
|
||||
import binnie.extrabees.gui.WindowAlvearyMutator;
|
||||
import binnie.extrabees.gui.database.WindowApiaristDatabase;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import binnie.core.craftgui.minecraft.Window;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import binnie.core.gui.IBinnieGUID;
|
||||
import binnie.extrabees.gui.WindowAlvearyFrame;
|
||||
import binnie.extrabees.gui.WindowAlvearyHatchery;
|
||||
import binnie.extrabees.gui.WindowAlvearyMutator;
|
||||
import binnie.extrabees.gui.WindowAlvearyStimulator;
|
||||
import binnie.extrabees.gui.database.WindowApiaristDatabase;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public enum ExtraBeeGUID implements IBinnieGUID
|
||||
{
|
||||
public enum ExtraBeeGUID implements IBinnieGUID {
|
||||
Database,
|
||||
DatabaseNEI,
|
||||
AlvearyMutator,
|
||||
@@ -28,35 +23,35 @@ public enum ExtraBeeGUID implements IBinnieGUID
|
||||
AlvearyHatchery;
|
||||
|
||||
@Override
|
||||
public Window getWindow(final EntityPlayer player, final World world, final int x, final int y, final int z, final Side side) {
|
||||
public Window getWindow(EntityPlayer player, World world, int x, int y, int z, Side side) {
|
||||
Window window = null;
|
||||
final TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
TileEntity tileEntity = world.getTileEntity(x, y, z);
|
||||
IInventory object = null;
|
||||
if (tileEntity instanceof IInventory) {
|
||||
object = (IInventory) tileEntity;
|
||||
}
|
||||
|
||||
switch (this) {
|
||||
case Database:
|
||||
case DatabaseNEI: {
|
||||
window = WindowApiaristDatabase.create(player, side, this != ExtraBeeGUID.Database);
|
||||
break;
|
||||
}
|
||||
case AlvearyMutator: {
|
||||
window = WindowAlvearyMutator.create(player, object, side);
|
||||
break;
|
||||
}
|
||||
case AlvearyFrame: {
|
||||
window = WindowAlvearyFrame.create(player, object, side);
|
||||
break;
|
||||
}
|
||||
case AlvearyStimulator: {
|
||||
window = WindowAlvearyStimulator.create(player, object, side);
|
||||
break;
|
||||
}
|
||||
case AlvearyHatchery: {
|
||||
window = WindowAlvearyHatchery.create(player, object, side);
|
||||
break;
|
||||
}
|
||||
case Database:
|
||||
case DatabaseNEI:
|
||||
window = WindowApiaristDatabase.create(player, side, this != ExtraBeeGUID.Database);
|
||||
break;
|
||||
|
||||
case AlvearyMutator:
|
||||
window = WindowAlvearyMutator.create(player, object, side);
|
||||
break;
|
||||
|
||||
case AlvearyFrame:
|
||||
window = WindowAlvearyFrame.create(player, object, side);
|
||||
break;
|
||||
|
||||
case AlvearyStimulator:
|
||||
window = WindowAlvearyStimulator.create(player, object, side);
|
||||
break;
|
||||
|
||||
case AlvearyHatchery:
|
||||
window = WindowAlvearyHatchery.create(player, object, side);
|
||||
break;
|
||||
}
|
||||
return window;
|
||||
}
|
||||
|
||||
@@ -1,28 +1,24 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.core;
|
||||
|
||||
import java.util.List;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.Mods;
|
||||
import binnie.core.item.IItemMisc;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import binnie.core.Mods;
|
||||
import binnie.Binnie;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import binnie.core.item.IItemMisc;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public enum ExtraBeeItems implements IItemMisc
|
||||
{
|
||||
import java.util.List;
|
||||
|
||||
public enum ExtraBeeItems implements IItemMisc {
|
||||
ScentedGear("Scented Gear", "scentedGear"),
|
||||
DiamondShard("Diamond Fragment", "diamondShard"),
|
||||
EmeraldShard("Emerald Fragment", "emeraldShard"),
|
||||
@@ -54,117 +50,6 @@ public enum ExtraBeeItems implements IItemMisc
|
||||
BlutoniumDust("Blutonium Grains", "blutoniumDust"),
|
||||
CyaniteDust("Cyanite Grains", "cyaniteDust");
|
||||
|
||||
String name;
|
||||
String iconPath;
|
||||
IIcon icon;
|
||||
String metalString;
|
||||
String gemString;
|
||||
|
||||
public static void init() {
|
||||
OreDictionary.registerOre("dyeRed", ExtraBeeItems.RedDye.get(1));
|
||||
OreDictionary.registerOre("dyeYellow", ExtraBeeItems.YellowDye.get(1));
|
||||
OreDictionary.registerOre("dyeBlue", ExtraBeeItems.BlueDye.get(1));
|
||||
OreDictionary.registerOre("dyeGreen", ExtraBeeItems.GreenDye.get(1));
|
||||
OreDictionary.registerOre("dyeBlack", ExtraBeeItems.BlackDye.get(1));
|
||||
OreDictionary.registerOre("dyeWhite", ExtraBeeItems.WhiteDye.get(1));
|
||||
OreDictionary.registerOre("dyeBrown", ExtraBeeItems.BrownDye.get(1));
|
||||
}
|
||||
|
||||
public static void postInit() {
|
||||
final ItemStack lapisShard = ExtraBeeItems.LapisShard.get(1);
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Items.dye, 1, 4), new Object[] { lapisShard, lapisShard, lapisShard, lapisShard });
|
||||
for (final ExtraBeeItems item : values()) {
|
||||
if (item.metalString != null) {
|
||||
ItemStack dust = null;
|
||||
ItemStack ingot = null;
|
||||
if (!OreDictionary.getOres("ingot" + item.metalString).isEmpty()) {
|
||||
ingot = OreDictionary.getOres("ingot" + item.metalString).get(0).copy();
|
||||
}
|
||||
if (!OreDictionary.getOres("dust" + item.metalString).isEmpty()) {
|
||||
dust = OreDictionary.getOres("dust" + item.metalString).get(0).copy();
|
||||
}
|
||||
final ItemStack input = item.get(1);
|
||||
if (dust != null) {
|
||||
GameRegistry.addShapelessRecipe(dust, new Object[] { input, input, input, input });
|
||||
}
|
||||
else if (ingot != null) {
|
||||
GameRegistry.addShapelessRecipe(ingot, new Object[] { input, input, input, input, input, input, input, input, input });
|
||||
}
|
||||
else if (item == ExtraBeeItems.CoalDust) {
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Items.coal), new Object[] { input, input, input, input });
|
||||
}
|
||||
}
|
||||
else if (item.gemString != null) {
|
||||
ItemStack gem = null;
|
||||
if (!OreDictionary.getOres("gem" + item.gemString).isEmpty()) {
|
||||
gem = OreDictionary.getOres("gem" + item.gemString).get(0);
|
||||
}
|
||||
final ItemStack input2 = item.get(1);
|
||||
if (gem != null) {
|
||||
GameRegistry.addShapelessRecipe(gem.copy(), new Object[] { input2, input2, input2, input2, input2, input2, input2, input2, input2 });
|
||||
}
|
||||
}
|
||||
}
|
||||
Item woodGear = null;
|
||||
try {
|
||||
woodGear = (Item) Class.forName("buildcraft.BuildCraftCore").getField("woodenGearItem").get(null);
|
||||
} catch (Exception ex) {
|
||||
}
|
||||
ItemStack gear = new ItemStack(Blocks.planks, 1);
|
||||
if (woodGear != null) {
|
||||
gear = new ItemStack(woodGear, 1);
|
||||
}
|
||||
RecipeManagers.carpenterManager.addRecipe(100, Binnie.Liquid.getLiquidStack("for.honey", 500), (ItemStack) null, ExtraBeeItems.ScentedGear.get(1), new Object[] { " j ", "bgb", " p ", 'j', Mods.Forestry.item("royalJelly"), 'b', Mods.Forestry.item("beeswax"), 'p', Mods.Forestry.item("pollen"), 'g', gear });
|
||||
}
|
||||
|
||||
private ExtraBeeItems(final String name, final String iconPath) {
|
||||
this.metalString = null;
|
||||
this.gemString = null;
|
||||
this.name = name;
|
||||
this.iconPath = iconPath;
|
||||
}
|
||||
|
||||
private void setGem(final String string) {
|
||||
this.gemString = string;
|
||||
}
|
||||
|
||||
private void setMetal(final String string) {
|
||||
this.metalString = string;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
if (this.metalString != null) {
|
||||
return !OreDictionary.getOres("ingot" + this.metalString).isEmpty() || !OreDictionary.getOres("dust" + this.metalString).isEmpty() || this == ExtraBeeItems.CoalDust;
|
||||
}
|
||||
return this.gemString == null || !OreDictionary.getOres("gem" + this.gemString).isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(final ItemStack itemStack) {
|
||||
return this.icon;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(final IIconRegister register) {
|
||||
this.icon = ExtraBees.proxy.getIcon(register, "misc/" + this.iconPath);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(final List data) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName(final ItemStack itemStack) {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack get(final int count) {
|
||||
return new ItemStack(ExtraBees.itemMisc, count, this.ordinal());
|
||||
}
|
||||
|
||||
static {
|
||||
ExtraBeeItems.TinDust.setMetal("Tin");
|
||||
ExtraBeeItems.ZincDust.setMetal("Zinc");
|
||||
@@ -186,4 +71,132 @@ public enum ExtraBeeItems implements IItemMisc
|
||||
ExtraBeeItems.RubyShard.setGem("Ruby");
|
||||
ExtraBeeItems.SapphireShard.setGem("Sapphire");
|
||||
}
|
||||
|
||||
protected String name;
|
||||
protected String iconPath;
|
||||
protected IIcon icon;
|
||||
protected String metalString;
|
||||
protected String gemString;
|
||||
|
||||
ExtraBeeItems(String name, String iconPath) {
|
||||
this.name = name;
|
||||
this.iconPath = iconPath;
|
||||
metalString = null;
|
||||
gemString = null;
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
OreDictionary.registerOre("dyeRed", ExtraBeeItems.RedDye.get(1));
|
||||
OreDictionary.registerOre("dyeYellow", ExtraBeeItems.YellowDye.get(1));
|
||||
OreDictionary.registerOre("dyeBlue", ExtraBeeItems.BlueDye.get(1));
|
||||
OreDictionary.registerOre("dyeGreen", ExtraBeeItems.GreenDye.get(1));
|
||||
OreDictionary.registerOre("dyeBlack", ExtraBeeItems.BlackDye.get(1));
|
||||
OreDictionary.registerOre("dyeWhite", ExtraBeeItems.WhiteDye.get(1));
|
||||
OreDictionary.registerOre("dyeBrown", ExtraBeeItems.BrownDye.get(1));
|
||||
}
|
||||
|
||||
public static void postInit() {
|
||||
ItemStack lapisShard = ExtraBeeItems.LapisShard.get(1);
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Items.dye, 1, 4), lapisShard, lapisShard, lapisShard, lapisShard);
|
||||
for (ExtraBeeItems item : values()) {
|
||||
if (item.metalString != null) {
|
||||
ItemStack dust = null;
|
||||
ItemStack ingot = null;
|
||||
if (!OreDictionary.getOres("ingot" + item.metalString).isEmpty()) {
|
||||
ingot = OreDictionary.getOres("ingot" + item.metalString).get(0).copy();
|
||||
}
|
||||
if (!OreDictionary.getOres("dust" + item.metalString).isEmpty()) {
|
||||
dust = OreDictionary.getOres("dust" + item.metalString).get(0).copy();
|
||||
}
|
||||
|
||||
ItemStack input = item.get(1);
|
||||
if (dust != null) {
|
||||
GameRegistry.addShapelessRecipe(dust, input, input, input, input);
|
||||
} else if (ingot != null) {
|
||||
GameRegistry.addShapelessRecipe(ingot, input, input, input, input, input, input, input, input, input);
|
||||
} else if (item == ExtraBeeItems.CoalDust) {
|
||||
GameRegistry.addShapelessRecipe(new ItemStack(Items.coal), input, input, input, input);
|
||||
}
|
||||
} else if (item.gemString != null) {
|
||||
ItemStack gem = null;
|
||||
if (!OreDictionary.getOres("gem" + item.gemString).isEmpty()) {
|
||||
gem = OreDictionary.getOres("gem" + item.gemString).get(0);
|
||||
}
|
||||
|
||||
ItemStack input2 = item.get(1);
|
||||
if (gem != null) {
|
||||
GameRegistry.addShapelessRecipe(gem.copy(), input2, input2, input2, input2, input2, input2, input2, input2, input2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Item woodGear = null;
|
||||
try {
|
||||
woodGear = (Item) Class.forName("buildcraft.BuildCraftCore").getField("woodenGearItem").get(null);
|
||||
} catch (Exception ex) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
ItemStack gear = new ItemStack(Blocks.planks, 1);
|
||||
if (woodGear != null) {
|
||||
gear = new ItemStack(woodGear, 1);
|
||||
}
|
||||
|
||||
RecipeManagers.carpenterManager.addRecipe(
|
||||
100,
|
||||
Binnie.Liquid.getLiquidStack("for.honey", 500),
|
||||
null,
|
||||
ExtraBeeItems.ScentedGear.get(1),
|
||||
" j ", "bgb", " p ",
|
||||
'j', Mods.Forestry.item("royalJelly"),
|
||||
'b', Mods.Forestry.item("beeswax"),
|
||||
'p', Mods.Forestry.item("pollen"),
|
||||
'g', gear
|
||||
);
|
||||
}
|
||||
|
||||
private void setGem(String string) {
|
||||
gemString = string;
|
||||
}
|
||||
|
||||
private void setMetal(String string) {
|
||||
metalString = string;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
if (metalString != null) {
|
||||
return !OreDictionary.getOres("ingot" + metalString).isEmpty()
|
||||
|| !OreDictionary.getOres("dust" + metalString).isEmpty()
|
||||
|| this == ExtraBeeItems.CoalDust;
|
||||
}
|
||||
return gemString == null
|
||||
|| !OreDictionary.getOres("gem" + gemString).isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(ItemStack itemStack) {
|
||||
return icon;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(IIconRegister register) {
|
||||
icon = ExtraBees.proxy.getIcon(register, "misc/" + iconPath);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(List data) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName(ItemStack itemStack) {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack get(int count) {
|
||||
return new ItemStack(ExtraBees.itemMisc, count, ordinal());
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,12 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.core;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.resource.BinnieResource;
|
||||
import binnie.core.resource.ResourceType;
|
||||
import binnie.core.resource.IBinnieTexture;
|
||||
import binnie.core.resource.ResourceType;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
|
||||
public enum ExtraBeeTexture implements IBinnieTexture
|
||||
{
|
||||
public enum ExtraBeeTexture implements IBinnieTexture {
|
||||
AlvearyMutator(ResourceType.Tile, "alveary/AlvearyMutator"),
|
||||
AlvearyNovaBlock(ResourceType.Tile, "alveary/AlvearyNovaBlock"),
|
||||
AlvearyFrame(ResourceType.Tile, "alveary/AlvearyFrame"),
|
||||
@@ -25,16 +20,16 @@ public enum ExtraBeeTexture implements IBinnieTexture
|
||||
GUIProgress2(ResourceType.GUI, "processes2"),
|
||||
AlvearyTransmission(ResourceType.Tile, "alveary/AlvearyTransmission");
|
||||
|
||||
String texture;
|
||||
ResourceType type;
|
||||
protected String texture;
|
||||
protected ResourceType type;
|
||||
|
||||
private ExtraBeeTexture(final ResourceType base, final String texture) {
|
||||
ExtraBeeTexture(ResourceType base, String texture) {
|
||||
this.texture = texture;
|
||||
this.type = base;
|
||||
type = base;
|
||||
}
|
||||
|
||||
@Override
|
||||
public BinnieResource getTexture() {
|
||||
return Binnie.Resource.getPNG(ExtraBees.instance, this.type, this.texture);
|
||||
return Binnie.Resource.getPNG(ExtraBees.instance, type, texture);
|
||||
}
|
||||
}
|
||||
@@ -1,16 +1,11 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.core;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import forestry.api.core.Tabs;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.IInitializable;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import forestry.api.core.Tabs;
|
||||
|
||||
public class ModuleCore implements IInitializable
|
||||
{
|
||||
public class ModuleCore implements IInitializable {
|
||||
@Override
|
||||
public void preInit() {
|
||||
ExtraBees.itemMisc = Binnie.Item.registerMiscItems(ExtraBeeItems.values(), Tabs.tabApiculture);
|
||||
|
||||
@@ -1,47 +1,62 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.genetics;
|
||||
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.genetics.ForestryAllele;
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
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.genetics.IAllele;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IGenome;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import forestry.api.genetics.IGenome;
|
||||
import forestry.api.apiculture.BeeManager;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
|
||||
import forestry.api.genetics.IMutation;
|
||||
import binnie.Binnie;
|
||||
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
|
||||
import binnie.core.genetics.ForestryAllele;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import forestry.api.apiculture.IBeeMutation;
|
||||
|
||||
public class ExtraBeeMutation implements IBeeMutation
|
||||
{
|
||||
public class ExtraBeeMutation implements IBeeMutation {
|
||||
public static List<IBeeMutation> mutations;
|
||||
MutationRequirement req;
|
||||
IAlleleBeeSpecies species0;
|
||||
IAlleleBeeSpecies species1;
|
||||
IAllele[] template;
|
||||
int chance;
|
||||
|
||||
static {
|
||||
ExtraBeeMutation.mutations = new ArrayList<>();
|
||||
}
|
||||
|
||||
protected MutationRequirement req;
|
||||
protected IAlleleBeeSpecies species0;
|
||||
protected IAlleleBeeSpecies species1;
|
||||
protected IAllele[] template;
|
||||
protected int chance;
|
||||
|
||||
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 = 80;
|
||||
this.chance = chance;
|
||||
this.req = req;
|
||||
species0 = allele0;
|
||||
species1 = allele1;
|
||||
template = mutation;
|
||||
if (species0 != null && species1 != null && template != null) {
|
||||
ExtraBeeMutation.mutations.add(this);
|
||||
}
|
||||
}
|
||||
|
||||
public static void doInit() {
|
||||
final IAlleleBeeSpecies[] vanilla = new IAlleleBeeSpecies[0];
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Meadows.getAllele(), ForestryAllele.BeeSpecies.Frugal.getAllele(), ExtraBeesSpecies.ARID, 10);
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Forest.getAllele(), ForestryAllele.BeeSpecies.Frugal.getAllele(), ExtraBeesSpecies.ARID, 10);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.ARID, ForestryAllele.BeeSpecies.Common.getAllele(), ExtraBeesSpecies.BARREN, 8);
|
||||
@@ -194,66 +209,39 @@ public class ExtraBeeMutation implements IBeeMutation
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.UNUSUAL, ForestryAllele.BeeSpecies.Hermitic.getAllele(), ExtraBeesSpecies.SPATIAL, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.SPATIAL, ForestryAllele.BeeSpecies.Spectral.getAllele(), ExtraBeesSpecies.QUANTUM, 5);
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Noble.getAllele(), ForestryAllele.BeeSpecies.Monastic.getAllele(), ExtraBeesSpecies.MYSTICAL, 5);
|
||||
for (final IBeeMutation mutation : ExtraBeeMutation.mutations) {
|
||||
for (IBeeMutation mutation : ExtraBeeMutation.mutations) {
|
||||
Binnie.Genetics.getBeeRoot().registerMutation(mutation);
|
||||
}
|
||||
}
|
||||
|
||||
public ExtraBeeMutation(final IAlleleBeeSpecies allele0, final IAlleleBeeSpecies allele1, final ExtraBeesSpecies mutation, final int chance) {
|
||||
this(allele0, allele1, mutation.getTemplate(), chance, null);
|
||||
}
|
||||
|
||||
public ExtraBeeMutation(final IAlleleBeeSpecies allele0, final IAlleleBeeSpecies allele1, final ExtraBeesSpecies mutation, final int chance, final MutationRequirement req) {
|
||||
this(allele0, allele1, mutation.getTemplate(), chance, req);
|
||||
}
|
||||
|
||||
public ExtraBeeMutation(final IAlleleBeeSpecies allele0, final IAlleleBeeSpecies allele1, final IAllele[] mutation, final int chance) {
|
||||
this(allele0, allele1, mutation, chance, null);
|
||||
}
|
||||
|
||||
public ExtraBeeMutation(final IAlleleBeeSpecies allele0, final IAlleleBeeSpecies allele1, final IAllele[] mutation, final int chance, final MutationRequirement req) {
|
||||
this.species0 = null;
|
||||
this.species1 = null;
|
||||
this.template = new IAllele[0];
|
||||
this.chance = 80;
|
||||
this.chance = chance;
|
||||
this.req = req;
|
||||
this.species0 = allele0;
|
||||
this.species1 = allele1;
|
||||
this.template = mutation;
|
||||
if (this.species0 != null && this.species1 != null && this.template != null) {
|
||||
ExtraBeeMutation.mutations.add(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAlleleSpecies getAllele0() {
|
||||
return this.species0;
|
||||
return species0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAlleleSpecies getAllele1() {
|
||||
return this.species1;
|
||||
return species1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAllele[] getTemplate() {
|
||||
return this.template;
|
||||
return template;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getBaseChance() {
|
||||
return this.chance;
|
||||
return chance;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPartner(final IAllele allele) {
|
||||
return allele.getUID().equals(this.species0.getUID()) || allele.getUID().equals(this.species1.getUID());
|
||||
public boolean isPartner(IAllele allele) {
|
||||
return allele.getUID().equals(species0.getUID()) || allele.getUID().equals(species1.getUID());
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAllele getPartner(final IAllele allele) {
|
||||
return allele.getUID().equals(this.species0.getUID()) ? this.species1 : this.species0;
|
||||
public IAllele getPartner(IAllele allele) {
|
||||
return allele.getUID().equals(species0.getUID()) ? species1 : species0;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -262,23 +250,22 @@ public class ExtraBeeMutation implements IBeeMutation
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getChance(final IBeeHousing housing, final IAlleleBeeSpecies allele0, final IAlleleBeeSpecies allele1, final IBeeGenome genome0, final IBeeGenome genome1) {
|
||||
if (this.species0 == null || this.species1 == null || allele0 == null || allele1 == null) {
|
||||
public float getChance(IBeeHousing housing, IAlleleBeeSpecies allele0, IAlleleBeeSpecies allele1, IBeeGenome genome0, IBeeGenome genome1) {
|
||||
if (species0 == null || species1 == null || allele0 == null || allele1 == null) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
final World world = housing.getWorld();
|
||||
final BiomeGenBase biome = housing.getBiome();
|
||||
if (this.req != null && !this.req.fufilled(housing, allele0, allele1, genome0, genome1)) {
|
||||
World world = housing.getWorld();
|
||||
if (req != null && !req.fufilled(housing, allele0, allele1, genome0, genome1)) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
final int processedChance = Math.round(this.chance * BeeManager.beeRoot.createBeeHousingModifier(housing).getMutationModifier(genome0, genome1, 1.0f)
|
||||
int processedChance = Math.round(chance * BeeManager.beeRoot.createBeeHousingModifier(housing).getMutationModifier(genome0, genome1, 1.0f)
|
||||
* Binnie.Genetics.getBeeRoot().getBeekeepingMode(world).getBeeModifier().getMutationModifier(genome0, genome1, 1.0f));
|
||||
if (this.species0.getUID().equals(allele0.getUID()) && this.species1.getUID().equals(allele1.getUID())) {
|
||||
if (species0.getUID().equals(allele0.getUID()) && species1.getUID().equals(allele1.getUID())) {
|
||||
return processedChance;
|
||||
}
|
||||
if (this.species1.getUID().equals(allele0.getUID()) && this.species0.getUID().equals(allele1.getUID())) {
|
||||
if (species1.getUID().equals(allele0.getUID()) && species0.getUID().equals(allele1.getUID())) {
|
||||
return processedChance;
|
||||
}
|
||||
return 0.0f;
|
||||
@@ -286,11 +273,9 @@ public class ExtraBeeMutation implements IBeeMutation
|
||||
|
||||
@Override
|
||||
public Collection<String> getSpecialConditions() {
|
||||
final List<String> conditions = new ArrayList<String>();
|
||||
if (this.req != null) {
|
||||
for (final String s : this.req.tooltip()) {
|
||||
conditions.add(s);
|
||||
}
|
||||
List<String> conditions = new ArrayList<>();
|
||||
if (req != null) {
|
||||
Collections.addAll(conditions, req.tooltip());
|
||||
}
|
||||
return conditions;
|
||||
}
|
||||
@@ -300,52 +285,46 @@ public class ExtraBeeMutation implements IBeeMutation
|
||||
return Binnie.Genetics.getBeeRoot();
|
||||
}
|
||||
|
||||
static {
|
||||
ExtraBeeMutation.mutations = new ArrayList<IBeeMutation>();
|
||||
}
|
||||
|
||||
abstract static class MutationRequirement
|
||||
{
|
||||
abstract static class MutationRequirement {
|
||||
public abstract String[] tooltip();
|
||||
|
||||
public abstract boolean fufilled(final IBeeHousing p0, final IAllele p1, final IAllele p2, final IGenome p3, final IGenome p4);
|
||||
public abstract boolean fufilled(IBeeHousing housing, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1);
|
||||
}
|
||||
|
||||
static class RequirementBiomeType extends MutationRequirement
|
||||
{
|
||||
BiomeDictionary.Type type;
|
||||
static class RequirementBiomeType extends MutationRequirement {
|
||||
protected BiomeDictionary.Type type;
|
||||
|
||||
public RequirementBiomeType(final BiomeDictionary.Type type) {
|
||||
public RequirementBiomeType(BiomeDictionary.Type type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] tooltip() {
|
||||
return new String[] { "Is restricted to " + this.type + "-like biomes." };
|
||||
return new String[]{"Is restricted to " + type + "-like biomes."};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean fufilled(final IBeeHousing housing, final IAllele allele0, final IAllele allele1, final IGenome genome0, final IGenome genome1) {
|
||||
return BiomeDictionary.isBiomeOfType(housing.getBiome(), this.type);
|
||||
public boolean fufilled(IBeeHousing housing, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1) {
|
||||
return BiomeDictionary.isBiomeOfType(housing.getBiome(), type);
|
||||
}
|
||||
}
|
||||
|
||||
static class RequirementPerson extends MutationRequirement
|
||||
{
|
||||
String name;
|
||||
static class RequirementPerson extends MutationRequirement {
|
||||
protected String name;
|
||||
|
||||
public RequirementPerson(final String name) {
|
||||
public RequirementPerson(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] tooltip() {
|
||||
return new String[] { "Can only be bred by " + this.name };
|
||||
return new String[]{"Can only be bred by " + name};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean fufilled(final IBeeHousing housing, final IAllele allele0, final IAllele allele1, final IGenome genome0, final IGenome genome1) {
|
||||
return housing.getOwner().getName() != null && housing.getOwner().getName().equals(this.name);
|
||||
public boolean fufilled(IBeeHousing housing, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1) {
|
||||
return housing.getOwner().getName() != null
|
||||
&& housing.getOwner().getName().equals(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,15 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.genetics;
|
||||
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import java.util.LinkedHashSet;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import java.util.Set;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import forestry.api.genetics.IClassification;
|
||||
|
||||
public enum ExtraBeesBranch implements IClassification
|
||||
{
|
||||
import java.util.LinkedHashSet;
|
||||
import java.util.Set;
|
||||
|
||||
public enum ExtraBeesBranch implements IClassification {
|
||||
BARREN("Vacapis"),
|
||||
HOSTILE("Infenapis"),
|
||||
ROCKY("Monapis"),
|
||||
@@ -44,59 +40,28 @@ public enum ExtraBeesBranch implements IClassification
|
||||
QUANTUM("Quantapis"),
|
||||
BOTANIA("Botaniapis");
|
||||
|
||||
protected IClassification parent;
|
||||
|
||||
private String uid;
|
||||
private String scientific;
|
||||
private Set<IAlleleBeeSpecies> speciesSet;
|
||||
IClassification parent;
|
||||
|
||||
@Override
|
||||
public String getUID() {
|
||||
return "extrabees.genus." + this.uid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraBees.proxy.localise("branch." + this.toString().toLowerCase() + ".name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getScientific() {
|
||||
return this.scientific;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return ExtraBees.proxy.localiseOrBlank("branch." + this.toString().toLowerCase() + ".desc");
|
||||
}
|
||||
|
||||
private ExtraBeesBranch(final String scientific) {
|
||||
this.uid = "";
|
||||
this.scientific = "";
|
||||
this.speciesSet = new LinkedHashSet<IAlleleBeeSpecies>();
|
||||
ExtraBeesBranch(String scientific) {
|
||||
this.scientific = scientific;
|
||||
this.uid = this.toString().toLowerCase();
|
||||
}
|
||||
|
||||
public void register() {
|
||||
if (!this.speciesSet.isEmpty()) {
|
||||
AlleleManager.alleleRegistry.registerClassification(this);
|
||||
final IClassification parent = AlleleManager.alleleRegistry.getClassification("family.apidae");
|
||||
if (parent != null) {
|
||||
parent.addMemberGroup(this);
|
||||
this.setParent(parent);
|
||||
}
|
||||
}
|
||||
speciesSet = new LinkedHashSet<>();
|
||||
uid = toString().toLowerCase();
|
||||
}
|
||||
|
||||
public static void doInit() {
|
||||
final IClassification frozenBranch = AlleleManager.alleleRegistry.getClassification("genus.bees.frozen");
|
||||
IClassification frozenBranch = AlleleManager.alleleRegistry.getClassification("genus.bees.frozen");
|
||||
if (frozenBranch != null) {
|
||||
frozenBranch.addMemberSpecies(ExtraBeesSpecies.ARTIC);
|
||||
ExtraBeesSpecies.ARTIC.setBranch(frozenBranch);
|
||||
frozenBranch.addMemberSpecies(ExtraBeesSpecies.FREEZING);
|
||||
ExtraBeesSpecies.FREEZING.setBranch(frozenBranch);
|
||||
}
|
||||
final IClassification agrarianBranch = AlleleManager.alleleRegistry.getClassification("genus.bees.agrarian");
|
||||
|
||||
IClassification agrarianBranch = AlleleManager.alleleRegistry.getClassification("genus.bees.agrarian");
|
||||
if (agrarianBranch != null) {
|
||||
agrarianBranch.addMemberSpecies(ExtraBeesSpecies.FARM);
|
||||
ExtraBeesSpecies.FARM.setBranch(agrarianBranch);
|
||||
@@ -104,7 +69,8 @@ public enum ExtraBeesBranch implements IClassification
|
||||
ExtraBeesSpecies.THRIVING.setBranch(agrarianBranch);
|
||||
ExtraBeesSpecies.BLOOMING.setBranch(agrarianBranch);
|
||||
}
|
||||
final IClassification boggyBranch = AlleleManager.alleleRegistry.getClassification("genus.bees.boggy");
|
||||
|
||||
IClassification boggyBranch = AlleleManager.alleleRegistry.getClassification("genus.bees.boggy");
|
||||
if (boggyBranch != null) {
|
||||
boggyBranch.addMemberSpecies(ExtraBeesSpecies.SWAMP);
|
||||
boggyBranch.addMemberSpecies(ExtraBeesSpecies.BOGGY);
|
||||
@@ -113,57 +79,68 @@ public enum ExtraBeesBranch implements IClassification
|
||||
ExtraBeesSpecies.BOGGY.setBranch(boggyBranch);
|
||||
ExtraBeesSpecies.FUNGAL.setBranch(boggyBranch);
|
||||
}
|
||||
final IClassification festiveBranch = AlleleManager.alleleRegistry.getClassification("genus.bees.festive");
|
||||
|
||||
IClassification festiveBranch = AlleleManager.alleleRegistry.getClassification("genus.bees.festive");
|
||||
if (festiveBranch != null) {
|
||||
festiveBranch.addMemberSpecies(ExtraBeesSpecies.CELEBRATORY);
|
||||
ExtraBeesSpecies.CELEBRATORY.setBranch(festiveBranch);
|
||||
}
|
||||
final IClassification austereBranch = AlleleManager.alleleRegistry.getClassification("genus.bees.austere");
|
||||
|
||||
IClassification austereBranch = AlleleManager.alleleRegistry.getClassification("genus.bees.austere");
|
||||
if (austereBranch != null) {
|
||||
austereBranch.addMemberSpecies(ExtraBeesSpecies.HAZARDOUS);
|
||||
ExtraBeesSpecies.HAZARDOUS.setBranch(austereBranch);
|
||||
}
|
||||
|
||||
ExtraBeesBranch.FARMING.addMemberSpecies(ExtraBeesSpecies.ALCOHOL);
|
||||
ExtraBeesBranch.FARMING.addMemberSpecies(ExtraBeesSpecies.MILK);
|
||||
ExtraBeesBranch.FARMING.addMemberSpecies(ExtraBeesSpecies.COFFEE);
|
||||
ExtraBeesBranch.FARMING.addMemberSpecies(ExtraBeesSpecies.CITRUS);
|
||||
ExtraBeesBranch.FARMING.addMemberSpecies(ExtraBeesSpecies.MINT);
|
||||
ExtraBeesBranch.FARMING.register();
|
||||
|
||||
ExtraBeesBranch.BARREN.addMemberSpecies(ExtraBeesSpecies.ARID);
|
||||
ExtraBeesBranch.BARREN.addMemberSpecies(ExtraBeesSpecies.BARREN);
|
||||
ExtraBeesBranch.BARREN.addMemberSpecies(ExtraBeesSpecies.DESOLATE);
|
||||
ExtraBeesBranch.BARREN.addMemberSpecies(ExtraBeesSpecies.DECOMPOSING);
|
||||
ExtraBeesBranch.BARREN.addMemberSpecies(ExtraBeesSpecies.GNAWING);
|
||||
ExtraBeesBranch.BARREN.register();
|
||||
|
||||
ExtraBeesBranch.HOSTILE.addMemberSpecies(ExtraBeesSpecies.ROTTEN);
|
||||
ExtraBeesBranch.HOSTILE.addMemberSpecies(ExtraBeesSpecies.BONE);
|
||||
ExtraBeesBranch.HOSTILE.addMemberSpecies(ExtraBeesSpecies.CREEPER);
|
||||
ExtraBeesBranch.HOSTILE.register();
|
||||
|
||||
ExtraBeesBranch.ROCKY.addMemberSpecies(ExtraBeesSpecies.ROCK);
|
||||
ExtraBeesBranch.ROCKY.addMemberSpecies(ExtraBeesSpecies.STONE);
|
||||
ExtraBeesBranch.ROCKY.addMemberSpecies(ExtraBeesSpecies.GRANITE);
|
||||
ExtraBeesBranch.ROCKY.addMemberSpecies(ExtraBeesSpecies.MINERAL);
|
||||
ExtraBeesBranch.ROCKY.register();
|
||||
|
||||
ExtraBeesBranch.METALLIC.addMemberSpecies(ExtraBeesSpecies.IRON);
|
||||
ExtraBeesBranch.METALLIC.addMemberSpecies(ExtraBeesSpecies.COPPER);
|
||||
ExtraBeesBranch.METALLIC.addMemberSpecies(ExtraBeesSpecies.TIN);
|
||||
ExtraBeesBranch.METALLIC.addMemberSpecies(ExtraBeesSpecies.LEAD);
|
||||
ExtraBeesBranch.METALLIC.register();
|
||||
|
||||
ExtraBeesBranch.METALLIC2.addMemberSpecies(ExtraBeesSpecies.NICKEL);
|
||||
ExtraBeesBranch.METALLIC2.addMemberSpecies(ExtraBeesSpecies.ZINC);
|
||||
ExtraBeesBranch.METALLIC2.addMemberSpecies(ExtraBeesSpecies.TUNGSTATE);
|
||||
ExtraBeesBranch.METALLIC2.addMemberSpecies(ExtraBeesSpecies.TITANIUM);
|
||||
ExtraBeesBranch.METALLIC2.register();
|
||||
|
||||
ExtraBeesBranch.ALLOY.addMemberSpecies(ExtraBeesSpecies.BRONZE);
|
||||
ExtraBeesBranch.ALLOY.addMemberSpecies(ExtraBeesSpecies.BRASS);
|
||||
ExtraBeesBranch.ALLOY.addMemberSpecies(ExtraBeesSpecies.STEEL);
|
||||
ExtraBeesBranch.ALLOY.addMemberSpecies(ExtraBeesSpecies.INVAR);
|
||||
ExtraBeesBranch.ALLOY.register();
|
||||
|
||||
ExtraBeesBranch.PRECIOUS.addMemberSpecies(ExtraBeesSpecies.SILVER);
|
||||
ExtraBeesBranch.PRECIOUS.addMemberSpecies(ExtraBeesSpecies.GOLD);
|
||||
ExtraBeesBranch.PRECIOUS.addMemberSpecies(ExtraBeesSpecies.ELECTRUM);
|
||||
ExtraBeesBranch.PRECIOUS.addMemberSpecies(ExtraBeesSpecies.PLATINUM);
|
||||
ExtraBeesBranch.PRECIOUS.register();
|
||||
|
||||
ExtraBeesBranch.MINERAL.addMemberSpecies(ExtraBeesSpecies.LAPIS);
|
||||
ExtraBeesBranch.MINERAL.addMemberSpecies(ExtraBeesSpecies.SODALITE);
|
||||
ExtraBeesBranch.MINERAL.addMemberSpecies(ExtraBeesSpecies.PYRITE);
|
||||
@@ -171,12 +148,14 @@ public enum ExtraBeesBranch implements IClassification
|
||||
ExtraBeesBranch.MINERAL.addMemberSpecies(ExtraBeesSpecies.CINNABAR);
|
||||
ExtraBeesBranch.MINERAL.addMemberSpecies(ExtraBeesSpecies.SPHALERITE);
|
||||
ExtraBeesBranch.MINERAL.register();
|
||||
|
||||
ExtraBeesBranch.GEMSTONE.addMemberSpecies(ExtraBeesSpecies.EMERALD);
|
||||
ExtraBeesBranch.GEMSTONE.addMemberSpecies(ExtraBeesSpecies.RUBY);
|
||||
ExtraBeesBranch.GEMSTONE.addMemberSpecies(ExtraBeesSpecies.SAPPHIRE);
|
||||
ExtraBeesBranch.GEMSTONE.addMemberSpecies(ExtraBeesSpecies.OLIVINE);
|
||||
ExtraBeesBranch.GEMSTONE.addMemberSpecies(ExtraBeesSpecies.DIAMOND);
|
||||
ExtraBeesBranch.GEMSTONE.register();
|
||||
|
||||
ExtraBeesBranch.NUCLEAR.addMemberSpecies(ExtraBeesSpecies.UNSTABLE);
|
||||
ExtraBeesBranch.NUCLEAR.addMemberSpecies(ExtraBeesSpecies.NUCLEAR);
|
||||
ExtraBeesBranch.NUCLEAR.addMemberSpecies(ExtraBeesSpecies.RADIOACTIVE);
|
||||
@@ -184,62 +163,75 @@ public enum ExtraBeesBranch implements IClassification
|
||||
ExtraBeesBranch.NUCLEAR.addMemberSpecies(ExtraBeesSpecies.CYANITE);
|
||||
ExtraBeesBranch.NUCLEAR.addMemberSpecies(ExtraBeesSpecies.BLUTONIUM);
|
||||
ExtraBeesBranch.NUCLEAR.register();
|
||||
|
||||
ExtraBeesBranch.HISTORIC.addMemberSpecies(ExtraBeesSpecies.ANCIENT);
|
||||
ExtraBeesBranch.HISTORIC.addMemberSpecies(ExtraBeesSpecies.PRIMEVAL);
|
||||
ExtraBeesBranch.HISTORIC.addMemberSpecies(ExtraBeesSpecies.PREHISTORIC);
|
||||
ExtraBeesBranch.HISTORIC.addMemberSpecies(ExtraBeesSpecies.RELIC);
|
||||
ExtraBeesBranch.HISTORIC.register();
|
||||
|
||||
ExtraBeesBranch.FOSSILIZED.addMemberSpecies(ExtraBeesSpecies.COAL);
|
||||
ExtraBeesBranch.FOSSILIZED.addMemberSpecies(ExtraBeesSpecies.RESIN);
|
||||
ExtraBeesBranch.FOSSILIZED.addMemberSpecies(ExtraBeesSpecies.OIL);
|
||||
ExtraBeesBranch.FOSSILIZED.addMemberSpecies(ExtraBeesSpecies.PEAT);
|
||||
ExtraBeesBranch.FOSSILIZED.register();
|
||||
|
||||
ExtraBeesBranch.REFINED.addMemberSpecies(ExtraBeesSpecies.DISTILLED);
|
||||
ExtraBeesBranch.REFINED.addMemberSpecies(ExtraBeesSpecies.FUEL);
|
||||
ExtraBeesBranch.REFINED.addMemberSpecies(ExtraBeesSpecies.CREOSOTE);
|
||||
ExtraBeesBranch.REFINED.addMemberSpecies(ExtraBeesSpecies.LATEX);
|
||||
ExtraBeesBranch.REFINED.register();
|
||||
|
||||
ExtraBeesBranch.AQUATIC.addMemberSpecies(ExtraBeesSpecies.WATER);
|
||||
ExtraBeesBranch.AQUATIC.addMemberSpecies(ExtraBeesSpecies.RIVER);
|
||||
ExtraBeesBranch.AQUATIC.addMemberSpecies(ExtraBeesSpecies.OCEAN);
|
||||
ExtraBeesBranch.AQUATIC.addMemberSpecies(ExtraBeesSpecies.INK);
|
||||
ExtraBeesBranch.AQUATIC.register();
|
||||
|
||||
ExtraBeesBranch.SACCHARINE.addMemberSpecies(ExtraBeesSpecies.SWEET);
|
||||
ExtraBeesBranch.SACCHARINE.addMemberSpecies(ExtraBeesSpecies.SUGAR);
|
||||
ExtraBeesBranch.SACCHARINE.addMemberSpecies(ExtraBeesSpecies.FRUIT);
|
||||
ExtraBeesBranch.SACCHARINE.addMemberSpecies(ExtraBeesSpecies.RIPENING);
|
||||
ExtraBeesBranch.SACCHARINE.register();
|
||||
|
||||
ExtraBeesBranch.CLASSICAL.addMemberSpecies(ExtraBeesSpecies.MARBLE);
|
||||
ExtraBeesBranch.CLASSICAL.addMemberSpecies(ExtraBeesSpecies.ROMAN);
|
||||
ExtraBeesBranch.CLASSICAL.addMemberSpecies(ExtraBeesSpecies.GREEK);
|
||||
ExtraBeesBranch.CLASSICAL.addMemberSpecies(ExtraBeesSpecies.CLASSICAL);
|
||||
ExtraBeesBranch.CLASSICAL.register();
|
||||
|
||||
ExtraBeesBranch.VOLCANIC.addMemberSpecies(ExtraBeesSpecies.BASALT);
|
||||
ExtraBeesBranch.VOLCANIC.addMemberSpecies(ExtraBeesSpecies.TEMPERED);
|
||||
ExtraBeesBranch.VOLCANIC.addMemberSpecies(ExtraBeesSpecies.ANGRY);
|
||||
ExtraBeesBranch.VOLCANIC.addMemberSpecies(ExtraBeesSpecies.VOLCANIC);
|
||||
ExtraBeesBranch.VOLCANIC.addMemberSpecies(ExtraBeesSpecies.GLOWSTONE);
|
||||
ExtraBeesBranch.VOLCANIC.register();
|
||||
|
||||
ExtraBeesBranch.VISCOUS.addMemberSpecies(ExtraBeesSpecies.VISCOUS);
|
||||
ExtraBeesBranch.VISCOUS.addMemberSpecies(ExtraBeesSpecies.GLUTINOUS);
|
||||
ExtraBeesBranch.VISCOUS.addMemberSpecies(ExtraBeesSpecies.STICKY);
|
||||
ExtraBeesBranch.VISCOUS.register();
|
||||
|
||||
ExtraBeesBranch.VIRULENT.addMemberSpecies(ExtraBeesSpecies.MALICIOUS);
|
||||
ExtraBeesBranch.VIRULENT.addMemberSpecies(ExtraBeesSpecies.INFECTIOUS);
|
||||
ExtraBeesBranch.VIRULENT.addMemberSpecies(ExtraBeesSpecies.VIRULENT);
|
||||
ExtraBeesBranch.VIRULENT.register();
|
||||
|
||||
ExtraBeesBranch.CAUSTIC.addMemberSpecies(ExtraBeesSpecies.CORROSIVE);
|
||||
ExtraBeesBranch.CAUSTIC.addMemberSpecies(ExtraBeesSpecies.CAUSTIC);
|
||||
ExtraBeesBranch.CAUSTIC.addMemberSpecies(ExtraBeesSpecies.ACIDIC);
|
||||
ExtraBeesBranch.CAUSTIC.register();
|
||||
|
||||
ExtraBeesBranch.ENERGETIC.addMemberSpecies(ExtraBeesSpecies.EXCITED);
|
||||
ExtraBeesBranch.ENERGETIC.addMemberSpecies(ExtraBeesSpecies.ENERGETIC);
|
||||
ExtraBeesBranch.ENERGETIC.addMemberSpecies(ExtraBeesSpecies.ECSTATIC);
|
||||
ExtraBeesBranch.ENERGETIC.register();
|
||||
|
||||
ExtraBeesBranch.SHADOW.addMemberSpecies(ExtraBeesSpecies.SHADOW);
|
||||
ExtraBeesBranch.SHADOW.addMemberSpecies(ExtraBeesSpecies.DARKENED);
|
||||
ExtraBeesBranch.SHADOW.addMemberSpecies(ExtraBeesSpecies.ABYSS);
|
||||
ExtraBeesBranch.SHADOW.register();
|
||||
|
||||
ExtraBeesBranch.PRIMARY.addMemberSpecies(ExtraBeesSpecies.RED);
|
||||
ExtraBeesBranch.PRIMARY.addMemberSpecies(ExtraBeesSpecies.YELLOW);
|
||||
ExtraBeesBranch.PRIMARY.addMemberSpecies(ExtraBeesSpecies.BLUE);
|
||||
@@ -248,6 +240,7 @@ public enum ExtraBeesBranch implements IClassification
|
||||
ExtraBeesBranch.PRIMARY.addMemberSpecies(ExtraBeesSpecies.WHITE);
|
||||
ExtraBeesBranch.PRIMARY.addMemberSpecies(ExtraBeesSpecies.BROWN);
|
||||
ExtraBeesBranch.PRIMARY.register();
|
||||
|
||||
ExtraBeesBranch.SECONDARY.addMemberSpecies(ExtraBeesSpecies.ORANGE);
|
||||
ExtraBeesBranch.SECONDARY.addMemberSpecies(ExtraBeesSpecies.CYAN);
|
||||
ExtraBeesBranch.SECONDARY.addMemberSpecies(ExtraBeesSpecies.PURPLE);
|
||||
@@ -256,19 +249,56 @@ public enum ExtraBeesBranch implements IClassification
|
||||
ExtraBeesBranch.SECONDARY.addMemberSpecies(ExtraBeesSpecies.PINK);
|
||||
ExtraBeesBranch.SECONDARY.addMemberSpecies(ExtraBeesSpecies.LIMEGREEN);
|
||||
ExtraBeesBranch.SECONDARY.register();
|
||||
|
||||
ExtraBeesBranch.TERTIARY.addMemberSpecies(ExtraBeesSpecies.MAGENTA);
|
||||
ExtraBeesBranch.TERTIARY.addMemberSpecies(ExtraBeesSpecies.LIGHTGRAY);
|
||||
ExtraBeesBranch.TERTIARY.register();
|
||||
|
||||
ExtraBeesBranch.FTB.addMemberSpecies(ExtraBeesSpecies.JADED);
|
||||
ExtraBeesBranch.FTB.register();
|
||||
|
||||
ExtraBeesBranch.QUANTUM.addMemberSpecies(ExtraBeesSpecies.UNUSUAL);
|
||||
ExtraBeesBranch.QUANTUM.addMemberSpecies(ExtraBeesSpecies.SPATIAL);
|
||||
ExtraBeesBranch.QUANTUM.addMemberSpecies(ExtraBeesSpecies.QUANTUM);
|
||||
ExtraBeesBranch.QUANTUM.register();
|
||||
|
||||
ExtraBeesBranch.BOTANIA.addMemberSpecies(ExtraBeesSpecies.MYSTICAL);
|
||||
ExtraBeesBranch.BOTANIA.register();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUID() {
|
||||
return "extrabees.genus." + uid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraBees.proxy.localise("branch." + toString().toLowerCase() + ".name");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getScientific() {
|
||||
return scientific;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return ExtraBees.proxy.localiseOrBlank("branch." + toString().toLowerCase() + ".desc");
|
||||
}
|
||||
|
||||
public void register() {
|
||||
if (speciesSet.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
AlleleManager.alleleRegistry.registerClassification(this);
|
||||
IClassification parent = AlleleManager.alleleRegistry.getClassification("family.apidae");
|
||||
if (parent != null) {
|
||||
parent.addMemberGroup(this);
|
||||
setParent(parent);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IClassification.EnumClassLevel getLevel() {
|
||||
return IClassification.EnumClassLevel.GENUS;
|
||||
@@ -280,17 +310,17 @@ public enum ExtraBeesBranch implements IClassification
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addMemberGroup(final IClassification group) {
|
||||
public void addMemberGroup(IClassification group) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public IAlleleSpecies[] getMemberSpecies() {
|
||||
return this.speciesSet.toArray(new IAlleleSpecies[0]);
|
||||
return speciesSet.toArray(new IAlleleSpecies[0]);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addMemberSpecies(final IAlleleSpecies species) {
|
||||
this.speciesSet.add((IAlleleBeeSpecies) species);
|
||||
public void addMemberSpecies(IAlleleSpecies species) {
|
||||
speciesSet.add((IAlleleBeeSpecies) species);
|
||||
if (species instanceof ExtraBeesSpecies) {
|
||||
((ExtraBeesSpecies) species).setBranch(this);
|
||||
}
|
||||
@@ -298,11 +328,11 @@ public enum ExtraBeesBranch implements IClassification
|
||||
|
||||
@Override
|
||||
public IClassification getParent() {
|
||||
return this.parent;
|
||||
return parent;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setParent(final IClassification parent) {
|
||||
public void setParent(IClassification parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
}
|
||||
@@ -1,49 +1,35 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.genetics;
|
||||
|
||||
import forestry.api.apiculture.FlowerManager;
|
||||
import forestry.api.genetics.IFlower;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Set;
|
||||
|
||||
import binnie.core.Mods;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import forestry.api.apiculture.FlowerManager;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IAlleleFlowers;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
import forestry.api.genetics.IFlower;
|
||||
import forestry.api.genetics.IFlowerProvider;
|
||||
import forestry.api.genetics.IFruitBearer;
|
||||
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
import forestry.api.genetics.IIndividual;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
import forestry.api.genetics.IPollinatable;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
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;
|
||||
|
||||
import forestry.api.genetics.IPollinatable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import forestry.api.genetics.IAlleleFlowers;
|
||||
import forestry.api.genetics.IFlowerProvider;
|
||||
|
||||
public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromosomeType
|
||||
{
|
||||
public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromosomeType {
|
||||
WATER,
|
||||
SUGAR,
|
||||
ROCK,
|
||||
@@ -52,24 +38,30 @@ public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromo
|
||||
REDSTONE,
|
||||
WOOD,
|
||||
LEAVES,
|
||||
Sapling,
|
||||
Fruit,
|
||||
Mystical;
|
||||
SAPLING,
|
||||
FRUIT,
|
||||
MYSTICAL;
|
||||
|
||||
boolean dominant;
|
||||
protected boolean dominant;
|
||||
|
||||
private ExtraBeesFlowers() {
|
||||
this.dominant = true;
|
||||
ExtraBeesFlowers() {
|
||||
dominant = true;
|
||||
}
|
||||
|
||||
public static void doInit() {
|
||||
for (ExtraBeesFlowers effect : values()) {
|
||||
effect.register();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUID() {
|
||||
return "extrabees.flower." + this.toString().toLowerCase();
|
||||
return "extrabees.flower." + toString().toLowerCase();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDominant() {
|
||||
return this.dominant;
|
||||
return dominant;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -79,12 +71,11 @@ public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromo
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return ExtraBees.proxy.localise("flowers." + this.name().toString().toLowerCase() + ".name");
|
||||
return ExtraBees.proxy.localise("flowers." + name().toString().toLowerCase() + ".name");
|
||||
}
|
||||
|
||||
public void register() {
|
||||
// AlleleManager.alleleRegistry.registerAllele((IAllele)this);
|
||||
|
||||
for (ItemStack stack : getItemStacks()) {
|
||||
FlowerManager.flowerRegistry.registerAcceptableFlower(Block.getBlockFromItem(stack.getItem()), getUID());
|
||||
}
|
||||
@@ -92,135 +83,125 @@ public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromo
|
||||
AlleleManager.alleleRegistry.registerAllele(this, this);
|
||||
}
|
||||
|
||||
public static void doInit() {
|
||||
for (final ExtraBeesFlowers effect : values()) {
|
||||
effect.register();
|
||||
}
|
||||
}
|
||||
|
||||
public ItemStack[] getItemStacks() {
|
||||
switch (this) {
|
||||
case WATER: {
|
||||
return new ItemStack[] { new ItemStack(Blocks.waterlily) };
|
||||
}
|
||||
case SUGAR: {
|
||||
return new ItemStack[] { new ItemStack(Blocks.reeds) };
|
||||
}
|
||||
case ROCK: {
|
||||
return new ItemStack[] { new ItemStack(Blocks.cobblestone) };
|
||||
}
|
||||
case BOOK: {
|
||||
return new ItemStack[] { new ItemStack(Blocks.bookshelf) };
|
||||
}
|
||||
case REDSTONE: {
|
||||
return new ItemStack[] { new ItemStack(Blocks.redstone_torch) };
|
||||
}
|
||||
case DEAD: {
|
||||
return new ItemStack[] { new ItemStack(Blocks.deadbush) };
|
||||
}
|
||||
case Fruit: {
|
||||
return new ItemStack[] { new ItemStack(Items.apple) };
|
||||
}
|
||||
case LEAVES: {
|
||||
return new ItemStack[] { new ItemStack(Blocks.leaves) };
|
||||
}
|
||||
case Sapling: {
|
||||
return new ItemStack[] { new ItemStack(Blocks.sapling) };
|
||||
}
|
||||
case WOOD: {
|
||||
return new ItemStack[] { new ItemStack(Blocks.log) };
|
||||
}
|
||||
default: {
|
||||
return new ItemStack[0];
|
||||
}
|
||||
case WATER:
|
||||
return new ItemStack[]{new ItemStack(Blocks.waterlily)};
|
||||
|
||||
case SUGAR:
|
||||
return new ItemStack[]{new ItemStack(Blocks.reeds)};
|
||||
|
||||
case ROCK:
|
||||
return new ItemStack[]{new ItemStack(Blocks.cobblestone)};
|
||||
|
||||
case BOOK:
|
||||
return new ItemStack[]{new ItemStack(Blocks.bookshelf)};
|
||||
|
||||
case REDSTONE:
|
||||
return new ItemStack[]{new ItemStack(Blocks.redstone_torch)};
|
||||
|
||||
case DEAD:
|
||||
return new ItemStack[]{new ItemStack(Blocks.deadbush)};
|
||||
|
||||
case FRUIT:
|
||||
return new ItemStack[]{new ItemStack(Items.apple)};
|
||||
|
||||
case LEAVES:
|
||||
return new ItemStack[]{new ItemStack(Blocks.leaves)};
|
||||
|
||||
case SAPLING:
|
||||
return new ItemStack[]{new ItemStack(Blocks.sapling)};
|
||||
|
||||
case WOOD:
|
||||
return new ItemStack[]{new ItemStack(Blocks.log)};
|
||||
}
|
||||
return new ItemStack[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isAcceptedPollinatable(final World world, final IPollinatable pollinatable) {
|
||||
final EnumSet<EnumPlantType> types = pollinatable.getPlantType();
|
||||
public boolean isAcceptedPollinatable(World world, IPollinatable pollinatable) {
|
||||
EnumSet<EnumPlantType> types = pollinatable.getPlantType();
|
||||
return types.size() > 1 || !types.contains(EnumPlantType.Nether);
|
||||
}
|
||||
|
||||
public boolean isAcceptedFlower(final World world, final IIndividual individual, final int x, final int y, final int z) {
|
||||
final Block block = world.getBlock(x, y, z);
|
||||
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 (this) {
|
||||
case WATER: {
|
||||
return block == Blocks.waterlily;
|
||||
}
|
||||
case ROCK: {
|
||||
return block.getMaterial() == Material.rock;
|
||||
}
|
||||
case SUGAR: {
|
||||
return block == Blocks.reeds;
|
||||
}
|
||||
case BOOK: {
|
||||
return block == Blocks.bookshelf;
|
||||
}
|
||||
case REDSTONE: {
|
||||
return block == Blocks.redstone_torch;
|
||||
}
|
||||
case DEAD: {
|
||||
return block == Blocks.deadbush;
|
||||
}
|
||||
case WOOD: {
|
||||
return block.isWood(world, x, y, z);
|
||||
}
|
||||
case Fruit: {
|
||||
return world.getTileEntity(x, y, z) instanceof IFruitBearer;
|
||||
}
|
||||
case LEAVES: {
|
||||
return block.isLeaves(world, x, y, z);
|
||||
}
|
||||
case Sapling: {
|
||||
return block.getClass().getName().toLowerCase().contains("sapling");
|
||||
}
|
||||
case Mystical: {
|
||||
return block == Mods.Botania.block("flower");
|
||||
}
|
||||
default: {
|
||||
return false;
|
||||
}
|
||||
case WATER:
|
||||
return block == Blocks.waterlily;
|
||||
|
||||
case ROCK:
|
||||
return block.getMaterial() == Material.rock;
|
||||
|
||||
case SUGAR:
|
||||
return block == Blocks.reeds;
|
||||
|
||||
case BOOK:
|
||||
return block == Blocks.bookshelf;
|
||||
|
||||
case REDSTONE:
|
||||
return block == Blocks.redstone_torch;
|
||||
|
||||
case DEAD:
|
||||
return block == Blocks.deadbush;
|
||||
|
||||
case WOOD:
|
||||
return block.isWood(world, x, y, z);
|
||||
|
||||
case FRUIT:
|
||||
return world.getTileEntity(x, y, z) instanceof IFruitBearer;
|
||||
|
||||
case LEAVES:
|
||||
return block.isLeaves(world, x, y, z);
|
||||
|
||||
case SAPLING:
|
||||
return block.getClass().getName().toLowerCase().contains("sapling");
|
||||
|
||||
case MYSTICAL:
|
||||
return block == Mods.Botania.block("flower");
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean growFlower(final World world, final IIndividual individual, final int x, final int y, final int z) {
|
||||
public boolean growFlower(World world, IIndividual individual, int x, int y, int z) {
|
||||
switch (this) {
|
||||
case WATER: {
|
||||
return world.isAirBlock(x, y, z) && world.getBlock(x, y - 1, z) == Blocks.water && world.setBlock(x, y, z, Blocks.waterlily, 0, 2);
|
||||
}
|
||||
case SUGAR: {
|
||||
return world.getBlock(x, y - 1, z) == Blocks.reeds && world.isAirBlock(x, y, z) && world.setBlock(x, y, z, Blocks.reeds, 0, 0);
|
||||
}
|
||||
default: {
|
||||
return false;
|
||||
}
|
||||
case WATER:
|
||||
return world.isAirBlock(x, y, z)
|
||||
&& world.getBlock(x, y - 1, z) == Blocks.water
|
||||
&& world.setBlock(x, y, z, Blocks.waterlily, 0, 2);
|
||||
|
||||
case SUGAR:
|
||||
return world.getBlock(x, y - 1, z) == Blocks.reeds
|
||||
&& world.isAirBlock(x, y, z)
|
||||
&& world.setBlock(x, y, z, Blocks.reeds, 0, 0);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] affectProducts(final World world, final IIndividual individual, final int x, final int y, final int z, final ItemStack[] products) {
|
||||
if (this == ExtraBeesFlowers.Mystical) {
|
||||
final List<ItemStack> prods = new ArrayList<ItemStack>();
|
||||
for (final ItemStack stack : products) {
|
||||
prods.add(stack);
|
||||
}
|
||||
public ItemStack[] affectProducts(World world, IIndividual individual, int x, int y, int z, ItemStack[] products) {
|
||||
if (this == ExtraBeesFlowers.MYSTICAL) {
|
||||
List<ItemStack> prods = new ArrayList<>();
|
||||
Collections.addAll(prods, products);
|
||||
|
||||
for (int k = 0; k < 50; ++k) {
|
||||
final int tX = 7;
|
||||
final int tY = 7;
|
||||
final int tZ = 3;
|
||||
final int x2 = x - tX + world.rand.nextInt(1 + 2 * tX);
|
||||
final int y2 = y - tY + world.rand.nextInt(1 + 2 * tY);
|
||||
final int z2 = z - tZ + world.rand.nextInt(1 + 2 * tZ);
|
||||
final Block block = world.getBlock(x2, y2, z2);
|
||||
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")) {
|
||||
final int meta = world.getBlockMetadata(x2, y2, z2);
|
||||
final Item item = Mods.Botania.item("petal");
|
||||
int meta = world.getBlockMetadata(x2, y2, z2);
|
||||
Item item = Mods.Botania.item("petal");
|
||||
if (item != null) {
|
||||
prods.add(new ItemStack(item, 1, meta));
|
||||
}
|
||||
@@ -234,22 +215,22 @@ public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromo
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.getDescription();
|
||||
return getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName() {
|
||||
return this.getUID();
|
||||
return getUID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFlowerType() {
|
||||
return this.getUID();
|
||||
return getUID();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Set<IFlower> getFlowers() {
|
||||
return new HashSet<IFlower>();
|
||||
return new HashSet<>();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,36 +1,48 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.genetics;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.IInitializable;
|
||||
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.genetics.IIndividual;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import binnie.core.BinnieCore;
|
||||
import forestry.api.genetics.IGenome;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import binnie.Binnie;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import binnie.extrabees.genetics.effect.ExtraBeesEffect;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import binnie.extrabees.genetics.effect.BlockEctoplasm;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.genetics.items.ItemDictionary;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import binnie.core.IInitializable;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IGenome;
|
||||
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 static IGenome getGenome(IAlleleBeeSpecies allele0) {
|
||||
return Binnie.Genetics.getBeeRoot().templateAsGenome(Binnie.Genetics.getBeeRoot().getTemplate(allele0.getUID()));
|
||||
}
|
||||
|
||||
// TODO unsused method?
|
||||
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;
|
||||
}
|
||||
|
||||
public class ModuleGenetics implements IInitializable
|
||||
{
|
||||
@Override
|
||||
public void preInit() {
|
||||
for (final ExtraBeesSpecies species : ExtraBeesSpecies.values()) {
|
||||
for (ExtraBeesSpecies species : ExtraBeesSpecies.values()) {
|
||||
AlleleManager.alleleRegistry.registerAllele(species);
|
||||
}
|
||||
ExtraBees.dictionary = new ItemDictionary();
|
||||
@@ -48,32 +60,15 @@ public class ModuleGenetics implements IInitializable
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
int ebSpeciesCount = 0;
|
||||
// unused code?
|
||||
/*int ebSpeciesCount = 0;
|
||||
int ebTotalSpeciesCount = 0;
|
||||
for (final ExtraBeesSpecies species : ExtraBeesSpecies.values()) {
|
||||
for (ExtraBeesSpecies species : ExtraBeesSpecies.values()) {
|
||||
++ebTotalSpeciesCount;
|
||||
if (!AlleleManager.alleleRegistry.isBlacklisted(species.getUID())) {
|
||||
++ebSpeciesCount;
|
||||
}
|
||||
}
|
||||
RecipeManagers.carpenterManager.addRecipe(100, Binnie.Liquid.getLiquidStack("water", 2000), (ItemStack) null, new ItemStack(ExtraBees.dictionary), new Object[] { "X#X", "YEY", "RDR", '#', Blocks.glass_pane, 'X', Items.gold_ingot, 'Y', "ingotTin", 'R', Items.redstone, 'D', Items.diamond, 'E', Items.emerald });
|
||||
}
|
||||
|
||||
public static IGenome getGenome(final IAlleleBeeSpecies allele0) {
|
||||
return Binnie.Genetics.getBeeRoot().templateAsGenome(Binnie.Genetics.getBeeRoot().getTemplate(allele0.getUID()));
|
||||
}
|
||||
|
||||
public static ItemStack getBeeIcon(final IAlleleBeeSpecies species) {
|
||||
if (species == null) {
|
||||
return null;
|
||||
}
|
||||
final IAllele[] template = Binnie.Genetics.getBeeRoot().getTemplate(species.getUID());
|
||||
if (template == null) {
|
||||
return null;
|
||||
}
|
||||
final IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(template);
|
||||
final IBee bee = Binnie.Genetics.getBeeRoot().getBee(BinnieCore.proxy.getWorld(), genome);
|
||||
final ItemStack item = Binnie.Genetics.getBeeRoot().getMemberStack(bee, EnumBeeType.PRINCESS.ordinal());
|
||||
return item;
|
||||
}*/
|
||||
RecipeManagers.carpenterManager.addRecipe(100, Binnie.Liquid.getLiquidStack("water", 2000), null, new ItemStack(ExtraBees.dictionary), "X#X", "YEY", "RDR", '#', Blocks.glass_pane, 'X', Items.gold_ingot, 'Y', "ingotTin", 'R', Items.redstone, 'D', Items.diamond, 'E', Items.emerald);
|
||||
}
|
||||
}
|
||||
@@ -1,38 +1,34 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.genetics.effect;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import java.util.Random;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.block.BlockWeb;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockEctoplasm extends BlockWeb {
|
||||
public BlockEctoplasm() {
|
||||
setLightOpacity(1);
|
||||
setHardness(0.5f);
|
||||
}
|
||||
|
||||
public class BlockEctoplasm extends BlockWeb
|
||||
{
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(final IIconRegister register) {
|
||||
this.blockIcon = ExtraBees.proxy.getIcon(register, "ectoplasm");
|
||||
}
|
||||
|
||||
public BlockEctoplasm() {
|
||||
this.setLightOpacity(1);
|
||||
this.setHardness(0.5f);
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
blockIcon = ExtraBees.proxy.getIcon(register, "ectoplasm");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(final Random rand) {
|
||||
public int quantityDropped(Random rand) {
|
||||
return (rand.nextInt(5) == 0) ? 1 : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(final int p_149650_1_, final Random p_149650_2_, final int p_149650_3_) {
|
||||
public Item getItemDropped(int meta, Random rand, int fortune) {
|
||||
return Items.slime_ball;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,60 +1,56 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.genetics.effect;
|
||||
|
||||
import java.util.List;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.entity.effect.EntityLightningBolt;
|
||||
|
||||
public class EntityBeeLightning extends EntityLightningBolt
|
||||
{
|
||||
import java.util.List;
|
||||
|
||||
public class EntityBeeLightning extends EntityLightningBolt {
|
||||
int lightningState;
|
||||
int boltLivingTime;
|
||||
|
||||
public EntityBeeLightning(final World par1World, final double par2, final double par4, final double par6) {
|
||||
public EntityBeeLightning(World par1World, double par2, double par4, double par6) {
|
||||
super(par1World, par2, par4, par6);
|
||||
this.lightningState = 2;
|
||||
this.boltLivingTime = this.rand.nextInt(3) + 1;
|
||||
lightningState = 2;
|
||||
boltLivingTime = rand.nextInt(3) + 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
this.onEntityUpdate();
|
||||
--this.lightningState;
|
||||
if (this.lightningState < 0) {
|
||||
if (this.boltLivingTime == 0) {
|
||||
this.setDead();
|
||||
}
|
||||
else if (this.lightningState < -this.rand.nextInt(10)) {
|
||||
--this.boltLivingTime;
|
||||
this.lightningState = 1;
|
||||
this.boltVertex = this.rand.nextLong();
|
||||
if (!this.worldObj.isRemote && this.worldObj.doChunksNearChunkExist(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ), 10)) {
|
||||
final int i = MathHelper.floor_double(this.posX);
|
||||
final int j = MathHelper.floor_double(this.posY);
|
||||
final int k = MathHelper.floor_double(this.posZ);
|
||||
if (this.worldObj.getBlock(i, j, k) == null && Blocks.fire.canPlaceBlockAt(this.worldObj, i, j, k)) {
|
||||
this.worldObj.setBlock(i, j, k, Blocks.fire);
|
||||
onEntityUpdate();
|
||||
lightningState--;
|
||||
|
||||
if (lightningState < 0) {
|
||||
if (boltLivingTime == 0) {
|
||||
setDead();
|
||||
} else if (lightningState < -rand.nextInt(10)) {
|
||||
boltLivingTime--;
|
||||
lightningState = 1;
|
||||
boltVertex = rand.nextLong();
|
||||
|
||||
if (!worldObj.isRemote && worldObj.doChunksNearChunkExist(MathHelper.floor_double(posX), MathHelper.floor_double(posY), MathHelper.floor_double(posZ), 10)) {
|
||||
int i = MathHelper.floor_double(posX);
|
||||
int j = MathHelper.floor_double(posY);
|
||||
int k = MathHelper.floor_double(posZ);
|
||||
if (worldObj.getBlock(i, j, k) == null && Blocks.fire.canPlaceBlockAt(worldObj, i, j, k)) {
|
||||
worldObj.setBlock(i, j, k, Blocks.fire);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.lightningState >= 0) {
|
||||
if (this.worldObj.isRemote) {
|
||||
this.worldObj.lastLightningBolt = 2;
|
||||
}
|
||||
else {
|
||||
final double d0 = 3.0;
|
||||
final List list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getBoundingBox(this.posX - d0, this.posY - d0, this.posZ - d0, this.posX + d0, this.posY + 6.0 + d0, this.posZ + d0));
|
||||
for (int l = 0; l < list.size(); ++l) {
|
||||
final Entity entity = (Entity) list.get(l);
|
||||
|
||||
if (lightningState >= 0) {
|
||||
if (worldObj.isRemote) {
|
||||
worldObj.lastLightningBolt = 2;
|
||||
} else {
|
||||
double offset = 3.0;
|
||||
List list = worldObj.getEntitiesWithinAABBExcludingEntity(this, AxisAlignedBB.getBoundingBox(posX - offset, posY - offset, posZ - offset, posX + offset, posY + 6.0 + offset, posZ + offset));
|
||||
for (Object aList : list) {
|
||||
Entity entity = (Entity) aList;
|
||||
entity.onStruckByLightning(this);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,87 +1,84 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.genetics.effect;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.nbt.NBTBase;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class FireworkCreator
|
||||
{
|
||||
public enum Shape
|
||||
{
|
||||
public class FireworkCreator {
|
||||
public enum Shape {
|
||||
Ball,
|
||||
LargeBall,
|
||||
Star,
|
||||
Creeper,
|
||||
Burst;
|
||||
Burst
|
||||
}
|
||||
|
||||
public static class Firework
|
||||
{
|
||||
boolean flicker;
|
||||
boolean trail;
|
||||
ArrayList<Integer> colors;
|
||||
byte shape;
|
||||
public static class Firework {
|
||||
protected boolean flicker;
|
||||
protected boolean trail;
|
||||
protected ArrayList<Integer> colors;
|
||||
protected byte shape;
|
||||
|
||||
public Firework() {
|
||||
this.flicker = false;
|
||||
this.trail = false;
|
||||
this.colors = new ArrayList<Integer>();
|
||||
this.shape = 0;
|
||||
flicker = false;
|
||||
trail = false;
|
||||
colors = new ArrayList<>();
|
||||
shape = 0;
|
||||
}
|
||||
|
||||
public void setFlicker() {
|
||||
this.flicker = true;
|
||||
flicker = true;
|
||||
}
|
||||
|
||||
public void setTrail() {
|
||||
this.trail = true;
|
||||
trail = true;
|
||||
}
|
||||
|
||||
public void setShape(final Shape shape) {
|
||||
public void setShape(Shape shape) {
|
||||
this.shape = (byte) shape.ordinal();
|
||||
}
|
||||
|
||||
public void addColor(final int color) {
|
||||
this.colors.add(color);
|
||||
public void addColor(int color) {
|
||||
colors.add(color);
|
||||
}
|
||||
|
||||
NBTTagCompound getNBT() {
|
||||
final NBTTagCompound nbt = new NBTTagCompound();
|
||||
if (this.flicker) {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
if (flicker) {
|
||||
nbt.setBoolean("Flicker", true);
|
||||
}
|
||||
if (this.trail) {
|
||||
|
||||
if (trail) {
|
||||
nbt.setBoolean("Trail", true);
|
||||
}
|
||||
if (this.colors.size() == 0) {
|
||||
this.addColor(16777215);
|
||||
|
||||
if (colors.size() == 0) {
|
||||
addColor(0xffffff);
|
||||
}
|
||||
final int[] array = new int[this.colors.size()];
|
||||
for (int i = 0; i < this.colors.size(); ++i) {
|
||||
array[i] = this.colors.get(i);
|
||||
|
||||
int[] array = new int[colors.size()];
|
||||
for (int i = 0; i < colors.size(); ++i) {
|
||||
array[i] = colors.get(i);
|
||||
}
|
||||
|
||||
nbt.setIntArray("Colors", array);
|
||||
nbt.setByte("Type", this.shape);
|
||||
nbt.setByte("Type", shape);
|
||||
return nbt;
|
||||
}
|
||||
|
||||
public ItemStack getFirework() {
|
||||
final NBTTagCompound var15 = new NBTTagCompound();
|
||||
final NBTTagCompound var16 = new NBTTagCompound();
|
||||
final NBTTagList var17 = new NBTTagList();
|
||||
var17.appendTag(this.getNBT());
|
||||
var16.setTag("Explosions", var17);
|
||||
var16.setByte("Flight", (byte) 0);
|
||||
var15.setTag("Fireworks", var16);
|
||||
final ItemStack item = new ItemStack(Items.fireworks);
|
||||
item.setTagCompound(var15);
|
||||
NBTTagCompound fireworksNbt = new NBTTagCompound();
|
||||
NBTTagCompound fireworkNbt = new NBTTagCompound();
|
||||
NBTTagList explosions = new NBTTagList();
|
||||
explosions.appendTag(getNBT());
|
||||
fireworkNbt.setTag("Explosions", explosions);
|
||||
fireworkNbt.setByte("Flight", (byte) 0);
|
||||
fireworksNbt.setTag("Fireworks", fireworkNbt);
|
||||
ItemStack item = new ItemStack(Items.fireworks);
|
||||
item.setTagCompound(fireworksNbt);
|
||||
return item;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,75 +1,72 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.genetics.items;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import net.minecraft.world.World;
|
||||
import forestry.api.core.Tabs;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import java.util.List;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import forestry.api.core.Tabs;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
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;
|
||||
import java.util.List;
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister register) {
|
||||
this.itemIcon = ExtraBees.proxy.getIcon(register, "apiaristDatabase");
|
||||
this.iconMaster = ExtraBees.proxy.getIcon(register, "masterApiaristDatabase");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(final int par1) {
|
||||
return (par1 == 0) ? this.itemIcon : this.iconMaster;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(final ItemStack par1ItemStack, final EntityPlayer par2EntityPlayer, final List par3List, final boolean par4) {
|
||||
super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
|
||||
if (par1ItemStack.getItemDamage() > 0) {
|
||||
par3List.add("Flora-in-a-box");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List par3List) {
|
||||
super.getSubItems(par1, par2CreativeTabs, par3List);
|
||||
par3List.add(new ItemStack(par1, 1, 1));
|
||||
}
|
||||
public class ItemDictionary extends Item {
|
||||
protected IIcon iconMaster;
|
||||
|
||||
public ItemDictionary() {
|
||||
this.setCreativeTab(Tabs.tabApiculture);
|
||||
this.setUnlocalizedName("dictionary");
|
||||
this.setMaxStackSize(1);
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
setUnlocalizedName("dictionary");
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(final ItemStack itemstack, final World world, final EntityPlayer player) {
|
||||
if (itemstack.getItemDamage() == 0) {
|
||||
ExtraBees.proxy.openGui(ExtraBeeGUID.Database, player, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {
|
||||
itemIcon = ExtraBees.proxy.getIcon(register, "apiaristDatabase");
|
||||
iconMaster = ExtraBees.proxy.getIcon(register, "masterApiaristDatabase");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return (par1 == 0) ? itemIcon : iconMaster;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||
super.addInformation(stack, player, tooltip, advanced);
|
||||
if (stack.getItemDamage() > 0) {
|
||||
tooltip.add("Flora-in-a-box");
|
||||
}
|
||||
else {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
super.getSubItems(item, tab, list);
|
||||
list.add(new ItemStack(item, 1, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
if (stack.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;
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(final ItemStack i) {
|
||||
return (i.getItemDamage() == 0) ? "Apiarist Database" : "Master Apiarist Database";
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
return (stack.getItemDamage() == 0) ?
|
||||
"Apiarist Database" :
|
||||
"Master Apiarist Database";
|
||||
}
|
||||
}
|
||||
@@ -1,41 +1,37 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.genetics.items;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
// TODO unused class?
|
||||
public class ItemPunnettSquare extends Item {
|
||||
public ItemPunnettSquare() {
|
||||
setCreativeTab(CreativeTabs.tabTools);
|
||||
setMaxStackSize(1);
|
||||
}
|
||||
|
||||
public class ItemPunnettSquare extends Item
|
||||
{
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister register) {
|
||||
this.itemIcon = ExtraBees.proxy.getIcon(register, "");
|
||||
}
|
||||
|
||||
public ItemPunnettSquare() {
|
||||
this.setCreativeTab(CreativeTabs.tabTools);
|
||||
this.setMaxStackSize(1);
|
||||
public void registerIcons(IIconRegister register) {
|
||||
itemIcon = ExtraBees.proxy.getIcon(register, "");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(final ItemStack itemstack) {
|
||||
public String getItemStackDisplayName(ItemStack itemstack) {
|
||||
return "Punnett Square";
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(final ItemStack itemstack, final World world, final EntityPlayer player) {
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
ExtraBees.proxy.openGui(ExtraBeeGUID.PunnettSquare, player, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
return itemstack;
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
@@ -1,31 +1,26 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.craftgui.minecraft.Window;
|
||||
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
public class WindowAlvearyFrame extends Window
|
||||
{
|
||||
Machine machine;
|
||||
ControlPlayerInventory playerInventory;
|
||||
public class WindowAlvearyFrame extends Window {
|
||||
protected Machine machine;
|
||||
protected ControlPlayerInventory playerInventory;
|
||||
|
||||
public WindowAlvearyFrame(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
public WindowAlvearyFrame(EntityPlayer player, IInventory inventory, Side side) {
|
||||
super(176.0f, 144.0f, player, inventory, side);
|
||||
this.machine = ((TileEntityMachine) inventory).getMachine();
|
||||
machine = ((TileEntityMachine) inventory).getMachine();
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
public static Window create(EntityPlayer player, IInventory inventory, Side side) {
|
||||
if (player == null || inventory == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -34,9 +29,9 @@ public class WindowAlvearyFrame extends Window
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle("Frame Housing");
|
||||
this.playerInventory = new ControlPlayerInventory(this);
|
||||
final ControlSlot slot = new ControlSlot(this, 79.0f, 30.0f);
|
||||
setTitle("Frame Housing");
|
||||
playerInventory = new ControlPlayerInventory(this);
|
||||
ControlSlot slot = new ControlSlot(this, 79.0f, 30.0f);
|
||||
slot.assign(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,32 +1,27 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.extrabees.apiary.machine.AlvearyHatchery;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlotArray;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.craftgui.minecraft.Window;
|
||||
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlotArray;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.apiary.machine.AlvearyHatchery;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
public class WindowAlvearyHatchery extends Window
|
||||
{
|
||||
Machine machine;
|
||||
ControlPlayerInventory playerInventory;
|
||||
public class WindowAlvearyHatchery extends Window {
|
||||
protected Machine machine;
|
||||
protected ControlPlayerInventory playerInventory;
|
||||
|
||||
public WindowAlvearyHatchery(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
public WindowAlvearyHatchery(EntityPlayer player, IInventory inventory, Side side) {
|
||||
super(176.0f, 144.0f, player, inventory, side);
|
||||
this.machine = ((TileEntityMachine) inventory).getMachine();
|
||||
machine = ((TileEntityMachine) inventory).getMachine();
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
public static Window create(EntityPlayer player, IInventory inventory, Side side) {
|
||||
if (player == null || inventory == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -35,9 +30,9 @@ public class WindowAlvearyHatchery extends Window
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle("Hatchery");
|
||||
this.playerInventory = new ControlPlayerInventory(this);
|
||||
final ControlSlotArray slot = new ControlSlotArray(this, 43, 30, 5, 1);
|
||||
setTitle("Hatchery");
|
||||
playerInventory = new ControlPlayerInventory(this);
|
||||
ControlSlotArray slot = new ControlSlotArray(this, 43, 30, 5, 1);
|
||||
slot.create(AlvearyHatchery.slotLarvae);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,31 +1,27 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.craftgui.minecraft.Window;
|
||||
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
public class WindowAlvearyIndustrialFrame extends Window
|
||||
{
|
||||
Machine machine;
|
||||
ControlPlayerInventory playerInventory;
|
||||
// TODO unused class?
|
||||
public class WindowAlvearyIndustrialFrame extends Window {
|
||||
protected Machine machine;
|
||||
protected ControlPlayerInventory playerInventory;
|
||||
|
||||
public WindowAlvearyIndustrialFrame(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
public WindowAlvearyIndustrialFrame(EntityPlayer player, IInventory inventory, Side side) {
|
||||
super(176.0f, 144.0f, player, inventory, side);
|
||||
this.machine = ((TileEntityMachine) inventory).getMachine();
|
||||
machine = ((TileEntityMachine) inventory).getMachine();
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
public static Window create(EntityPlayer player, IInventory inventory, Side side) {
|
||||
if (player == null || inventory == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -34,9 +30,9 @@ public class WindowAlvearyIndustrialFrame extends Window
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle("Industrial Frame Housing");
|
||||
this.playerInventory = new ControlPlayerInventory(this);
|
||||
final ControlSlot slot = new ControlSlot(this, 79.0f, 30.0f);
|
||||
setTitle("Industrial Frame Housing");
|
||||
playerInventory = new ControlPlayerInventory(this);
|
||||
ControlSlot slot = new ControlSlot(this, 79.0f, 30.0f);
|
||||
slot.assign(0);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,37 +1,32 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.craftgui.minecraft.control.ControlItemDisplay;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import binnie.extrabees.apiary.machine.AlvearyMutator;
|
||||
import binnie.core.craftgui.controls.ControlText;
|
||||
import binnie.core.craftgui.geometry.TextJustification;
|
||||
import binnie.core.craftgui.geometry.IArea;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.craftgui.geometry.TextJustification;
|
||||
import binnie.core.craftgui.minecraft.Window;
|
||||
import binnie.core.craftgui.minecraft.control.ControlItemDisplay;
|
||||
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.apiary.machine.AlvearyMutator;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class WindowAlvearyMutator extends Window
|
||||
{
|
||||
Machine machine;
|
||||
ControlPlayerInventory playerInventory;
|
||||
public class WindowAlvearyMutator extends Window {
|
||||
protected Machine machine;
|
||||
protected ControlPlayerInventory playerInventory;
|
||||
|
||||
public WindowAlvearyMutator(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
public WindowAlvearyMutator(EntityPlayer player, IInventory inventory, Side side) {
|
||||
super(176.0f, 176.0f, player, inventory, side);
|
||||
this.machine = ((TileEntityMachine) inventory).getMachine();
|
||||
machine = ((TileEntityMachine) inventory).getMachine();
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
public static Window create(EntityPlayer player, IInventory inventory, Side side) {
|
||||
if (player == null || inventory == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -40,21 +35,24 @@ public class WindowAlvearyMutator extends Window
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle("Mutator");
|
||||
this.playerInventory = new ControlPlayerInventory(this);
|
||||
final ControlSlot slot = new ControlSlot(this, 79.0f, 30.0f);
|
||||
setTitle("Mutator");
|
||||
playerInventory = new ControlPlayerInventory(this);
|
||||
ControlSlot slot = new ControlSlot(this, 79.0f, 30.0f);
|
||||
slot.assign(0);
|
||||
new ControlText(this, new IArea(0.0f, 52.0f, this.w(), 16.0f), "Possible Mutagens:", TextJustification.MiddleCenter).setColor(5592405);
|
||||
final int size = AlvearyMutator.getMutagens().size();
|
||||
final int w = size * 18;
|
||||
if (size > 0) {
|
||||
float x = (this.w() - w) / 2.0f;
|
||||
for (final ItemStack stack : AlvearyMutator.getMutagens()) {
|
||||
final ControlItemDisplay display = new ControlItemDisplay(this, x, 66.0f);
|
||||
display.setItemStack(stack);
|
||||
display.hastooltip = true;
|
||||
x += 18.0f;
|
||||
}
|
||||
new ControlText(this, new IArea(0.0f, 52.0f, w(), 16.0f), "Possible Mutagens:", TextJustification.MiddleCenter).setColor(5592405);
|
||||
int size = AlvearyMutator.getMutagens().size();
|
||||
int w = size * 18;
|
||||
|
||||
if (size <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
float x = (w() - w) / 2.0f;
|
||||
for (ItemStack stack : AlvearyMutator.getMutagens()) {
|
||||
ControlItemDisplay display = new ControlItemDisplay(this, x, 66.0f);
|
||||
display.setItemStack(stack);
|
||||
display.hastooltip = true;
|
||||
x += 18.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,34 +1,29 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.extrabees.apiary.machine.AlvearyStimulator;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.core.craftgui.geometry.Position;
|
||||
import binnie.core.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.craftgui.minecraft.Window;
|
||||
import binnie.core.craftgui.minecraft.control.ControlEnergyBar;
|
||||
import binnie.core.craftgui.minecraft.control.ControlPlayerInventory;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.TileEntityMachine;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.apiary.machine.AlvearyStimulator;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
public class WindowAlvearyStimulator extends Window
|
||||
{
|
||||
Machine machine;
|
||||
ControlPlayerInventory playerInventory;
|
||||
public class WindowAlvearyStimulator extends Window {
|
||||
protected Machine machine;
|
||||
protected ControlPlayerInventory playerInventory;
|
||||
|
||||
public WindowAlvearyStimulator(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
public WindowAlvearyStimulator(EntityPlayer player, IInventory inventory, Side side) {
|
||||
super(176.0f, 144.0f, player, inventory, side);
|
||||
this.machine = ((TileEntityMachine) inventory).getMachine();
|
||||
machine = ((TileEntityMachine) inventory).getMachine();
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
public static Window create(EntityPlayer player, IInventory inventory, Side side) {
|
||||
if (player == null || inventory == null) {
|
||||
return null;
|
||||
}
|
||||
@@ -37,11 +32,11 @@ public class WindowAlvearyStimulator extends Window
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle("Stimulator");
|
||||
setTitle("Stimulator");
|
||||
new ControlEnergyBar(this, 75, 29, 60, 16, Position.Left);
|
||||
final ControlSlot slot = new ControlSlot(this, 41.0f, 28.0f);
|
||||
ControlSlot slot = new ControlSlot(this, 41.0f, 28.0f);
|
||||
slot.assign(AlvearyStimulator.slotCircuit);
|
||||
this.playerInventory = new ControlPlayerInventory(this);
|
||||
playerInventory = new ControlPlayerInventory(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,54 +1,51 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui.database;
|
||||
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.Binnie;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import binnie.core.craftgui.geometry.IArea;
|
||||
import binnie.core.craftgui.resource.minecraft.CraftGUITexture;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.Tooltip;
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import java.util.ArrayList;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import java.util.List;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.geometry.IArea;
|
||||
import binnie.core.craftgui.resource.minecraft.CraftGUITexture;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
|
||||
public class ControlBiomes extends Control implements ITooltip
|
||||
{
|
||||
List<Integer> tolerated;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public ControlBiomes(final IWidget parent, final int x, final int y, final int width, final int height) {
|
||||
public class ControlBiomes extends Control implements ITooltip {
|
||||
protected List<Integer> tolerated;
|
||||
|
||||
public ControlBiomes(IWidget parent, int x, int y, int width, int height) {
|
||||
super(parent, x, y, width * 16, height * 16);
|
||||
this.tolerated = new ArrayList<Integer>();
|
||||
this.addAttribute(WidgetAttribute.MouseOver);
|
||||
tolerated = new ArrayList<>();
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
if (this.tolerated.isEmpty()) {
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
if (tolerated.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
final int x = (int) (this.getRelativeMousePosition().x() / 16.0f);
|
||||
final int y = (int) (this.getRelativeMousePosition().y() / 16.0f);
|
||||
final int i = x + y * 8;
|
||||
if (i < this.tolerated.size()) {
|
||||
tooltip.add(BiomeGenBase.getBiome(this.tolerated.get(i)).biomeName);
|
||||
|
||||
int x = (int) (getRelativeMousePosition().x() / 16.0f);
|
||||
int y = (int) (getRelativeMousePosition().y() / 16.0f);
|
||||
int i = x + y * 8;
|
||||
if (i < tolerated.size()) {
|
||||
tooltip.add(BiomeGenBase.getBiome(tolerated.get(i)).biomeName);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderForeground() {
|
||||
for (int i = 0; i < this.tolerated.size(); ++i) {
|
||||
final int x = i % 8 * 16;
|
||||
final int y = i / 8 * 16;
|
||||
for (int i = 0; i < 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);
|
||||
}
|
||||
@@ -56,12 +53,14 @@ public class ControlBiomes extends Control implements ITooltip
|
||||
}
|
||||
}
|
||||
|
||||
public void setSpecies(final IAlleleBeeSpecies species) {
|
||||
this.tolerated.clear();
|
||||
public void setSpecies(IAlleleBeeSpecies species) {
|
||||
tolerated.clear();
|
||||
if (species == null) {
|
||||
return;
|
||||
}
|
||||
final IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(Binnie.Genetics.getBeeRoot().getTemplate(species.getUID()));
|
||||
final IBee bee = Binnie.Genetics.getBeeRoot().getBee(BinnieCore.proxy.getWorld(), genome);
|
||||
|
||||
// TODO unused code?
|
||||
IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(Binnie.Genetics.getBeeRoot().getTemplate(species.getUID()));
|
||||
IBee bee = Binnie.Genetics.getBeeRoot().getBee(BinnieCore.proxy.getWorld(), genome);
|
||||
}
|
||||
}
|
||||
@@ -1,156 +1,157 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui.database;
|
||||
|
||||
import forestry.api.genetics.EnumTolerance;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import binnie.Binnie;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import binnie.core.craftgui.geometry.IArea;
|
||||
import binnie.core.craftgui.resource.minecraft.CraftGUITexture;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.Tooltip;
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import java.util.ArrayList;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import java.util.List;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.geometry.IArea;
|
||||
import binnie.core.craftgui.resource.minecraft.CraftGUITexture;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import forestry.api.genetics.EnumTolerance;
|
||||
|
||||
public class ControlClimateBar extends Control implements ITooltip
|
||||
{
|
||||
boolean isHumidity;
|
||||
List<Integer> tolerated;
|
||||
int[] tempColours;
|
||||
int[] humidColours;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public ControlClimateBar(final IWidget parent, final int x, final int y, final int width, final int height) {
|
||||
public class ControlClimateBar extends Control implements ITooltip {
|
||||
protected boolean isHumidity;
|
||||
protected List<Integer> tolerated;
|
||||
protected int[] tempColours;
|
||||
protected int[] humidColours;
|
||||
|
||||
public ControlClimateBar(IWidget parent, int x, int y, int width, int height) {
|
||||
super(parent, x, y, width, height);
|
||||
this.isHumidity = false;
|
||||
this.tolerated = new ArrayList<Integer>();
|
||||
this.tempColours = new int[] { 65531, 7912447, 5242672, 16776960, 16753152, 16711680 };
|
||||
this.humidColours = new int[] { 16770979, 1769216, 3177727 };
|
||||
this.addAttribute(WidgetAttribute.MouseOver);
|
||||
isHumidity = false;
|
||||
tolerated = new ArrayList<>();
|
||||
tempColours = new int[]{0x00fffb, 0x78bbff, 0x4fff30, 0xffff00, 0xffa200, 0xff0000};
|
||||
humidColours = new int[]{0xffe7a3, 0x1aff00, 0x307cff};
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
}
|
||||
|
||||
public ControlClimateBar(final IWidget parent, final int x, final int y, final int width, final int height, final boolean humidity) {
|
||||
public ControlClimateBar(IWidget parent, int x, int y, int width, int height, boolean humidity) {
|
||||
super(parent, x, y, width, height);
|
||||
this.isHumidity = false;
|
||||
this.tolerated = new ArrayList<Integer>();
|
||||
this.tempColours = new int[] { 65531, 7912447, 5242672, 16776960, 16753152, 16711680 };
|
||||
this.humidColours = new int[] { 16770979, 1769216, 3177727 };
|
||||
this.addAttribute(WidgetAttribute.MouseOver);
|
||||
this.isHumidity = true;
|
||||
tolerated = new ArrayList<>();
|
||||
tempColours = new int[]{0x00fffb, 0x78bbff, 0x4fff30, 0xffff00, 0xffa200, 0xff0000};
|
||||
humidColours = new int[]{0xffe7a3, 0x1aff00, 0x307cff};
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
isHumidity = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
if (this.tolerated.isEmpty()) {
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
if (tolerated.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
final int types = this.isHumidity ? 3 : 6;
|
||||
final int type = (int) ((int) (this.getRelativeMousePosition().x() - 1.0f) / ((this.getSize().x() - 2.0f) / types));
|
||||
if (!this.tolerated.contains(type)) {
|
||||
|
||||
int types = isHumidity ? 3 : 6;
|
||||
int type = (int) ((int) (getRelativeMousePosition().x() - 1.0f) / ((getSize().x() - 2.0f) / types));
|
||||
if (!tolerated.contains(type) || type >= types) {
|
||||
return;
|
||||
}
|
||||
if (type < types) {
|
||||
if (this.isHumidity) {
|
||||
tooltip.add(EnumHumidity.values()[type].name);
|
||||
}
|
||||
else {
|
||||
tooltip.add(EnumTemperature.values()[type + 1].name);
|
||||
}
|
||||
|
||||
if (isHumidity) {
|
||||
tooltip.add(EnumHumidity.values()[type].name);
|
||||
} else {
|
||||
tooltip.add(EnumTemperature.values()[type + 1].name);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.Render.texture(CraftGUITexture.EnergyBarBack, this.getArea());
|
||||
final int types = this.isHumidity ? 3 : 6;
|
||||
final int w = (int) ((this.getSize().x() - 2.0f) / types);
|
||||
CraftGUI.Render.texture(CraftGUITexture.EnergyBarBack, getArea());
|
||||
int types = isHumidity ? 3 : 6;
|
||||
int w = (int) ((getSize().x() - 2.0f) / types);
|
||||
for (int i = 0; i < types; ++i) {
|
||||
final int x = i * w;
|
||||
if (this.tolerated.contains(i)) {
|
||||
int colour = 0;
|
||||
if (this.isHumidity) {
|
||||
colour = this.humidColours[i];
|
||||
int x = i * w;
|
||||
if (tolerated.contains(i)) {
|
||||
int colour;
|
||||
if (isHumidity) {
|
||||
colour = humidColours[i];
|
||||
} else {
|
||||
colour = tempColours[i];
|
||||
}
|
||||
else {
|
||||
colour = this.tempColours[i];
|
||||
}
|
||||
CraftGUI.Render.solid(new IArea(x + 1, 1.0f, w, this.getSize().y() - 2.0f), colour);
|
||||
CraftGUI.Render.solid(new IArea(x + 1, 1.0f, w, getSize().y() - 2.0f), colour);
|
||||
}
|
||||
}
|
||||
CraftGUI.Render.texture(CraftGUITexture.EnergyBarGlass, this.getArea());
|
||||
CraftGUI.Render.texture(CraftGUITexture.EnergyBarGlass, getArea());
|
||||
}
|
||||
|
||||
public void setSpecies(final IAlleleBeeSpecies species) {
|
||||
this.tolerated.clear();
|
||||
public void setSpecies(IAlleleBeeSpecies species) {
|
||||
tolerated.clear();
|
||||
if (species == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
int main;
|
||||
EnumTolerance tolerance;
|
||||
if (!this.isHumidity) {
|
||||
if (!isHumidity) {
|
||||
main = species.getTemperature().ordinal() - 1;
|
||||
final IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(Binnie.Genetics.getBeeRoot().getTemplate(species.getUID()));
|
||||
IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(Binnie.Genetics.getBeeRoot().getTemplate(species.getUID()));
|
||||
tolerance = genome.getToleranceTemp();
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
main = species.getHumidity().ordinal();
|
||||
final IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(Binnie.Genetics.getBeeRoot().getTemplate(species.getUID()));
|
||||
IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(Binnie.Genetics.getBeeRoot().getTemplate(species.getUID()));
|
||||
tolerance = genome.getToleranceHumid();
|
||||
}
|
||||
this.tolerated.add(main);
|
||||
|
||||
tolerated.add(main);
|
||||
switch (tolerance) {
|
||||
case BOTH_5:
|
||||
case UP_5: {
|
||||
this.tolerated.add(main + 5);
|
||||
}
|
||||
case BOTH_4:
|
||||
case UP_4: {
|
||||
this.tolerated.add(main + 4);
|
||||
}
|
||||
case BOTH_3:
|
||||
case UP_3: {
|
||||
this.tolerated.add(main + 3);
|
||||
}
|
||||
case BOTH_2:
|
||||
case UP_2: {
|
||||
this.tolerated.add(main + 2);
|
||||
}
|
||||
case BOTH_1:
|
||||
case UP_1: {
|
||||
this.tolerated.add(main + 1);
|
||||
break;
|
||||
}
|
||||
case BOTH_5:
|
||||
case UP_5:
|
||||
tolerated.add(main + 5);
|
||||
break;
|
||||
|
||||
case BOTH_4:
|
||||
case UP_4:
|
||||
tolerated.add(main + 4);
|
||||
break;
|
||||
|
||||
case BOTH_3:
|
||||
case UP_3:
|
||||
tolerated.add(main + 3);
|
||||
break;
|
||||
|
||||
case BOTH_2:
|
||||
case UP_2:
|
||||
tolerated.add(main + 2);
|
||||
break;
|
||||
|
||||
case BOTH_1:
|
||||
case UP_1:
|
||||
tolerated.add(main + 1);
|
||||
break;
|
||||
}
|
||||
|
||||
switch (tolerance) {
|
||||
case BOTH_5:
|
||||
case DOWN_5: {
|
||||
this.tolerated.add(main - 5);
|
||||
}
|
||||
case BOTH_4:
|
||||
case DOWN_4: {
|
||||
this.tolerated.add(main - 4);
|
||||
}
|
||||
case BOTH_3:
|
||||
case DOWN_3: {
|
||||
this.tolerated.add(main - 3);
|
||||
}
|
||||
case BOTH_2:
|
||||
case DOWN_2: {
|
||||
this.tolerated.add(main - 2);
|
||||
}
|
||||
case BOTH_1:
|
||||
case DOWN_1: {
|
||||
this.tolerated.add(main - 1);
|
||||
break;
|
||||
}
|
||||
case BOTH_5:
|
||||
case DOWN_5:
|
||||
tolerated.add(main - 5);
|
||||
break;
|
||||
|
||||
case BOTH_4:
|
||||
case DOWN_4:
|
||||
tolerated.add(main - 4);
|
||||
break;
|
||||
|
||||
case BOTH_3:
|
||||
case DOWN_3:
|
||||
tolerated.add(main - 3);
|
||||
break;
|
||||
|
||||
case BOTH_2:
|
||||
case DOWN_2:
|
||||
tolerated.add(main - 2);
|
||||
break;
|
||||
|
||||
case BOTH_1:
|
||||
case DOWN_1:
|
||||
tolerated.add(main - 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,74 +1,73 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui.database;
|
||||
|
||||
import java.util.List;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.controls.listbox.ControlListBox;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import java.util.Map;
|
||||
import java.util.ArrayList;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import binnie.core.craftgui.controls.listbox.ControlListBox;
|
||||
|
||||
public class ControlProductsBox extends ControlListBox<ControlProductsBox.Product>
|
||||
{
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
public class ControlProductsBox extends ControlListBox<ControlProductsBox.Product> {
|
||||
protected IAlleleBeeSpecies species;
|
||||
|
||||
private int index;
|
||||
private Type type;
|
||||
IAlleleBeeSpecies species;
|
||||
|
||||
@Override
|
||||
public IWidget createOption(final Product value, final int y) {
|
||||
return new ControlProductsItem(getContent(), value, y);
|
||||
}
|
||||
|
||||
public ControlProductsBox(final IWidget parent, final int x, final int y, final int width, final int height, final Type type) {
|
||||
public ControlProductsBox(IWidget parent, int x, int y, int width, int height, Type type) {
|
||||
super(parent, x, y, width, height, 12.0f);
|
||||
this.species = null;
|
||||
species = null;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public void setSpecies(final IAlleleBeeSpecies species) {
|
||||
@Override
|
||||
public IWidget createOption(Product value, int y) {
|
||||
return new ControlProductsItem(getContent(), value, y);
|
||||
}
|
||||
|
||||
public void setSpecies(IAlleleBeeSpecies species) {
|
||||
if (species != this.species && (this.species = species) != null) {
|
||||
final IAllele[] template = Binnie.Genetics.getBeeRoot().getTemplate(species.getUID());
|
||||
IAllele[] template = Binnie.Genetics.getBeeRoot().getTemplate(species.getUID());
|
||||
if (template == null) {
|
||||
return;
|
||||
}
|
||||
final IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(template);
|
||||
final float speed = genome.getSpeed();
|
||||
final float modeSpeed = Binnie.Genetics.getBeeRoot().getBeekeepingMode(BinnieCore.proxy.getWorld()).getBeeModifier().getProductionModifier(genome, 1.0f);
|
||||
final List<Product> strings = new ArrayList<Product>();
|
||||
if (this.type == Type.Products) {
|
||||
for (final Map.Entry<ItemStack, Float> entry : species.getProductChances().entrySet()) {
|
||||
|
||||
IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(template);
|
||||
float speed = genome.getSpeed();
|
||||
float modeSpeed = Binnie.Genetics.getBeeRoot()
|
||||
.getBeekeepingMode(BinnieCore.proxy.getWorld())
|
||||
.getBeeModifier()
|
||||
.getProductionModifier(genome, 1.0f);
|
||||
|
||||
List<Product> strings = new ArrayList<>();
|
||||
if (type == Type.Products) {
|
||||
for (Map.Entry<ItemStack, Float> entry : species.getProductChances().entrySet()) {
|
||||
strings.add(new Product(entry.getKey(), speed * modeSpeed * entry.getValue()));
|
||||
}
|
||||
} else {
|
||||
for (Map.Entry<ItemStack, Float> entry : species.getSpecialtyChances().entrySet()) {
|
||||
strings.add(new Product(entry.getKey(), speed * modeSpeed * entry.getValue()));
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (final Map.Entry<ItemStack, Float> entry : species.getSpecialtyChances().entrySet()) {
|
||||
strings.add(new Product(entry.getKey(), speed * modeSpeed * entry.getValue()));
|
||||
}
|
||||
}
|
||||
this.setOptions(strings);
|
||||
setOptions(strings);
|
||||
}
|
||||
}
|
||||
|
||||
enum Type
|
||||
{
|
||||
enum Type {
|
||||
Products,
|
||||
Specialties;
|
||||
Specialties
|
||||
}
|
||||
|
||||
class Product
|
||||
{
|
||||
ItemStack item;
|
||||
float chance;
|
||||
class Product {
|
||||
protected ItemStack item;
|
||||
protected float chance;
|
||||
|
||||
public Product(final ItemStack item, final float chance) {
|
||||
public Product(ItemStack item, float chance) {
|
||||
this.item = item;
|
||||
this.chance = chance;
|
||||
}
|
||||
|
||||
@@ -1,43 +1,41 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui.database;
|
||||
|
||||
import binnie.core.craftgui.controls.ControlText;
|
||||
import java.text.DecimalFormat;
|
||||
import binnie.core.craftgui.geometry.CraftGUIUtil;
|
||||
import binnie.core.craftgui.geometry.IPoint;
|
||||
import binnie.core.craftgui.controls.ControlTextCentered;
|
||||
import binnie.core.craftgui.controls.listbox.ControlList;
|
||||
import binnie.core.craftgui.minecraft.control.ControlItemDisplay;
|
||||
import binnie.core.craftgui.controls.listbox.ControlOption;
|
||||
import binnie.core.craftgui.geometry.CraftGUIUtil;
|
||||
import binnie.core.craftgui.geometry.IPoint;
|
||||
import binnie.core.craftgui.minecraft.control.ControlItemDisplay;
|
||||
|
||||
public class ControlProductsItem extends ControlOption<ControlProductsBox.Product>
|
||||
{
|
||||
ControlItemDisplay item;
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
public ControlProductsItem(final ControlList<ControlProductsBox.Product> controlList, final ControlProductsBox.Product value, final int y) {
|
||||
public class ControlProductsItem extends ControlOption<ControlProductsBox.Product> {
|
||||
protected 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)).setTooltip();
|
||||
final ControlText textWidget = new ControlTextCentered(this, 2.0f, "");
|
||||
(item = new ControlItemDisplay(this, 4.0f, 4.0f)).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);
|
||||
final float time = (int) (55000.0 / value.chance);
|
||||
final float seconds = time / 20.0f;
|
||||
final float minutes = seconds / 60.0f;
|
||||
final float hours = minutes / 60.0f;
|
||||
final DecimalFormat df = new DecimalFormat("#.0");
|
||||
if (hours > 1.0f) {
|
||||
textWidget.setValue("Every " + df.format(hours) + " hours");
|
||||
}
|
||||
else if (minutes > 1.0f) {
|
||||
textWidget.setValue("Every " + df.format(minutes) + " min.");
|
||||
}
|
||||
else {
|
||||
textWidget.setValue("Every " + df.format(seconds) + " sec.");
|
||||
}
|
||||
|
||||
if (value == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
item.setItemStack(value.item);
|
||||
float time = (int) (55000.0 / 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.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,35 +1,30 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui.database;
|
||||
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.controls.ControlTextCentered;
|
||||
import binnie.core.craftgui.database.DatabaseTab;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.database.PageSpecies;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
|
||||
public class PageSpeciesClimate extends PageSpecies
|
||||
{
|
||||
ControlClimateBar tempBar;
|
||||
ControlClimateBar humidBar;
|
||||
ControlBiomes biomes;
|
||||
public class PageSpeciesClimate extends PageSpecies {
|
||||
protected ControlClimateBar tempBar;
|
||||
protected ControlClimateBar humidBar;
|
||||
protected ControlBiomes biomes;
|
||||
|
||||
public PageSpeciesClimate(final IWidget parent, final DatabaseTab tab) {
|
||||
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);
|
||||
tempBar = new ControlClimateBar(this, 8, 24, 128, 12);
|
||||
humidBar = new ControlClimateBar(this, 8, 42, 128, 12, true);
|
||||
new ControlTextCentered(this, 70.0f, "Biomes");
|
||||
this.biomes = new ControlBiomes(this, 8, 90, 8, 4);
|
||||
biomes = new ControlBiomes(this, 8, 90, 8, 4);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(final IAlleleSpecies species) {
|
||||
this.tempBar.setSpecies((IAlleleBeeSpecies) species);
|
||||
this.humidBar.setSpecies((IAlleleBeeSpecies) species);
|
||||
this.biomes.setSpecies((IAlleleBeeSpecies) species);
|
||||
public void onValueChanged(IAlleleSpecies species) {
|
||||
tempBar.setSpecies((IAlleleBeeSpecies) species);
|
||||
humidBar.setSpecies((IAlleleBeeSpecies) species);
|
||||
biomes.setSpecies((IAlleleBeeSpecies) species);
|
||||
}
|
||||
}
|
||||
@@ -1,40 +1,35 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui.database;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.controls.ControlText;
|
||||
import binnie.core.craftgui.controls.ControlTextCentered;
|
||||
import binnie.core.craftgui.database.DatabaseTab;
|
||||
import binnie.core.craftgui.database.PageSpecies;
|
||||
import binnie.core.craftgui.geometry.IArea;
|
||||
import binnie.core.craftgui.geometry.TextJustification;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.Binnie;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import binnie.core.craftgui.geometry.TextJustification;
|
||||
import binnie.core.craftgui.geometry.IArea;
|
||||
import binnie.core.craftgui.controls.ControlTextCentered;
|
||||
import binnie.core.craftgui.database.DatabaseTab;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.controls.ControlText;
|
||||
import binnie.core.craftgui.database.PageSpecies;
|
||||
|
||||
public class PageSpeciesGenome extends PageSpecies
|
||||
{
|
||||
ControlText pageSpeciesGenome_Title;
|
||||
ControlText pageSpeciesGenome_SpeedText;
|
||||
ControlText pageSpeciesGenome_LifespanText;
|
||||
ControlText pageSpeciesGenome_FertilityText;
|
||||
ControlText pageSpeciesGenome_FloweringText;
|
||||
ControlText pageSpeciesGenome_TerritoryText;
|
||||
ControlText pageSpeciesGenome_NocturnalText;
|
||||
ControlText pageSpeciesGenome_CaveDwellingText;
|
||||
ControlText pageSpeciesGenome_TolerantFlyerText;
|
||||
ControlText pageSpeciesGenome_FlowerText;
|
||||
ControlText pageSpeciesGenome_EffectText;
|
||||
public class PageSpeciesGenome extends PageSpecies {
|
||||
protected ControlText title;
|
||||
protected ControlText speedText;
|
||||
protected ControlText lifespanText;
|
||||
protected ControlText fertilityText;
|
||||
protected ControlText floweringText;
|
||||
protected ControlText territoryText;
|
||||
protected ControlText nocturnalText;
|
||||
protected ControlText caveDwellingText;
|
||||
protected ControlText tolerantFlyerText;
|
||||
protected ControlText flowerText;
|
||||
protected ControlText effectText;
|
||||
|
||||
public PageSpeciesGenome(final IWidget parent, final DatabaseTab tab) {
|
||||
public PageSpeciesGenome(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
this.pageSpeciesGenome_Title = new ControlTextCentered(this, 8.0f, "Genome");
|
||||
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);
|
||||
@@ -45,57 +40,21 @@ public class PageSpeciesGenome extends PageSpecies
|
||||
new ControlText(this, new IArea(0.0f, 121.0f, 68.0f, 30.0f), "Rain:", TextJustification.TopRight);
|
||||
new ControlText(this, new IArea(0.0f, 138.0f, 68.0f, 30.0f), "Flower:", TextJustification.TopRight);
|
||||
new ControlText(this, new IArea(0.0f, 155.0f, 68.0f, 30.0f), "Effect:", TextJustification.TopRight);
|
||||
final int x = 72;
|
||||
this.pageSpeciesGenome_SpeedText = new ControlText(this, new IArea(x, 32.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
this.pageSpeciesGenome_LifespanText = new ControlText(this, new IArea(x, 44.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
this.pageSpeciesGenome_FertilityText = new ControlText(this, new IArea(x, 56.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
this.pageSpeciesGenome_FloweringText = new ControlText(this, new IArea(x, 68.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
this.pageSpeciesGenome_TerritoryText = new ControlText(this, new IArea(x, 80.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
this.pageSpeciesGenome_NocturnalText = new ControlText(this, new IArea(x, 97.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
this.pageSpeciesGenome_CaveDwellingText = new ControlText(this, new IArea(x, 109.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
this.pageSpeciesGenome_TolerantFlyerText = new ControlText(this, new IArea(x, 121.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
this.pageSpeciesGenome_FlowerText = new ControlText(this, new IArea(x, 138.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
this.pageSpeciesGenome_EffectText = new ControlText(this, new IArea(x, 155.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
int x = 72;
|
||||
|
||||
speedText = new ControlText(this, new IArea(x, 32.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
lifespanText = new ControlText(this, new IArea(x, 44.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
fertilityText = new ControlText(this, new IArea(x, 56.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
floweringText = new ControlText(this, new IArea(x, 68.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
territoryText = new ControlText(this, new IArea(x, 80.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
nocturnalText = new ControlText(this, new IArea(x, 97.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
caveDwellingText = new ControlText(this, new IArea(x, 109.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
tolerantFlyerText = new ControlText(this, new IArea(x, 121.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
flowerText = new ControlText(this, new IArea(x, 138.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
effectText = new ControlText(this, new IArea(x, 155.0f, 72.0f, 30.0f), "", TextJustification.TopLeft);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(final IAlleleSpecies species) {
|
||||
final IAllele[] template = Binnie.Genetics.getBeeRoot().getTemplate(species.getUID());
|
||||
if (template != null) {
|
||||
final IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(template);
|
||||
final IBee bee = Binnie.Genetics.getBeeRoot().getBee(BinnieCore.proxy.getWorld(), genome);
|
||||
this.pageSpeciesGenome_SpeedText.setValue(rateSpeed(genome.getSpeed()));
|
||||
this.pageSpeciesGenome_LifespanText.setValue(rateLifespan(genome.getLifespan()));
|
||||
this.pageSpeciesGenome_FertilityText.setValue(genome.getFertility() + " children");
|
||||
this.pageSpeciesGenome_FloweringText.setValue(rateFlowering(genome.getFlowering()));
|
||||
final int[] area = genome.getTerritory();
|
||||
this.pageSpeciesGenome_TerritoryText.setValue(area[0] + "x" + area[1] + "x" + area[2]);
|
||||
String behavior = "Daytime";
|
||||
if (genome.getPrimary().isNocturnal()) {
|
||||
behavior = "Nighttime";
|
||||
}
|
||||
if (genome.getNocturnal()) {
|
||||
behavior = "All Day";
|
||||
}
|
||||
this.pageSpeciesGenome_NocturnalText.setValue(behavior);
|
||||
if (genome.getCaveDwelling()) {
|
||||
this.pageSpeciesGenome_CaveDwellingText.setValue("Not Needed");
|
||||
}
|
||||
else {
|
||||
this.pageSpeciesGenome_CaveDwellingText.setValue("Required");
|
||||
}
|
||||
this.pageSpeciesGenome_TolerantFlyerText.setValue(tolerated(genome.getTolerantFlyer()));
|
||||
if (genome.getFlowerProvider() != null) {
|
||||
this.pageSpeciesGenome_FlowerText.setValue(genome.getFlowerProvider().getDescription());
|
||||
}
|
||||
else {
|
||||
this.pageSpeciesGenome_FlowerText.setValue("None");
|
||||
}
|
||||
this.pageSpeciesGenome_EffectText.setValue(genome.getEffect().getName());
|
||||
}
|
||||
}
|
||||
|
||||
public static String rateFlowering(final int flowering) {
|
||||
public static String rateFlowering(int flowering) {
|
||||
if (flowering >= 99) {
|
||||
return "Maximum";
|
||||
}
|
||||
@@ -120,7 +79,7 @@ public class PageSpeciesGenome extends PageSpecies
|
||||
return "Slowest";
|
||||
}
|
||||
|
||||
public static String rateSpeed(final float speed) {
|
||||
public static String rateSpeed(float speed) {
|
||||
if (speed >= 1.7f) {
|
||||
return "Fastest";
|
||||
}
|
||||
@@ -142,7 +101,7 @@ public class PageSpeciesGenome extends PageSpecies
|
||||
return "Slowest";
|
||||
}
|
||||
|
||||
public static String rateLifespan(final int life) {
|
||||
public static String rateLifespan(int life) {
|
||||
if (life >= 70) {
|
||||
return "Longest";
|
||||
}
|
||||
@@ -170,10 +129,50 @@ public class PageSpeciesGenome extends PageSpecies
|
||||
return "Shortest";
|
||||
}
|
||||
|
||||
public static String tolerated(final boolean t) {
|
||||
public static String tolerated(boolean t) {
|
||||
if (t) {
|
||||
return "Tolerated";
|
||||
}
|
||||
return "Not Tolerated";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(IAlleleSpecies species) {
|
||||
IAllele[] template = Binnie.Genetics.getBeeRoot().getTemplate(species.getUID());
|
||||
if (template == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
IBeeGenome genome = Binnie.Genetics.getBeeRoot().templateAsGenome(template);
|
||||
IBee bee = Binnie.Genetics.getBeeRoot().getBee(BinnieCore.proxy.getWorld(), genome);
|
||||
speedText.setValue(rateSpeed(genome.getSpeed()));
|
||||
lifespanText.setValue(rateLifespan(genome.getLifespan()));
|
||||
fertilityText.setValue(genome.getFertility() + " children");
|
||||
floweringText.setValue(rateFlowering(genome.getFlowering()));
|
||||
int[] area = genome.getTerritory();
|
||||
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";
|
||||
}
|
||||
|
||||
nocturnalText.setValue(behavior);
|
||||
if (genome.getCaveDwelling()) {
|
||||
caveDwellingText.setValue("Not Needed");
|
||||
} else {
|
||||
caveDwellingText.setValue("Required");
|
||||
}
|
||||
|
||||
tolerantFlyerText.setValue(tolerated(genome.getTolerantFlyer()));
|
||||
if (genome.getFlowerProvider() != null) {
|
||||
flowerText.setValue(genome.getFlowerProvider().getDescription());
|
||||
} else {
|
||||
flowerText.setValue("None");
|
||||
}
|
||||
effectText.setValue(genome.getEffect().getName());
|
||||
}
|
||||
}
|
||||
@@ -1,35 +1,30 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui.database;
|
||||
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import forestry.api.genetics.IAlleleSpecies;
|
||||
import binnie.core.craftgui.controls.ControlTextCentered;
|
||||
import binnie.core.craftgui.database.DatabaseTab;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.controls.ControlText;
|
||||
import binnie.core.craftgui.controls.ControlTextCentered;
|
||||
import binnie.core.craftgui.database.DatabaseTab;
|
||||
import binnie.core.craftgui.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 class PageSpeciesProducts extends PageSpecies {
|
||||
protected ControlText title;
|
||||
protected ControlProductsBox products;
|
||||
protected ControlText title2;
|
||||
protected ControlProductsBox specialties;
|
||||
|
||||
public PageSpeciesProducts(final IWidget parent, final DatabaseTab tab) {
|
||||
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);
|
||||
title = new ControlTextCentered(this, 8.0f, "Products");
|
||||
products = new ControlProductsBox(this, 4, 20, 136, 48, ControlProductsBox.Type.Products);
|
||||
title2 = new ControlTextCentered(this, 68.0f, "Specialties");
|
||||
specialties = new ControlProductsBox(this, 4, 80, 136, 48, ControlProductsBox.Type.Specialties);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(final IAlleleSpecies species) {
|
||||
this.pageSpeciesProducts_Products.setSpecies((IAlleleBeeSpecies) species);
|
||||
this.pageSpeciesProducts_Specialties.setSpecies((IAlleleBeeSpecies) species);
|
||||
public void onValueChanged(IAlleleSpecies species) {
|
||||
products.setSpecies((IAlleleBeeSpecies) species);
|
||||
specialties.setSpecies((IAlleleBeeSpecies) species);
|
||||
}
|
||||
}
|
||||
@@ -1,49 +1,44 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui.database;
|
||||
|
||||
import binnie.core.craftgui.minecraft.Window;
|
||||
import binnie.Binnie;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import binnie.core.craftgui.database.PageBreeder;
|
||||
import binnie.core.craftgui.database.PageBranchSpecies;
|
||||
import binnie.core.craftgui.database.PageBranchOverview;
|
||||
import binnie.core.craftgui.database.PageSpeciesMutations;
|
||||
import binnie.core.craftgui.database.PageSpeciesResultant;
|
||||
import binnie.core.craftgui.database.PageSpeciesClassification;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.craftgui.database.DatabaseTab;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.craftgui.database.PageBranchOverview;
|
||||
import binnie.core.craftgui.database.PageBranchSpecies;
|
||||
import binnie.core.craftgui.database.PageBreeder;
|
||||
import binnie.core.craftgui.database.PageSpeciesClassification;
|
||||
import binnie.core.craftgui.database.PageSpeciesMutations;
|
||||
import binnie.core.craftgui.database.PageSpeciesOverview;
|
||||
import binnie.core.craftgui.database.PageSpeciesResultant;
|
||||
import binnie.core.craftgui.database.WindowAbstractDatabase;
|
||||
import binnie.core.craftgui.minecraft.Window;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
public class WindowApiaristDatabase extends WindowAbstractDatabase
|
||||
{
|
||||
@Override
|
||||
protected void addTabs() {
|
||||
new PageSpeciesOverview(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.overview", 0));
|
||||
new PageSpeciesClassification(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.classification", 0));
|
||||
new PageSpeciesGenome(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.genome", 0));
|
||||
new PageSpeciesProducts(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.products", 0));
|
||||
new PageSpeciesClimate(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.climate", 0));
|
||||
new PageSpeciesResultant(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.resultant", 0));
|
||||
new PageSpeciesMutations(this.getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.further", 0));
|
||||
new PageBranchOverview(this.getInfoPages(Mode.Branches), new DatabaseTab(ExtraBees.instance, "branches.overview", 0));
|
||||
new PageBranchSpecies(this.getInfoPages(Mode.Branches), new DatabaseTab(ExtraBees.instance, "branches.species", 0));
|
||||
new PageBreeder(this.getInfoPages(Mode.Breeder), this.getUsername(), new DatabaseTab(ExtraBees.instance, "breeder", 0));
|
||||
}
|
||||
|
||||
public WindowApiaristDatabase(final EntityPlayer player, final Side side, final boolean nei) {
|
||||
public class WindowApiaristDatabase extends WindowAbstractDatabase {
|
||||
public WindowApiaristDatabase(EntityPlayer player, Side side, boolean nei) {
|
||||
super(player, side, nei, Binnie.Genetics.beeBreedingSystem, 110.0f);
|
||||
}
|
||||
|
||||
public static Window create(final EntityPlayer player, final Side side, final boolean nei) {
|
||||
public static Window create(EntityPlayer player, Side side, boolean nei) {
|
||||
return new WindowApiaristDatabase(player, side, nei);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void addTabs() {
|
||||
new PageSpeciesOverview(getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.overview", 0));
|
||||
new PageSpeciesClassification(getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.classification", 0));
|
||||
new PageSpeciesGenome(getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.genome", 0));
|
||||
new PageSpeciesProducts(getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.products", 0));
|
||||
new PageSpeciesClimate(getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.climate", 0));
|
||||
new PageSpeciesResultant(getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.resultant", 0));
|
||||
new PageSpeciesMutations(getInfoPages(Mode.Species), new DatabaseTab(ExtraBees.instance, "species.further", 0));
|
||||
new PageBranchOverview(getInfoPages(Mode.Branches), new DatabaseTab(ExtraBees.instance, "branches.overview", 0));
|
||||
new PageBranchSpecies(getInfoPages(Mode.Branches), new DatabaseTab(ExtraBees.instance, "branches.species", 0));
|
||||
new PageBreeder(getInfoPages(Mode.Breeder), getUsername(), new DatabaseTab(ExtraBees.instance, "breeder", 0));
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbstractMod getMod() {
|
||||
return ExtraBees.instance;
|
||||
@@ -54,30 +49,29 @@ public class WindowApiaristDatabase extends WindowAbstractDatabase
|
||||
return "Database";
|
||||
}
|
||||
|
||||
enum SpeciesTab
|
||||
{
|
||||
Overview(255),
|
||||
Genome(16776960),
|
||||
Productivity(65535),
|
||||
Climate(16711680),
|
||||
ResultantMutations(16711935),
|
||||
FurtherMutations(65280);
|
||||
// TODO unused class?
|
||||
enum SpeciesTab {
|
||||
Overview(0xff),
|
||||
Genome(0xffff00),
|
||||
Productivity(0xffff),
|
||||
Climate(0xff0000),
|
||||
ResultantMutations(0xff00ff),
|
||||
FurtherMutations(0xff00);
|
||||
|
||||
public int colour;
|
||||
|
||||
private SpeciesTab(final int colour) {
|
||||
SpeciesTab(int colour) {
|
||||
this.colour = colour;
|
||||
}
|
||||
}
|
||||
|
||||
enum BranchesTab
|
||||
{
|
||||
enum BranchesTab {
|
||||
Overview(255),
|
||||
Species(16711680);
|
||||
|
||||
public int colour;
|
||||
|
||||
private BranchesTab(final int colour) {
|
||||
BranchesTab(int colour) {
|
||||
this.colour = colour;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,49 +1,45 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui.punnett;
|
||||
|
||||
import binnie.core.craftgui.Tooltip;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
import binnie.core.craftgui.controls.core.IControlValue;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.Tooltip;
|
||||
import binnie.core.craftgui.WidgetAttribute;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.controls.core.IControlValue;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
|
||||
public class ControlChromosome extends Control implements IControlValue<IChromosomeType>, ITooltip
|
||||
{
|
||||
IChromosomeType value;
|
||||
// TODO unused class?
|
||||
public class ControlChromosome extends Control implements IControlValue<IChromosomeType>, ITooltip {
|
||||
protected IChromosomeType value;
|
||||
|
||||
protected ControlChromosome(final IWidget parent, final float x, final float y, final IChromosomeType type) {
|
||||
protected ControlChromosome(IWidget parent, float x, float y, IChromosomeType type) {
|
||||
super(parent, x, y, 16.0f, 16.0f);
|
||||
this.setValue(type);
|
||||
this.addAttribute(WidgetAttribute.MouseOver);
|
||||
setValue(type);
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IChromosomeType getValue() {
|
||||
return this.value;
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setValue(final IChromosomeType value) {
|
||||
public void setValue(IChromosomeType value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRenderBackground() {
|
||||
CraftGUI.Render.texture(ExtraBeeGUITexture.Chromosome, this.getArea());
|
||||
CraftGUI.Render.colour(16711680);
|
||||
CraftGUI.Render.texture(ExtraBeeGUITexture.Chromosome2, this.getArea());
|
||||
CraftGUI.Render.texture(ExtraBeeGUITexture.Chromosome, getArea());
|
||||
CraftGUI.Render.colour(0xff0000);
|
||||
CraftGUI.Render.texture(ExtraBeeGUITexture.Chromosome2, getArea());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(final Tooltip tooltip) {
|
||||
if (this.value != null) {
|
||||
tooltip.add(this.value.getName());
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
if (value != null) {
|
||||
tooltip.add(value.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,28 +1,24 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui.punnett;
|
||||
|
||||
import java.util.List;
|
||||
import binnie.core.craftgui.controls.ControlText;
|
||||
import binnie.core.craftgui.geometry.TextJustification;
|
||||
import java.util.LinkedList;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
import binnie.core.craftgui.geometry.IArea;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.controls.ControlText;
|
||||
import binnie.core.craftgui.controls.core.Control;
|
||||
import binnie.core.craftgui.geometry.IArea;
|
||||
import binnie.core.craftgui.geometry.TextJustification;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
|
||||
public class ControlPunnett extends Control
|
||||
{
|
||||
static int boxWidth;
|
||||
static int boxHeight;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
protected ControlPunnett(final IWidget parent, final float x, final float y) {
|
||||
public class ControlPunnett extends Control {
|
||||
protected static int boxWidth = 80;
|
||||
protected static int boxHeight = 28;
|
||||
|
||||
protected ControlPunnett(IWidget parent, float x, float y) {
|
||||
super(parent, x, y, ControlPunnett.boxWidth * 3, ControlPunnett.boxWidth * 3);
|
||||
}
|
||||
|
||||
@@ -34,50 +30,47 @@ public class ControlPunnett extends Control
|
||||
CraftGUI.Render.solid(new IArea(ControlPunnett.boxWidth * 2, ControlPunnett.boxHeight / 2.0f, 1.0f, ControlPunnett.boxHeight * 2.5f), 11184810);
|
||||
}
|
||||
|
||||
public void setup(final IChromosomeType chromosome, final IIndividual ind1, final IIndividual ind2, final ISpeciesRoot root) {
|
||||
this.deleteAllChildren();
|
||||
// TODO unused method?
|
||||
public void setup(IChromosomeType chromosome, IIndividual ind1, IIndividual ind2, ISpeciesRoot root) {
|
||||
deleteAllChildren();
|
||||
if (chromosome == null || ind1 == null || ind2 == null || root == null) {
|
||||
return;
|
||||
}
|
||||
final IAllele primary1 = ind1.getGenome().getActiveAllele(chromosome);
|
||||
final IAllele primary2 = ind2.getGenome().getActiveAllele(chromosome);
|
||||
final IAllele secondary1 = ind1.getGenome().getInactiveAllele(chromosome);
|
||||
final IAllele secondary2 = ind2.getGenome().getInactiveAllele(chromosome);
|
||||
|
||||
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 (final IAllele allele1 : new IAllele[] { primary1, secondary1 }) {
|
||||
int y;
|
||||
|
||||
for (IAllele allele1 : new IAllele[]{primary1, secondary1}) {
|
||||
y = 1;
|
||||
for (final IAllele allele2 : new IAllele[] { primary2, secondary2 }) {
|
||||
final List<IAllele> alleles = new LinkedList<IAllele>();
|
||||
for (IAllele allele2 : new IAllele[]{primary2, secondary2}) {
|
||||
List<IAllele> alleles = new LinkedList<IAllele>();
|
||||
if (allele1.isDominant() && !allele2.isDominant()) {
|
||||
alleles.add(allele1);
|
||||
}
|
||||
else if (allele2.isDominant() && !allele1.isDominant()) {
|
||||
} else if (allele2.isDominant() && !allele1.isDominant()) {
|
||||
alleles.add(allele2);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
alleles.add(allele1);
|
||||
if (allele1 != allele2) {
|
||||
alleles.add(allele2);
|
||||
}
|
||||
}
|
||||
|
||||
String text = "";
|
||||
for (final IAllele allele3 : alleles) {
|
||||
for (IAllele allele3 : alleles) {
|
||||
text = text + allele3.getName() + ": " + 25.0f / alleles.size() + "%\n";
|
||||
}
|
||||
new ControlText(this, new IArea(x * ControlPunnett.boxWidth, ControlPunnett.boxHeight * y, ControlPunnett.boxWidth, ControlPunnett.boxHeight), text, TextJustification.TopCenter).setColor(11184810);
|
||||
++y;
|
||||
y++;
|
||||
}
|
||||
++x;
|
||||
x++;
|
||||
}
|
||||
new ControlText(this, new IArea(ControlPunnett.boxWidth, 0.0f, ControlPunnett.boxWidth, ControlPunnett.boxHeight), "\n" + primary1.getName(), TextJustification.TopCenter).setColor(11184810);
|
||||
new ControlText(this, new IArea(ControlPunnett.boxWidth * 2, 0.0f, ControlPunnett.boxWidth, ControlPunnett.boxHeight), "\n" + secondary1.getName(), TextJustification.TopCenter).setColor(11184810);
|
||||
new ControlText(this, new IArea(0.0f, ControlPunnett.boxHeight, ControlPunnett.boxWidth, ControlPunnett.boxHeight), primary2.getName(), TextJustification.TopCenter).setColor(11184810);
|
||||
new ControlText(this, new IArea(0.0f, ControlPunnett.boxHeight * 2, ControlPunnett.boxWidth, ControlPunnett.boxHeight), primary2.getName(), TextJustification.TopCenter).setColor(11184810);
|
||||
}
|
||||
|
||||
static {
|
||||
ControlPunnett.boxWidth = 80;
|
||||
ControlPunnett.boxHeight = 28;
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,6 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui.punnett;
|
||||
|
||||
public enum ExtraBeeGUITexture
|
||||
{
|
||||
public enum ExtraBeeGUITexture {
|
||||
Chromosome,
|
||||
Chromosome2;
|
||||
Chromosome2
|
||||
}
|
||||
@@ -1,38 +1,34 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.gui.punnett;
|
||||
|
||||
import binnie.core.craftgui.resource.minecraft.StandardTexture;
|
||||
import binnie.core.craftgui.resource.minecraft.PaddedTexture;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
import binnie.core.craftgui.resource.minecraft.CraftGUITexture;
|
||||
import binnie.core.craftgui.resource.StyleSheet;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.AbstractMod;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.minecraft.Window;
|
||||
import binnie.core.craftgui.minecraft.control.ControlSlot;
|
||||
import binnie.core.craftgui.resource.StyleSheet;
|
||||
import binnie.core.craftgui.resource.minecraft.CraftGUITexture;
|
||||
import binnie.core.craftgui.resource.minecraft.PaddedTexture;
|
||||
import binnie.core.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 net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
|
||||
public class WindowPunnettSquare extends Window
|
||||
{
|
||||
// TODO unused class?
|
||||
public class WindowPunnettSquare extends Window {
|
||||
ControlSlot bee1;
|
||||
ControlSlot bee2;
|
||||
ControlPunnett punnett;
|
||||
ISpeciesRoot root;
|
||||
|
||||
public static Window create(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
return new WindowPunnettSquare(player, inventory, side);
|
||||
public WindowPunnettSquare(EntityPlayer player, IInventory inventory, Side side) {
|
||||
super(245.0f, 205.0f, player, inventory, side);
|
||||
root = null;
|
||||
}
|
||||
|
||||
public WindowPunnettSquare(final EntityPlayer player, final IInventory inventory, final Side side) {
|
||||
super(245.0f, 205.0f, player, inventory, side);
|
||||
this.root = null;
|
||||
public static Window create(EntityPlayer player, IInventory inventory, Side side) {
|
||||
return new WindowPunnettSquare(player, inventory, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -47,17 +43,16 @@ public class WindowPunnettSquare extends Window
|
||||
|
||||
@Override
|
||||
public void initialiseClient() {
|
||||
this.setTitle("Punnett Square");
|
||||
setTitle("Punnett Square");
|
||||
CraftGUI.Render.stylesheet(new StyleSheetPunnett());
|
||||
}
|
||||
|
||||
static class StyleSheetPunnett extends StyleSheet
|
||||
{
|
||||
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));
|
||||
textures.put(CraftGUITexture.Window, new PaddedTexture(0, 0, 160, 160, 0, ExtraBeeTexture.GUIPunnett, 32, 32, 32, 32));
|
||||
textures.put(CraftGUITexture.Slot, new StandardTexture(160, 0, 18, 18, 0, ExtraBeeTexture.GUIPunnett));
|
||||
textures.put(ExtraBeeGUITexture.Chromosome, new StandardTexture(160, 36, 16, 16, 0, ExtraBeeTexture.GUIPunnett));
|
||||
textures.put(ExtraBeeGUITexture.Chromosome2, new StandardTexture(160, 52, 16, 16, 0, ExtraBeeTexture.GUIPunnett));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,63 +1,58 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.liquids;
|
||||
|
||||
import binnie.core.liquid.FluidContainer;
|
||||
import binnie.Binnie;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import binnie.core.liquid.FluidContainer;
|
||||
import binnie.core.liquid.ILiquidType;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.util.IIcon;
|
||||
import binnie.core.liquid.ILiquidType;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
public enum ExtraBeeLiquid implements ILiquidType
|
||||
{
|
||||
ACID("acid", 11528985),
|
||||
POISON("poison", 15406315),
|
||||
GLACIAL("liquidnitrogen", 9881800);
|
||||
public enum ExtraBeeLiquid implements ILiquidType {
|
||||
ACID("acid", 0xafeb19),
|
||||
POISON("poison", 0xeb14eb),
|
||||
GLACIAL("liquidnitrogen", 0x96c8c8);
|
||||
|
||||
String ident;
|
||||
IIcon icon;
|
||||
int colour;
|
||||
protected String ident;
|
||||
protected IIcon icon;
|
||||
protected int colour;
|
||||
|
||||
private ExtraBeeLiquid(final String ident, final int colour) {
|
||||
ExtraBeeLiquid(String ident, int colour) {
|
||||
this.ident = ident;
|
||||
this.colour = colour;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon() {
|
||||
return this.icon;
|
||||
return icon;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcon(final IIconRegister register) {
|
||||
this.icon = ExtraBees.proxy.getIcon(register, "liquids/" + this.getIdentifier());
|
||||
public void registerIcon(IIconRegister register) {
|
||||
icon = ExtraBees.proxy.getIcon(register, "liquids/" + getIdentifier());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraBees.proxy.localise(this.toString().toLowerCase());
|
||||
return ExtraBees.proxy.localise(toString().toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getIdentifier() {
|
||||
return this.ident;
|
||||
return ident;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColour() {
|
||||
return 16777215;
|
||||
public int getColor() {
|
||||
return 0xffffff;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidStack get(final int amount) {
|
||||
return Binnie.Liquid.getLiquidStack(this.ident, amount);
|
||||
public FluidStack get(int amount) {
|
||||
return Binnie.Liquid.getLiquidStack(ident, amount);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -66,17 +61,20 @@ public enum ExtraBeeLiquid implements ILiquidType
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceIn(final FluidContainer container) {
|
||||
public boolean canPlaceIn(FluidContainer container) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showInCreative(final FluidContainer container) {
|
||||
return container == FluidContainer.Bucket || container == FluidContainer.Can || container == FluidContainer.Capsule || container == FluidContainer.Refractory;
|
||||
public boolean showInCreative(FluidContainer container) {
|
||||
return container == FluidContainer.Bucket
|
||||
|| container == FluidContainer.Can
|
||||
|| container == FluidContainer.Capsule
|
||||
|| container == FluidContainer.Refractory;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getContainerColour() {
|
||||
return this.colour;
|
||||
return colour;
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,10 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.liquids;
|
||||
|
||||
import binnie.core.liquid.ItemFluidContainer;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.IInitializable;
|
||||
import binnie.core.liquid.ItemFluidContainer;
|
||||
|
||||
public class ModuleLiquids implements IInitializable
|
||||
{
|
||||
public class ModuleLiquids implements IInitializable {
|
||||
@Override
|
||||
public void preInit() {
|
||||
Binnie.Liquid.createLiquids(ExtraBeeLiquid.values(), ItemFluidContainer.LiquidExtraBee);
|
||||
@@ -17,9 +12,11 @@ public class ModuleLiquids implements IInitializable
|
||||
|
||||
@Override
|
||||
public void init() {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
// ignored
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,15 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import binnie.core.item.IItemEnum;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import java.util.LinkedHashMap;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import java.util.Map;
|
||||
import binnie.core.item.IItemEnum;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public enum EnumHoneyComb implements IItemEnum
|
||||
{
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public enum EnumHoneyComb implements IItemEnum {
|
||||
BARREN(7564356, 12762791),
|
||||
ROTTEN(4084257, 11652233),
|
||||
BONE(12895407, 14606017),
|
||||
@@ -101,79 +97,79 @@ public enum EnumHoneyComb implements IItemEnum
|
||||
CYANITE(2564173, 34541),
|
||||
BLUTONIUM(2564173, 1769702);
|
||||
|
||||
int[] colour;
|
||||
public Map<ItemStack, Float> products;
|
||||
boolean active;
|
||||
public boolean deprecated;
|
||||
|
||||
private EnumHoneyComb() {
|
||||
this(16777215, 16777215);
|
||||
this.active = false;
|
||||
this.deprecated = true;
|
||||
protected int[] color;
|
||||
protected boolean active;
|
||||
|
||||
EnumHoneyComb() {
|
||||
this(0xffffff, 0xffffff);
|
||||
active = false;
|
||||
deprecated = true;
|
||||
}
|
||||
|
||||
private EnumHoneyComb(final int colour, final int colour2) {
|
||||
this.colour = new int[0];
|
||||
this.products = new LinkedHashMap<ItemStack, Float>();
|
||||
this.active = true;
|
||||
this.deprecated = false;
|
||||
this.colour = new int[] { colour, colour2 };
|
||||
EnumHoneyComb(int color, int color2) {
|
||||
this.color = new int[]{color, color2};
|
||||
products = new LinkedHashMap<>();
|
||||
active = true;
|
||||
deprecated = false;
|
||||
}
|
||||
|
||||
public void addRecipe() {
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, this.get(1), this.products);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return this.active;
|
||||
}
|
||||
|
||||
public static EnumHoneyComb get(final ItemStack itemStack) {
|
||||
final int i = itemStack.getItemDamage();
|
||||
public static EnumHoneyComb get(ItemStack itemStack) {
|
||||
int i = itemStack.getItemDamage();
|
||||
if (i >= 0 && i < values().length) {
|
||||
return values()[i];
|
||||
}
|
||||
return values()[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack get(final int count) {
|
||||
return new ItemStack(ExtraBees.comb, count, this.ordinal());
|
||||
public void addRecipe() {
|
||||
RecipeManagers.centrifugeManager.addRecipe(20, get(1), products);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName(final ItemStack itemStack) {
|
||||
return ExtraBees.proxy.localise("item.comb." + this.name().toLowerCase());
|
||||
public boolean isActive() {
|
||||
return active;
|
||||
}
|
||||
|
||||
public boolean addProduct(final ItemStack item, final Float chance) {
|
||||
@Override
|
||||
public ItemStack get(int count) {
|
||||
return new ItemStack(ExtraBees.comb, count, ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName(ItemStack itemStack) {
|
||||
return ExtraBees.proxy.localise("item.comb." + name().toLowerCase());
|
||||
}
|
||||
|
||||
public boolean addProduct(ItemStack item, Float chance) {
|
||||
if (item == null) {
|
||||
return false;
|
||||
}
|
||||
this.products.put(item.copy(), chance);
|
||||
products.put(item.copy(), chance);
|
||||
return true;
|
||||
}
|
||||
|
||||
public void tryAddProduct(final ItemStack item, final Float chance) {
|
||||
this.active = this.addProduct(item, chance);
|
||||
public void tryAddProduct(ItemStack item, Float chance) {
|
||||
active = addProduct(item, chance);
|
||||
}
|
||||
|
||||
public void tryAddProduct(final String oreDict, final Float chance) {
|
||||
// TODO unused method?
|
||||
public void tryAddProduct(String oreDict, Float chance) {
|
||||
if (!OreDictionary.getOres(oreDict).isEmpty()) {
|
||||
this.tryAddProduct(OreDictionary.getOres(oreDict).get(0), chance);
|
||||
}
|
||||
else {
|
||||
this.active = false;
|
||||
tryAddProduct(OreDictionary.getOres(oreDict).get(0), chance);
|
||||
} else {
|
||||
active = false;
|
||||
}
|
||||
}
|
||||
|
||||
public void tryAddProduct(final IItemEnum type, final Float chance) {
|
||||
this.tryAddProduct(type.get(1), chance);
|
||||
this.active = (this.active && type.isActive());
|
||||
public void tryAddProduct(IItemEnum type, Float chance) {
|
||||
tryAddProduct(type.get(1), chance);
|
||||
active = (active && type.isActive());
|
||||
}
|
||||
|
||||
public void copyProducts(final EnumHoneyComb comb) {
|
||||
this.products.putAll(comb.products);
|
||||
public void copyProducts(EnumHoneyComb comb) {
|
||||
products.putAll(comb.products);
|
||||
}
|
||||
}
|
||||
@@ -1,98 +1,94 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.item.IItemEnum;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import binnie.Binnie;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import binnie.core.item.IItemEnum;
|
||||
|
||||
public enum EnumHoneyDrop implements IItemEnum
|
||||
{
|
||||
ENERGY(10242418, 14905713, ""),
|
||||
ACID(4961601, 4841020, "acid"),
|
||||
POISON(13698745, 16712674, "poison"),
|
||||
APPLE(13062738, 13183530, "juice"),
|
||||
public enum EnumHoneyDrop implements IItemEnum {
|
||||
ENERGY(0x9c4972, 0xe37171, ""),
|
||||
ACID(0x4bb541, 0x49de3c, "acid"),
|
||||
POISON(0xd106b9, 0xff03e2, "poison"),
|
||||
APPLE(0xc75252, 0xc92a2a, "juice"),
|
||||
CITRUS,
|
||||
ICE(11462882, 9895925, "liquidnitrogen"),
|
||||
MILK(14737632, 16777215, "milk"),
|
||||
SEED(8176242, 12762791, "seedoil"),
|
||||
ALCOHOL(14411853, 10872909, "short.mead"),
|
||||
ICE(0xaee8e2, 0x96fff5, "liquidnitrogen"),
|
||||
MILK(0xe0e0e0, 0xffffff, "milk"),
|
||||
SEED(0x7cc272, 0xc2bea7, "seedoil"),
|
||||
ALCOHOL(0xdbe84d, 0xa5e84d, "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");
|
||||
RED(0xcc4c4c, 0xff0000, "for.honey"),
|
||||
YELLOW(0xe5e533, 0xffdd00, "for.honey"),
|
||||
BLUE(0x99b2f2, 0x0022ff, "for.honey"),
|
||||
GREEN(0x667f33, 0x009900, "for.honey"),
|
||||
BLACK(0x191919, 0x575757, "for.honey"),
|
||||
WHITE(0xd6d6d6, 0xffffff, "for.honey"),
|
||||
BROWN(0x7f664c, 0x5c350f, "for.honey"),
|
||||
ORANGE(0xf2b233, 0xff9d00, "for.honey"),
|
||||
CYAN(0x4c99b2, 0x00ffe5, "for.honey"),
|
||||
PURPLE(0xb266e5, 0xae00ff, "for.honey"),
|
||||
GRAY(0x4c4c4c, 0xbababa, "for.honey"),
|
||||
LIGHTBLUE(0x99b2f2, 0x009dff, "for.honey"),
|
||||
PINK(0xf2b2cc, 0xff80df, "for.honey"),
|
||||
LIMEGREEN(0x7fcc19, 0x00ff08, "for.honey"),
|
||||
MAGENTA(0xe57fd8, 0xff00cc, "for.honey"),
|
||||
LIGHTGRAY(0x999999, 0xc9c9c9, "for.honey");
|
||||
|
||||
int[] colour;
|
||||
String liquidName;
|
||||
ItemStack remenant;
|
||||
public boolean deprecated;
|
||||
|
||||
public void addRemenant(final ItemStack stack) {
|
||||
this.remenant = stack;
|
||||
this.deprecated = true;
|
||||
protected int[] color;
|
||||
protected String liquidName;
|
||||
protected ItemStack remenant;
|
||||
|
||||
EnumHoneyDrop() {
|
||||
this(0xffffff, 0xffffff, "");
|
||||
}
|
||||
|
||||
private EnumHoneyDrop() {
|
||||
this(16777215, 16777215, "");
|
||||
EnumHoneyDrop(int color, int color2, String liquid) {
|
||||
liquidName = "";
|
||||
remenant = null;
|
||||
deprecated = false;
|
||||
this.color = new int[]{color, color2};
|
||||
liquidName = liquid;
|
||||
}
|
||||
|
||||
private EnumHoneyDrop(final int colour, final int colour2, final String liquid) {
|
||||
this.liquidName = "";
|
||||
this.remenant = null;
|
||||
this.deprecated = false;
|
||||
this.colour = new int[] { colour, colour2 };
|
||||
this.liquidName = liquid;
|
||||
}
|
||||
|
||||
public void addRecipe() {
|
||||
final FluidStack liquid = Binnie.Liquid.getLiquidStack(this.liquidName, 200);
|
||||
if (liquid != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[] { this.get(1) }, liquid, this.remenant, 100);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return !this.deprecated && (this.liquidName == null || FluidRegistry.isFluidRegistered(this.liquidName));
|
||||
}
|
||||
|
||||
public static EnumHoneyDrop get(final ItemStack itemStack) {
|
||||
final int i = itemStack.getItemDamage();
|
||||
public static EnumHoneyDrop get(ItemStack itemStack) {
|
||||
int i = itemStack.getItemDamage();
|
||||
if (i >= 0 && i < values().length) {
|
||||
return values()[i];
|
||||
}
|
||||
return values()[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack get(final int count) {
|
||||
return new ItemStack(ExtraBees.honeyDrop, count, this.ordinal());
|
||||
public void addRemenant(ItemStack stack) {
|
||||
remenant = stack;
|
||||
deprecated = true;
|
||||
}
|
||||
|
||||
public void addRecipe() {
|
||||
FluidStack liquid = Binnie.Liquid.getLiquidStack(liquidName, 200);
|
||||
if (liquid != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{get(1)}, liquid, remenant, 100);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName(final ItemStack itemStack) {
|
||||
return ExtraBees.proxy.localise("item.honeydrop." + this.name().toLowerCase());
|
||||
public boolean isActive() {
|
||||
return !deprecated && (liquidName == null || FluidRegistry.isFluidRegistered(liquidName));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack get(int count) {
|
||||
return new ItemStack(ExtraBees.honeyDrop, count, ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName(ItemStack itemStack) {
|
||||
return ExtraBees.proxy.localise("item.honeydrop." + name().toLowerCase());
|
||||
}
|
||||
}
|
||||
@@ -1,26 +1,21 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.item.IItemEnum;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
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"),
|
||||
public enum EnumPropolis implements IItemEnum {
|
||||
WATER(0x24b3c9, 0xc2bea7, "Water"),
|
||||
OIL(0x172f33, 0xc2bea7, "oil"),
|
||||
FUEL(0xa38d12, 0xc2bea7, "fuel"),
|
||||
MILK,
|
||||
FRUIT,
|
||||
SEED,
|
||||
ALCOHOL,
|
||||
CREOSOTE(8877313, 12428819, "creosote"),
|
||||
CREOSOTE(0x877501, 0xbda613, "creosote"),
|
||||
GLACIAL,
|
||||
PEAT;
|
||||
|
||||
@@ -28,45 +23,45 @@ public enum EnumPropolis implements IItemEnum
|
||||
String liquidName;
|
||||
boolean active;
|
||||
|
||||
private EnumPropolis() {
|
||||
this(16777215, 16777215, "");
|
||||
this.active = false;
|
||||
EnumPropolis() {
|
||||
this(0xffffff, 0xffffff, "");
|
||||
active = false;
|
||||
}
|
||||
|
||||
private EnumPropolis(final int colour, final int colour2, final String liquid) {
|
||||
EnumPropolis(int colour, int colour2, String liquid) {
|
||||
this.colour = new int[0];
|
||||
this.active = true;
|
||||
this.colour = new int[] { colour, colour2 };
|
||||
this.liquidName = liquid;
|
||||
active = true;
|
||||
this.colour = new int[]{colour, colour2};
|
||||
liquidName = liquid;
|
||||
}
|
||||
|
||||
public void addRecipe() {
|
||||
final FluidStack liquid = Binnie.Liquid.getLiquidStack(this.liquidName, 500);
|
||||
if (liquid != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(20, new ItemStack[] { this.get(1) }, liquid, (ItemStack) null, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return this.active && Binnie.Liquid.getLiquidStack(this.liquidName, 100) != null;
|
||||
}
|
||||
|
||||
public static EnumPropolis get(final ItemStack itemStack) {
|
||||
final int i = itemStack.getItemDamage();
|
||||
public static EnumPropolis get(ItemStack itemStack) {
|
||||
int i = itemStack.getItemDamage();
|
||||
if (i >= 0 && i < values().length) {
|
||||
return values()[i];
|
||||
}
|
||||
return values()[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack get(final int count) {
|
||||
return new ItemStack(ExtraBees.propolis, count, this.ordinal());
|
||||
public void addRecipe() {
|
||||
FluidStack liquid = Binnie.Liquid.getLiquidStack(liquidName, 500);
|
||||
if (liquid != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(20, new ItemStack[]{get(1)}, liquid, null, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName(final ItemStack itemStack) {
|
||||
return ExtraBees.proxy.localise("item.propolis." + this.name().toLowerCase());
|
||||
public boolean isActive() {
|
||||
return active && Binnie.Liquid.getLiquidStack(liquidName, 100) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack get(int count) {
|
||||
return new ItemStack(ExtraBees.propolis, count, ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName(ItemStack itemStack) {
|
||||
return ExtraBees.proxy.localise("item.propolis." + name().toLowerCase());
|
||||
}
|
||||
}
|
||||
@@ -1,241 +1,283 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.init.Blocks;
|
||||
import binnie.extrabees.core.ExtraBeeItems;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraft.init.Items;
|
||||
import binnie.core.Mods;
|
||||
import forestry.api.core.Tabs;
|
||||
import 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 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;
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses() {
|
||||
return true;
|
||||
}
|
||||
public class ItemHoneyComb extends ItemProduct {
|
||||
protected IIcon icon1;
|
||||
protected IIcon icon2;
|
||||
|
||||
public ItemHoneyComb() {
|
||||
super(EnumHoneyComb.values());
|
||||
this.setCreativeTab(Tabs.tabApiculture);
|
||||
this.setUnlocalizedName("honeyComb");
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
setUnlocalizedName("honeyComb");
|
||||
}
|
||||
|
||||
public static void addSubtypes() {
|
||||
final ItemStack beeswax = Mods.Forestry.stack("beeswax");
|
||||
final ItemStack honeyDrop = Mods.Forestry.stack("honeyDrop");
|
||||
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, 1.00f);
|
||||
EnumHoneyComb.BARREN.addProduct(honeyDrop, 0.50f);
|
||||
|
||||
EnumHoneyComb.ROTTEN.addProduct(beeswax, 0.20f);
|
||||
EnumHoneyComb.ROTTEN.addProduct(honeyDrop, 0.20f);
|
||||
EnumHoneyComb.ROTTEN.addProduct(new ItemStack(Items.rotten_flesh, 1, 0), 0.80f);
|
||||
|
||||
EnumHoneyComb.BONE.addProduct(beeswax, 0.20f);
|
||||
EnumHoneyComb.BONE.addProduct(honeyDrop, 0.20f);
|
||||
EnumHoneyComb.BONE.addProduct(new ItemStack(Items.dye, 1, 15), 0.80f);
|
||||
|
||||
EnumHoneyComb.OIL.tryAddProduct(EnumPropolis.OIL, 0.60f);
|
||||
EnumHoneyComb.OIL.addProduct(honeyDrop, 0.75f);
|
||||
|
||||
EnumHoneyComb.COAL.addProduct(beeswax, 0.80f);
|
||||
EnumHoneyComb.COAL.addProduct(honeyDrop, 0.75f);
|
||||
EnumHoneyComb.COAL.tryAddProduct(ExtraBeeItems.CoalDust, 1.00f);
|
||||
|
||||
EnumHoneyComb.WATER.tryAddProduct(EnumPropolis.WATER, 1.00f);
|
||||
EnumHoneyComb.WATER.addProduct(honeyDrop, 0.90f);
|
||||
|
||||
EnumHoneyComb.STONE.addProduct(beeswax, 0.50f);
|
||||
EnumHoneyComb.STONE.addProduct(honeyDrop, 0.25f);
|
||||
|
||||
EnumHoneyComb.MILK.tryAddProduct(EnumHoneyDrop.MILK, 1.00f);
|
||||
EnumHoneyComb.MILK.addProduct(honeyDrop, 0.90f);
|
||||
|
||||
EnumHoneyComb.FRUIT.tryAddProduct(EnumHoneyDrop.APPLE, 1.00f);
|
||||
EnumHoneyComb.FRUIT.addProduct(honeyDrop, 0.90f);
|
||||
|
||||
EnumHoneyComb.SEED.tryAddProduct(EnumHoneyDrop.SEED, 1.00f);
|
||||
EnumHoneyComb.SEED.addProduct(honeyDrop, 0.90f);
|
||||
|
||||
EnumHoneyComb.ALCOHOL.tryAddProduct(EnumHoneyDrop.ALCOHOL, 1.00f);
|
||||
EnumHoneyComb.ALCOHOL.addProduct(honeyDrop, 0.90f);
|
||||
|
||||
EnumHoneyComb.FUEL.tryAddProduct(EnumPropolis.FUEL, 0.60f);
|
||||
EnumHoneyComb.FUEL.addProduct(honeyDrop, 0.50f);
|
||||
|
||||
EnumHoneyComb.CREOSOTE.tryAddProduct(EnumPropolis.CREOSOTE, 0.70f);
|
||||
EnumHoneyComb.CREOSOTE.addProduct(honeyDrop, 0.50f);
|
||||
|
||||
EnumHoneyComb.LATEX.addProduct(honeyDrop, 0.50f);
|
||||
EnumHoneyComb.LATEX.addProduct(beeswax, 0.85f);
|
||||
if (!OreDictionary.getOres("itemRubber").isEmpty()) {
|
||||
EnumHoneyComb.LATEX.tryAddProduct(OreDictionary.getOres("itemRubber").get(0), 1.00f);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
EnumHoneyComb.LATEX.active = false;
|
||||
}
|
||||
|
||||
EnumHoneyComb.REDSTONE.addProduct(beeswax, 0.80f);
|
||||
EnumHoneyComb.REDSTONE.addProduct(new ItemStack(Items.redstone, 1, 0), 1.00f);
|
||||
EnumHoneyComb.REDSTONE.addProduct(honeyDrop, 0.50f);
|
||||
|
||||
EnumHoneyComb.RESIN.addProduct(beeswax, 1.00f);
|
||||
EnumHoneyComb.RESIN.tryAddProduct(Mods.IC2.stack("itemHarz"), 1.00f);
|
||||
EnumHoneyComb.RESIN.tryAddProduct(Mods.IC2.stack("itemHarz"), 0.50f);
|
||||
|
||||
EnumHoneyComb.IC2ENERGY.addProduct(beeswax, 0.80f);
|
||||
EnumHoneyComb.IC2ENERGY.addProduct(new ItemStack(Items.redstone, 1, 0), 0.75f);
|
||||
EnumHoneyComb.IC2ENERGY.tryAddProduct(EnumHoneyDrop.ENERGY, 1.00f);
|
||||
|
||||
EnumHoneyComb.IRON.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.IRON.tryAddProduct(ExtraBeeItems.IronDust, 1.00f);
|
||||
|
||||
EnumHoneyComb.GOLD.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.GOLD.tryAddProduct(ExtraBeeItems.GoldDust, 1.00f);
|
||||
|
||||
EnumHoneyComb.COPPER.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.COPPER.tryAddProduct(ExtraBeeItems.CopperDust, 1.00f);
|
||||
|
||||
EnumHoneyComb.TIN.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.TIN.tryAddProduct(ExtraBeeItems.TinDust, 1.00f);
|
||||
|
||||
EnumHoneyComb.NICKEL.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.NICKEL.tryAddProduct(ExtraBeeItems.NickelDust, 1.00f);
|
||||
|
||||
EnumHoneyComb.SILVER.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.SILVER.tryAddProduct(ExtraBeeItems.SilverDust, 1.00f);
|
||||
|
||||
EnumHoneyComb.URANIUM.copyProducts(EnumHoneyComb.STONE);
|
||||
if (!OreDictionary.getOres("crushedUranium").isEmpty()) {
|
||||
EnumHoneyComb.URANIUM.tryAddProduct(OreDictionary.getOres("crushedUranium").get(0), 0.50f);
|
||||
}
|
||||
|
||||
EnumHoneyComb.CLAY.addProduct(beeswax, 0.25f);
|
||||
EnumHoneyComb.CLAY.addProduct(honeyDrop, 0.80f);
|
||||
EnumHoneyComb.CLAY.addProduct(new ItemStack(Items.clay_ball), 0.80f);
|
||||
|
||||
EnumHoneyComb.OLD.addProduct(beeswax, 1.00f);
|
||||
EnumHoneyComb.OLD.addProduct(honeyDrop, 0.90f);
|
||||
|
||||
EnumHoneyComb.FUNGAL.addProduct(beeswax, 0.90f);
|
||||
EnumHoneyComb.FUNGAL.addProduct(new ItemStack(Blocks.brown_mushroom_block, 1, 0), 1.00f);
|
||||
EnumHoneyComb.FUNGAL.addProduct(new ItemStack(Blocks.red_mushroom_block, 1, 0), 0.75f);
|
||||
|
||||
EnumHoneyComb.ACIDIC.addProduct(beeswax, 0.80f);
|
||||
EnumHoneyComb.ACIDIC.tryAddProduct(EnumHoneyDrop.ACID, 0.50f);
|
||||
if (!OreDictionary.getOres("dustSulfur").isEmpty()) {
|
||||
EnumHoneyComb.ACIDIC.addProduct(OreDictionary.getOres("dustSulfur").get(0), 0.75f);
|
||||
}
|
||||
|
||||
EnumHoneyComb.VENOMOUS.addProduct(beeswax, 0.80f);
|
||||
EnumHoneyComb.VENOMOUS.tryAddProduct(EnumHoneyDrop.POISON, 0.80f);
|
||||
|
||||
EnumHoneyComb.SLIME.addProduct(beeswax, 1.00f);
|
||||
EnumHoneyComb.SLIME.addProduct(honeyDrop, 0.75f);
|
||||
EnumHoneyComb.SLIME.addProduct(new ItemStack(Items.slime_ball, 1, 0), 0.75f);
|
||||
|
||||
EnumHoneyComb.BLAZE.addProduct(beeswax, 0.75f);
|
||||
EnumHoneyComb.BLAZE.addProduct(new ItemStack(Items.blaze_powder, 1, 0), 1.00f);
|
||||
|
||||
EnumHoneyComb.COFFEE.addProduct(beeswax, 0.90f);
|
||||
EnumHoneyComb.COFFEE.addProduct(honeyDrop, 0.75f);
|
||||
EnumHoneyComb.COFFEE.tryAddProduct(Mods.IC2.stack("itemCofeePowder"), 0.75f);
|
||||
|
||||
EnumHoneyComb.GLACIAL.tryAddProduct(EnumHoneyDrop.ICE, 0.80f);
|
||||
EnumHoneyComb.GLACIAL.addProduct(honeyDrop, 0.75f);
|
||||
|
||||
EnumHoneyComb.SHADOW.addProduct(honeyDrop, 0.50f);
|
||||
if (!OreDictionary.getOres("dustObsidian").isEmpty()) {
|
||||
EnumHoneyComb.SHADOW.tryAddProduct(OreDictionary.getOres("dustObsidian").get(0), 0.75f);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
EnumHoneyComb.SHADOW.active = false;
|
||||
}
|
||||
|
||||
EnumHoneyComb.LEAD.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.LEAD.tryAddProduct(ExtraBeeItems.LeadDust, 1.00f);
|
||||
|
||||
EnumHoneyComb.ZINC.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.ZINC.tryAddProduct(ExtraBeeItems.ZincDust, 1.00f);
|
||||
|
||||
EnumHoneyComb.TITANIUM.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.TITANIUM.tryAddProduct(ExtraBeeItems.TitaniumDust, 1.00f);
|
||||
|
||||
EnumHoneyComb.TUNGSTEN.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.TUNGSTEN.tryAddProduct(ExtraBeeItems.TungstenDust, 1.00f);
|
||||
|
||||
EnumHoneyComb.PLATINUM.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.PLATINUM.tryAddProduct(ExtraBeeItems.PlatinumDust, 1.00f);
|
||||
|
||||
EnumHoneyComb.LAPIS.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.LAPIS.addProduct(new ItemStack(Items.dye, 6, 4), 1.00f);
|
||||
|
||||
EnumHoneyComb.EMERALD.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.EMERALD.tryAddProduct(ExtraBeeItems.EmeraldShard, 1.00f);
|
||||
|
||||
EnumHoneyComb.RUBY.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.RUBY.tryAddProduct(ExtraBeeItems.RubyShard, 1.00f);
|
||||
|
||||
EnumHoneyComb.SAPPHIRE.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.SAPPHIRE.tryAddProduct(ExtraBeeItems.SapphireShard, 1.00f);
|
||||
|
||||
EnumHoneyComb.DIAMOND.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.DIAMOND.tryAddProduct(ExtraBeeItems.DiamondShard, 1.00f);
|
||||
|
||||
EnumHoneyComb.RED.addProduct(honeyDrop, 0.80f);
|
||||
EnumHoneyComb.RED.addProduct(beeswax, 0.80f);
|
||||
|
||||
EnumHoneyComb.GLOWSTONE.addProduct(honeyDrop, 0.25f);
|
||||
EnumHoneyComb.GLOWSTONE.addProduct(new ItemStack(Items.glowstone_dust), 1.00f);
|
||||
|
||||
EnumHoneyComb.SALTPETER.addProduct(honeyDrop, 0.25f);
|
||||
EnumHoneyComb.SALTPETER.tryAddProduct(getOreDictionary("dustSaltpeter"), 1.00f);
|
||||
|
||||
EnumHoneyComb.COMPOST.addProduct(honeyDrop, 0.25f);
|
||||
EnumHoneyComb.COMPOST.tryAddProduct(Mods.Forestry.stack("fertilizerBio"), 1.00f);
|
||||
|
||||
EnumHoneyComb.SAWDUST.addProduct(honeyDrop, 0.25f);
|
||||
if (!OreDictionary.getOres("dustSawdust").isEmpty()) {
|
||||
EnumHoneyComb.SAWDUST.tryAddProduct(OreDictionary.getOres("dustSawdust").get(0), 1.00f);
|
||||
}
|
||||
else if (!OreDictionary.getOres("sawdust").isEmpty()) {
|
||||
} else if (!OreDictionary.getOres("sawdust").isEmpty()) {
|
||||
EnumHoneyComb.SAWDUST.tryAddProduct(OreDictionary.getOres("sawdust").get(0), 1.00f);
|
||||
}
|
||||
|
||||
EnumHoneyComb.CERTUS.addProduct(honeyDrop, 0.25f);
|
||||
EnumHoneyComb.CERTUS.addProduct(new ItemStack(Items.quartz), 0.25f);
|
||||
if (!OreDictionary.getOres("dustCertusQuartz").isEmpty()) {
|
||||
EnumHoneyComb.CERTUS.tryAddProduct(OreDictionary.getOres("dustCertusQuartz").get(0), 0.20f);
|
||||
}
|
||||
|
||||
EnumHoneyComb.ENDERPEARL.addProduct(honeyDrop, 0.25f);
|
||||
if (!OreDictionary.getOres("dustEnderPearl").isEmpty()) {
|
||||
EnumHoneyComb.ENDERPEARL.tryAddProduct(OreDictionary.getOres("dustEnderPearl").get(0), 0.25f);
|
||||
}
|
||||
|
||||
EnumHoneyComb.YELLORIUM.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.CYANITE.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.BLUTONIUM.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.YELLORIUM.tryAddProduct(ExtraBeeItems.YelloriumDust, 0.25f);
|
||||
|
||||
EnumHoneyComb.CYANITE.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.CYANITE.tryAddProduct(ExtraBeeItems.CyaniteDust, 0.25f);
|
||||
|
||||
EnumHoneyComb.BLUTONIUM.copyProducts(EnumHoneyComb.STONE);
|
||||
EnumHoneyComb.BLUTONIUM.tryAddProduct(ExtraBeeItems.BlutoniumDust, 0.25f);
|
||||
OreDictionary.registerOre("beeComb", new ItemStack(ExtraBees.comb, 1, 32767));
|
||||
|
||||
for (int i = 0; i < 16; ++i) {
|
||||
final EnumHoneyComb type = EnumHoneyComb.values()[EnumHoneyComb.RED.ordinal() + i];
|
||||
EnumHoneyComb type = EnumHoneyComb.values()[EnumHoneyComb.RED.ordinal() + i];
|
||||
if (type != EnumHoneyComb.RED) {
|
||||
type.copyProducts(EnumHoneyComb.RED);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 16; ++i) {
|
||||
final EnumHoneyComb type = EnumHoneyComb.values()[EnumHoneyComb.RED.ordinal() + i];
|
||||
final EnumHoneyDrop drop = EnumHoneyDrop.values()[EnumHoneyDrop.RED.ordinal() + i];
|
||||
final int[] dyeC = { 1, 11, 4, 2, 0, 15, 3, 14, 6, 5, 8, 12, 9, 10, 13, 7 };
|
||||
final int k = dyeC[i];
|
||||
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);
|
||||
break;
|
||||
}
|
||||
case 0:
|
||||
dye = ExtraBeeItems.BlackDye.get(1);
|
||||
break;
|
||||
|
||||
case 1:
|
||||
dye = ExtraBeeItems.RedDye.get(1);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
dye = ExtraBeeItems.GreenDye.get(1);
|
||||
break;
|
||||
|
||||
case 3:
|
||||
dye = ExtraBeeItems.BrownDye.get(1);
|
||||
break;
|
||||
|
||||
case 4:
|
||||
dye = ExtraBeeItems.BlueDye.get(1);
|
||||
break;
|
||||
|
||||
case 11:
|
||||
dye = ExtraBeeItems.YellowDye.get(1);
|
||||
break;
|
||||
|
||||
case 15:
|
||||
dye = ExtraBeeItems.WhiteDye.get(1);
|
||||
break;
|
||||
|
||||
}
|
||||
type.addProduct(drop.get(1), 1.00f);
|
||||
drop.addRemenant(dye);
|
||||
}
|
||||
}
|
||||
|
||||
private static ItemStack getOreDictionary(final String string) {
|
||||
private static ItemStack getOreDictionary(String string) {
|
||||
if (OreDictionary.getOres(string).size() > 0) {
|
||||
return OreDictionary.getOres(string).get(0);
|
||||
}
|
||||
@@ -243,34 +285,39 @@ public class ItemHoneyComb extends ItemProduct
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColorFromItemStack(final ItemStack itemStack, final int j) {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColorFromItemStack(ItemStack itemStack, int j) {
|
||||
if (EnumHoneyComb.get(itemStack) == null) {
|
||||
return 16777215;
|
||||
return 0xffffff;
|
||||
}
|
||||
if (j == 0) {
|
||||
return EnumHoneyComb.get(itemStack).colour[0];
|
||||
return EnumHoneyComb.get(itemStack).color[0];
|
||||
}
|
||||
return EnumHoneyComb.get(itemStack).colour[1];
|
||||
return EnumHoneyComb.get(itemStack).color[1];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamageForRenderPass(final int i, final int j) {
|
||||
public IIcon getIconFromDamageForRenderPass(int i, int j) {
|
||||
if (j > 0) {
|
||||
return this.icon1;
|
||||
return icon1;
|
||||
}
|
||||
return this.icon2;
|
||||
return icon2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister register) {
|
||||
this.icon1 = BinnieCore.proxy.getIcon(register, "forestry", "beeCombs.0");
|
||||
this.icon2 = BinnieCore.proxy.getIcon(register, "forestry", "beeCombs.1");
|
||||
public void registerIcons(IIconRegister register) {
|
||||
icon1 = BinnieCore.proxy.getIcon(register, "forestry", "beeCombs.0");
|
||||
icon2 = BinnieCore.proxy.getIcon(register, "forestry", "beeCombs.1");
|
||||
}
|
||||
|
||||
public enum VanillaComb
|
||||
{
|
||||
public enum VanillaComb {
|
||||
HONEY,
|
||||
COCOA,
|
||||
SIMMERING,
|
||||
@@ -290,7 +337,7 @@ public class ItemHoneyComb extends ItemProduct
|
||||
QUARTZ;
|
||||
|
||||
public ItemStack get() {
|
||||
return new ItemStack(Mods.Forestry.item("beeCombs"), 1, this.ordinal());
|
||||
return new ItemStack(Mods.Forestry.item("beeCombs"), 1, ordinal());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,46 +1,30 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import forestry.api.core.Tabs;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
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
|
||||
{
|
||||
public class ItemHoneyCrystal extends Item {
|
||||
private int maxCharge;
|
||||
private int transferLimit;
|
||||
private int tier;
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister register) {
|
||||
this.itemIcon = ExtraBees.proxy.getIcon(register, "honeyCrystal");
|
||||
}
|
||||
|
||||
public ItemHoneyCrystal() {
|
||||
this.maxCharge = 8000;
|
||||
this.transferLimit = 500;
|
||||
this.tier = 1;
|
||||
this.setMaxDamage(27);
|
||||
this.setMaxStackSize(1);
|
||||
this.setCreativeTab(Tabs.tabApiculture);
|
||||
this.setUnlocalizedName("honeyCrystal");
|
||||
maxCharge = 8000;
|
||||
transferLimit = 500;
|
||||
tier = 1;
|
||||
setMaxDamage(27);
|
||||
setMaxStackSize(1);
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
setUnlocalizedName("honeyCrystal");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(final ItemStack i) {
|
||||
return ExtraBees.proxy.localise("item.honeycrystal");
|
||||
}
|
||||
|
||||
public static NBTTagCompound getOrCreateNbtData(final ItemStack itemStack) {
|
||||
public static NBTTagCompound getOrCreateNbtData(ItemStack itemStack) {
|
||||
NBTTagCompound ret = itemStack.getTagCompound();
|
||||
if (ret == null) {
|
||||
ret = new NBTTagCompound();
|
||||
@@ -48,4 +32,15 @@ public class ItemHoneyCrystal extends Item
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {
|
||||
itemIcon = ExtraBees.proxy.getIcon(register, "honeyCrystal");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack i) {
|
||||
return ExtraBees.proxy.localise("item.honeycrystal");
|
||||
}
|
||||
}
|
||||
@@ -1,31 +1,26 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemHoneyCrystalEmpty extends ItemHoneyCrystal
|
||||
{
|
||||
public class ItemHoneyCrystalEmpty extends ItemHoneyCrystal {
|
||||
public ItemHoneyCrystalEmpty() {
|
||||
this.setMaxDamage(0);
|
||||
this.setMaxStackSize(64);
|
||||
this.setUnlocalizedName("honeyCrystalEmpty");
|
||||
setMaxDamage(0);
|
||||
setMaxStackSize(64);
|
||||
setUnlocalizedName("honeyCrystalEmpty");
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerIcons(final IIconRegister register) {
|
||||
this.itemIcon = ExtraBees.proxy.getIcon(register, "honeyCrystalEmpty");
|
||||
public void registerIcons(IIconRegister register) {
|
||||
itemIcon = ExtraBees.proxy.getIcon(register, "honeyCrystalEmpty");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(final ItemStack i) {
|
||||
public String getItemStackDisplayName(ItemStack i) {
|
||||
return ExtraBees.proxy.localise("item.honeycrystal.empty");
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,22 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import forestry.api.core.Tabs;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import 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;
|
||||
public class ItemHoneyDrop extends ItemProduct {
|
||||
protected IIcon icon1;
|
||||
protected IIcon icon2;
|
||||
|
||||
public ItemHoneyDrop() {
|
||||
super(EnumHoneyDrop.values());
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
setUnlocalizedName("honeyDrop");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -23,34 +24,27 @@ public class ItemHoneyDrop extends ItemProduct
|
||||
return true;
|
||||
}
|
||||
|
||||
public ItemHoneyDrop() {
|
||||
super(EnumHoneyDrop.values());
|
||||
this.setCreativeTab(Tabs.tabApiculture);
|
||||
this.setUnlocalizedName("honeyDrop");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColorFromItemStack(final ItemStack itemStack, final int j) {
|
||||
final int i = itemStack.getItemDamage();
|
||||
public int getColorFromItemStack(ItemStack itemStack, int j) {
|
||||
if (j == 0) {
|
||||
return EnumHoneyDrop.get(itemStack).colour[0];
|
||||
return EnumHoneyDrop.get(itemStack).color[0];
|
||||
}
|
||||
return EnumHoneyDrop.get(itemStack).colour[1];
|
||||
return EnumHoneyDrop.get(itemStack).color[1];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamageForRenderPass(final int i, final int j) {
|
||||
public IIcon getIconFromDamageForRenderPass(int i, int j) {
|
||||
if (j > 0) {
|
||||
return this.icon1;
|
||||
return icon1;
|
||||
}
|
||||
return this.icon2;
|
||||
return icon2;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister register) {
|
||||
this.icon1 = BinnieCore.proxy.getIcon(register, "forestry", "honeyDrop.0");
|
||||
this.icon2 = BinnieCore.proxy.getIcon(register, "forestry", "honeyDrop.1");
|
||||
public void registerIcons(IIconRegister register) {
|
||||
icon1 = BinnieCore.proxy.getIcon(register, "forestry", "honeyDrop.0");
|
||||
icon2 = BinnieCore.proxy.getIcon(register, "forestry", "honeyDrop.1");
|
||||
}
|
||||
}
|
||||
@@ -1,42 +1,38 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import java.util.List;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import binnie.core.item.IItemEnum;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemProduct extends Item
|
||||
{
|
||||
IItemEnum[] types;
|
||||
import java.util.List;
|
||||
|
||||
public ItemProduct(final IItemEnum[] types) {
|
||||
this.setMaxStackSize(64);
|
||||
this.setMaxDamage(0);
|
||||
this.setHasSubtypes(true);
|
||||
public class ItemProduct extends Item {
|
||||
protected IItemEnum[] types;
|
||||
|
||||
public ItemProduct(IItemEnum[] types) {
|
||||
setMaxStackSize(64);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
this.types = types;
|
||||
}
|
||||
|
||||
public IItemEnum get(final ItemStack stack) {
|
||||
final int i = stack.getItemDamage();
|
||||
if (i >= 0 && i < this.types.length) {
|
||||
return this.types[i];
|
||||
public IItemEnum get(ItemStack stack) {
|
||||
int i = stack.getItemDamage();
|
||||
if (i >= 0 && i < types.length) {
|
||||
return types[i];
|
||||
}
|
||||
return this.types[0];
|
||||
return types[0];
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(final ItemStack itemstack) {
|
||||
return this.get(itemstack).getName(itemstack);
|
||||
public String getItemStackDisplayName(ItemStack itemstack) {
|
||||
return get(itemstack).getName(itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
|
||||
for (final IItemEnum type : this.types) {
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
for (IItemEnum type : types) {
|
||||
if (type.isActive()) {
|
||||
itemList.add(new ItemStack(this, 1, type.ordinal()));
|
||||
}
|
||||
|
||||
@@ -1,27 +1,21 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import binnie.core.BinnieCore;
|
||||
import forestry.api.core.Tabs;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import forestry.api.core.Tabs;
|
||||
|
||||
public class ItemPropolis extends ItemProduct
|
||||
{
|
||||
public class ItemPropolis extends ItemProduct {
|
||||
public ItemPropolis() {
|
||||
super(EnumPropolis.values());
|
||||
this.setCreativeTab(Tabs.tabApiculture);
|
||||
this.setUnlocalizedName("propolis");
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
setUnlocalizedName("propolis");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColorFromItemStack(final ItemStack itemStack, final int j) {
|
||||
final int i = itemStack.getItemDamage();
|
||||
public int getColorFromItemStack(ItemStack itemStack, int j) {
|
||||
if (j == 0) {
|
||||
return EnumPropolis.get(itemStack).colour[0];
|
||||
}
|
||||
@@ -30,7 +24,7 @@ public class ItemPropolis extends ItemProduct
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(final IIconRegister register) {
|
||||
this.itemIcon = BinnieCore.proxy.getIcon(register, "forestry", "propolis.0");
|
||||
public void registerIcons(IIconRegister register) {
|
||||
itemIcon = BinnieCore.proxy.getIcon(register, "forestry", "propolis.0");
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,14 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import binnie.core.IInitializable;
|
||||
import binnie.core.Mods;
|
||||
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;
|
||||
import net.minecraft.init.Items;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.IInitializable;
|
||||
|
||||
public class ModuleProducts implements IInitializable
|
||||
{
|
||||
public class ModuleProducts implements IInitializable {
|
||||
@Override
|
||||
public void preInit() {
|
||||
ExtraBees.honeyCrystal = new ItemHoneyCrystal();
|
||||
@@ -33,14 +28,19 @@ public class ModuleProducts implements IInitializable
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
GameRegistry.addRecipe(new ItemStack(ExtraBees.honeyCrystalEmpty), new Object[] { "#@#", "@#@", "#@#", '@', Mods.Forestry.stack("honeyDrop"), '#', EnumHoneyDrop.ENERGY.get(1) });
|
||||
for (final EnumHoneyComb info : EnumHoneyComb.values()) {
|
||||
GameRegistry.addRecipe(
|
||||
new ItemStack(ExtraBees.honeyCrystalEmpty),
|
||||
"#@#", "@#@", "#@#",
|
||||
'@', Mods.Forestry.stack("honeyDrop"),
|
||||
'#', EnumHoneyDrop.ENERGY.get(1)
|
||||
);
|
||||
for (EnumHoneyComb info : EnumHoneyComb.values()) {
|
||||
info.addRecipe();
|
||||
}
|
||||
for (final EnumHoneyDrop info2 : EnumHoneyDrop.values()) {
|
||||
for (EnumHoneyDrop info2 : EnumHoneyDrop.values()) {
|
||||
info2.addRecipe();
|
||||
}
|
||||
for (final EnumPropolis info3 : EnumPropolis.values()) {
|
||||
for (EnumPropolis info3 : EnumPropolis.values()) {
|
||||
info3.addRecipe();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,14 +1,9 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.proxy;
|
||||
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.proxy.BinnieModProxy;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
|
||||
public class ExtraBeesProxy extends BinnieModProxy
|
||||
{
|
||||
public class ExtraBeesProxy extends BinnieModProxy {
|
||||
public ExtraBeesProxy() {
|
||||
super(ExtraBees.instance);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,4 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.proxy;
|
||||
|
||||
public class ExtraBeesProxyClient extends ExtraBeesProxy
|
||||
{
|
||||
public class ExtraBeesProxyClient extends ExtraBeesProxy {
|
||||
}
|
||||
@@ -1,9 +1,4 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.proxy;
|
||||
|
||||
public class ExtraBeesProxyServer extends ExtraBeesProxy
|
||||
{
|
||||
public class ExtraBeesProxyServer extends ExtraBeesProxy {
|
||||
}
|
||||
@@ -1,92 +1,91 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.worldgen;
|
||||
|
||||
import forestry.api.apiculture.IHiveDrop;
|
||||
import java.util.Collections;
|
||||
import java.util.ArrayList;
|
||||
import net.minecraft.world.World;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import forestry.api.apiculture.IHiveDrop;
|
||||
import forestry.api.core.Tabs;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import java.util.List;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import forestry.api.core.Tabs;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockExtraBeeHive extends Block
|
||||
{
|
||||
IIcon[][] icons;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockExtraBeeHive extends Block {
|
||||
protected IIcon[][] icons;
|
||||
|
||||
public BlockExtraBeeHive() {
|
||||
super(ExtraBees.materialBeehive);
|
||||
this.setLightLevel(0.2f);
|
||||
this.setHardness(1.0f);
|
||||
this.setTickRandomly(true);
|
||||
this.setBlockName("hive");
|
||||
this.setCreativeTab(Tabs.tabApiculture);
|
||||
setLightLevel(0.2f);
|
||||
setHardness(1.0f);
|
||||
setTickRandomly(true);
|
||||
setBlockName("hive");
|
||||
setCreativeTab(Tabs.tabApiculture);
|
||||
}
|
||||
|
||||
public String getUnlocalizedName(final ItemStack par1ItemStack) {
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack) {
|
||||
return "extrabees.block.hive." + par1ItemStack.getItemDamage();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
itemList.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IIcon getIcon(final int side, final int metadata) {
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
if (metadata >= EnumHiveType.values().length) {
|
||||
return null;
|
||||
}
|
||||
if (side < 2) {
|
||||
return this.icons[metadata][1];
|
||||
return icons[metadata][1];
|
||||
}
|
||||
return this.icons[metadata][0];
|
||||
return icons[metadata][0];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(final IIconRegister register) {
|
||||
this.icons = new IIcon[EnumHiveType.values().length][2];
|
||||
for (final EnumHiveType hive : EnumHiveType.values()) {
|
||||
this.icons[hive.ordinal()][0] = ExtraBees.proxy.getIcon(register, "hive/" + hive.toString().toLowerCase() + ".0");
|
||||
this.icons[hive.ordinal()][1] = ExtraBees.proxy.getIcon(register, "hive/" + hive.toString().toLowerCase() + ".1");
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
icons = new IIcon[EnumHiveType.values().length][2];
|
||||
for (EnumHiveType hive : EnumHiveType.values()) {
|
||||
icons[hive.ordinal()][0] = ExtraBees.proxy.getIcon(register, "hive/" + hive.toString().toLowerCase() + ".0");
|
||||
icons[hive.ordinal()][1] = ExtraBees.proxy.getIcon(register, "hive/" + hive.toString().toLowerCase() + ".1");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(final World world, final int x, final int y, final int z, final int metadata, final int fortune) {
|
||||
final ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
final List<IHiveDrop> dropList = EnumHiveType.values()[metadata].drops;
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
List<IHiveDrop> dropList = EnumHiveType.values()[metadata].drops;
|
||||
Collections.shuffle(dropList);
|
||||
int tries = 0;
|
||||
|
||||
for (boolean hasPrincess = false; tries <= 10 && !hasPrincess; hasPrincess = true) {
|
||||
++tries;
|
||||
for (final IHiveDrop drop : dropList) {
|
||||
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));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (final IHiveDrop drop : dropList) {
|
||||
|
||||
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 (final IHiveDrop drop : dropList) {
|
||||
|
||||
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;
|
||||
|
||||
@@ -1,15 +1,11 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.worldgen;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import forestry.api.apiculture.IHiveDrop;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public enum EnumHiveType
|
||||
{
|
||||
public enum EnumHiveType {
|
||||
Water,
|
||||
Rock,
|
||||
Nether,
|
||||
@@ -17,7 +13,7 @@ public enum EnumHiveType
|
||||
|
||||
public List<IHiveDrop> drops;
|
||||
|
||||
private EnumHiveType() {
|
||||
this.drops = new ArrayList<IHiveDrop>();
|
||||
EnumHiveType() {
|
||||
drops = new ArrayList<>();
|
||||
}
|
||||
}
|
||||
@@ -1,64 +1,62 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.worldgen;
|
||||
|
||||
import forestry.api.genetics.IIndividual;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import net.minecraft.world.World;
|
||||
import binnie.Binnie;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import java.util.ArrayList;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.apiculture.IBeeRoot;
|
||||
import forestry.api.apiculture.IHiveDrop;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class HiveDrop implements IHiveDrop
|
||||
{
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class HiveDrop implements IHiveDrop {
|
||||
private IAllele[] template;
|
||||
private ArrayList<ItemStack> additional;
|
||||
private int chance;
|
||||
|
||||
public HiveDrop(final IAlleleBeeSpecies species, final int chance) {
|
||||
public HiveDrop(IAlleleBeeSpecies species, int chance) {
|
||||
this(Binnie.Genetics.getBeeRoot().getTemplate(species.getUID()), new ItemStack[0], chance);
|
||||
}
|
||||
|
||||
public HiveDrop(IAllele[] template, final ItemStack[] bonus, final int chance) {
|
||||
this.additional = new ArrayList<ItemStack>();
|
||||
public HiveDrop(IAllele[] template, ItemStack[] bonus, int chance) {
|
||||
additional = new ArrayList<>();
|
||||
if (template == null) {
|
||||
template = Binnie.Genetics.getBeeRoot().getDefaultTemplate();
|
||||
}
|
||||
this.template = template;
|
||||
this.chance = chance;
|
||||
for (final ItemStack stack : bonus) {
|
||||
this.additional.add(stack);
|
||||
for (ItemStack stack : bonus) {
|
||||
additional.add(stack);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPrincess(final World world, final int x, final int y, final int z, final int fortune) {
|
||||
return Binnie.Genetics.getBeeRoot().getMemberStack(Binnie.Genetics.getBeeRoot().getBee(world, Binnie.Genetics.getBeeRoot().templateAsGenome(this.template)), EnumBeeType.PRINCESS.ordinal());
|
||||
public ItemStack getPrincess(World world, int x, int y, int z, int fortune) {
|
||||
IBeeRoot beeRoot = Binnie.Genetics.getBeeRoot();
|
||||
return beeRoot.getMemberStack(beeRoot.getBee(world, beeRoot.templateAsGenome(template)), EnumBeeType.PRINCESS.ordinal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrones(final World world, final int x, final int y, final int z, final int fortune) {
|
||||
final ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
ret.add(Binnie.Genetics.getBeeRoot().getMemberStack(Binnie.Genetics.getBeeRoot().templateAsIndividual(this.template), EnumBeeType.DRONE.ordinal()));
|
||||
public ArrayList<ItemStack> getDrones(World world, int x, int y, int z, int fortune) {
|
||||
ArrayList<ItemStack> ret = new ArrayList<>();
|
||||
IBeeRoot beeRoot = Binnie.Genetics.getBeeRoot();
|
||||
ret.add(beeRoot.getMemberStack(beeRoot.templateAsIndividual(template), EnumBeeType.DRONE.ordinal()));
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getAdditional(final World world, final int x, final int y, final int z, final int fortune) {
|
||||
final ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
for (final ItemStack stack : this.additional) {
|
||||
public ArrayList<ItemStack> getAdditional(World world, int x, int y, int z, int fortune) {
|
||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
for (ItemStack stack : additional) {
|
||||
ret.add(stack.copy());
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getChance(final World world, final int x, final int y, final int z) {
|
||||
return this.chance;
|
||||
public int getChance(World world, int x, int y, int z) {
|
||||
return chance;
|
||||
}
|
||||
}
|
||||
@@ -1,39 +1,35 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.worldgen;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import java.util.List;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemBeehive extends ItemBlock
|
||||
{
|
||||
public ItemBeehive(final Block block) {
|
||||
import java.util.List;
|
||||
|
||||
public class ItemBeehive extends ItemBlock {
|
||||
public ItemBeehive(Block block) {
|
||||
super(block);
|
||||
this.setMaxDamage(0);
|
||||
this.setHasSubtypes(true);
|
||||
this.setCreativeTab(CreativeTabs.tabBlock);
|
||||
setMaxDamage(0);
|
||||
setHasSubtypes(true);
|
||||
setCreativeTab(CreativeTabs.tabBlock);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(final int i) {
|
||||
public int getMetadata(int i) {
|
||||
return i;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List itemList) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
itemList.add(new ItemStack(this, 1, i));
|
||||
list.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(final ItemStack itemStack) {
|
||||
public String getItemStackDisplayName(ItemStack itemStack) {
|
||||
return EnumHiveType.values()[itemStack.getItemDamage()].toString() + " Hive";
|
||||
}
|
||||
}
|
||||
@@ -1,18 +1,13 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.worldgen;
|
||||
|
||||
import net.minecraft.block.material.MapColor;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
public class MaterialBeehive extends Material
|
||||
{
|
||||
public class MaterialBeehive extends Material {
|
||||
public MaterialBeehive() {
|
||||
super(MapColor.stoneColor);
|
||||
this.setRequiresTool();
|
||||
this.setImmovableMobility();
|
||||
setRequiresTool();
|
||||
setImmovableMobility();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,29 +1,23 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.worldgen;
|
||||
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.World;
|
||||
import java.util.Random;
|
||||
import binnie.core.IInitializable;
|
||||
import binnie.core.genetics.ForestryAllele;
|
||||
import forestry.api.apiculture.IHiveDrop;
|
||||
import forestry.api.apiculture.IAlleleBeeSpecies;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.config.ConfigurationMain;
|
||||
import binnie.extrabees.genetics.ExtraBeesSpecies;
|
||||
import buildcraft.api.core.BuildCraftAPI;
|
||||
import binnie.extrabees.config.ConfigurationMain;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.IInitializable;
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
|
||||
public class ModuleGeneration implements IWorldGenerator, IInitializable
|
||||
{
|
||||
static int waterRate;
|
||||
static int rockRate;
|
||||
static int netherRate;
|
||||
static int marbleRate;
|
||||
import java.util.Random;
|
||||
|
||||
public class ModuleGeneration implements IWorldGenerator, IInitializable {
|
||||
protected static int waterRate = 2;
|
||||
protected static int rockRate = 2;
|
||||
protected static int netherRate = 2;
|
||||
protected static int marbleRate = 2;
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
@@ -46,10 +40,13 @@ public class ModuleGeneration implements IWorldGenerator, IInitializable
|
||||
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);
|
||||
@@ -57,33 +54,29 @@ public class ModuleGeneration implements IWorldGenerator, IInitializable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void generate(final Random rand, int chunkX, int chunkZ, final World world, final IChunkProvider chunkGenerator, final IChunkProvider chunkProvider) {
|
||||
public void generate(Random rand, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) {
|
||||
chunkX <<= 4;
|
||||
chunkZ <<= 4;
|
||||
|
||||
for (int i = 0; i < ModuleGeneration.waterRate; ++i) {
|
||||
final int randPosX = chunkX + rand.nextInt(16);
|
||||
final int randPosY = rand.nextInt(50) + 20;
|
||||
final int randPosZ = chunkZ + rand.nextInt(16);
|
||||
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 < ModuleGeneration.rockRate; ++i) {
|
||||
final int randPosX = chunkX + rand.nextInt(16);
|
||||
final int randPosY = rand.nextInt(50) + 20;
|
||||
final int randPosZ = chunkZ + rand.nextInt(16);
|
||||
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 < ModuleGeneration.netherRate; ++i) {
|
||||
final int randPosX = chunkX + rand.nextInt(16);
|
||||
final int randPosY = rand.nextInt(50) + 20;
|
||||
final int randPosZ = chunkZ + rand.nextInt(16);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
static {
|
||||
ModuleGeneration.waterRate = 2;
|
||||
ModuleGeneration.rockRate = 2;
|
||||
ModuleGeneration.netherRate = 2;
|
||||
ModuleGeneration.marbleRate = 2;
|
||||
}
|
||||
}
|
||||
@@ -1,33 +1,38 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.worldgen;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
import java.util.Random;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
|
||||
public class WorldGenHiveNether extends WorldGenerator
|
||||
{
|
||||
import java.util.Random;
|
||||
|
||||
public class WorldGenHiveNether extends WorldGenerator {
|
||||
@Override
|
||||
public boolean generate(final World world, final Random random, final int i, final int j, final int k) {
|
||||
final BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(i, k);
|
||||
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 (this.embedInWall(world, Blocks.netherrack, i, j, k)) {
|
||||
|
||||
if (embedInWall(world, Blocks.netherrack, i, j, k)) {
|
||||
world.setBlock(i, j, k, ExtraBees.hive, 2, 0);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean embedInWall(final World world, final Block blockID, final int i, final int j, final int k) {
|
||||
return world.getBlock(i, j, k) == blockID && world.getBlock(i, j + 1, k) == blockID && world.getBlock(i, j - 1, k) == blockID && (world.isAirBlock(i + 1, j, k) || world.isAirBlock(i - 1, j, k) || world.isAirBlock(i, j, k + 1) || world.isAirBlock(i, j, k - 1));
|
||||
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)
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,26 +1,23 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.worldgen;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import java.util.Random;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
public class WorldGenHiveRock extends WorldGenerator
|
||||
{
|
||||
import java.util.Random;
|
||||
|
||||
public class WorldGenHiveRock extends WorldGenerator {
|
||||
@Override
|
||||
public boolean generate(final World world, final Random random, final int i, final int j, final int k) {
|
||||
final BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(i, k);
|
||||
final Block block = world.getBlock(i, j, k);
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -1,28 +1,25 @@
|
||||
//
|
||||
// Decompiled by Procyon v0.5.30
|
||||
//
|
||||
|
||||
package binnie.extrabees.worldgen;
|
||||
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
import java.util.Random;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.BiomeGenBase;
|
||||
import net.minecraft.world.gen.feature.WorldGenerator;
|
||||
|
||||
public class WorldGenHiveWater extends WorldGenerator
|
||||
{
|
||||
import java.util.Random;
|
||||
|
||||
public class WorldGenHiveWater extends WorldGenerator {
|
||||
@Override
|
||||
public boolean generate(final World world, final Random random, final int i, final int j, final int k) {
|
||||
final BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(i, k);
|
||||
final int i2 = i + random.nextInt(8) - random.nextInt(8);
|
||||
final int j2 = j + random.nextInt(4) - random.nextInt(4);
|
||||
final int k2 = k + random.nextInt(8) - random.nextInt(8);
|
||||
public boolean generate(World world, Random random, int i, int j, int k) {
|
||||
BiomeGenBase biome = world.getWorldChunkManager().getBiomeGenAt(i, k);
|
||||
int i2 = i + random.nextInt(8) - random.nextInt(8);
|
||||
int j2 = j + random.nextInt(4) - random.nextInt(4);
|
||||
int k2 = k + random.nextInt(8) - random.nextInt(8);
|
||||
if (world.getBlock(i2, j2, k2) != Blocks.water && world.getBlock(i2, j2, k2) != Blocks.water) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (world.getBlock(i2, j2 - 1, k2).getMaterial() == Material.sand || world.getBlock(i2, j2 - 1, k2).getMaterial() == Material.clay || world.getBlock(i2, j2 - 1, k2).getMaterial() == Material.ground || world.getBlock(i2, j2 - 1, k2).getMaterial() == Material.rock) {
|
||||
world.setBlock(i2, j2, k2, ExtraBees.hive, 0, 0);
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ public enum Alcohol implements IFluidType, ICocktailLiquid
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColour() {
|
||||
public int getColor() {
|
||||
return this.colour;
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ public enum Alcohol implements IFluidType, ICocktailLiquid
|
||||
|
||||
@Override
|
||||
public int getContainerColour() {
|
||||
return this.getColour();
|
||||
return this.getColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -75,7 +75,7 @@ public enum Cocktail
|
||||
|
||||
public static void registerIngredient(final ICocktailIngredient ingredient) {
|
||||
Cocktail.cocktailIngredients.put(ingredient.getIdentifier().toLowerCase(), ingredient);
|
||||
DrinkManager.registerDrinkLiquid(ingredient.getIdentifier().toLowerCase(), new DrinkLiquid(ingredient.getName(), ingredient.getColour(), ingredient.getTransparency(), ingredient.getABV()));
|
||||
DrinkManager.registerDrinkLiquid(ingredient.getIdentifier().toLowerCase(), new DrinkLiquid(ingredient.getName(), ingredient.getColor(), ingredient.getTransparency(), ingredient.getABV()));
|
||||
}
|
||||
|
||||
public static ICocktailIngredient getIngredient(final String name2) {
|
||||
|
||||
@@ -10,7 +10,7 @@ public interface ICocktailIngredient
|
||||
|
||||
String getIdentifier();
|
||||
|
||||
int getColour();
|
||||
int getColor();
|
||||
|
||||
int getTransparency();
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ public enum Juice implements IFluidType, ICocktailLiquid
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColour() {
|
||||
public int getColor() {
|
||||
return this.colour;
|
||||
}
|
||||
|
||||
@@ -110,7 +110,7 @@ public enum Juice implements IFluidType, ICocktailLiquid
|
||||
|
||||
@Override
|
||||
public int getContainerColour() {
|
||||
return this.getColour();
|
||||
return this.getColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -90,7 +90,7 @@ public enum Liqueur implements IFluidType, ICocktailLiquid
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColour() {
|
||||
public int getColor() {
|
||||
return this.colour;
|
||||
}
|
||||
|
||||
@@ -111,7 +111,7 @@ public enum Liqueur implements IFluidType, ICocktailLiquid
|
||||
|
||||
@Override
|
||||
public int getContainerColour() {
|
||||
return this.getColour();
|
||||
return this.getColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -72,7 +72,7 @@ public enum MiscFluid implements IFluidType, ICocktailLiquid
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColour() {
|
||||
public int getColor() {
|
||||
return this.colour;
|
||||
}
|
||||
|
||||
@@ -93,7 +93,7 @@ public enum MiscFluid implements IFluidType, ICocktailLiquid
|
||||
|
||||
@Override
|
||||
public int getContainerColour() {
|
||||
return this.getColour();
|
||||
return this.getColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -93,7 +93,7 @@ public enum Spirit implements IFluidType, ICocktailLiquid
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColour() {
|
||||
public int getColor() {
|
||||
return this.colour;
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ public enum Spirit implements IFluidType, ICocktailLiquid
|
||||
|
||||
@Override
|
||||
public int getContainerColour() {
|
||||
return this.getColour();
|
||||
return this.getColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -52,7 +52,7 @@ public enum ExtraTreeLiquid implements ILiquidType
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColour() {
|
||||
public int getColor() {
|
||||
return 16777215;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,13 +18,13 @@ public enum GeneticLiquid implements IFluidType {
|
||||
protected String name;
|
||||
protected String ident;
|
||||
protected IIcon icon;
|
||||
protected int colour;
|
||||
protected int color;
|
||||
protected float transparency;
|
||||
|
||||
GeneticLiquid(String name, String ident, int colour) {
|
||||
GeneticLiquid(String name, String ident, int color) {
|
||||
this.name = name;
|
||||
this.ident = ident;
|
||||
this.colour = colour;
|
||||
this.color = color;
|
||||
transparency = 1.0f;
|
||||
}
|
||||
|
||||
@@ -54,13 +54,13 @@ public enum GeneticLiquid implements IFluidType {
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getColour() {
|
||||
public int getColor() {
|
||||
return 0xffffff;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getContainerColour() {
|
||||
return colour;
|
||||
return color;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -75,7 +75,8 @@ public enum GeneticLiquid implements IFluidType {
|
||||
|
||||
@Override
|
||||
public boolean canPlaceIn(FluidContainer container) {
|
||||
return this == GeneticLiquid.GrowthMedium || container == FluidContainer.Cylinder;
|
||||
return this == GeneticLiquid.GrowthMedium
|
||||
|| container == FluidContainer.Cylinder;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -33,35 +33,37 @@ public class ItemDatabase extends Item {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return (par1 == 0) ? itemIcon : iconMaster;
|
||||
public IIcon getIconFromDamage(int damage) {
|
||||
return (damage == 0) ? itemIcon : iconMaster;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||
super.addInformation(stack, player, tooltip, advanced);
|
||||
}
|
||||
|
||||
@Override
|
||||
@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 void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
super.getSubItems(item, tab, list);
|
||||
list.add(new ItemStack(item, 1, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) {
|
||||
if (itemstack.getItemDamage() == 0) {
|
||||
public ItemStack onItemRightClick(ItemStack itemststackck, World world, EntityPlayer player) {
|
||||
if (itemststackck.getItemDamage() == 0) {
|
||||
Genetics.proxy.openGui(GeneticsGUI.Database, player, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
} else {
|
||||
Genetics.proxy.openGui(GeneticsGUI.DatabaseNEI, player, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
}
|
||||
return itemstack;
|
||||
return itemststackck;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack i) {
|
||||
return (i.getItemDamage() == 0) ? "Gene Database" : "Master Gene Database";
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
return (stack.getItemDamage() == 0) ?
|
||||
"Gene Database" :
|
||||
"Master Gene Database";
|
||||
}
|
||||
}
|
||||
@@ -70,19 +70,19 @@ public abstract class ItemGene extends Item {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer entityPlayer, List list, boolean par4) {
|
||||
super.addInformation(itemstack, entityPlayer, list, par4);
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||
super.addInformation(itemstack, player, tooltip, advanced);
|
||||
int damage = getMaxDamage() - itemstack.getItemDamage();
|
||||
if (damage == 0) {
|
||||
list.add("Empty");
|
||||
tooltip.add("Empty");
|
||||
} else if (damage == 1) {
|
||||
list.add("1 Charge");
|
||||
tooltip.add("1 Charge");
|
||||
} else {
|
||||
list.add(damage + " Charges");
|
||||
tooltip.add(damage + " Charges");
|
||||
}
|
||||
|
||||
IGeneItem gene = getGeneItem(itemstack);
|
||||
gene.getInfo(list);
|
||||
gene.getInfo(tooltip);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,9 +25,9 @@ public class ItemMasterRegistry extends Item {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) {
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
Genetics.proxy.openGui(GeneticsGUI.MasterRegistry, player, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
return itemstack;
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -25,9 +25,9 @@ public class ItemRegistry extends Item {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) {
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
Genetics.proxy.openGui(GeneticsGUI.Registry, player, (int) player.posX, (int) player.posY, (int) player.posZ);
|
||||
return itemstack;
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -43,8 +43,8 @@ public class ItemSequence extends Item implements IItemAnalysable, IItemChargabl
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack itemstack) {
|
||||
GeneItem gene = new GeneItem(itemstack);
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
GeneItem gene = new GeneItem(stack);
|
||||
if (gene.isCorrupted()) {
|
||||
return "Corrupted Sequence";
|
||||
}
|
||||
@@ -53,27 +53,27 @@ public class ItemSequence extends Item implements IItemAnalysable, IItemChargabl
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer entityPlayer, List list, boolean par4) {
|
||||
super.addInformation(itemstack, entityPlayer, list, par4);
|
||||
list.add(Genetics.proxy.localise("item.sequence." + (5 - itemstack.getItemDamage() % 6)));
|
||||
SequencerItem gene = new SequencerItem(itemstack);
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||
super.addInformation(stack, player, tooltip, advanced);
|
||||
tooltip.add(Genetics.proxy.localise("item.sequence." + (5 - stack.getItemDamage() % 6)));
|
||||
SequencerItem gene = new SequencerItem(stack);
|
||||
if (gene.isCorrupted()) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (gene.analysed) {
|
||||
gene.getInfo(list);
|
||||
gene.getInfo(tooltip);
|
||||
} else {
|
||||
list.add("<Unknown>");
|
||||
tooltip.add("<Unknown>");
|
||||
}
|
||||
|
||||
int seq = gene.sequenced;
|
||||
if (seq == 0) {
|
||||
list.add("Unsequenced");
|
||||
tooltip.add("Unsequenced");
|
||||
} else if (seq < 100) {
|
||||
list.add("Partially Sequenced (" + seq + "%)");
|
||||
tooltip.add("Partially Sequenced (" + seq + "%)");
|
||||
} else {
|
||||
list.add("Fully Sequenced");
|
||||
tooltip.add("Fully Sequenced");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,9 +84,9 @@ public class ItemSequence extends Item implements IItemAnalysable, IItemChargabl
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
IAlleleBeeSpecies species = (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele("forestry.speciesMeadows");
|
||||
itemList.add(create(new Gene(species, EnumBeeChromosome.SPECIES, Binnie.Genetics.getBeeRoot()), false));
|
||||
list.add(create(new Gene(species, EnumBeeChromosome.SPECIES, Binnie.Genetics.getBeeRoot()), false));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -37,8 +37,8 @@ public class ItemSerum extends ItemGene implements IItemSerum {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer entityPlayer, List list, boolean par4) {
|
||||
super.addInformation(itemstack, entityPlayer, list, par4);
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||
super.addInformation(itemstack, player, tooltip, advanced);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -47,7 +47,7 @@ public class ItemSerum extends ItemGene implements IItemSerum {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item par1, CreativeTabs tab, List itemList) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
for (ISpeciesRoot root : AlleleManager.alleleRegistry.getSpeciesRoot().values()) {
|
||||
Map<IChromosomeType, List<IAllele>> chromosomeMap = Binnie.Genetics.getChromosomeMap(root);
|
||||
for (Map.Entry<IChromosomeType, List<IAllele>> entry : chromosomeMap.entrySet()) {
|
||||
@@ -58,10 +58,10 @@ public class ItemSerum extends ItemGene implements IItemSerum {
|
||||
continue;
|
||||
}
|
||||
|
||||
IGeneItem item = new GeneItem(gene);
|
||||
IGeneItem geneItem = new GeneItem(gene);
|
||||
ItemStack stack = new ItemStack(this);
|
||||
item.writeToItem(stack);
|
||||
itemList.add(stack);
|
||||
geneItem.writeToItem(stack);
|
||||
list.add(stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,8 +39,8 @@ public class ItemSerumArray extends ItemGene implements IItemSerum {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer entityPlayer, List list, boolean par4) {
|
||||
super.addInformation(itemstack, entityPlayer, list, par4);
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||
super.addInformation(stack, player, tooltip, advanced);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -69,14 +69,14 @@ public class ItemSerumArray extends ItemGene implements IItemSerum {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(Item par1, CreativeTabs tab, List itemList) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
for (ISpeciesRoot root : AlleleManager.alleleRegistry.getSpeciesRoot().values()) {
|
||||
for (IIndividual template : root.getIndividualTemplates()) {
|
||||
if (template.getGenome().getPrimary().isSecret()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
IGeneItem item = new GeneArrayItem();
|
||||
IGeneItem geneItem = new GeneArrayItem();
|
||||
for (IChromosomeType type : root.getKaryotype()) {
|
||||
IChromosome c = template.getGenome().getChromosomes()[type.ordinal()];
|
||||
if (c == null) {
|
||||
@@ -85,13 +85,13 @@ public class ItemSerumArray extends ItemGene implements IItemSerum {
|
||||
|
||||
IAllele active = c.getActiveAllele();
|
||||
if (active != null) {
|
||||
item.addGene(new Gene(active, type, root));
|
||||
geneItem.addGene(new Gene(active, type, root));
|
||||
}
|
||||
}
|
||||
|
||||
ItemStack array = new ItemStack(this);
|
||||
item.writeToItem(array);
|
||||
itemList.add(array);
|
||||
geneItem.writeToItem(array);
|
||||
list.add(array);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,12 @@ public class ModuleItem implements IInitializable {
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
GameRegistry.addShapelessRecipe(GeneticsItems.DNADye.get(8), Items.glowstone_dust, new ItemStack(Items.dye, 1, 5));
|
||||
GameRegistry.addShapelessRecipe(
|
||||
GeneticsItems.DNADye.get(8),
|
||||
Items.glowstone_dust,
|
||||
new ItemStack(Items.dye, 1, 5)
|
||||
);
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
GeneticsItems.LaboratoryCasing.get(1),
|
||||
new Object[]{
|
||||
@@ -80,6 +85,7 @@ public class ModuleItem implements IInitializable {
|
||||
'Y', Mods.Forestry.item("sturdyMachine")
|
||||
}
|
||||
));
|
||||
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(
|
||||
GeneticsItems.DNADye.get(2),
|
||||
new Object[]{
|
||||
@@ -88,6 +94,7 @@ public class ModuleItem implements IInitializable {
|
||||
"dyePink"
|
||||
}
|
||||
));
|
||||
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(
|
||||
GeneticsItems.FluorescentDye.get(2),
|
||||
new Object[]{
|
||||
@@ -96,6 +103,7 @@ public class ModuleItem implements IInitializable {
|
||||
"dustGlowstone"
|
||||
}
|
||||
));
|
||||
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(
|
||||
GeneticsItems.GrowthMedium.get(2),
|
||||
new Object[]{
|
||||
@@ -103,6 +111,7 @@ public class ModuleItem implements IInitializable {
|
||||
Items.sugar
|
||||
}
|
||||
));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
GeneticsItems.EmptySequencer.get(1),
|
||||
new Object[]{
|
||||
@@ -112,6 +121,7 @@ public class ModuleItem implements IInitializable {
|
||||
'p', Items.paper
|
||||
}
|
||||
));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
GeneticsItems.EmptySerum.get(1),
|
||||
new Object[]{
|
||||
@@ -120,6 +130,7 @@ public class ModuleItem implements IInitializable {
|
||||
'G', Blocks.glass_pane
|
||||
}
|
||||
));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
GeneticsItems.EmptyGenome.get(1),
|
||||
new Object[]{
|
||||
@@ -127,6 +138,7 @@ public class ModuleItem implements IInitializable {
|
||||
's', GeneticsItems.EmptySerum.get(1)
|
||||
}
|
||||
));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
GeneticsItems.Cylinder.get(8),
|
||||
new Object[]{
|
||||
@@ -134,6 +146,7 @@ public class ModuleItem implements IInitializable {
|
||||
'g', Blocks.glass_pane
|
||||
}
|
||||
));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
GeneticsItems.IntegratedCircuit.get(1),
|
||||
new Object[]{
|
||||
@@ -143,6 +156,7 @@ public class ModuleItem implements IInitializable {
|
||||
'g', "dustGlowstone"
|
||||
}
|
||||
));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
GeneticsItems.IntegratedCircuit.get(1),
|
||||
new Object[]{
|
||||
@@ -160,6 +174,7 @@ public class ModuleItem implements IInitializable {
|
||||
'd', GeneticsItems.LaboratoryCasing.get(1)
|
||||
}
|
||||
));
|
||||
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
GeneticsItems.IntegratedCPU.get(1),
|
||||
new Object[]{
|
||||
@@ -168,6 +183,7 @@ public class ModuleItem implements IInitializable {
|
||||
'd', Items.diamond
|
||||
}
|
||||
));
|
||||
|
||||
RecipeManagers.carpenterManager.addRecipe(
|
||||
100,
|
||||
Binnie.Liquid.getLiquidStack("water", 2000),
|
||||
@@ -181,6 +197,7 @@ public class ModuleItem implements IInitializable {
|
||||
'D', Items.ender_eye,
|
||||
'E', Blocks.obsidian
|
||||
);
|
||||
|
||||
GameRegistry.addSmelting(Genetics.itemSequencer, GeneticsItems.EmptySequencer.get(1), 0.0f);
|
||||
GameRegistry.addSmelting(Genetics.itemSerum, GeneticsItems.EmptySerum.get(1), 0.0f);
|
||||
GameRegistry.addSmelting(Genetics.itemSerumArray, GeneticsItems.EmptyGenome.get(1), 0.0f);
|
||||
|
||||
Reference in new issue
Block a user