mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-22 21:19:56 +00:00
[1.7.10] Some refactoring (#102)
* Some refactoring * Some refactoring Added some localization * Added some localization Fix wrong branch localization in page branch overview Simplify some localization * Simplify some localization * Removed unused localize method * Simplify some localization * Removed proxy.localise method * Simplify localization
This commit is contained in:
1 parent
81301c3bd2
commit
1ffaad9fcd
232 files changed
+1947
-2054
No files matched your search
@@ -4,7 +4,7 @@ import binnie.core.Mods;
|
||||
import binnie.core.genetics.BeeModifierLogic;
|
||||
import binnie.core.genetics.EnumBeeBooleanModifier;
|
||||
import binnie.core.genetics.EnumBeeModifier;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.util.I18N;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
@@ -135,7 +135,7 @@ public enum EnumHiveFrame implements IHiveFrame, IBeeModifier {
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return ExtraBees.proxy.localise("item.frame." + toString().toLowerCase());
|
||||
return I18N.localise("extrabees.item.frame." + toString().toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,143 +0,0 @@
|
||||
package binnie.extrabees.apiary;
|
||||
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public enum IndustrialFrame implements IBeeModifier {
|
||||
Empty("Empty", 5, 0),
|
||||
Light("Glowstone Lighting", 2, 4),
|
||||
Rain("Rain Shielding", 2, 4),
|
||||
Sunlight("Sunlight Simulator", 4, 8),
|
||||
Soul("Low Grade Mutagen", 5, 15),
|
||||
Uranium("High Grade Mutagen", 10, 50),
|
||||
Cage("Meshed Restrainer", 3, 12),
|
||||
Freedom("Territory Extension", 3, 16),
|
||||
Honey("Honey Amplifier", 4, 12),
|
||||
Jelly("Gelatin Amplifier", 8, 36),
|
||||
Leaf("Pollinator MK I", 3, 15),
|
||||
Pollen("Pollinator MK II", 7, 25),
|
||||
Clay("Lifespan Extensor", 2, 10),
|
||||
Emerald("Eon Simulator", 7, 20),
|
||||
NetherStar("Immortality Gate", 12, 50),
|
||||
Poison("Mortality Inhibitor", 8, 18);
|
||||
|
||||
static {
|
||||
IndustrialFrame.Light.lighted = true;
|
||||
IndustrialFrame.Rain.rain = true;
|
||||
IndustrialFrame.Sunlight.lighted = true;
|
||||
IndustrialFrame.Sunlight.sunlight = true;
|
||||
IndustrialFrame.Soul.mutationMod = 1.3f;
|
||||
IndustrialFrame.Uranium.mutationMod = 2.0f;
|
||||
IndustrialFrame.Cage.territoryMod = 0.4f;
|
||||
IndustrialFrame.Freedom.territoryMod = 1.4f;
|
||||
IndustrialFrame.Honey.productionMod = 1.4f;
|
||||
IndustrialFrame.Jelly.productionMod = 1.8f;
|
||||
IndustrialFrame.Leaf.floweringMod = 1.4f;
|
||||
IndustrialFrame.Pollen.floweringMod = 2.0f;
|
||||
IndustrialFrame.Clay.lifespanMod = 1.4f;
|
||||
IndustrialFrame.Emerald.lifespanMod = 2.0f;
|
||||
IndustrialFrame.NetherStar.lifespanMod = 20.0f;
|
||||
IndustrialFrame.Poison.lifespanMod = 0.5f;
|
||||
}
|
||||
|
||||
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,63 +0,0 @@
|
||||
package binnie.extrabees.apiary;
|
||||
|
||||
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")];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean requiresMultipleRenderPasses() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, List par3List, boolean par4) {
|
||||
super.addInformation(par1ItemStack, par2EntityPlayer, par3List, par4);
|
||||
IndustrialFrame frame = getFrame(par1ItemStack);
|
||||
if (frame == null) {
|
||||
par3List.add("Invalid Contents");
|
||||
} else {
|
||||
par3List.add(frame.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack par1ItemStack) {
|
||||
return "Industrial Frame";
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,8 @@ 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 binnie.extrabees.apiary.machine.mutator.AlvearyMutator;
|
||||
import binnie.extrabees.apiary.machine.stimulator.CircuitType;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import forestry.api.core.Tabs;
|
||||
import net.minecraft.block.Block;
|
||||
@@ -106,7 +106,7 @@ public class ModuleApiary implements IInitializable {
|
||||
}
|
||||
));
|
||||
|
||||
for (AlvearyStimulator.CircuitType type : AlvearyStimulator.CircuitType.values()) {
|
||||
for (CircuitType type : CircuitType.values()) {
|
||||
type.createCircuit(stimulatorLayout);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,12 @@ import net.minecraft.util.ChunkCoordinates;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyComponent.Active, IAlvearyComponent.BeeModifier, IAlvearyComponent.BeeListener, IBeeListener, IBeeModifier {
|
||||
public class TileExtraBeeAlveary extends TileEntityMachine implements
|
||||
IAlvearyComponent.Active,
|
||||
IAlvearyComponent.BeeModifier,
|
||||
IAlvearyComponent.BeeListener,
|
||||
IBeeListener,
|
||||
IBeeModifier {
|
||||
protected IMultiblockLogicAlveary structureLogic;
|
||||
protected ChunkCoordinates min;
|
||||
protected ChunkCoordinates max;
|
||||
@@ -44,15 +49,17 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyCo
|
||||
}
|
||||
|
||||
public List<TileEntity> getAlvearyBlocks() {
|
||||
LinkedList<TileEntity> tiles = new LinkedList<TileEntity>();
|
||||
if (min != null && max != null) {
|
||||
for (int x = min.posX; x <= max.posX; ++x) {
|
||||
for (int z = min.posZ; z <= max.posZ; ++z) {
|
||||
for (int y = min.posY; y <= max.posY; ++y) {
|
||||
TileEntity tile = getWorldObj().getTileEntity(x, y, z);
|
||||
if (tile instanceof IMultiblockComponent) {
|
||||
tiles.add(tile);
|
||||
}
|
||||
LinkedList<TileEntity> tiles = new LinkedList<>();
|
||||
if (min == null || max == null) {
|
||||
return tiles;
|
||||
}
|
||||
|
||||
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 = getWorldObj().getTileEntity(x, y, z);
|
||||
if (tile instanceof IMultiblockComponent) {
|
||||
tiles.add(tile);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -544,5 +551,4 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyCo
|
||||
// return this.getMachine().getInterface(ISidedInventory.class);
|
||||
// }
|
||||
//
|
||||
|
||||
}
|
||||
@@ -1,123 +0,0 @@
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
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.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 = 0;
|
||||
|
||||
public static class PackageAlvearyFrame extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public PackageAlvearyFrame() {
|
||||
super("frame", ExtraBeeTexture.AlvearyFrame.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyFrame);
|
||||
ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
inventory.addSlot(AlvearyFrame.slotFrame, "frame");
|
||||
inventory.getSlot(AlvearyFrame.slotFrame).setValidator(new SlotValidatorFrame());
|
||||
new ComponentFrameModifier(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class SlotValidatorFrame extends SlotValidator {
|
||||
public SlotValidatorFrame() {
|
||||
super(SlotValidator.IconFrame);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(ItemStack itemStack) {
|
||||
return itemStack != null
|
||||
&& itemStack.getItem() instanceof IHiveFrame;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return "Hive Frames";
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentFrameModifier extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public ComponentFrameModifier(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wearOutEquipment(int amount) {
|
||||
if (getHiveFrame() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
World world = getMachine().getTileEntity().getWorldObj();
|
||||
int wear = Math.round(amount * 5 * Binnie.Genetics.getBeeRoot().getBeekeepingMode(world).getWearModifier());
|
||||
getInventory().setInventorySlotContents(AlvearyFrame.slotFrame, getHiveFrame().frameUsed(((TileExtraBeeAlveary) getMachine().getTileEntity()).getMultiblockLogic().getController(), getInventory().getStackInSlot(AlvearyFrame.slotFrame), null, wear));
|
||||
}
|
||||
|
||||
public IHiveFrame getHiveFrame() {
|
||||
if (getInventory().getStackInSlot(AlvearyFrame.slotFrame) != null) {
|
||||
return (IHiveFrame) getInventory().getStackInSlot(AlvearyFrame.slotFrame).getItem();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
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(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(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(IBeeGenome genome, float currentModifier) {
|
||||
IHiveFrame frame = getHiveFrame();
|
||||
if (frame == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
return frame.getBeeModifier().getProductionModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
|
||||
IHiveFrame frame = getHiveFrame();
|
||||
if (frame == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
return frame.getBeeModifier().getFloweringModifier(genome, currentModifier);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,93 +0,0 @@
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
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.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;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class AlvearyHatchery {
|
||||
public static int[] slotLarvae = new int[]{0, 1, 2, 3, 4};
|
||||
|
||||
public static class PackageAlvearyHatchery extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public PackageAlvearyHatchery() {
|
||||
super("hatchery", ExtraBeeTexture.AlvearyHatchery.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyHatchery);
|
||||
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 SlotValidatorLarvae() {
|
||||
super(SlotValidator.IconBee);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(ItemStack itemStack) {
|
||||
return Binnie.Genetics.getBeeRoot().isMember(itemStack) && Binnie.Genetics.getBeeRoot().getType(itemStack) == EnumBeeType.LARVAE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return "Larvae";
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentFrameModifier extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public ComponentFrameModifier(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
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,32 +0,0 @@
|
||||
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;
|
||||
|
||||
public class AlvearyLighting {
|
||||
public static class PackageAlvearyLighting extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public PackageAlvearyLighting() {
|
||||
super("lighting", ExtraBeeTexture.AlvearyLighting.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentLighting(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentLighting extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public ComponentLighting(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,18 +7,25 @@ import binnie.core.machines.MachineRendererBlock;
|
||||
import binnie.core.resource.BinnieResource;
|
||||
import binnie.extrabees.apiary.ModuleApiary;
|
||||
import binnie.extrabees.apiary.TileExtraBeeAlveary;
|
||||
import binnie.extrabees.apiary.machine.frame.FrameAlvearyPackage;
|
||||
import binnie.extrabees.apiary.machine.hatchery.HatcheryAlvearyPackage;
|
||||
import binnie.extrabees.apiary.machine.lighting.LightingAlvearyPackage;
|
||||
import binnie.extrabees.apiary.machine.mutator.MutatorAlvearyPackage;
|
||||
import binnie.extrabees.apiary.machine.rainShield.RainShieldAlvearyPackage;
|
||||
import binnie.extrabees.apiary.machine.stimulator.StimulatorAlvearyPackage;
|
||||
import binnie.extrabees.apiary.machine.transmission.TransmissionAlvearyPackage;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public enum AlvearyMachine implements IMachineType {
|
||||
Mutator(AlvearyMutator.PackageAlvearyMutator.class),
|
||||
Frame(AlvearyFrame.PackageAlvearyFrame.class),
|
||||
RainShield(AlvearyRainShield.PackageAlvearyRainShield.class),
|
||||
Lighting(AlvearyLighting.PackageAlvearyLighting.class),
|
||||
Stimulator(AlvearyStimulator.PackageAlvearyStimulator.class),
|
||||
Hatchery(AlvearyHatchery.PackageAlvearyHatchery.class),
|
||||
Transmission(AlvearyTransmission.PackageAlvearyTransmission.class);
|
||||
Mutator(MutatorAlvearyPackage.class),
|
||||
Frame(FrameAlvearyPackage.class),
|
||||
RainShield(RainShieldAlvearyPackage.class),
|
||||
Lighting(LightingAlvearyPackage.class),
|
||||
Stimulator(StimulatorAlvearyPackage.class),
|
||||
Hatchery(HatcheryAlvearyPackage.class),
|
||||
Transmission(TransmissionAlvearyPackage.class);
|
||||
|
||||
protected Class<? extends MachinePackage> cls;
|
||||
|
||||
|
||||
@@ -1,107 +0,0 @@
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
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.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;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class AlvearyMutator {
|
||||
public static int slotMutator = 0;
|
||||
|
||||
protected static Map<ItemStack, Float> mutations = new HashMap<>();
|
||||
|
||||
public static boolean isMutationItem(ItemStack item) {
|
||||
return getMutationMult(item) > 1.0f;
|
||||
}
|
||||
|
||||
public static float getMutationMult(ItemStack item) {
|
||||
if (item == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
for (ItemStack comp : AlvearyMutator.mutations.keySet()) {
|
||||
if (ItemStack.areItemStackTagsEqual(item, comp) && item.isItemEqual(comp)) {
|
||||
return AlvearyMutator.mutations.get(comp);
|
||||
}
|
||||
}
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
public static void addMutationItem(ItemStack item, float chance) {
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
AlvearyMutator.mutations.put(item, chance);
|
||||
}
|
||||
|
||||
public static Collection<ItemStack> getMutagens() {
|
||||
return AlvearyMutator.mutations.keySet();
|
||||
}
|
||||
|
||||
public static class PackageAlvearyMutator extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public PackageAlvearyMutator() {
|
||||
super("mutator", ExtraBeeTexture.AlvearyMutator.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyMutator);
|
||||
ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
inventory.addSlot(AlvearyMutator.slotMutator, "mutator");
|
||||
inventory.getSlot(AlvearyMutator.slotMutator).setValidator(new SlotValidatorMutator());
|
||||
new ComponentMutatorModifier(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class SlotValidatorMutator extends SlotValidator {
|
||||
public SlotValidatorMutator() {
|
||||
super(new ValidatorIcon(ExtraBees.instance, "validator/mutator.0", "validator/mutator.1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(ItemStack itemStack) {
|
||||
return AlvearyMutator.isMutationItem(itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return "Mutagenic Agents";
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentMutatorModifier extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public ComponentMutatorModifier(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
if (getUtil().isSlotEmpty(AlvearyMutator.slotMutator)) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
float mult = AlvearyMutator.getMutationMult(getUtil().getStack(AlvearyMutator.slotMutator));
|
||||
return Math.min(mult, 15.0f / currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostQueenDeath(IBee queen) {
|
||||
getUtil().decreaseStack(AlvearyMutator.slotMutator, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,32 +0,0 @@
|
||||
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;
|
||||
|
||||
public class AlvearyRainShield {
|
||||
public static class PackageAlvearyRainShield extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public PackageAlvearyRainShield() {
|
||||
super("rainShield", ExtraBeeTexture.AlvearyRainShield.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentRainShield(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentRainShield extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public ComponentRainShield(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,419 +0,0 @@
|
||||
package binnie.extrabees.apiary.machine;
|
||||
|
||||
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;
|
||||
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.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;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class AlvearyStimulator {
|
||||
public static int slotCircuit = 0;
|
||||
|
||||
public enum CircuitType implements IBeeModifier {
|
||||
LowVoltage(3, 10),
|
||||
HighVoltage(5, 20),
|
||||
Plant(10, 10),
|
||||
Death(6, 10),
|
||||
Life(11, 10),
|
||||
Nether(7, 15),
|
||||
Mutation(4, 15),
|
||||
Inhibitor(1, 10),
|
||||
Territory(2, 10);
|
||||
|
||||
static {
|
||||
CircuitType.LowVoltage.logic.setModifier(EnumBeeModifier.PRODUCTION, 1.5f, 5.0f);
|
||||
CircuitType.HighVoltage.logic.setModifier(EnumBeeModifier.PRODUCTION, 2.5f, 10.0f);
|
||||
CircuitType.Plant.logic.setModifier(EnumBeeModifier.FLOWERING, 1.5f, 5.0f);
|
||||
CircuitType.Death.logic.setModifier(EnumBeeModifier.LIFESPAN, 0.8f, 0.2f);
|
||||
CircuitType.Life.logic.setModifier(EnumBeeModifier.LIFESPAN, 1.5f, 5.0f);
|
||||
CircuitType.Nether.logic.setModifier(EnumBeeBooleanModifier.HELLISH);
|
||||
CircuitType.Mutation.logic.setModifier(EnumBeeModifier.MUTATION, 1.5f, 5.0f);
|
||||
CircuitType.Inhibitor.logic.setModifier(EnumBeeModifier.TERRITORY, 0.4f, 0.1f);
|
||||
CircuitType.Inhibitor.logic.setModifier(EnumBeeModifier.PRODUCTION, 0.9f, 0.5f);
|
||||
CircuitType.Territory.logic.setModifier(EnumBeeModifier.TERRITORY, 1.5f, 5.0f);
|
||||
for (CircuitType type : values()) {
|
||||
type.logic.setModifier(EnumBeeModifier.GENETIC_DECAY, 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.GENETIC_DECAY, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return logic.getModifier(EnumBeeBooleanModifier.SEALED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return logic.getModifier(EnumBeeBooleanModifier.SELF_LIGHTED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
return logic.getModifier(EnumBeeBooleanModifier.SUNLIGHT_STIMULATED);
|
||||
}
|
||||
|
||||
@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,74 +0,0 @@
|
||||
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;
|
||||
|
||||
public class AlvearyTransmission {
|
||||
public static class PackageAlvearyTransmission extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public PackageAlvearyTransmission() {
|
||||
super("transmission", ExtraBeeTexture.AlvearyTransmission.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentPowerReceptor(machine, 1000);
|
||||
new ComponentTransmission(machine);
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentTransmission extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public ComponentTransmission(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
int energy = getUtil().getPoweredMachine().getEnergyStored(ForgeDirection.NORTH);
|
||||
if (energy == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
TileExtraBeeAlveary tile = (TileExtraBeeAlveary) getMachine().getTileEntity();
|
||||
List<IEnergyHandler> handlers = new ArrayList<IEnergyHandler>();
|
||||
for (TileEntity alvearyTile : tile.getAlvearyBlocks()) {
|
||||
if (alvearyTile instanceof IEnergyHandler && alvearyTile != tile) {
|
||||
handlers.add((IEnergyHandler) alvearyTile);
|
||||
}
|
||||
}
|
||||
|
||||
if (handlers.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
int maxOutput = 500;
|
||||
int output = energy / handlers.size();
|
||||
if (output > maxOutput) {
|
||||
output = maxOutput;
|
||||
} else if (output < 1) {
|
||||
output = 1;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package binnie.extrabees.apiary.machine.frame;
|
||||
|
||||
public class AlvearyFrame {
|
||||
public static final int SLOT_FRAME = 0;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package binnie.extrabees.apiary.machine.frame;
|
||||
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.extrabees.apiary.ComponentExtraBeeGUI;
|
||||
import binnie.extrabees.apiary.machine.AlvearyMachine;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
|
||||
public class FrameAlvearyPackage extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public FrameAlvearyPackage() {
|
||||
super("frame", ExtraBeeTexture.AlvearyFrame.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyFrame);
|
||||
ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
inventory.addSlot(AlvearyFrame.SLOT_FRAME, "frame");
|
||||
inventory.getSlot(AlvearyFrame.SLOT_FRAME).setValidator(new FrameSlotValidator());
|
||||
new FrameComponentModifier(machine);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package binnie.extrabees.apiary.machine.frame;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.extrabees.apiary.TileExtraBeeAlveary;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.apiculture.IHiveFrame;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class FrameComponentModifier extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public FrameComponentModifier(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void wearOutEquipment(int amount) {
|
||||
if (getHiveFrame() == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
World world = getMachine().getTileEntity().getWorldObj();
|
||||
int wear = Math.round(amount * 5 * Binnie.Genetics.getBeeRoot().getBeekeepingMode(world).getWearModifier());
|
||||
getInventory().setInventorySlotContents(AlvearyFrame.SLOT_FRAME, getHiveFrame().frameUsed(((TileExtraBeeAlveary) getMachine().getTileEntity()).getMultiblockLogic().getController(), getInventory().getStackInSlot(AlvearyFrame.SLOT_FRAME), null, wear));
|
||||
}
|
||||
|
||||
public IHiveFrame getHiveFrame() {
|
||||
if (getInventory().getStackInSlot(AlvearyFrame.SLOT_FRAME) == null) {
|
||||
return null;
|
||||
}
|
||||
return (IHiveFrame) getInventory().getStackInSlot(AlvearyFrame.SLOT_FRAME).getItem();
|
||||
}
|
||||
|
||||
@Override
|
||||
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(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(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(IBeeGenome genome, float currentModifier) {
|
||||
IHiveFrame frame = getHiveFrame();
|
||||
if (frame == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
return frame.getBeeModifier().getProductionModifier(genome, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getFloweringModifier(IBeeGenome genome, float currentModifier) {
|
||||
IHiveFrame frame = getHiveFrame();
|
||||
if (frame == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
return frame.getBeeModifier().getFloweringModifier(genome, currentModifier);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package binnie.extrabees.apiary.machine.frame;
|
||||
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
import binnie.core.util.I18N;
|
||||
import forestry.api.apiculture.IHiveFrame;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class FrameSlotValidator extends SlotValidator {
|
||||
public FrameSlotValidator() {
|
||||
super(SlotValidator.IconFrame);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(ItemStack itemStack) {
|
||||
return itemStack != null
|
||||
&& itemStack.getItem() instanceof IHiveFrame;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return I18N.localise("extrabees.achine.alveay.frame.tooltip");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package binnie.extrabees.apiary.machine.hatchery;
|
||||
|
||||
public class AlvearyHatchery {
|
||||
public static final int[] SLOT_LARVAE = new int[]{0, 1, 2, 3, 4};
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package binnie.extrabees.apiary.machine.hatchery;
|
||||
|
||||
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.extrabees.apiary.ComponentExtraBeeGUI;
|
||||
import binnie.extrabees.apiary.machine.AlvearyMachine;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
|
||||
public class HatcheryAlvearyPackage extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public HatcheryAlvearyPackage() {
|
||||
super("hatchery", ExtraBeeTexture.AlvearyHatchery.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyHatchery);
|
||||
ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
for (InventorySlot slot : inventory.addSlotArray(AlvearyHatchery.SLOT_LARVAE, "hatchery")) {
|
||||
slot.setValidator(new LarvaeSlotValidator());
|
||||
}
|
||||
new HatcheryComponentModifier(machine);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package binnie.extrabees.apiary.machine.hatchery;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.transfer.TransferRequest;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.extrabees.apiary.TileExtraBeeAlveary;
|
||||
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;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class HatcheryComponentModifier extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public HatcheryComponentModifier(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package binnie.extrabees.apiary.machine.hatchery;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
import binnie.core.util.I18N;
|
||||
import forestry.api.apiculture.EnumBeeType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class LarvaeSlotValidator extends SlotValidator {
|
||||
public LarvaeSlotValidator() {
|
||||
super(SlotValidator.IconBee);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(ItemStack itemStack) {
|
||||
return Binnie.Genetics.getBeeRoot().isMember(itemStack) && Binnie.Genetics.getBeeRoot().getType(itemStack) == EnumBeeType.LARVAE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return I18N.localise("extrabees.machine.alveay.hatchery.tooltip");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package binnie.extrabees.apiary.machine.lighting;
|
||||
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extrabees.apiary.machine.AlvearyMachine;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
|
||||
public class LightingAlvearyPackage extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public LightingAlvearyPackage() {
|
||||
super("lighting", ExtraBeeTexture.AlvearyLighting.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new LightingComponentModifier(machine);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package binnie.extrabees.apiary.machine.lighting;
|
||||
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
|
||||
public class LightingComponentModifier extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public LightingComponentModifier(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
package binnie.extrabees.apiary.machine.mutator;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class AlvearyMutator {
|
||||
public static final int SLOT_MUTATOR = 0;
|
||||
|
||||
protected static Map<ItemStack, Float> mutations = new HashMap<>();
|
||||
|
||||
public static boolean isMutationItem(ItemStack item) {
|
||||
return getMutationMult(item) > 1.0f;
|
||||
}
|
||||
|
||||
public static float getMutationMult(ItemStack item) {
|
||||
if (item == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
for (ItemStack comp : AlvearyMutator.mutations.keySet()) {
|
||||
if (ItemStack.areItemStackTagsEqual(item, comp) && item.isItemEqual(comp)) {
|
||||
return AlvearyMutator.mutations.get(comp);
|
||||
}
|
||||
}
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
public static void addMutationItem(ItemStack item, float chance) {
|
||||
if (item == null) {
|
||||
return;
|
||||
}
|
||||
AlvearyMutator.mutations.put(item, chance);
|
||||
}
|
||||
|
||||
public static Collection<ItemStack> getMutagens() {
|
||||
return AlvearyMutator.mutations.keySet();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package binnie.extrabees.apiary.machine.mutator;
|
||||
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.extrabees.apiary.ComponentExtraBeeGUI;
|
||||
import binnie.extrabees.apiary.machine.AlvearyMachine;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
|
||||
public class MutatorAlvearyPackage extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public MutatorAlvearyPackage() {
|
||||
super("mutator", ExtraBeeTexture.AlvearyMutator.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentExtraBeeGUI(machine, ExtraBeeGUID.AlvearyMutator);
|
||||
ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
inventory.addSlot(AlvearyMutator.SLOT_MUTATOR, "mutator");
|
||||
inventory.getSlot(AlvearyMutator.SLOT_MUTATOR).setValidator(new MutatorSlotValidator());
|
||||
new MutatorModifierComponent(machine);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package binnie.extrabees.apiary.machine.mutator;
|
||||
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
|
||||
public class MutatorModifierComponent extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public MutatorModifierComponent(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getMutationModifier(IBeeGenome genome, IBeeGenome mate, float currentModifier) {
|
||||
if (getUtil().isSlotEmpty(AlvearyMutator.SLOT_MUTATOR)) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
float mult = AlvearyMutator.getMutationMult(getUtil().getStack(AlvearyMutator.SLOT_MUTATOR));
|
||||
return Math.min(mult, 15.0f / currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPostQueenDeath(IBee queen) {
|
||||
getUtil().decreaseStack(AlvearyMutator.SLOT_MUTATOR, 1);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package binnie.extrabees.apiary.machine.mutator;
|
||||
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
import binnie.core.machines.inventory.ValidatorIcon;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class MutatorSlotValidator extends SlotValidator {
|
||||
public MutatorSlotValidator() {
|
||||
super(new ValidatorIcon(ExtraBees.instance, "validator/mutator.0", "validator/mutator.1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(ItemStack itemStack) {
|
||||
return AlvearyMutator.isMutationItem(itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return I18N.localise("extrabees.machine.alveay.mutator.tooltip");
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package binnie.extrabees.apiary.machine.rainShield;
|
||||
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extrabees.apiary.machine.AlvearyMachine;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
|
||||
public class RainShieldAlvearyPackage extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public RainShieldAlvearyPackage() {
|
||||
super("rainShield", ExtraBeeTexture.AlvearyRainShield.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new RainShieldModifierComponent(machine);
|
||||
}
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package binnie.extrabees.apiary.machine.rainShield;
|
||||
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import forestry.api.apiculture.IBeeListener;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
|
||||
public class RainShieldModifierComponent extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public RainShieldModifierComponent(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
package binnie.extrabees.apiary.machine.stimulator;
|
||||
|
||||
public class AlvearyStimulator {
|
||||
public static final int SLOT_CIRCUIT = 0;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package binnie.extrabees.apiary.machine.stimulator;
|
||||
|
||||
import binnie.core.machines.inventory.SlotValidator;
|
||||
import binnie.core.util.I18N;
|
||||
import forestry.api.circuits.ChipsetManager;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class CircuitSlotValidator extends SlotValidator {
|
||||
public CircuitSlotValidator() {
|
||||
super(SlotValidator.IconCircuit);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid(ItemStack itemStack) {
|
||||
return itemStack != null && ChipsetManager.circuitRegistry.isChipset(itemStack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTooltip() {
|
||||
return I18N.localise("extrabees.machine.alveay.stimulator.tooltip");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,115 @@
|
||||
package binnie.extrabees.apiary.machine.stimulator;
|
||||
|
||||
import binnie.core.genetics.BeeModifierLogic;
|
||||
import binnie.core.genetics.EnumBeeBooleanModifier;
|
||||
import binnie.core.genetics.EnumBeeModifier;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.circuits.ICircuitLayout;
|
||||
|
||||
public enum CircuitType implements IBeeModifier {
|
||||
LowVoltage(3, 10),
|
||||
HighVoltage(5, 20),
|
||||
Plant(10, 10),
|
||||
Death(6, 10),
|
||||
Life(11, 10),
|
||||
Nether(7, 15),
|
||||
Mutation(4, 15),
|
||||
Inhibitor(1, 10),
|
||||
Territory(2, 10);
|
||||
|
||||
static {
|
||||
CircuitType.LowVoltage.logic.setModifier(EnumBeeModifier.PRODUCTION, 1.5f, 5.0f);
|
||||
CircuitType.HighVoltage.logic.setModifier(EnumBeeModifier.PRODUCTION, 2.5f, 10.0f);
|
||||
CircuitType.Plant.logic.setModifier(EnumBeeModifier.FLOWERING, 1.5f, 5.0f);
|
||||
CircuitType.Death.logic.setModifier(EnumBeeModifier.LIFESPAN, 0.8f, 0.2f);
|
||||
CircuitType.Life.logic.setModifier(EnumBeeModifier.LIFESPAN, 1.5f, 5.0f);
|
||||
CircuitType.Nether.logic.setModifier(EnumBeeBooleanModifier.HELLISH);
|
||||
CircuitType.Mutation.logic.setModifier(EnumBeeModifier.MUTATION, 1.5f, 5.0f);
|
||||
CircuitType.Inhibitor.logic.setModifier(EnumBeeModifier.TERRITORY, 0.4f, 0.1f);
|
||||
CircuitType.Inhibitor.logic.setModifier(EnumBeeModifier.PRODUCTION, 0.9f, 0.5f);
|
||||
CircuitType.Territory.logic.setModifier(EnumBeeModifier.TERRITORY, 1.5f, 5.0f);
|
||||
for (CircuitType type : values()) {
|
||||
type.logic.setModifier(EnumBeeModifier.GENETIC_DECAY, 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.GENETIC_DECAY, currentModifier);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSealed() {
|
||||
return logic.getModifier(EnumBeeBooleanModifier.SEALED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelfLighted() {
|
||||
return logic.getModifier(EnumBeeBooleanModifier.SELF_LIGHTED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSunlightSimulated() {
|
||||
return logic.getModifier(EnumBeeBooleanModifier.SUNLIGHT_STIMULATED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isHellish() {
|
||||
return logic.getModifier(EnumBeeBooleanModifier.HELLISH);
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
package binnie.extrabees.apiary.machine.stimulator;
|
||||
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.inventory.ComponentInventorySlots;
|
||||
import binnie.core.machines.power.ComponentPowerReceptor;
|
||||
import binnie.extrabees.apiary.ComponentExtraBeeGUI;
|
||||
import binnie.extrabees.apiary.machine.AlvearyMachine;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
|
||||
public class StimulatorAlvearyPackage extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public StimulatorAlvearyPackage() {
|
||||
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.SLOT_CIRCUIT, "circuit");
|
||||
inventory.getSlot(AlvearyStimulator.SLOT_CIRCUIT).setValidator(new CircuitSlotValidator());
|
||||
new ComponentPowerReceptor(machine);
|
||||
new StimulatorModifierComponent(machine);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
package binnie.extrabees.apiary.machine.stimulator;
|
||||
|
||||
import binnie.core.Mods;
|
||||
import binnie.core.circuits.BinnieCircuit;
|
||||
import forestry.api.apiculture.IBeeGenome;
|
||||
import forestry.api.apiculture.IBeeModifier;
|
||||
import forestry.api.circuits.ICircuitLayout;
|
||||
|
||||
public 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);
|
||||
}
|
||||
}
|
||||
+199
@@ -0,0 +1,199 @@
|
||||
package binnie.extrabees.apiary.machine.stimulator;
|
||||
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
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 java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class StimulatorModifierComponent extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
protected float powerUsage;
|
||||
protected boolean powered;
|
||||
protected StimulatorCircuit[] modifiers;
|
||||
|
||||
public StimulatorModifierComponent(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.SLOT_CIRCUIT)) {
|
||||
return ChipsetManager.circuitRegistry.getCircuitboard(getUtil().getStack(AlvearyStimulator.SLOT_CIRCUIT));
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
package binnie.extrabees.apiary.machine.transmission;
|
||||
|
||||
import binnie.core.craftgui.minecraft.IMachineInformation;
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.core.machines.power.ComponentPowerReceptor;
|
||||
import binnie.extrabees.apiary.machine.AlvearyMachine;
|
||||
import binnie.extrabees.core.ExtraBeeTexture;
|
||||
|
||||
public class TransmissionAlvearyPackage extends AlvearyMachine.AlvearyPackage implements IMachineInformation {
|
||||
public TransmissionAlvearyPackage() {
|
||||
super("transmission", ExtraBeeTexture.AlvearyTransmission.getTexture(), false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentPowerReceptor(machine, 1000);
|
||||
new TransmissionModifierComponent(machine);
|
||||
}
|
||||
}
|
||||
+57
@@ -0,0 +1,57 @@
|
||||
package binnie.extrabees.apiary.machine.transmission;
|
||||
|
||||
import binnie.core.machines.Machine;
|
||||
import binnie.extrabees.apiary.ComponentBeeModifier;
|
||||
import binnie.extrabees.apiary.TileExtraBeeAlveary;
|
||||
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;
|
||||
|
||||
public class TransmissionModifierComponent extends ComponentBeeModifier implements IBeeModifier, IBeeListener {
|
||||
public TransmissionModifierComponent(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
int energy = getUtil().getPoweredMachine().getEnergyStored(ForgeDirection.NORTH);
|
||||
if (energy == 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
TileExtraBeeAlveary tile = (TileExtraBeeAlveary) getMachine().getTileEntity();
|
||||
List<IEnergyHandler> handlers = new ArrayList<IEnergyHandler>();
|
||||
for (TileEntity alvearyTile : tile.getAlvearyBlocks()) {
|
||||
if (alvearyTile instanceof IEnergyHandler && alvearyTile != tile) {
|
||||
handlers.add((IEnergyHandler) alvearyTile);
|
||||
}
|
||||
}
|
||||
|
||||
if (handlers.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
int maxOutput = 500;
|
||||
int output = energy / handlers.size();
|
||||
if (output > maxOutput) {
|
||||
output = maxOutput;
|
||||
} else if (output < 1) {
|
||||
output = 1;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -193,7 +193,7 @@ public enum ExtraBeeItems implements IItemMisc {
|
||||
|
||||
@Override
|
||||
public String getName(ItemStack itemStack) {
|
||||
return I18N.localise(ExtraBees.instance, "item." + name);
|
||||
return I18N.localise("extrabees.item." + name);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -271,6 +271,8 @@ public enum ExtraBeeBranchDefinition implements IBranchDefinition {
|
||||
}
|
||||
};
|
||||
|
||||
private static IAllele[] defaultTemplate;
|
||||
|
||||
private final IClassification branch;
|
||||
|
||||
ExtraBeeBranchDefinition(String scientific) {
|
||||
@@ -297,8 +299,6 @@ public enum ExtraBeeBranchDefinition implements IBranchDefinition {
|
||||
return branch;
|
||||
}
|
||||
|
||||
private static IAllele[] defaultTemplate;
|
||||
|
||||
private static IAllele[] getDefaultTemplate() {
|
||||
if (defaultTemplate == null) {
|
||||
defaultTemplate = new IAllele[EnumBeeChromosome.values().length];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package binnie.extrabees.genetics;
|
||||
|
||||
import binnie.core.Mods;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.core.util.I18N;
|
||||
import forestry.api.apiculture.FlowerManager;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IAllele;
|
||||
@@ -71,7 +71,7 @@ public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromo
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return ExtraBees.proxy.localise("flowers." + name().toString().toLowerCase() + ".name");
|
||||
return I18N.localise("extrabees.flowers." + name().toString().toLowerCase() + ".name");
|
||||
}
|
||||
|
||||
public void register() {
|
||||
@@ -124,7 +124,7 @@ public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromo
|
||||
return types.size() > 1 || !types.contains(EnumPlantType.Nether);
|
||||
}
|
||||
|
||||
public boolean isAcceptedFlower(World world, IIndividual individual, int x, int y, int z) {
|
||||
public boolean isAcceptedFlower(World world, int x, int y, int z) {
|
||||
Block block = world.getBlock(x, y, z);
|
||||
if (block == null) {
|
||||
return false;
|
||||
|
||||
@@ -13,8 +13,8 @@ public class EntityBeeLightning extends EntityLightningBolt {
|
||||
int lightningState;
|
||||
int boltLivingTime;
|
||||
|
||||
public EntityBeeLightning(World par1World, double par2, double par4, double par6) {
|
||||
super(par1World, par2, par4, par6);
|
||||
public EntityBeeLightning(World world, double x, double y, double z) {
|
||||
super(world, x, y, z);
|
||||
lightningState = 2;
|
||||
boltLivingTime = rand.nextInt(3) + 1;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package binnie.extrabees.genetics.effect;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.genetics.ExtraBeesFlowers;
|
||||
import cofh.api.energy.IEnergyReceiver;
|
||||
@@ -67,7 +68,8 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
protected static List<Birthday> birthdays;
|
||||
|
||||
static {
|
||||
(ExtraBeesEffect.birthdays = new ArrayList<>()).add(new Birthday(3, 10, "Binnie"));
|
||||
birthdays = new ArrayList<>();
|
||||
birthdays.add(new Birthday(3, 10, "Binnie"));
|
||||
}
|
||||
|
||||
public boolean combinable;
|
||||
@@ -152,7 +154,7 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraBees.proxy.localise("effect." + name().toString().toLowerCase() + ".name");
|
||||
return I18N.localise("extrabees.effect." + name().toLowerCase() + ".name");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -161,33 +163,35 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
}
|
||||
|
||||
public void spawnMob(World world, int x, int y, int z, String name) {
|
||||
if (anyPlayerInRange(world, x, y, z, 16)) {
|
||||
double xOffset = x + world.rand.nextFloat();
|
||||
double yOffset = y + world.rand.nextFloat();
|
||||
double zOffset = z + world.rand.nextFloat();
|
||||
world.spawnParticle("smoke", xOffset, yOffset, zOffset, 0.0, 0.0, 0.0);
|
||||
world.spawnParticle("flame", xOffset, yOffset, zOffset, 0.0, 0.0, 0.0);
|
||||
EntityLiving entity = (EntityLiving) EntityList.createEntityByName(name, world);
|
||||
if (!anyPlayerInRange(world, x, y, z, 16)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (entity == null) {
|
||||
return;
|
||||
}
|
||||
double xOffset = x + world.rand.nextFloat();
|
||||
double yOffset = y + world.rand.nextFloat();
|
||||
double zOffset = z + world.rand.nextFloat();
|
||||
world.spawnParticle("smoke", xOffset, yOffset, zOffset, 0.0, 0.0, 0.0);
|
||||
world.spawnParticle("flame", xOffset, yOffset, zOffset, 0.0, 0.0, 0.0);
|
||||
EntityLiving entity = (EntityLiving) EntityList.createEntityByName(name, world);
|
||||
|
||||
int entityCount = world.getEntitiesWithinAABB(entity.getClass(), AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1).expand(8.0, 4.0, 8.0)).size();
|
||||
if (entityCount >= 6) {
|
||||
return;
|
||||
}
|
||||
if (entity == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
xOffset = x + (world.rand.nextDouble() - world.rand.nextDouble()) * 4.0;
|
||||
yOffset = y + world.rand.nextInt(3) - 1;
|
||||
zOffset = z + (world.rand.nextDouble() - world.rand.nextDouble()) * 4.0;
|
||||
entity.setLocationAndAngles(xOffset, yOffset, zOffset, world.rand.nextFloat() * 360.0f, 0.0f);
|
||||
int entityCount = world.getEntitiesWithinAABB(entity.getClass(), AxisAlignedBB.getBoundingBox(x, y, z, x + 1, y + 1, z + 1).expand(8.0, 4.0, 8.0)).size();
|
||||
if (entityCount >= 6) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (entity.getCanSpawnHere()) {
|
||||
world.spawnEntityInWorld(entity);
|
||||
world.playAuxSFX(2004, x, y, z, 0);
|
||||
entity.spawnExplosionParticle();
|
||||
}
|
||||
xOffset = x + (world.rand.nextDouble() - world.rand.nextDouble()) * 4.0;
|
||||
yOffset = y + world.rand.nextInt(3) - 1;
|
||||
zOffset = z + (world.rand.nextDouble() - world.rand.nextDouble()) * 4.0;
|
||||
entity.setLocationAndAngles(xOffset, yOffset, zOffset, world.rand.nextFloat() * 360.0f, 0.0f);
|
||||
|
||||
if (entity.getCanSpawnHere()) {
|
||||
world.spawnEntityInWorld(entity);
|
||||
world.playAuxSFX(2004, x, y, z, 0);
|
||||
entity.spawnExplosionParticle();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -521,7 +525,7 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ExtraBeesFlowers.SAPLING.isAcceptedFlower(world, null, x, y, z)) {
|
||||
if (ExtraBeesFlowers.SAPLING.isAcceptedFlower(world, x, y, z)) {
|
||||
ItemDye.applyBonemeal(new ItemStack(Blocks.dirt, 1), world, x, y, z, null);
|
||||
}
|
||||
}
|
||||
@@ -531,7 +535,7 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ExtraBeesFlowers.FRUIT.isAcceptedFlower(world, null, x, y, z)) {
|
||||
if (ExtraBeesFlowers.FRUIT.isAcceptedFlower(world, x, y, z)) {
|
||||
ItemDye.applyBonemeal(new ItemStack(Blocks.dirt, 1), world, x, y, z, null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,10 +29,6 @@ public class FireworkCreator {
|
||||
shape = 0;
|
||||
}
|
||||
|
||||
public void setFlicker() {
|
||||
flicker = true;
|
||||
}
|
||||
|
||||
public void setTrail() {
|
||||
trail = true;
|
||||
}
|
||||
@@ -45,7 +41,7 @@ public class FireworkCreator {
|
||||
colors.add(color);
|
||||
}
|
||||
|
||||
NBTTagCompound getNBT() {
|
||||
public NBTTagCompound getNBT() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
if (flicker) {
|
||||
nbt.setBoolean("Flicker", true);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.extrabees.genetics.items;
|
||||
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.extrabees.core.ExtraBeeGUID;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -42,7 +43,7 @@ public class ItemDictionary extends Item {
|
||||
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");
|
||||
tooltip.add(I18N.localise("extrabees.item.database.tooltip"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,8 +66,8 @@ public class ItemDictionary extends Item {
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
return (stack.getItemDamage() == 0) ?
|
||||
"Apiarist Database" :
|
||||
"Master Apiarist Database";
|
||||
return (stack.getItemDamage() == 0)
|
||||
? I18N.localise("extrabees.item.database")
|
||||
: I18N.localise("extrabees.item.masterDatabase");
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package binnie.extrabees.genetics.requirements;
|
||||
|
||||
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IGenome;
|
||||
import forestry.api.genetics.IMutationCondition;
|
||||
@@ -14,7 +13,7 @@ public class DummyMutationCondition implements IMutationCondition {
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getChance(World world, int i, int i1, int i2, IAllele iAllele, IAllele iAllele1, IGenome iGenome, IGenome iGenome1) {
|
||||
public float getChance(World world, int x, int y, int z, IAllele allele0, IAllele allele1, IGenome genome0, IGenome genome1) {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.extrabees.genetics.requirements;
|
||||
|
||||
import binnie.core.util.I18N;
|
||||
import forestry.api.apiculture.IBeeHousing;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import forestry.api.genetics.IGenome;
|
||||
@@ -13,7 +14,7 @@ public class RequirementPerson implements IMutationRequirement {
|
||||
|
||||
@Override
|
||||
public String getDescription() {
|
||||
return "Can only be bred by " + name;
|
||||
return I18N.localise("extrabees.genetics.requirements.user", name);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -7,7 +7,7 @@ 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 binnie.extrabees.apiary.machine.hatchery.AlvearyHatchery;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
@@ -33,7 +33,7 @@ public class WindowAlvearyHatchery extends Window {
|
||||
setTitle("Hatchery");
|
||||
playerInventory = new ControlPlayerInventory(this);
|
||||
ControlSlotArray slot = new ControlSlotArray(this, 43, 30, 5, 1);
|
||||
slot.create(AlvearyHatchery.slotLarvae);
|
||||
slot.create(AlvearyHatchery.SLOT_LARVAE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,7 +11,7 @@ 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 binnie.extrabees.apiary.machine.mutator.AlvearyMutator;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
@@ -39,7 +39,7 @@ public class WindowAlvearyMutator extends Window {
|
||||
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, w(), 16.0f), "Possible Mutagens:", TextJustification.MiddleCenter).setColor(5592405);
|
||||
new ControlText(this, new IArea(0.0f, 52.0f, w(), 16.0f), "Possible Mutagens:", TextJustification.MIDDLE_CENTER).setColor(5592405);
|
||||
int size = AlvearyMutator.getMutagens().size();
|
||||
int w = size * 18;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ 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 binnie.extrabees.apiary.machine.stimulator.AlvearyStimulator;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
@@ -35,7 +35,7 @@ public class WindowAlvearyStimulator extends Window {
|
||||
setTitle("Stimulator");
|
||||
new ControlEnergyBar(this, 75, 29, 60, 16, Position.LEFT);
|
||||
ControlSlot slot = new ControlSlot(this, 41.0f, 28.0f);
|
||||
slot.assign(AlvearyStimulator.slotCircuit);
|
||||
slot.assign(AlvearyStimulator.SLOT_CIRCUIT);
|
||||
playerInventory = new ControlPlayerInventory(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package binnie.extrabees.gui.database;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
import binnie.core.craftgui.IWidget;
|
||||
@@ -11,8 +9,6 @@ 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;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -55,12 +51,5 @@ public class ControlBiomes extends Control implements ITooltip {
|
||||
|
||||
public void setSpecies(IAlleleBeeSpecies species) {
|
||||
tolerated.clear();
|
||||
if (species == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
@@ -15,31 +15,36 @@ import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
import forestry.api.genetics.EnumTolerance;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ControlClimateBar extends Control implements ITooltip {
|
||||
protected boolean isHumidity;
|
||||
protected List<Integer> tolerated;
|
||||
protected int[] tempColours;
|
||||
protected int[] humidColours;
|
||||
protected Color[] tempColours = new Color[]{
|
||||
new Color(0x00fffb),
|
||||
new Color(0x78bbff),
|
||||
new Color(0x4fff30),
|
||||
new Color(0xffff00),
|
||||
new Color(0xffa200),
|
||||
new Color(0xff0000)
|
||||
};
|
||||
protected Color[] humidColours = new Color[]{
|
||||
new Color(0xffe7a3),
|
||||
new Color(0x1aff00),
|
||||
new Color(0x307cff)
|
||||
};
|
||||
|
||||
public ControlClimateBar(IWidget parent, int x, int y, int width, int height) {
|
||||
super(parent, x, y, width, height);
|
||||
isHumidity = false;
|
||||
tolerated = new ArrayList<>();
|
||||
tempColours = new int[]{0x00fffb, 0x78bbff, 0x4fff30, 0xffff00, 0xffa200, 0xff0000};
|
||||
humidColours = new int[]{0xffe7a3, 0x1aff00, 0x307cff};
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
this(parent, x, y, width, height, false);
|
||||
}
|
||||
|
||||
public ControlClimateBar(IWidget parent, int x, int y, int width, int height, boolean humidity) {
|
||||
super(parent, x, y, width, height);
|
||||
tolerated = new ArrayList<>();
|
||||
tempColours = new int[]{0x00fffb, 0x78bbff, 0x4fff30, 0xffff00, 0xffa200, 0xff0000};
|
||||
humidColours = new int[]{0xffe7a3, 0x1aff00, 0x307cff};
|
||||
addAttribute(WidgetAttribute.MOUSE_OVER);
|
||||
isHumidity = true;
|
||||
isHumidity = humidity;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -69,13 +74,13 @@ public class ControlClimateBar extends Control implements ITooltip {
|
||||
for (int i = 0; i < types; ++i) {
|
||||
int x = i * w;
|
||||
if (tolerated.contains(i)) {
|
||||
int colour;
|
||||
Color color;
|
||||
if (isHumidity) {
|
||||
colour = humidColours[i];
|
||||
color = humidColours[i];
|
||||
} else {
|
||||
colour = tempColours[i];
|
||||
color = tempColours[i];
|
||||
}
|
||||
CraftGUI.Render.solid(new IArea(x + 1, 1.0f, w, getSize().y() - 2.0f), colour);
|
||||
CraftGUI.Render.solid(new IArea(x + 1, 1.0f, w, getSize().y() - 2.0f), color.getRGB());
|
||||
}
|
||||
}
|
||||
CraftGUI.Render.texture(CraftGUITexture.EnergyBarGlass, getArea());
|
||||
|
||||
@@ -7,6 +7,7 @@ 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;
|
||||
import binnie.core.util.I18N;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
@@ -31,11 +32,11 @@ public class ControlProductsItem extends ControlOption<ControlProductsBox.Produc
|
||||
DecimalFormat df = new DecimalFormat("#.0");
|
||||
|
||||
if (hours > 1.0f) {
|
||||
textWidget.setValue("Every " + df.format(hours) + " hours");
|
||||
textWidget.setValue(I18N.localise("extrabees.gui.database.tab.species.products.everyHours", df.format(hours)));
|
||||
} else if (minutes > 1.0f) {
|
||||
textWidget.setValue("Every " + df.format(minutes) + " min.");
|
||||
textWidget.setValue(I18N.localise("extrabees.gui.database.tab.species.products.everyMins", df.format(minutes)));
|
||||
} else {
|
||||
textWidget.setValue("Every " + df.format(seconds) + " sec.");
|
||||
textWidget.setValue(I18N.localise("extrabees.gui.database.tab.species.products.everySecs", df.format(seconds)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
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;
|
||||
@@ -9,7 +8,6 @@ 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 forestry.api.genetics.IAlleleSpecies;
|
||||
@@ -30,28 +28,28 @@ public class PageSpeciesGenome extends PageSpecies {
|
||||
public PageSpeciesGenome(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
title = new ControlTextCentered(this, 8.0f, "Genome");
|
||||
new ControlText(this, new IArea(0.0f, 32.0f, 68.0f, 30.0f), "Speed:", TextJustification.TopRight);
|
||||
new ControlText(this, new IArea(0.0f, 44.0f, 68.0f, 30.0f), "Lifespan:", TextJustification.TopRight);
|
||||
new ControlText(this, new IArea(0.0f, 56.0f, 68.0f, 30.0f), "Fertility:", TextJustification.TopRight);
|
||||
new ControlText(this, new IArea(0.0f, 68.0f, 68.0f, 30.0f), "Flowering:", TextJustification.TopRight);
|
||||
new ControlText(this, new IArea(0.0f, 80.0f, 68.0f, 30.0f), "Territory:", TextJustification.TopRight);
|
||||
new ControlText(this, new IArea(0.0f, 97.0f, 68.0f, 30.0f), "Behavior:", TextJustification.TopRight);
|
||||
new ControlText(this, new IArea(0.0f, 109.0f, 68.0f, 30.0f), "Sunlight:", TextJustification.TopRight);
|
||||
new ControlText(this, new IArea(0.0f, 121.0f, 68.0f, 30.0f), "Rain:", TextJustification.TopRight);
|
||||
new ControlText(this, new IArea(0.0f, 138.0f, 68.0f, 30.0f), "Flower:", TextJustification.TopRight);
|
||||
new ControlText(this, new IArea(0.0f, 155.0f, 68.0f, 30.0f), "Effect:", TextJustification.TopRight);
|
||||
new ControlText(this, new IArea(0.0f, 32.0f, 68.0f, 30.0f), "Speed:", TextJustification.TOP_RIGHT);
|
||||
new ControlText(this, new IArea(0.0f, 44.0f, 68.0f, 30.0f), "Lifespan:", TextJustification.TOP_RIGHT);
|
||||
new ControlText(this, new IArea(0.0f, 56.0f, 68.0f, 30.0f), "Fertility:", TextJustification.TOP_RIGHT);
|
||||
new ControlText(this, new IArea(0.0f, 68.0f, 68.0f, 30.0f), "Flowering:", TextJustification.TOP_RIGHT);
|
||||
new ControlText(this, new IArea(0.0f, 80.0f, 68.0f, 30.0f), "Territory:", TextJustification.TOP_RIGHT);
|
||||
new ControlText(this, new IArea(0.0f, 97.0f, 68.0f, 30.0f), "Behavior:", TextJustification.TOP_RIGHT);
|
||||
new ControlText(this, new IArea(0.0f, 109.0f, 68.0f, 30.0f), "Sunlight:", TextJustification.TOP_RIGHT);
|
||||
new ControlText(this, new IArea(0.0f, 121.0f, 68.0f, 30.0f), "Rain:", TextJustification.TOP_RIGHT);
|
||||
new ControlText(this, new IArea(0.0f, 138.0f, 68.0f, 30.0f), "Flower:", TextJustification.TOP_RIGHT);
|
||||
new ControlText(this, new IArea(0.0f, 155.0f, 68.0f, 30.0f), "Effect:", TextJustification.TOP_RIGHT);
|
||||
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);
|
||||
speedText = new ControlText(this, new IArea(x, 32.0f, 72.0f, 30.0f), "", TextJustification.TOP_LEFT);
|
||||
lifespanText = new ControlText(this, new IArea(x, 44.0f, 72.0f, 30.0f), "", TextJustification.TOP_LEFT);
|
||||
fertilityText = new ControlText(this, new IArea(x, 56.0f, 72.0f, 30.0f), "", TextJustification.TOP_LEFT);
|
||||
floweringText = new ControlText(this, new IArea(x, 68.0f, 72.0f, 30.0f), "", TextJustification.TOP_LEFT);
|
||||
territoryText = new ControlText(this, new IArea(x, 80.0f, 72.0f, 30.0f), "", TextJustification.TOP_LEFT);
|
||||
nocturnalText = new ControlText(this, new IArea(x, 97.0f, 72.0f, 30.0f), "", TextJustification.TOP_LEFT);
|
||||
caveDwellingText = new ControlText(this, new IArea(x, 109.0f, 72.0f, 30.0f), "", TextJustification.TOP_LEFT);
|
||||
tolerantFlyerText = new ControlText(this, new IArea(x, 121.0f, 72.0f, 30.0f), "", TextJustification.TOP_LEFT);
|
||||
flowerText = new ControlText(this, new IArea(x, 138.0f, 72.0f, 30.0f), "", TextJustification.TOP_LEFT);
|
||||
effectText = new ControlText(this, new IArea(x, 155.0f, 72.0f, 30.0f), "", TextJustification.TOP_LEFT);
|
||||
}
|
||||
|
||||
public static String rateFlowering(int flowering) {
|
||||
@@ -144,7 +142,6 @@ public class PageSpeciesGenome extends PageSpecies {
|
||||
}
|
||||
|
||||
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");
|
||||
|
||||
@@ -3,6 +3,7 @@ package binnie.extrabees.liquids;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.liquid.FluidContainer;
|
||||
import binnie.core.liquid.ILiquidType;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -39,7 +40,7 @@ public enum ExtraBeeLiquid implements ILiquidType {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraBees.proxy.localise(toString().toLowerCase());
|
||||
return I18N.localise("extrabees." + toString().toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import binnie.core.item.IItemEnum;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -136,7 +137,7 @@ public enum EnumHoneyComb implements IItemEnum {
|
||||
|
||||
@Override
|
||||
public String getName(ItemStack stack) {
|
||||
return ExtraBees.proxy.localise("item.comb." + name);
|
||||
return I18N.localise("extrabees.item.comb." + name);
|
||||
}
|
||||
|
||||
public boolean addProduct(ItemStack item, Float chance) {
|
||||
|
||||
@@ -2,6 +2,7 @@ package binnie.extrabees.products;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.item.IItemEnum;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -85,6 +86,6 @@ public enum EnumHoneyDrop implements IItemEnum {
|
||||
|
||||
@Override
|
||||
public String getName(ItemStack itemStack) {
|
||||
return ExtraBees.proxy.localise("item.honeydrop." + name().toLowerCase());
|
||||
return I18N.localise("extrabees.item.honeydrop." + name().toLowerCase());
|
||||
}
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package binnie.extrabees.products;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.item.IItemEnum;
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import forestry.api.recipes.RecipeManagers;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -58,6 +59,6 @@ public enum EnumPropolis implements IItemEnum {
|
||||
|
||||
@Override
|
||||
public String getName(ItemStack itemStack) {
|
||||
return ExtraBees.proxy.localise("item.propolis." + name().toLowerCase());
|
||||
return I18N.localise("extrabees.item.propolis." + name().toLowerCase());
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -41,6 +42,6 @@ public class ItemHoneyCrystal extends Item {
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack i) {
|
||||
return ExtraBees.proxy.localise("item.honeycrystal");
|
||||
return I18N.localise("extrabees.item.honeycrystal");
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.extrabees.products;
|
||||
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -21,6 +22,6 @@ public class ItemHoneyCrystalEmpty extends ItemHoneyCrystal {
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack i) {
|
||||
return ExtraBees.proxy.localise("item.honeycrystal.empty");
|
||||
return I18N.localise("extrabees.item.honeycrystal.empty");
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package binnie.extrabees.worldgen;
|
||||
|
||||
import binnie.core.util.I18N;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
@@ -32,6 +31,6 @@ public class ItemBeehive extends ItemBlock {
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack itemStack) {
|
||||
return I18N.localise(ExtraBees.instance, "block.hive." + itemStack.getItemDamage());
|
||||
return I18N.localise("extrabees.block.hive." + itemStack.getItemDamage());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user