mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-22 13:09:47 +00:00
Merge branch 'master-MC1.7.10' of https://github.com/ForestryMC/Binnie into master-MC1.7.10
This commit is contained in:
commit
c3d0da2d0a
92 files changed
+4566
-493
No files matched your search
@@ -14,7 +14,7 @@ import java.util.List;
|
||||
|
||||
public final class Binnie {
|
||||
public static List<ManagerBase> Managers = new ArrayList<>();
|
||||
public static ManagerLanguage Language = new ManagerLanguage();
|
||||
public static ManagerLanguage I18N = new ManagerLanguage();
|
||||
public static ManagerGenetics Genetics = new ManagerGenetics();
|
||||
public static ManagerConfig Configuration = new ManagerConfig();
|
||||
public static ManagerLiquid Liquid = new ManagerLiquid();
|
||||
|
||||
@@ -22,7 +22,6 @@ import binnie.botany.gardening.ItemSoilMeter;
|
||||
import binnie.botany.gardening.ItemTrowel;
|
||||
import binnie.botany.gardening.ModuleGardening;
|
||||
import binnie.botany.genetics.ItemDictionary;
|
||||
import binnie.botany.genetics.ItemEncyclopedia;
|
||||
import binnie.botany.genetics.ModuleGenetics;
|
||||
import binnie.botany.items.ItemClay;
|
||||
import binnie.botany.items.ItemPigment;
|
||||
@@ -88,8 +87,6 @@ public class Botany extends AbstractMod {
|
||||
public static ItemInsulatedTube insulatedTube;
|
||||
public static ItemSoilMeter soilMeter;
|
||||
public static ItemMisc misc;
|
||||
public static ItemEncyclopedia encyclopedia;
|
||||
public static ItemEncyclopedia encyclopediaIron;
|
||||
public static ItemFlower flowerItem;
|
||||
public static ItemPigment pigment;
|
||||
public static ItemClay clay;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.botany.ceramic;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
@@ -16,6 +17,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -39,9 +41,8 @@ public class BlockCeramic extends Block implements IBlockMetadata {
|
||||
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
|
||||
}
|
||||
|
||||
// TODO replace deprecated
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
|
||||
@@ -74,13 +75,13 @@ public class BlockCeramic extends Block implements IBlockMetadata {
|
||||
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return EnumFlowerColor.get(meta).getName() + " Ceramic Block";
|
||||
return Binnie.I18N.localise(Botany.instance, "ceramicBlock");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
// ignored
|
||||
public void addBlockTooltip(ItemStack stack, List tooltip) {
|
||||
int meta = TileEntityMetadata.getItemDamage(stack);
|
||||
tooltip.add(EnumChatFormatting.GRAY + EnumFlowerColor.get(meta).getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -89,7 +90,7 @@ public class BlockCeramic extends Block implements IBlockMetadata {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
public void getSubBlocks(Item item, CreativeTabs tabs, List itemList) {
|
||||
for (EnumFlowerColor c : EnumFlowerColor.values()) {
|
||||
itemList.add(TileEntityMetadata.getItemStack(this, c.ordinal()));
|
||||
}
|
||||
@@ -127,14 +128,13 @@ public class BlockCeramic extends Block implements IBlockMetadata {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World par1World, int par2, int par3, int par4, Block par5, int par6) {
|
||||
super.breakBlock(par1World, par2, par3, par4, par5, par6);
|
||||
par1World.removeTileEntity(par2, par3, par4);
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int side) {
|
||||
super.breakBlock(world, x, y, z, block, side);
|
||||
world.removeTileEntity(x, y, z);
|
||||
}
|
||||
|
||||
// TODO remove deprecated
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
package binnie.botany.ceramic;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.botany.items.BotanyItems;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.block.BlockMetadata;
|
||||
import binnie.core.block.IBlockMetadata;
|
||||
import binnie.core.block.IMultipassBlock;
|
||||
import binnie.core.block.MultipassBlockRenderer;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.core.block.*;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
@@ -20,6 +17,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -86,8 +84,9 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
// ignored
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
getType(meta).addTooltip(tooltip);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -96,7 +95,7 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(Item par1, CreativeTabs par2CreativeTabs, List itemList) {
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List itemList) {
|
||||
for (EnumFlowerColor c : EnumFlowerColor.values()) {
|
||||
BlockType type = new BlockType(c, c, TileType.Tile);
|
||||
itemList.add(TileEntityMetadata.getItemStack(this, type.ordinal()));
|
||||
@@ -145,7 +144,7 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
if (tile != null) {
|
||||
return getRenderColor(tile.getTileMetadata());
|
||||
}
|
||||
return 16777215;
|
||||
return 0xffffff;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -188,16 +187,16 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
}
|
||||
|
||||
public enum TileType {
|
||||
Tile("tile", "Ceramic Tile"),
|
||||
Brick("brick", "Ceramic Bricks"),
|
||||
StripeBrick("brickstripe", "Striped Ceramic Bricks"),
|
||||
LargeBrick("bricklarge", "Large Ceramic Bricks"),
|
||||
Split("split", "Split Ceramic Tile"),
|
||||
Chequered("cheque", "Chequered Ceramic Tile"),
|
||||
Mixed("mixed", "Mixed Ceramic Tile"),
|
||||
VerticalBrick("verticalbrick", "Vertical Ceramic Bricks"),
|
||||
VerticalStripeBrick("verticalbrickstripe", "Vertical Striped Ceramic Bricks"),
|
||||
VerticalLargeBrick("verticalbricklarge", "Large Vertical Ceramic Bricks");
|
||||
Tile("tile", "ceramicTile"),
|
||||
Brick("brick", "ceramicBricks"),
|
||||
StripeBrick("brickstripe", "strippedCeramicBricks"),
|
||||
LargeBrick("bricklarge", "largeCeramicBricks"),
|
||||
Split("split", "splitCeramicTile"),
|
||||
Chequered("cheque", "chequeredCeramicTile"),
|
||||
Mixed("mixed", "mixedCeramicTile"),
|
||||
VerticalBrick("verticalbrick", "verticalCeramicBricks"),
|
||||
VerticalStripeBrick("verticalbrickstripe", "verticalStripedCeramicBricks"),
|
||||
VerticalLargeBrick("verticalbricklarge", "largeVerticalCeramicBricks");
|
||||
|
||||
protected String id;
|
||||
protected String name;
|
||||
@@ -419,8 +418,8 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
|
||||
private ItemStack getBrickRecipe(List<ItemStack> stacks) {
|
||||
if (stacks.size() == 1) {
|
||||
ItemStack stack5 = stacks.get(0);
|
||||
BlockType type = new BlockType(stack5);
|
||||
ItemStack stack = stacks.get(0);
|
||||
BlockType type = new BlockType(stack);
|
||||
if (type.type == TileType.VerticalBrick) {
|
||||
type.type = this;
|
||||
return type.getStack(1);
|
||||
@@ -439,18 +438,18 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
|
||||
int[] colors = {-1, -1};
|
||||
for (int index2 = 0; index2 < stacks.size(); ++index2) {
|
||||
ItemStack stack4 = stacks.get(index2);
|
||||
if (stack4.getItem() != Item.getItemFromBlock(Botany.ceramicBrick)) {
|
||||
ItemStack stack = stacks.get(index2);
|
||||
if (stack.getItem() != Item.getItemFromBlock(Botany.ceramicBrick)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
BlockType type4 = new BlockType(stack4);
|
||||
if (type4.type != TileType.LargeBrick) {
|
||||
BlockType type = new BlockType(stack);
|
||||
if (type.type != TileType.LargeBrick) {
|
||||
return null;
|
||||
}
|
||||
|
||||
int color5 = type4.color1.ordinal();
|
||||
int color6 = type4.color2.ordinal();
|
||||
int color5 = type.color1.ordinal();
|
||||
int color6 = type.color2.ordinal();
|
||||
int alt2 = (index2 != 0 && index2 != 3) ? 1 : 0;
|
||||
if (this == TileType.StripeBrick) {
|
||||
alt2 = 0;
|
||||
@@ -528,11 +527,15 @@ public class BlockCeramicBrick extends Block implements IBlockMetadata, IMultipa
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return Binnie.I18N.localise(Botany.instance, type.name);
|
||||
}
|
||||
|
||||
public void addTooltip(List tooltip) {
|
||||
String name = color1.getName();
|
||||
if (type.canDouble() && color2 != color1) {
|
||||
name = name + " & " + color2.getName();
|
||||
name = Binnie.I18N.localise(Botany.instance, "colour.double", name, color2.getName());
|
||||
}
|
||||
return name + " " + type.name;
|
||||
tooltip.add(EnumChatFormatting.GRAY + name);
|
||||
}
|
||||
|
||||
public int ordinal() {
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
package binnie.botany.ceramic;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
import binnie.core.block.TileEntityMetadata;
|
||||
import binnie.extratrees.api.IDesign;
|
||||
import binnie.extratrees.carpentry.BlockDesign;
|
||||
import binnie.extratrees.carpentry.DesignBlock;
|
||||
import binnie.extratrees.carpentry.ModuleCarpentry;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockCeramicPatterned extends BlockDesign {
|
||||
public BlockCeramicPatterned() {
|
||||
@@ -25,6 +31,13 @@ public class BlockCeramicPatterned extends BlockDesign {
|
||||
|
||||
@Override
|
||||
public String getBlockName(DesignBlock design) {
|
||||
return design.getDesign().getName() + " Ceramic Block";
|
||||
return Binnie.I18N.localise(Botany.instance, "ceramicBlock");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addBlockTooltip(ItemStack stack, List tooltip) {
|
||||
super.addBlockTooltip(stack, tooltip);
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
tooltip.add(EnumChatFormatting.GRAY + block.getDesign().getName());
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.botany.ceramic;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
@@ -17,6 +18,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -59,9 +61,9 @@ public class BlockStained extends Block implements IBlockMetadata {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||
// Block block2 = world.getBlock(x - Facing.offsetsXForSide[side], y - Facing.offsetsYForSide[side], z - Facing.offsetsZForSide[side]);
|
||||
Block block3 = world.getBlock(x, y, z);
|
||||
return block3 != this
|
||||
&& block3 != ExtraTrees.blockStained
|
||||
Block block = world.getBlock(x, y, z);
|
||||
return block != this
|
||||
&& block != ExtraTrees.blockStained
|
||||
&& super.shouldSideBeRendered(world, x, y, z, side);
|
||||
}
|
||||
|
||||
@@ -70,9 +72,8 @@ public class BlockStained extends Block implements IBlockMetadata {
|
||||
return BlockMetadata.getBlockDropped(this, world, x, y, z, blockMeta);
|
||||
}
|
||||
|
||||
// TODO remove deprecated
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
|
||||
return BlockMetadata.breakBlock(this, player, world, x, y, z);
|
||||
}
|
||||
|
||||
@@ -105,13 +106,13 @@ public class BlockStained extends Block implements IBlockMetadata {
|
||||
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return EnumFlowerColor.get(meta).getName() + " Pigmented Glass";
|
||||
return Binnie.I18N.localise(Botany.instance, "pigmentedGlass");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
// ignored
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
tooltip.add(EnumChatFormatting.GRAY + EnumFlowerColor.get(meta).getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -154,7 +155,7 @@ public class BlockStained extends Block implements IBlockMetadata {
|
||||
if (tile != null) {
|
||||
return getRenderColor(tile.getTileMetadata());
|
||||
}
|
||||
return 16777215;
|
||||
return 0xffffff;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -184,7 +185,7 @@ public class BlockStained extends Block implements IBlockMetadata {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
package binnie.botany.ceramic;
|
||||
|
||||
import binnie.core.block.ItemMetadata;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
// TODO unused class?
|
||||
public class ItemCeramic extends ItemMetadata {
|
||||
public ItemCeramic(Block block) {
|
||||
super(block);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getColorFromItemStack(ItemStack stack, int renderPass) {
|
||||
return 0xff00ff;
|
||||
}
|
||||
}
|
||||
@@ -9,8 +9,9 @@ import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class PigmentRecipe implements IRecipe {
|
||||
protected ItemStack cached;
|
||||
|
||||
private ItemStack unknown;
|
||||
ItemStack cached;
|
||||
|
||||
public PigmentRecipe() {
|
||||
unknown = null;
|
||||
|
||||
@@ -11,13 +11,13 @@ public class ModuleCore implements IInitializable {
|
||||
@Override
|
||||
public void preInit() {
|
||||
for (EnumAcidity pH : EnumAcidity.values()) {
|
||||
Binnie.Language.addObjectName(pH, Binnie.Language.unlocalised(Botany.instance, "ph." + pH.getID()));
|
||||
Binnie.I18N.addObjectName(pH, Binnie.I18N.unlocalised(Botany.instance, "ph." + pH.getID()));
|
||||
}
|
||||
for (EnumMoisture pH2 : EnumMoisture.values()) {
|
||||
Binnie.Language.addObjectName(pH2, Binnie.Language.unlocalised(Botany.instance, "moisture." + pH2.getID()));
|
||||
Binnie.I18N.addObjectName(pH2, Binnie.I18N.unlocalised(Botany.instance, "moisture." + pH2.getID()));
|
||||
}
|
||||
for (EnumSoilType pH3 : EnumSoilType.values()) {
|
||||
Binnie.Language.addObjectName(pH3, Binnie.Language.unlocalised(Botany.instance, "soil." + pH3.getID()));
|
||||
Binnie.I18N.addObjectName(pH3, Binnie.I18N.unlocalised(Botany.instance, "soil." + pH3.getID()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ import binnie.core.craftgui.IWidget;
|
||||
import binnie.core.craftgui.controls.listbox.ControlListBox;
|
||||
|
||||
public class ControlColorMixBox extends ControlListBox<IColourMix> {
|
||||
private int index;
|
||||
private Type type;
|
||||
|
||||
public ControlColorMixBox(IWidget parent, int x, int y, int width, int height, Type type) {
|
||||
|
||||
@@ -7,11 +7,11 @@ import binnie.core.craftgui.database.WindowAbstractDatabase;
|
||||
import binnie.core.genetics.BreedingSystem;
|
||||
|
||||
public class ControlColorMixItem extends ControlOption<IColourMix> {
|
||||
ControlColorDisplay itemWidget1;
|
||||
ControlColorDisplay itemWidget2;
|
||||
ControlColorDisplay itemWidget3;
|
||||
ControlColourMixSymbol addSymbol;
|
||||
ControlColourMixSymbol arrowSymbol;
|
||||
protected ControlColorDisplay itemWidget1;
|
||||
protected ControlColorDisplay itemWidget2;
|
||||
protected ControlColorDisplay itemWidget3;
|
||||
protected ControlColourMixSymbol addSymbol;
|
||||
protected ControlColourMixSymbol arrowSymbol;
|
||||
|
||||
public ControlColorMixItem(ControlList<IColourMix> controlList, IColourMix option, int y) {
|
||||
super(controlList, option, y);
|
||||
|
||||
@@ -9,8 +9,8 @@ import binnie.core.craftgui.geometry.CraftGUIUtil;
|
||||
import binnie.core.craftgui.geometry.IPoint;
|
||||
|
||||
public class ControlColorOption extends ControlTextOption<IFlowerColor> {
|
||||
ControlColorDisplay controlBee;
|
||||
IPoint boxPosition;
|
||||
protected ControlColorDisplay controlBee;
|
||||
protected IPoint boxPosition;
|
||||
|
||||
public ControlColorOption(ControlList<IFlowerColor> controlList, IFlowerColor option, int y) {
|
||||
super(controlList, option, option.getName(), y);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.botany.craftgui;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.IColourMix;
|
||||
import binnie.core.craftgui.CraftGUI;
|
||||
import binnie.core.craftgui.ITooltip;
|
||||
@@ -13,21 +15,16 @@ import binnie.core.craftgui.resource.minecraft.CraftGUITextureSheet;
|
||||
import binnie.core.craftgui.resource.minecraft.StandardTexture;
|
||||
|
||||
public class ControlColourMixSymbol extends Control implements ITooltip {
|
||||
static Texture MutationPlus;
|
||||
static Texture MutationArrow;
|
||||
protected static Texture MutationPlus = new StandardTexture(2, 94, 16, 16, CraftGUITextureSheet.Controls2);
|
||||
protected static Texture MutationArrow = new StandardTexture(20, 94, 32, 16, CraftGUITextureSheet.Controls2);
|
||||
|
||||
static {
|
||||
ControlColourMixSymbol.MutationPlus = new StandardTexture(2, 94, 16, 16, CraftGUITextureSheet.Controls2);
|
||||
ControlColourMixSymbol.MutationArrow = new StandardTexture(20, 94, 32, 16, CraftGUITextureSheet.Controls2);
|
||||
}
|
||||
|
||||
IColourMix value;
|
||||
int type;
|
||||
protected IColourMix value;
|
||||
protected int type;
|
||||
|
||||
protected ControlColourMixSymbol(IWidget parent, int x, int y, int type) {
|
||||
super(parent, x, y, 16 + type * 16, 16.0f);
|
||||
value = null;
|
||||
this.type = type;
|
||||
value = null;
|
||||
addAttribute(WidgetAttribute.MouseOver);
|
||||
}
|
||||
|
||||
@@ -43,14 +40,14 @@ public class ControlColourMixSymbol extends Control implements ITooltip {
|
||||
|
||||
public void setValue(IColourMix value) {
|
||||
this.value = value;
|
||||
setColor(16777215);
|
||||
setColor(0xffffff);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
if (type == 1) {
|
||||
float chance = value.getChance();
|
||||
tooltip.add("Current Chance - " + chance + "%");
|
||||
tooltip.add(Binnie.I18N.localise(Botany.instance, "gui.controls.colorMixSymbol.chance", chance));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.botany.craftgui;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.IColourMix;
|
||||
import binnie.botany.api.IFlowerColor;
|
||||
import binnie.botany.core.BotanyCore;
|
||||
@@ -18,7 +20,7 @@ public class PageColorMixResultant extends PageAbstract<IFlowerColor> {
|
||||
|
||||
public PageColorMixResultant(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
pageSpeciesFurtherTitle = new ControlTextCentered(this, 8.0f, "Resultant Mixes");
|
||||
pageSpeciesFurtherTitle = new ControlTextCentered(this, 8.0f, Binnie.I18N.localise(Botany.instance, "gui.controls.pageSpeciesFurtherTitle"));
|
||||
pageSpeciesFurtherList = new ControlColorMixBox(this, 4, 20, 136, 152, ControlColorMixBox.Type.Resultant);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.botany.craftgui;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.IColourMix;
|
||||
import binnie.botany.api.IFlowerColor;
|
||||
import binnie.botany.core.BotanyCore;
|
||||
@@ -13,23 +15,23 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class PageColourMix extends PageAbstract<IFlowerColor> {
|
||||
ControlText pageSpeciesFurther_Title;
|
||||
ControlColorMixBox pageSpeciesFurther_List;
|
||||
ControlText pageSpeciesFurtherTitle;
|
||||
ControlColorMixBox pageSpeciesFurtherList;
|
||||
|
||||
public PageColourMix(IWidget parent, DatabaseTab tab) {
|
||||
super(parent, tab);
|
||||
pageSpeciesFurther_Title = new ControlTextCentered(this, 8.0f, "Further Mixes");
|
||||
pageSpeciesFurther_List = new ControlColorMixBox(this, 4, 20, 136, 152, ControlColorMixBox.Type.Further);
|
||||
pageSpeciesFurtherTitle = new ControlTextCentered(this, 8.0f, Binnie.I18N.localise(Botany.instance, "gui.controls.pageColorFurtherTitle"));
|
||||
pageSpeciesFurtherList = new ControlColorMixBox(this, 4, 20, 136, 152, ControlColorMixBox.Type.Further);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(IFlowerColor colour) {
|
||||
List<IColourMix> mixes = new ArrayList<IColourMix>();
|
||||
List<IColourMix> mixes = new ArrayList<>();
|
||||
for (IColourMix mix : BotanyCore.getFlowerRoot().getColourMixes(false)) {
|
||||
if (mix.getColor1() == colour || mix.getColor2() == colour) {
|
||||
mixes.add(mix);
|
||||
}
|
||||
}
|
||||
pageSpeciesFurther_List.setOptions(mixes);
|
||||
pageSpeciesFurtherList.setOptions(mixes);
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package binnie.botany.craftgui;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.EnumFlowerChromosome;
|
||||
import binnie.botany.api.EnumFlowerStage;
|
||||
import binnie.botany.api.IAlleleFlowerSpecies;
|
||||
@@ -27,13 +28,6 @@ public class PageSpeciesFlowerGenome extends PageSpecies {
|
||||
super(parent, tab);
|
||||
}
|
||||
|
||||
public static String tolerated(boolean t) {
|
||||
if (t) {
|
||||
return "Tolerated";
|
||||
}
|
||||
return "Not Tolerated";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onValueChanged(IAlleleSpecies species) {
|
||||
deleteAllChildren();
|
||||
@@ -41,42 +35,53 @@ public class PageSpeciesFlowerGenome extends PageSpecies {
|
||||
if (template == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
IFlower tree = Binnie.Genetics.getFlowerRoot().templateAsIndividual(template);
|
||||
if (tree == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
IFlowerGenome genome = tree.getGenome();
|
||||
IAlleleFlowerSpecies treeSpecies = genome.getPrimary();
|
||||
int w = 144;
|
||||
int h = 176;
|
||||
new ControlText(this, new IArea(0.0f, 4.0f, w, 16.0f), "Genome", TextJustification.MiddleCenter);
|
||||
|
||||
new ControlText(this, new IArea(0.0f, 4.0f, w, 16.0f), Binnie.I18N.localise(Botany.instance, "gui.database.tab.genome"), TextJustification.MiddleCenter);
|
||||
ControlScrollableContent scrollable = new ControlScrollableContent(this, 4.0f, 20.0f, w - 8, h - 8 - 16, 12.0f);
|
||||
Control contents = new Control(scrollable, 0.0f, 0.0f, w - 8 - 12, h - 8 - 16);
|
||||
|
||||
int tw = w - 8 - 12;
|
||||
int w2 = 55;
|
||||
int w3 = tw - 50;
|
||||
int y = 0;
|
||||
int th = 14;
|
||||
int th2 = 18;
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), "Temp. : ", TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), treeSpecies.getTemperature().getName(), TextJustification.MiddleLeft);
|
||||
int valueX = w2 + 4;
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), Binnie.I18N.localise(Botany.instance, "gui.database.tab.genome.temp"), TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(valueX, y, w3, th), treeSpecies.getTemperature().getName(), TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), "Moist. : ", TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), Binnie.Language.localise(treeSpecies.getMoisture()), TextJustification.MiddleLeft);
|
||||
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), Binnie.I18N.localise(Botany.instance, "gui.database.tab.genome.moist"), TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(valueX, y, w3, th), Binnie.I18N.localise(treeSpecies.getMoisture()), TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), "pH. : ", TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), Binnie.Language.localise(treeSpecies.getPH()), TextJustification.MiddleLeft);
|
||||
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), Binnie.I18N.localise(Botany.instance, "gui.database.tab.genome.ph"), TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(valueX, y, w3, th), Binnie.I18N.localise(treeSpecies.getPH()), TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), "Fertility : ", TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getFertility() + "x", TextJustification.MiddleLeft);
|
||||
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), Binnie.I18N.localise(Botany.instance, "gui.database.tab.genome.fertility"), TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(valueX, y, w3, th), genome.getFertility() + "x", TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
|
||||
float lifespan = genome.getLifespan() * 68.27f / genome.getAgeChance() / 24000.0f;
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), "Lifespan : ", TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), "" + String.format("%.2f", lifespan) + " days", TextJustification.MiddleLeft);
|
||||
String lifespanValue = String.format("%.2f", lifespan);
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), Binnie.I18N.localise(Botany.instance, "gui.database.tab.genome.lifespan"), TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(valueX, y, w3, th), Binnie.I18N.localise(Botany.instance, "gui.database.tab.genome.lifespan.value", lifespanValue), TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), "Nectar : ", TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getActiveAllele(EnumFlowerChromosome.SAPPINESS).getName(), TextJustification.MiddleLeft);
|
||||
|
||||
new ControlText(contents, new IArea(0.0f, y, w2, th), Binnie.I18N.localise(Botany.instance, "gui.database.tab.genome.nectar"), TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(valueX, y, w3, th), genome.getActiveAllele(EnumFlowerChromosome.SAPPINESS).getName(), TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
|
||||
int x = w2;
|
||||
int tot = 0;
|
||||
for (IIndividual vid : BotanyCore.getFlowerRoot().getIndividualTemplates()) {
|
||||
@@ -88,12 +93,13 @@ public class PageSpeciesFlowerGenome extends PageSpecies {
|
||||
ItemStack stack = BotanyCore.getFlowerRoot().getMemberStack(vid, EnumFlowerStage.FLOWER.ordinal());
|
||||
ControlItemDisplay display = new ControlItemDisplay(contents, x, y);
|
||||
display.setItemStack(stack);
|
||||
++tot;
|
||||
tot++;
|
||||
x += 18;
|
||||
}
|
||||
}
|
||||
|
||||
int numOfLines = 1 + (tot - 1) / 3;
|
||||
new ControlText(contents, new IArea(0.0f, y - (numOfLines - 1) * 18, w2, 4 + 18 * numOfLines), "Varieties : ", TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(0.0f, y - (numOfLines - 1) * 18, w2, 4 + 18 * numOfLines), Binnie.I18N.localise(Botany.instance, "gui.database.tab.genome.varieties"), TextJustification.MiddleRight);
|
||||
y += th;
|
||||
contents.setSize(new IPoint(contents.size().x(), y));
|
||||
scrollable.setScrollableContent(contents);
|
||||
|
||||
@@ -23,11 +23,10 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class WindowBotanistDatabase extends WindowAbstractDatabase {
|
||||
protected ControlListBox<EnumFlowerColor> selectionBoxColors;
|
||||
|
||||
public WindowBotanistDatabase(EntityPlayer player, Side side, boolean nei) {
|
||||
super(player, side, nei, Binnie.Genetics.flowerBreedingSystem, 130.0f);
|
||||
}
|
||||
@@ -39,28 +38,13 @@ public class WindowBotanistDatabase extends WindowAbstractDatabase {
|
||||
@Override
|
||||
protected void addTabs() {
|
||||
new PageSpeciesOverview(getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.overview", 0));
|
||||
new PageSpeciesFlowerGenome(getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.genome", 0));
|
||||
new PageSpeciesFlowerGenome(getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "genome", 0));
|
||||
new PageSpeciesClassification(getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.classification", 0));
|
||||
new PageSpeciesResultant(getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.resultant", 0));
|
||||
new PageSpeciesMutations(getInfoPages(Mode.Species), new DatabaseTab(Botany.instance, "species.further", 0));
|
||||
new PageBranchOverview(getInfoPages(Mode.Branches), new DatabaseTab(Botany.instance, "branches.overview", 0));
|
||||
new PageBranchSpecies(getInfoPages(Mode.Branches), new DatabaseTab(Botany.instance, "branches.species", 0));
|
||||
createMode(FlowerMode.Colour, new ModeWidgets(FlowerMode.Colour, this) {
|
||||
@Override
|
||||
public void createListBox(IArea area) {
|
||||
listBox = new ControlListBox<IFlowerColor>(modePage, area.x(), area.y(), area.w(), area.h(), 12.0f) {
|
||||
@Override
|
||||
public IWidget createOption(IFlowerColor value, int y) {
|
||||
return new ControlColorOption(getContent(), value, y);
|
||||
}
|
||||
};
|
||||
List<IFlowerColor> colors = new ArrayList<IFlowerColor>();
|
||||
for (IFlowerColor c : EnumFlowerColor.values()) {
|
||||
colors.add(c);
|
||||
}
|
||||
listBox.setOptions(colors);
|
||||
}
|
||||
});
|
||||
createMode(FlowerMode.Colour, new ColorModeWidget());
|
||||
new PageColorMixResultant(getInfoPages(FlowerMode.Colour), new DatabaseTab(Botany.instance, "colour.resultant", 0));
|
||||
new PageColourMix(getInfoPages(FlowerMode.Colour), new DatabaseTab(Botany.instance, "colour.further", 0));
|
||||
new PageBreeder(getInfoPages(Mode.Breeder), getUsername(), new DatabaseTab(Botany.instance, "breeder", 0));
|
||||
@@ -73,7 +57,7 @@ public class WindowBotanistDatabase extends WindowAbstractDatabase {
|
||||
|
||||
@Override
|
||||
protected String getName() {
|
||||
return "FlowerDatabase";
|
||||
return Binnie.I18N.localise(Botany.instance, "gui.database.name");
|
||||
}
|
||||
|
||||
enum FlowerMode implements IDatabaseMode {
|
||||
@@ -81,7 +65,26 @@ public class WindowBotanistDatabase extends WindowAbstractDatabase {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return Botany.proxy.localise("gui.database.mode." + name().toLowerCase());
|
||||
return Botany.proxy.localise("gui.database.tab." + name().toLowerCase());
|
||||
}
|
||||
}
|
||||
|
||||
private class ColorModeWidget extends ModeWidgets {
|
||||
public ColorModeWidget() {
|
||||
super(FlowerMode.Colour, WindowBotanistDatabase.this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void createListBox(IArea area) {
|
||||
listBox = new ControlListBox<IFlowerColor>(modePage, area.x(), area.y(), area.w(), area.h(), 12.0f) {
|
||||
@Override
|
||||
public IWidget createOption(IFlowerColor value, int y) {
|
||||
return new ControlColorOption(getContent(), value, y);
|
||||
}
|
||||
};
|
||||
List<IFlowerColor> colors = new ArrayList<>();
|
||||
Collections.addAll(colors, EnumFlowerColor.values());
|
||||
listBox.setOptions(colors);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package binnie.botany.farm;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.EnumAcidity;
|
||||
import binnie.botany.api.EnumMoisture;
|
||||
import binnie.core.circuits.BinnieCircuit;
|
||||
@@ -11,7 +12,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class CircuitGarden extends BinnieCircuit {
|
||||
private Class<? extends FarmLogic> logicClass;
|
||||
private boolean isManual;
|
||||
private boolean isFertilised;
|
||||
private ItemStack icon;
|
||||
@@ -28,32 +28,42 @@ public class CircuitGarden extends BinnieCircuit {
|
||||
String info = "";
|
||||
|
||||
if (moisture == EnumMoisture.Dry) {
|
||||
info += EnumChatFormatting.YELLOW + "Dry" + EnumChatFormatting.RESET;
|
||||
info += EnumChatFormatting.YELLOW
|
||||
+ Binnie.I18N.localise(Botany.instance, "moisture.dry")
|
||||
+ EnumChatFormatting.RESET;
|
||||
}
|
||||
|
||||
if (moisture == EnumMoisture.Damp) {
|
||||
info += EnumChatFormatting.YELLOW + "Damp" + EnumChatFormatting.RESET;
|
||||
info += EnumChatFormatting.YELLOW
|
||||
+ Binnie.I18N.localise(Botany.instance, "moisture.damp")
|
||||
+ EnumChatFormatting.RESET;
|
||||
}
|
||||
|
||||
if (acidity == EnumAcidity.Acid) {
|
||||
if (info.length() > 0) {
|
||||
info += ", ";
|
||||
}
|
||||
info += EnumChatFormatting.RED + "Acidic" + EnumChatFormatting.RESET;
|
||||
info += EnumChatFormatting.RED
|
||||
+ Binnie.I18N.localise(Botany.instance, "ph.acid")
|
||||
+ EnumChatFormatting.RESET;
|
||||
}
|
||||
|
||||
if (acidity == EnumAcidity.Neutral) {
|
||||
if (info.length() > 0) {
|
||||
info += ", ";
|
||||
}
|
||||
info += EnumChatFormatting.GREEN + "Neutral" + EnumChatFormatting.RESET;
|
||||
info += EnumChatFormatting.GREEN
|
||||
+ Binnie.I18N.localise(Botany.instance, "ph.neutral")
|
||||
+ EnumChatFormatting.RESET;
|
||||
}
|
||||
|
||||
if (acidity == EnumAcidity.Alkaline) {
|
||||
if (info.length() > 0) {
|
||||
info += ", ";
|
||||
}
|
||||
info += EnumChatFormatting.AQUA + "Alkaline" + EnumChatFormatting.RESET;
|
||||
info += EnumChatFormatting.AQUA
|
||||
+ Binnie.I18N.localise(Botany.instance, "ph.alkaline")
|
||||
+ EnumChatFormatting.RESET;
|
||||
}
|
||||
|
||||
if (info.length() > 0) {
|
||||
@@ -72,8 +82,9 @@ public class CircuitGarden extends BinnieCircuit {
|
||||
if (!isCircuitable(tile)) {
|
||||
return;
|
||||
}
|
||||
|
||||
GardenLogic logic = new GardenLogic((IFarmHousing) tile);
|
||||
logic.setData(moisture, acidity, isManual, isFertilised, icon, Binnie.Language.localise(getName()));
|
||||
logic.setData(moisture, acidity, isManual, isFertilised, icon, Binnie.I18N.localise(getName()));
|
||||
((IFarmHousing) tile).setFarmLogic(FarmDirection.values()[slot], logic);
|
||||
}
|
||||
|
||||
@@ -92,6 +103,6 @@ public class CircuitGarden extends BinnieCircuit {
|
||||
|
||||
@Override
|
||||
public void onTick(int arg0, Object arg1) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
}
|
||||
@@ -356,5 +356,4 @@ public class GardenLogic extends FarmLogic {
|
||||
icon = icon2;
|
||||
name = name2;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -62,12 +62,10 @@ public class Vect {
|
||||
if (this == obj) {
|
||||
return true;
|
||||
}
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
if (obj == null || getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Vect other = (Vect) obj;
|
||||
return x == other.x
|
||||
&& y == other.y
|
||||
|
||||
@@ -99,20 +99,22 @@ public class BlockFlower extends BlockContainer {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if (tile instanceof TileEntityFlower) {
|
||||
TileEntityFlower f = (TileEntityFlower) tile;
|
||||
EnumFlowerStage stage = (f.getAge() == 0) ? EnumFlowerStage.SEED : EnumFlowerStage.FLOWER;
|
||||
IFlowerType flower = f.getType();
|
||||
int section = f.getRenderSection();
|
||||
boolean flowered = f.isFlowered();
|
||||
if (RendererBotany.pass == 0) {
|
||||
return flower.getStem(stage, flowered, section);
|
||||
}
|
||||
return (RendererBotany.pass == 1) ?
|
||||
flower.getPetalIcon(stage, flowered, section) :
|
||||
flower.getVariantIcon(stage, flowered, section);
|
||||
if (!(tile instanceof TileEntityFlower)) {
|
||||
return super.getIcon(world, x, y, z, side);
|
||||
}
|
||||
return super.getIcon(world, x, y, z, side);
|
||||
|
||||
TileEntityFlower f = (TileEntityFlower) tile;
|
||||
EnumFlowerStage stage = (f.getAge() == 0) ? EnumFlowerStage.SEED : EnumFlowerStage.FLOWER;
|
||||
IFlowerType flower = f.getType();
|
||||
int section = f.getRenderSection();
|
||||
boolean flowered = f.isFlowered();
|
||||
if (RendererBotany.pass == 0) {
|
||||
return flower.getStem(stage, flowered, section);
|
||||
}
|
||||
|
||||
return (RendererBotany.pass == 1) ?
|
||||
flower.getPetalIcon(stage, flowered, section) :
|
||||
flower.getVariantIcon(stage, flowered, section);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -133,7 +135,8 @@ public class BlockFlower extends BlockContainer {
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World world, int x, int y, int z) {
|
||||
return super.canPlaceBlockAt(world, x, y, z) && canBlockStay(world, x, y, z);
|
||||
return super.canPlaceBlockAt(world, x, y, z)
|
||||
&& canBlockStay(world, x, y, z);
|
||||
}
|
||||
|
||||
protected boolean canPlaceBlockOn(Block block) {
|
||||
@@ -153,7 +156,11 @@ public class BlockFlower extends BlockContainer {
|
||||
}
|
||||
|
||||
TileEntityFlower flower = (TileEntityFlower) tile;
|
||||
if (flower.getSection() == 0 && flower.getFlower() != null && flower.getFlower().getAge() > 0 && flower.getFlower().getGenome().getPrimary().getType().getSections() > 1 && world.getBlock(x, y + 1, z) != Botany.flower) {
|
||||
if (flower.getSection() == 0
|
||||
&& flower.getFlower() != null
|
||||
&& flower.getFlower().getAge() > 0
|
||||
&& flower.getFlower().getGenome().getPrimary().getType().getSections() > 1
|
||||
&& world.getBlock(x, y + 1, z) != Botany.flower) {
|
||||
dropBlockAsItem(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
|
||||
world.setBlockToAir(x, y, z);
|
||||
}
|
||||
@@ -199,9 +206,8 @@ public class BlockFlower extends BlockContainer {
|
||||
return drops;
|
||||
}
|
||||
|
||||
// TODO remove deprecated
|
||||
@Override
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z) {
|
||||
public boolean removedByPlayer(World world, EntityPlayer player, int x, int y, int z, boolean willHarvest) {
|
||||
List<ItemStack> drops = getDrops(world, x, y, z, world.getBlockMetadata(x, y, z), 0);
|
||||
boolean hasBeenBroken = world.setBlockToAir(x, y, z);
|
||||
if (hasBeenBroken && BinnieCore.proxy.isSimulating(world) && drops.size() > 0 && (player == null || !player.capabilities.isCreativeMode)) {
|
||||
|
||||
@@ -3,11 +3,7 @@ package binnie.botany.flower;
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.api.EnumFlowerChromosome;
|
||||
import binnie.botany.api.EnumFlowerStage;
|
||||
import binnie.botany.api.IAlleleFlowerSpecies;
|
||||
import binnie.botany.api.IFlower;
|
||||
import binnie.botany.api.IFlowerType;
|
||||
import binnie.botany.api.*;
|
||||
import binnie.botany.core.BotanyCore;
|
||||
import binnie.botany.genetics.EnumFlowerType;
|
||||
import binnie.botany.genetics.Flower;
|
||||
@@ -59,40 +55,43 @@ public abstract class ItemBotany extends Item {
|
||||
return true;
|
||||
}
|
||||
|
||||
// TODO remove deprecated
|
||||
@Override
|
||||
public boolean hasEffect(ItemStack itemstack) {
|
||||
if (!itemstack.hasTagCompound()) {
|
||||
public boolean hasEffect(ItemStack stack, int pass) {
|
||||
if (!stack.hasTagCompound()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
IIndividual individual = getIndividual(itemstack);
|
||||
IIndividual individual = getIndividual(stack);
|
||||
return individual != null
|
||||
&& individual.getGenome() != null
|
||||
&& individual.hasEffect();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List list, boolean flag) {
|
||||
public void addInformation(ItemStack itemstack, EntityPlayer player, List tooltip, boolean flag) {
|
||||
if (!itemstack.hasTagCompound()) {
|
||||
return;
|
||||
}
|
||||
IFlower individual = (IFlower) getIndividual(itemstack);
|
||||
if (individual == null) {
|
||||
list.add("This item is bugged. Destroy it!");
|
||||
tooltip.add(Binnie.I18N.localise(Botany.instance, "item.tooltip.bugged"));
|
||||
return;
|
||||
}
|
||||
|
||||
list.add(EnumChatFormatting.YELLOW + individual.getGenome().getPrimaryColor().getName() + ((individual.getGenome().getPrimaryColor() == individual.getGenome().getSecondaryColor()) ? "" : (" and " + individual.getGenome().getSecondaryColor().getName())) + ", " + individual.getGenome().getStemColor().getName() + " Stem");
|
||||
IFlowerGenome genome = individual.getGenome();
|
||||
IFlowerColor primaryColor = genome.getPrimaryColor();
|
||||
IFlowerColor secondColor = genome.getSecondaryColor();
|
||||
IFlowerColor stemColor = genome.getStemColor();
|
||||
tooltip.add(EnumChatFormatting.YELLOW + primaryColor.getName() + ((primaryColor == secondColor) ? "" : (" and " + secondColor.getName())) + ", " + stemColor.getName() + " Stem");
|
||||
|
||||
if (individual.isAnalyzed()) {
|
||||
if (BinnieCore.proxy.isShiftDown()) {
|
||||
individual.addTooltip(list);
|
||||
individual.addTooltip(tooltip);
|
||||
} else {
|
||||
// TODO remove hardcode strings and localize
|
||||
list.add(EnumChatFormatting.GRAY + "<Hold shift for details>");
|
||||
tooltip.add(EnumChatFormatting.GRAY + Binnie.I18N.localise(Botany.instance, "item.tooltip.holdMore"));
|
||||
}
|
||||
} else {
|
||||
list.add("<Unknown>");
|
||||
tooltip.add(Binnie.I18N.localise(Botany.instance, "item.tooltip.unknownGenome"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -116,12 +115,18 @@ public abstract class ItemBotany extends Item {
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack itemstack) {
|
||||
if (!itemstack.hasTagCompound()) {
|
||||
return "Unknown";
|
||||
return Binnie.I18N.localise(Botany.instance, "item.tooltip.unknown");
|
||||
}
|
||||
|
||||
IIndividual individual = getIndividual(itemstack);
|
||||
return (individual != null && individual.getGenome() != null) ?
|
||||
(individual.getDisplayName() + getTag()) :
|
||||
"Corrupted Flower";
|
||||
if (individual != null && individual.getGenome() != null) {
|
||||
String tag = getTag();
|
||||
if (tag == null || tag.isEmpty()) {
|
||||
return individual.getDisplayName();
|
||||
}
|
||||
return Binnie.I18N.localise(Botany.instance, "item.botany.name", individual.getDisplayName(), tag);
|
||||
}
|
||||
return Binnie.I18N.localise(Botany.instance, "item.flowerCorrupted.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -195,7 +200,7 @@ public abstract class ItemBotany extends Item {
|
||||
}
|
||||
pollinatable.mateWith(flower);
|
||||
if (!player.capabilities.isCreativeMode) {
|
||||
--itemstack.stackSize;
|
||||
itemstack.stackSize--;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -264,14 +269,14 @@ public abstract class ItemBotany extends Item {
|
||||
}
|
||||
|
||||
public boolean placeBlockAt(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) {
|
||||
Block field_150939_a = Botany.flower;
|
||||
if (!world.setBlock(x, y, z, field_150939_a, metadata, 3)) {
|
||||
Block block = Botany.flower;
|
||||
if (!world.setBlock(x, y, z, block, metadata, 3)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (world.getBlock(x, y, z) == field_150939_a) {
|
||||
field_150939_a.onBlockPlacedBy(world, x, y, z, player, stack);
|
||||
field_150939_a.onPostBlockPlaced(world, x, y, z, metadata);
|
||||
if (world.getBlock(x, y, z) == block) {
|
||||
block.onBlockPlacedBy(world, x, y, z, player, stack);
|
||||
block.onPostBlockPlaced(world, x, y, z, metadata);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.botany.flower;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -33,26 +34,31 @@ public class ItemInsulatedTube extends Item {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item p_150895_1_, CreativeTabs p_150895_2_, List p_150895_3_) {
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
for (Material mat : Material.values()) {
|
||||
for (Insulate ins : Insulate.values()) {
|
||||
p_150895_3_.add(new ItemStack(this, 1, mat.ordinal() + ins.ordinal() * 128));
|
||||
list.add(new ItemStack(this, 1, mat.ordinal() + ins.ordinal() * 128));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister p_94581_1_) {
|
||||
public void registerIcons(IIconRegister register) {
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
icons[i] = Botany.proxy.getIcon(p_94581_1_, "insulatedTube." + i);
|
||||
icons[i] = Botany.proxy.getIcon(register, "insulatedTube." + i);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getColorFromItemStack(ItemStack stack, int pass) {
|
||||
return (pass == 0) ? 16777215 : ((pass == 1) ? Material.get(stack.getItemDamage()).getColor() : Insulate.get(stack.getItemDamage()).getColor());
|
||||
if (pass == 0) {
|
||||
return 0xffffff;
|
||||
}
|
||||
return (pass == 1) ?
|
||||
Material.get(stack.getItemDamage()).getColor() :
|
||||
Insulate.get(stack.getItemDamage()).getColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -64,7 +70,8 @@ public class ItemInsulatedTube extends Item {
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
return Material.get(stack.getItemDamage()).getName() + " Insulated Tube";
|
||||
return Material.get(stack.getItemDamage()).getName() + " "
|
||||
+ Binnie.I18N.localise(Botany.instance, "tube.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -83,10 +90,10 @@ public class ItemInsulatedTube extends Item {
|
||||
}
|
||||
|
||||
enum Material {
|
||||
Copper(0xe3b78e, "Copper"),
|
||||
Tin(0xe1eef4, "Tin"),
|
||||
Bronze(0xddc276, "Bronze"),
|
||||
Iron(0xd8d8d8, "Iron");
|
||||
Copper(0xe3b78e, "tube.cooper"),
|
||||
Tin(0xe1eef4, "tube.tin"),
|
||||
Bronze(0xddc276, "tube.bronze"),
|
||||
Iron(0xd8d8d8, "tube.iron");
|
||||
|
||||
protected int color;
|
||||
protected String name;
|
||||
@@ -105,17 +112,17 @@ public class ItemInsulatedTube extends Item {
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
return Binnie.I18N.localise(Botany.instance, name);
|
||||
}
|
||||
}
|
||||
|
||||
enum Insulate {
|
||||
Clay(0xa1aacc, "Clay"),
|
||||
Cobble(0x7b7b7b, "Cobblestone"),
|
||||
Sand(0xefeab5, "Sand"),
|
||||
HardenedClay(0x935c43, "Hardened Clay"),
|
||||
Stone(0x6d6d6d, "Smooth Stone"),
|
||||
Sandstone(0xc1b989, "Sandstone");
|
||||
Clay(0xa1aacc, "tube.insulate.clay"),
|
||||
Cobble(0x7b7b7b, "tube.insulate.cobblestone"),
|
||||
Sand(0xefeab5, "tube.insulate.sand"),
|
||||
HardenedClay(0x935c43, "tube.insulate.hardenedClay"),
|
||||
Stone(0x6d6d6d, "tube.insulate.smoothStone"),
|
||||
Sandstone(0xc1b989, "tube.insulate.sandstone");
|
||||
|
||||
protected int color;
|
||||
protected String name;
|
||||
@@ -134,7 +141,7 @@ public class ItemInsulatedTube extends Item {
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
return Binnie.I18N.localise(Botany.instance, name);
|
||||
}
|
||||
|
||||
public ItemStack getStack() {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.botany.flower;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.EnumFlowerStage;
|
||||
|
||||
public class ItemPollen extends ItemBotany {
|
||||
@@ -14,6 +16,6 @@ public class ItemPollen extends ItemBotany {
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return " Pollen";
|
||||
return Binnie.I18N.localise(Botany.instance, "item.pollen.tag.name");
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
package binnie.botany.flower;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.api.EnumFlowerStage;
|
||||
|
||||
public class ItemSeed extends ItemBotany {
|
||||
@@ -14,6 +16,6 @@ public class ItemSeed extends ItemBotany {
|
||||
|
||||
@Override
|
||||
public String getTag() {
|
||||
return " Germling";
|
||||
return Binnie.I18N.localise(Botany.instance, "item.germling.tag.name");
|
||||
}
|
||||
}
|
||||
@@ -216,15 +216,15 @@ public class TileEntityFlower extends TileEntity implements IPollinatable, IButt
|
||||
flower.setWilted(false);
|
||||
}
|
||||
|
||||
float CHANCE_DISPERSAL = 0.8f;
|
||||
CHANCE_DISPERSAL += 0.2f * flower.getGenome().getFertility();
|
||||
CHANCE_DISPERSAL *= 1.0f + soil.ordinal() * 0.5f;
|
||||
float CHANCE_POLLINATE = 1.0f;
|
||||
CHANCE_POLLINATE += 0.25f * flower.getGenome().getFertility();
|
||||
CHANCE_POLLINATE *= 1.0f + soil.ordinal() * 0.5f;
|
||||
float CHANCE_SELFPOLLINATE = 0.2f * CHANCE_POLLINATE;
|
||||
float chanceDispersal = 0.8f;
|
||||
chanceDispersal += 0.2f * flower.getGenome().getFertility();
|
||||
chanceDispersal *= 1.0f + soil.ordinal() * 0.5f;
|
||||
float chancePollinate = 1.0f;
|
||||
chancePollinate += 0.25f * flower.getGenome().getFertility();
|
||||
chancePollinate *= 1.0f + soil.ordinal() * 0.5f;
|
||||
float chanceSelfPollinate = 0.2f * chancePollinate;
|
||||
|
||||
if (worldObj.rand.nextFloat() < CHANCE_DISPERSAL && flower.hasFlowered() && !flower.isWilted()) {
|
||||
if (worldObj.rand.nextFloat() < chanceDispersal && flower.hasFlowered() && !flower.isWilted()) {
|
||||
IFlowerGenome mate = flower.getMate();
|
||||
if (mate != null) {
|
||||
boolean dispersed = false;
|
||||
@@ -250,7 +250,7 @@ public class TileEntityFlower extends TileEntity implements IPollinatable, IButt
|
||||
}
|
||||
}
|
||||
|
||||
if (worldObj.rand.nextFloat() < CHANCE_POLLINATE && flower.hasFlowered() && !flower.isWilted()) {
|
||||
if (worldObj.rand.nextFloat() < chancePollinate && flower.hasFlowered() && !flower.isWilted()) {
|
||||
for (int a2 = 0; a2 < 4; ++a2) {
|
||||
int dx3 = 0;
|
||||
int dz2 = 0;
|
||||
@@ -266,7 +266,7 @@ public class TileEntityFlower extends TileEntity implements IPollinatable, IButt
|
||||
}
|
||||
}
|
||||
|
||||
if (worldObj.rand.nextFloat() < CHANCE_SELFPOLLINATE && flower.hasFlowered() && flower.getMate() == null) {
|
||||
if (worldObj.rand.nextFloat() < chanceSelfPollinate && flower.hasFlowered() && flower.getMate() == null) {
|
||||
mateWith(getFlower());
|
||||
}
|
||||
spawnButterflies();
|
||||
@@ -635,5 +635,4 @@ public class TileEntityFlower extends TileEntity implements IPollinatable, IButt
|
||||
return super.equals(obj);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -54,11 +54,11 @@ public class BlockSoil extends Block implements IBlockSoil {
|
||||
}
|
||||
|
||||
public static String getPH(ItemStack stack) {
|
||||
return Binnie.Language.localise(EnumAcidity.values()[stack.getItemDamage() / 3]);
|
||||
return Binnie.I18N.localise(EnumAcidity.values()[stack.getItemDamage() / 3]);
|
||||
}
|
||||
|
||||
public static String getMoisture(ItemStack stack) {
|
||||
return Binnie.Language.localise(EnumMoisture.values()[stack.getItemDamage() % 3]);
|
||||
return Binnie.I18N.localise(EnumMoisture.values()[stack.getItemDamage() % 3]);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -48,7 +48,7 @@ public class ItemSoilMeter extends Item {
|
||||
EnumChatFormatting.LIGHT_PURPLE,
|
||||
};
|
||||
String info = "Type: ";
|
||||
info += colors[type.ordinal()] + Binnie.Language.localise(type) + EnumChatFormatting.RESET;
|
||||
info += colors[type.ordinal()] + Binnie.I18N.localise(type) + EnumChatFormatting.RESET;
|
||||
|
||||
colors = new EnumChatFormatting[]{
|
||||
EnumChatFormatting.YELLOW,
|
||||
@@ -56,7 +56,7 @@ public class ItemSoilMeter extends Item {
|
||||
EnumChatFormatting.BLUE,
|
||||
};
|
||||
info += ", Moisture: ";
|
||||
info += colors[moisture.ordinal()] + Binnie.Language.localise(moisture) + EnumChatFormatting.RESET;
|
||||
info += colors[moisture.ordinal()] + Binnie.I18N.localise(moisture) + EnumChatFormatting.RESET;
|
||||
|
||||
colors = new EnumChatFormatting[]{
|
||||
EnumChatFormatting.RED,
|
||||
@@ -64,7 +64,7 @@ public class ItemSoilMeter extends Item {
|
||||
EnumChatFormatting.AQUA,
|
||||
};
|
||||
info += ", pH: ";
|
||||
info += colors[pH.ordinal()] + Binnie.Language.localise(pH) + EnumChatFormatting.RESET;
|
||||
info += colors[pH.ordinal()] + Binnie.I18N.localise(pH) + EnumChatFormatting.RESET;
|
||||
IChatComponent chat = new ChatComponentText(info);
|
||||
player.addChatMessage(chat);
|
||||
}
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
package binnie.botany.genetics;
|
||||
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class ItemEncyclopedia extends Item {
|
||||
boolean reinforced;
|
||||
|
||||
public ItemEncyclopedia(boolean reinforced) {
|
||||
this.reinforced = false;
|
||||
this.reinforced = reinforced;
|
||||
setCreativeTab(CreativeTabBotany.instance);
|
||||
setUnlocalizedName("encylopedia" + (reinforced ? "Iron" : ""));
|
||||
setMaxStackSize(1);
|
||||
setMaxDamage(reinforced ? 480 : 120);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister register) {
|
||||
itemIcon = Botany.proxy.getIcon(register, "encylopedia" + (reinforced ? "Iron" : ""));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int par1) {
|
||||
return itemIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack i) {
|
||||
return (reinforced ? "Reinforced " : "") + "Florist's Encyclopaedia";
|
||||
}
|
||||
}
|
||||
@@ -20,8 +20,6 @@ import forestry.api.recipes.RecipeManagers;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
||||
public class ModuleGenetics implements IInitializable {
|
||||
static AlleleEffectNone alleleEffectNone;
|
||||
@@ -42,8 +40,6 @@ public class ModuleGenetics implements IInitializable {
|
||||
GameRegistry.registerBlock(Botany.flower, "flower");
|
||||
BinnieCore.proxy.registerTileEntity(TileEntityFlower.class, "botany.tile.flower", null);
|
||||
Botany.database = new ItemDictionary();
|
||||
Botany.encyclopedia = new ItemEncyclopedia(false);
|
||||
Botany.encyclopediaIron = new ItemEncyclopedia(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -65,37 +61,6 @@ public class ModuleGenetics implements IInitializable {
|
||||
|
||||
@Override
|
||||
public void postInit() {
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
new ItemStack(Botany.encyclopedia),
|
||||
new Object[]{
|
||||
"fff", "fbf", "fff",
|
||||
'f', new ItemStack(Blocks.red_flower, 1, 32767),
|
||||
'b', Items.book
|
||||
}
|
||||
));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
new ItemStack(Botany.encyclopedia),
|
||||
new Object[]{
|
||||
"fff", "fbf", "fff",
|
||||
'f', new ItemStack(Blocks.yellow_flower, 1, 32767),
|
||||
'b', Items.book
|
||||
}
|
||||
));
|
||||
GameRegistry.addRecipe(new ShapedOreRecipe(
|
||||
new ItemStack(Botany.encyclopedia),
|
||||
new Object[]{
|
||||
"fff", "fbf", "fff",
|
||||
'f', new ItemStack(Botany.flower, 1, 32767),
|
||||
'b', Items.book
|
||||
}
|
||||
));
|
||||
GameRegistry.addRecipe(new ShapelessOreRecipe(
|
||||
new ItemStack(Botany.encyclopediaIron),
|
||||
new Object[]{
|
||||
new ItemStack(Botany.encyclopedia),
|
||||
"ingotIron"
|
||||
}
|
||||
));
|
||||
FlowerManager.flowerRegistry.registerAcceptableFlower(Botany.flower, "flowersVanilla");
|
||||
RecipeManagers.carpenterManager.addRecipe(
|
||||
100,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.botany.items;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
@@ -7,8 +8,10 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -19,6 +22,12 @@ public class ItemClay extends Item {
|
||||
setCreativeTab(CreativeTabBotany.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||
super.addInformation(stack, player, tooltip, advanced);
|
||||
tooltip.add(EnumChatFormatting.GRAY + EnumFlowerColor.get(stack.getItemDamage()).getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getColorFromItemStack(ItemStack stack, int index) {
|
||||
@@ -28,7 +37,7 @@ public class ItemClay extends Item {
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
return EnumFlowerColor.get(stack.getItemDamage()).getName() + " Clay";
|
||||
return Binnie.I18N.localise(Botany.instance, "item.clay.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package binnie.botany.items;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.botany.Botany;
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.botany.genetics.EnumFlowerColor;
|
||||
@@ -7,8 +8,10 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -19,6 +22,12 @@ public class ItemPigment extends Item {
|
||||
setCreativeTab(CreativeTabBotany.instance);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||
super.addInformation(stack, player, tooltip, advanced);
|
||||
tooltip.add(EnumChatFormatting.GRAY + EnumFlowerColor.get(stack.getItemDamage()).getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getColorFromItemStack(ItemStack stack, int index) {
|
||||
@@ -28,7 +37,7 @@ public class ItemPigment extends Item {
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
return EnumFlowerColor.get(stack.getItemDamage()).getName() + " Pigment";
|
||||
return Binnie.I18N.localise(Botany.instance, "item.pigment.name");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,13 +17,13 @@ import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.IChatComponent;
|
||||
|
||||
public enum PacketID implements IPacketID {
|
||||
Encylopedia,
|
||||
FieldKit,
|
||||
FlowerUpdate;
|
||||
|
||||
@Override
|
||||
public void onMessage(MessageBinnie message, MessageContext context) {
|
||||
if (this == PacketID.Encylopedia && context.side == Side.CLIENT) {
|
||||
onEnciclopediaPacket(message);
|
||||
if (this == PacketID.FieldKit && context.side == Side.CLIENT) {
|
||||
onFieldKitPacket(message);
|
||||
} else if (this == PacketID.FlowerUpdate) {
|
||||
onFlowerUpdatePacket(message);
|
||||
}
|
||||
@@ -37,7 +37,7 @@ public enum PacketID implements IPacketID {
|
||||
}
|
||||
}
|
||||
|
||||
private void onEnciclopediaPacket(MessageBinnie message) {
|
||||
private void onFieldKitPacket(MessageBinnie message) {
|
||||
MessageNBT packet = new MessageNBT(message);
|
||||
NBTTagCompound data = packet.getTagCompound();
|
||||
EntityPlayer player = BinnieCore.proxy.getPlayer();
|
||||
|
||||
@@ -61,7 +61,7 @@ public class BlockMetadata extends BlockContainer implements IBlockMetadata {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ public interface IBlockMetadata extends ITileEntityProvider {
|
||||
|
||||
String getBlockName(ItemStack itemStack);
|
||||
|
||||
void getBlockTooltip(ItemStack itemStack, List tooltip);
|
||||
void addBlockTooltip(ItemStack itemStack, List tooltip);
|
||||
|
||||
void dropAsStack(World world, int x, int y, int z, ItemStack itemStack);
|
||||
}
|
||||
@@ -54,7 +54,7 @@ public class ItemMetadata extends ItemBlock {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer player, List tooltip, boolean advanced) {
|
||||
((IBlockMetadata) field_150939_a).getBlockTooltip(itemStack, tooltip);
|
||||
((IBlockMetadata) field_150939_a).addBlockTooltip(itemStack, tooltip);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -24,12 +24,12 @@ public class BinnieCircuitLayout implements ICircuitLayout {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return Binnie.Language.localise(mod, "circuit.layout." + uid.toLowerCase());
|
||||
return Binnie.I18N.localise(mod, "circuit.layout." + uid.toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUsage() {
|
||||
return Binnie.Language.localise(mod, "circuit.layout." + uid.toLowerCase() + ".usage");
|
||||
return Binnie.I18N.localise(mod, "circuit.layout." + uid.toLowerCase() + ".usage");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -194,8 +194,8 @@ public class WindowFieldKit extends Window {
|
||||
List<String> infos = new ArrayList<>();
|
||||
|
||||
int i = 0;
|
||||
for (String pref = root.getUID() + ".fieldkit." + type.getName().toLowerCase() + "."; Binnie.Language.canLocalise(pref + i); ++i) {
|
||||
infos.add(Binnie.Language.localise(pref + i));
|
||||
for (String pref = root.getUID() + ".fieldkit." + type.getName().toLowerCase() + "."; Binnie.I18N.canLocalise(pref + i); ++i) {
|
||||
infos.add(Binnie.I18N.localise(pref + i));
|
||||
}
|
||||
|
||||
String text = Binnie.Genetics.getSystem(root).getAlleleName(type, allele);
|
||||
|
||||
@@ -18,11 +18,11 @@ public class DatabaseTab implements ITooltipHelp {
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Binnie.Language.localise(mod, "gui.database.tab." + unloc);
|
||||
return Binnie.I18N.localise(mod, "gui.database.tab." + unloc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getHelpTooltip(Tooltip tooltip) {
|
||||
tooltip.add(Binnie.Language.localiseOrBlank(mod, "gui.database.tab." + unloc + ".help"));
|
||||
tooltip.add(Binnie.I18N.localiseOrBlank(mod, "gui.database.tab." + unloc + ".help"));
|
||||
}
|
||||
}
|
||||
@@ -53,7 +53,6 @@ public class ControlSlot extends ControlSlotBase {
|
||||
|
||||
public ControlSlot(IWidget parent, int x, int y, Slot slot) {
|
||||
super(parent, x, y);
|
||||
this.slot = null;
|
||||
this.slot = slot;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,16 +56,16 @@ class BeeBreedingSystem extends BreedingSystem {
|
||||
public String getAlleleName(IChromosomeType chromosome, IAllele allele) {
|
||||
if (chromosome == EnumBeeChromosome.FERTILITY) {
|
||||
if (allele.getUID().contains("Low")) {
|
||||
return Binnie.Language.localise(BinnieCore.instance, "allele.fertility.low");
|
||||
return Binnie.I18N.localise(BinnieCore.instance, "allele.fertility.low");
|
||||
}
|
||||
if (allele.getUID().contains("Normal")) {
|
||||
return Binnie.Language.localise(BinnieCore.instance, "allele.fertility.normal");
|
||||
return Binnie.I18N.localise(BinnieCore.instance, "allele.fertility.normal");
|
||||
}
|
||||
if (allele.getUID().contains("High")) {
|
||||
return Binnie.Language.localise(BinnieCore.instance, "allele.fertility.high");
|
||||
return Binnie.I18N.localise(BinnieCore.instance, "allele.fertility.high");
|
||||
}
|
||||
if (allele.getUID().contains("Maximum")) {
|
||||
return Binnie.Language.localise(BinnieCore.instance, "allele.fertility.maximum");
|
||||
return Binnie.I18N.localise(BinnieCore.instance, "allele.fertility.maximum");
|
||||
}
|
||||
}
|
||||
return super.getAlleleName(chromosome, allele);
|
||||
|
||||
@@ -421,11 +421,11 @@ public abstract class BreedingSystem implements IItemStackRepresentative {
|
||||
public String getAlleleName(IChromosomeType chromosome, IAllele allele) {
|
||||
if (allele instanceof IAlleleBoolean) {
|
||||
return ((IAlleleBoolean) allele).getValue() ?
|
||||
Binnie.Language.localise(BinnieCore.instance, "allele.true") :
|
||||
Binnie.Language.localise(BinnieCore.instance, "allele.false");
|
||||
Binnie.I18N.localise(BinnieCore.instance, "allele.true") :
|
||||
Binnie.I18N.localise(BinnieCore.instance, "allele.false");
|
||||
}
|
||||
if (allele.getName() == "for.gui.maximum") {
|
||||
return Binnie.Language.localise(BinnieCore.instance, "allele.fertility.maximum");
|
||||
return Binnie.I18N.localise(BinnieCore.instance, "allele.fertility.maximum");
|
||||
}
|
||||
return allele.getName();
|
||||
}
|
||||
|
||||
@@ -12,6 +12,6 @@ public enum EnumBeeModifier {
|
||||
GeneticDecay;
|
||||
|
||||
public String getName() {
|
||||
return Binnie.Language.localise(BinnieCore.instance, "beemodifier." + name().toLowerCase());
|
||||
return Binnie.I18N.localise(BinnieCore.instance, "beemodifier." + name().toLowerCase());
|
||||
}
|
||||
}
|
||||
@@ -50,16 +50,16 @@ class FlowerBreedingSystem extends BreedingSystem {
|
||||
public String getAlleleName(IChromosomeType chromosome, IAllele allele) {
|
||||
if (chromosome == EnumFlowerChromosome.FERTILITY) {
|
||||
if (allele.getUID().contains("Low")) {
|
||||
return Binnie.Language.localise(BinnieCore.instance, "allele.fertility.low");
|
||||
return Binnie.I18N.localise(BinnieCore.instance, "allele.fertility.low");
|
||||
}
|
||||
if (allele.getUID().contains("Normal")) {
|
||||
return Binnie.Language.localise(BinnieCore.instance, "allele.fertility.normal");
|
||||
return Binnie.I18N.localise(BinnieCore.instance, "allele.fertility.normal");
|
||||
}
|
||||
if (allele.getUID().contains("High")) {
|
||||
return Binnie.Language.localise(BinnieCore.instance, "allele.fertility.high");
|
||||
return Binnie.I18N.localise(BinnieCore.instance, "allele.fertility.high");
|
||||
}
|
||||
if (allele.getUID().contains("Maximum")) {
|
||||
return Binnie.Language.localise(BinnieCore.instance, "allele.fertility.maximum");
|
||||
return Binnie.I18N.localise(BinnieCore.instance, "allele.fertility.maximum");
|
||||
}
|
||||
}
|
||||
return super.getAlleleName(chromosome, allele);
|
||||
|
||||
@@ -35,7 +35,7 @@ interface IBreedingMessage {
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return Binnie.Language.localise(BinnieCore.instance, "gui.breedingmessage.species");
|
||||
return Binnie.I18N.localise(BinnieCore.instance, "gui.breedingmessage.species");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -70,7 +70,7 @@ interface IBreedingMessage {
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return Binnie.Language.localise(BinnieCore.instance, "gui.breedingmessage.branch");
|
||||
return Binnie.I18N.localise(BinnieCore.instance, "gui.breedingmessage.branch");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -95,7 +95,7 @@ interface IBreedingMessage {
|
||||
|
||||
@Override
|
||||
public String getTitle() {
|
||||
return Binnie.Language.localise(BinnieCore.instance, "gui.breedingmessage.epithet");
|
||||
return Binnie.I18N.localise(BinnieCore.instance, "gui.breedingmessage.epithet");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -49,24 +49,24 @@ class MothBreedingSystem extends BreedingSystem {
|
||||
if (chromosome == EnumButterflyChromosome.METABOLISM) {
|
||||
int metabolism = ((IAlleleInteger) allele).getValue();
|
||||
if (metabolism >= 19) {
|
||||
return Binnie.Language.localise(BinnieCore.instance, "allele.metabolism.highest");
|
||||
return Binnie.I18N.localise(BinnieCore.instance, "allele.metabolism.highest");
|
||||
}
|
||||
if (metabolism >= 16) {
|
||||
return Binnie.Language.localise(BinnieCore.instance, "allele.metabolism.higher");
|
||||
return Binnie.I18N.localise(BinnieCore.instance, "allele.metabolism.higher");
|
||||
}
|
||||
if (metabolism >= 13) {
|
||||
return Binnie.Language.localise(BinnieCore.instance, "allele.metabolism.high");
|
||||
return Binnie.I18N.localise(BinnieCore.instance, "allele.metabolism.high");
|
||||
}
|
||||
if (metabolism >= 10) {
|
||||
return Binnie.Language.localise(BinnieCore.instance, "allele.metabolism.normal");
|
||||
return Binnie.I18N.localise(BinnieCore.instance, "allele.metabolism.normal");
|
||||
}
|
||||
if (metabolism >= 7) {
|
||||
return Binnie.Language.localise(BinnieCore.instance, "allele.metabolism.slow");
|
||||
return Binnie.I18N.localise(BinnieCore.instance, "allele.metabolism.slow");
|
||||
}
|
||||
if (metabolism >= 4) {
|
||||
return Binnie.Language.localise(BinnieCore.instance, "allele.metabolism.slower");
|
||||
return Binnie.I18N.localise(BinnieCore.instance, "allele.metabolism.slower");
|
||||
}
|
||||
return Binnie.Language.localise(BinnieCore.instance, "allele.metabolism.slowest");
|
||||
return Binnie.I18N.localise(BinnieCore.instance, "allele.metabolism.slowest");
|
||||
}
|
||||
if (chromosome == EnumButterflyChromosome.FERTILITY) {
|
||||
return ((IAlleleInteger) allele).getValue() + "x";
|
||||
|
||||
@@ -88,23 +88,23 @@ public class TreeBreedingSystem extends BreedingSystem {
|
||||
if (chromosome == EnumTreeChromosome.PLANT) {
|
||||
EnumSet<EnumPlantType> types = ((IAllelePlantType) allele).getPlantTypes();
|
||||
return types.isEmpty() ?
|
||||
Binnie.Language.localise(BinnieCore.instance, "allele.none") :
|
||||
Binnie.I18N.localise(BinnieCore.instance, "allele.none") :
|
||||
types.iterator().next().toString();
|
||||
}
|
||||
|
||||
if (chromosome == EnumTreeChromosome.FRUITS && allele.getUID().contains(".")) {
|
||||
IFruitProvider provider = ((IAlleleFruit) allele).getProvider();
|
||||
return (provider.getProducts().length == 0) ?
|
||||
Binnie.Language.localise(BinnieCore.instance, "allele.none") :
|
||||
Binnie.I18N.localise(BinnieCore.instance, "allele.none") :
|
||||
provider.getProducts()[0].getDisplayName();
|
||||
}
|
||||
|
||||
if (chromosome == EnumTreeChromosome.GROWTH) {
|
||||
if (allele.getUID().contains("Tropical")) {
|
||||
return Binnie.Language.localise(BinnieCore.instance, "allele.growth.tropical");
|
||||
return Binnie.I18N.localise(BinnieCore.instance, "allele.growth.tropical");
|
||||
}
|
||||
if (allele.getUID().contains("Lightlevel")) {
|
||||
return Binnie.Language.localise(BinnieCore.instance, "allele.growth.lightlevel");
|
||||
return Binnie.I18N.localise(BinnieCore.instance, "allele.growth.lightlevel");
|
||||
}
|
||||
}
|
||||
return super.getAlleleName(chromosome, allele);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
package binnie.core.item;
|
||||
|
||||
import binnie.botany.CreativeTabBotany;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.gui.BinnieCoreGUI;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -22,7 +22,7 @@ public class ItemFieldKit extends Item {
|
||||
|
||||
public ItemFieldKit() {
|
||||
setUnlocalizedName("fieldKit");
|
||||
setCreativeTab(CreativeTabs.tabTools);
|
||||
setCreativeTab(CreativeTabBotany.instance);
|
||||
setMaxStackSize(1);
|
||||
setMaxDamage(64);
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import binnie.core.IInitializable;
|
||||
import binnie.core.network.packet.MessageNBT;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -45,10 +46,12 @@ public class ModuleItems implements IInitializable {
|
||||
if (!BinnieCore.isBotanyActive() || event.action != PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) {
|
||||
return;
|
||||
}
|
||||
if (event.entityPlayer != null
|
||||
&& event.entityPlayer.getHeldItem() != null
|
||||
&& event.entityPlayer.getHeldItem().getItem() == BinnieCore.fieldKit
|
||||
&& event.entityPlayer.isSneaking()) {
|
||||
|
||||
EntityPlayer player = event.entityPlayer;
|
||||
if (player != null
|
||||
&& player.getHeldItem() != null
|
||||
&& player.getHeldItem().getItem() == BinnieCore.fieldKit
|
||||
&& player.isSneaking()) {
|
||||
TileEntity tile = event.world.getTileEntity(event.x, event.y, event.z);
|
||||
if (!(tile instanceof TileEntityFlower)) {
|
||||
return;
|
||||
@@ -68,7 +71,7 @@ public class ModuleItems implements IInitializable {
|
||||
info.setShort("Colour2", (short) flower.getGenome().getSecondaryColor().getID());
|
||||
info.setBoolean("Wilting", flower.isWilted());
|
||||
info.setBoolean("Flowered", flower.hasFlowered());
|
||||
Botany.proxy.sendToPlayer(new MessageNBT(PacketID.Encylopedia.ordinal(), info), event.entityPlayer);
|
||||
Botany.proxy.sendToPlayer(new MessageNBT(PacketID.FieldKit.ordinal(), info), event.entityPlayer);
|
||||
event.entityPlayer.getHeldItem().damageItem(1, event.entityPlayer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public abstract class MachinePackage {
|
||||
public abstract TileEntity createTileEntity();
|
||||
|
||||
public String getDisplayName() {
|
||||
return Binnie.Language.localise(group.getMod(), "machine." + group.getShortUID() + "." + getUID());
|
||||
return Binnie.I18N.localise(group.getMod(), "machine." + group.getShortUID() + "." + getUID());
|
||||
}
|
||||
|
||||
public Integer getMetadata() {
|
||||
@@ -57,6 +57,6 @@ public abstract class MachinePackage {
|
||||
}
|
||||
|
||||
public String getInformation() {
|
||||
return Binnie.Language.localise(group.getMod(), "machine." + group.getShortUID() + "." + getUID() + ".info");
|
||||
return Binnie.I18N.localise(group.getMod(), "machine." + group.getShortUID() + "." + getUID() + ".info");
|
||||
}
|
||||
}
|
||||
@@ -59,8 +59,8 @@ public class MachineUtil {
|
||||
setStack(slot, null);
|
||||
}
|
||||
|
||||
public ItemStack decreaseStack(int slotWood, int amount) {
|
||||
return getInventory().decrStackSize(slotWood, amount);
|
||||
public ItemStack decreaseStack(int slot, int amount) {
|
||||
return getInventory().decrStackSize(slot, amount);
|
||||
}
|
||||
|
||||
public void setStack(int slot, ItemStack stack) {
|
||||
|
||||
@@ -11,6 +11,7 @@ import java.util.List;
|
||||
|
||||
public class ComponentInventoryTransfer extends MachineComponent {
|
||||
private List<Transfer> transfers = new ArrayList<>();
|
||||
private ITransferRestockListener transferListener;
|
||||
|
||||
public ComponentInventoryTransfer(IMachine machine) {
|
||||
super(machine);
|
||||
@@ -43,6 +44,10 @@ public class ComponentInventoryTransfer extends MachineComponent {
|
||||
transfers.add(new Storage(getMachine(), source, destination).setCondition(condition));
|
||||
}
|
||||
|
||||
public void setTransferListener(ITransferRestockListener transferListener) {
|
||||
this.transferListener = transferListener;
|
||||
}
|
||||
|
||||
public abstract class Transfer {
|
||||
protected Condition condition;
|
||||
protected IMachine machine;
|
||||
@@ -92,17 +97,22 @@ public class ComponentInventoryTransfer extends MachineComponent {
|
||||
|
||||
@Override
|
||||
protected void doTransfer(IInventory inv) {
|
||||
if (inv.getStackInSlot(destination) == null) {
|
||||
for (int i : buffer) {
|
||||
if (inv.getStackInSlot(i) == null) {
|
||||
continue;
|
||||
}
|
||||
if (inv.getStackInSlot(destination) != null) {
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack newStack = inv.decrStackSize(i, limit);
|
||||
if (newStack != null) {
|
||||
inv.setInventorySlotContents(destination, newStack);
|
||||
return;
|
||||
for (int slot : buffer) {
|
||||
if (inv.getStackInSlot(slot) == null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ItemStack newStack = inv.decrStackSize(slot, limit);
|
||||
if (newStack != null) {
|
||||
inv.setInventorySlotContents(destination, newStack);
|
||||
if (transferListener != null) {
|
||||
transferListener.onRestock(destination);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -141,4 +151,8 @@ public class ComponentInventoryTransfer extends MachineComponent {
|
||||
|
||||
public abstract boolean fufilled(ItemStack p0);
|
||||
}
|
||||
|
||||
public interface ITransferRestockListener {
|
||||
void onRestock(int target);
|
||||
}
|
||||
}
|
||||
@@ -92,7 +92,7 @@ public class InventorySlot extends BaseSlot<ItemStack> {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return Binnie.Language.localise(BinnieCore.instance, "gui.slot." + unlocName);
|
||||
return Binnie.I18N.localise(BinnieCore.instance, "gui.slot." + unlocName);
|
||||
}
|
||||
|
||||
public enum Type {
|
||||
|
||||
@@ -48,6 +48,6 @@ public class TankSlot extends BaseSlot<FluidStack> {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return Binnie.Language.localise(BinnieCore.instance, "gui.slot." + unlocName);
|
||||
return Binnie.I18N.localise(BinnieCore.instance, "gui.slot." + unlocName);
|
||||
}
|
||||
}
|
||||
@@ -60,10 +60,10 @@ public class BinnieModProxy implements IBinnieModProxy {
|
||||
}
|
||||
|
||||
public String localise(String string) {
|
||||
return Binnie.Language.localise(mod, string);
|
||||
return Binnie.I18N.localise(mod, string);
|
||||
}
|
||||
|
||||
public String localiseOrBlank(String string) {
|
||||
return Binnie.Language.localiseOrBlank(mod, string);
|
||||
return Binnie.I18N.localiseOrBlank(mod, string);
|
||||
}
|
||||
}
|
||||
@@ -21,17 +21,12 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class AlvearyMutator {
|
||||
public static int slotMutator;
|
||||
public static int slotMutator = 0;
|
||||
|
||||
protected static Map<ItemStack, Float> mutations;
|
||||
|
||||
static {
|
||||
AlvearyMutator.slotMutator = 0;
|
||||
AlvearyMutator.mutations = new HashMap<>();
|
||||
}
|
||||
protected static Map<ItemStack, Float> mutations = new HashMap<>();
|
||||
|
||||
public static boolean isMutationItem(ItemStack item) {
|
||||
return getMutationMult(item) > 0.0f;
|
||||
return getMutationMult(item) > 1.0f;
|
||||
}
|
||||
|
||||
public static float getMutationMult(ItemStack item) {
|
||||
|
||||
@@ -20,18 +20,15 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class ExtraBeeMutation implements IBeeMutation {
|
||||
public static List<IBeeMutation> mutations;
|
||||
public static List<IBeeMutation> mutations = new ArrayList<>();
|
||||
|
||||
static {
|
||||
ExtraBeeMutation.mutations = new ArrayList<>();
|
||||
}
|
||||
|
||||
protected MutationRequirement req;
|
||||
protected IAlleleBeeSpecies species0;
|
||||
protected IAlleleBeeSpecies species1;
|
||||
protected IAllele[] template;
|
||||
protected int chance;
|
||||
|
||||
private MutationRequirement req;
|
||||
private IAlleleBeeSpecies species0;
|
||||
private IAlleleBeeSpecies species1;
|
||||
|
||||
public ExtraBeeMutation(IAlleleBeeSpecies allele0, IAlleleBeeSpecies allele1, ExtraBeesSpecies mutation, int chance) {
|
||||
this(allele0, allele1, mutation.getTemplate(), chance, null);
|
||||
}
|
||||
@@ -45,12 +42,12 @@ public class ExtraBeeMutation implements IBeeMutation {
|
||||
}
|
||||
|
||||
public ExtraBeeMutation(IAlleleBeeSpecies allele0, IAlleleBeeSpecies allele1, IAllele[] mutation, int chance, MutationRequirement req) {
|
||||
this.chance = 80;
|
||||
this.chance = chance;
|
||||
this.req = req;
|
||||
species0 = allele0;
|
||||
species1 = allele1;
|
||||
template = mutation;
|
||||
|
||||
if (species0 != null && species1 != null && template != null) {
|
||||
ExtraBeeMutation.mutations.add(this);
|
||||
}
|
||||
@@ -209,6 +206,7 @@ public class ExtraBeeMutation implements IBeeMutation {
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.UNUSUAL, ForestryAllele.BeeSpecies.Hermitic.getAllele(), ExtraBeesSpecies.SPATIAL, 5);
|
||||
new ExtraBeeMutation(ExtraBeesSpecies.SPATIAL, ForestryAllele.BeeSpecies.Spectral.getAllele(), ExtraBeesSpecies.QUANTUM, 5);
|
||||
new ExtraBeeMutation(ForestryAllele.BeeSpecies.Noble.getAllele(), ForestryAllele.BeeSpecies.Monastic.getAllele(), ExtraBeesSpecies.MYSTICAL, 5);
|
||||
|
||||
for (IBeeMutation mutation : ExtraBeeMutation.mutations) {
|
||||
Binnie.Genetics.getBeeRoot().registerMutation(mutation);
|
||||
}
|
||||
@@ -236,7 +234,9 @@ public class ExtraBeeMutation implements IBeeMutation {
|
||||
|
||||
@Override
|
||||
public boolean isPartner(IAllele allele) {
|
||||
return allele.getUID().equals(species0.getUID()) || allele.getUID().equals(species1.getUID());
|
||||
String uid = allele.getUID();
|
||||
return uid.equals(species0.getUID())
|
||||
|| uid.equals(species1.getUID());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -41,7 +41,7 @@ public enum Glassware {
|
||||
if (liquid == null) {
|
||||
return ExtraTrees.proxy.localise("item.glassware." + name().toLowerCase());
|
||||
}
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "item.glassware." + name().toLowerCase() + ".usage", liquid);
|
||||
return Binnie.I18N.localise(ExtraTrees.instance, "item.glassware." + name().toLowerCase() + ".usage", liquid);
|
||||
}
|
||||
|
||||
public int getCapacity() {
|
||||
|
||||
@@ -113,7 +113,7 @@ public class BlockBranch extends BlockLog implements IBlockMetadata {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
|
||||
@@ -194,13 +194,13 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
|
||||
String typeName = getDoorType(meta).getName();
|
||||
String woodName = WoodManager.getPlankType(meta & 0xFF).getName();
|
||||
if (typeName.equals("")) {
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.door.name", woodName);
|
||||
return Binnie.I18N.localise(ExtraTrees.instance, "block.door.name", woodName);
|
||||
}
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.door.name.adv", woodName, typeName);
|
||||
return Binnie.I18N.localise(ExtraTrees.instance, "block.door.name.adv", woodName, typeName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
|
||||
@@ -129,11 +129,11 @@ public class BlockETLog extends BlockLog implements IBlockMetadata {
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.log.name", ILogType.ExtraTreeLog.values()[meta].getName());
|
||||
return Binnie.I18N.localise(ExtraTrees.instance, "block.log.name", ILogType.ExtraTreeLog.values()[meta].getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -74,11 +74,11 @@ public class BlockETPlanks extends BlockWood implements IBlockMetadata {
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.plank.name", PlankType.ExtraTreePlanks.values()[meta].getName());
|
||||
return Binnie.I18N.localise(ExtraTrees.instance, "block.plank.name", PlankType.ExtraTreePlanks.values()[meta].getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
|
||||
@@ -82,11 +82,11 @@ public class BlockETSlab extends BlockWoodSlab implements IBlockMetadata {
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.woodslab.name", PlankType.ExtraTreePlanks.values()[meta].getName());
|
||||
return Binnie.I18N.localise(ExtraTrees.instance, "block.woodslab.name", PlankType.ExtraTreePlanks.values()[meta].getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -106,11 +106,11 @@ public class BlockETStairs extends BlockStairs implements IBlockMetadata {
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.woodstairs.name", WoodManager.getPlankType(meta + 32).getName());
|
||||
return Binnie.I18N.localise(ExtraTrees.instance, "block.woodstairs.name", WoodManager.getPlankType(meta + 32).getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -121,11 +121,11 @@ public class BlockFence extends net.minecraft.block.BlockFence implements IBlock
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.woodfence.name", getDescription(meta).getPlankType().getName());
|
||||
return Binnie.I18N.localise(ExtraTrees.instance, "block.woodfence.name", getDescription(meta).getPlankType().getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -104,11 +104,11 @@ public class BlockGate extends BlockFenceGate implements IBlockMetadata {
|
||||
@Override
|
||||
public String getBlockName(ItemStack itemStack) {
|
||||
int meta = TileEntityMetadata.getItemDamage(itemStack);
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.woodgate.name", WoodManager.getPlankType(meta).getName());
|
||||
return Binnie.I18N.localise(ExtraTrees.instance, "block.woodgate.name", WoodManager.getPlankType(meta).getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
public void addBlockTooltip(ItemStack itemStack, List tooltip) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -40,6 +40,6 @@ public class BlockMultiFence extends BlockFence implements IBlockMetadata {
|
||||
IPlankType type2 = getDescription(meta).getSecondaryPlankType();
|
||||
boolean twoTypes = type1 != type2;
|
||||
FenceType type3 = getDescription(meta).getFenceType();
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.woodslab.name" + (twoTypes ? "2" : ""), type3.getPrefix(), type1.getName(), type2.getName());
|
||||
return Binnie.I18N.localise(ExtraTrees.instance, "block.woodslab.name" + (twoTypes ? "2" : ""), type3.getPrefix(), type1.getName(), type2.getName());
|
||||
}
|
||||
}
|
||||
@@ -26,7 +26,7 @@ public class BlockCarpentry extends BlockDesign {
|
||||
|
||||
@Override
|
||||
public String getBlockName(DesignBlock design) {
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.woodentile.name", design.getDesign().getName());
|
||||
return Binnie.I18N.localise(ExtraTrees.instance, "block.woodentile.name", design.getDesign().getName());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public class BlockCarpentryPanel extends BlockCarpentry {
|
||||
@Override
|
||||
public String getBlockName(ItemStack stack) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.woodenpanel.name", block.getDesign().getName());
|
||||
return Binnie.I18N.localise(ExtraTrees.instance, "block.woodenpanel.name", block.getDesign().getName());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -101,8 +101,8 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
|
||||
return getBlockName(block);
|
||||
}
|
||||
|
||||
public abstract String getBlockName(DesignBlock p0);
|
||||
|
||||
public abstract String getBlockName(DesignBlock design);
|
||||
|
||||
public DesignBlock getCarpentryBlock(IBlockAccess world, int x, int y, int z) {
|
||||
return ModuleCarpentry.getDesignBlock(getDesignSystem(), TileEntityMetadata.getTileMetadata(world, x, y, z));
|
||||
}
|
||||
@@ -130,7 +130,7 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getBlockTooltip(ItemStack stack, List tooltip) {
|
||||
public void addBlockTooltip(ItemStack stack, List tooltip) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
if (block.getPrimaryMaterial() != block.getSecondaryMaterial()) {
|
||||
tooltip.add(block.getPrimaryMaterial().getName() + " and " + block.getSecondaryMaterial().getName());
|
||||
|
||||
@@ -59,6 +59,6 @@ public class BlockStainedDesign extends BlockDesign {
|
||||
|
||||
@Override
|
||||
public String getBlockName(DesignBlock design) {
|
||||
return Binnie.Language.localise(ExtraTrees.instance, "block.stainedglass.name", design.getDesign().getName());
|
||||
return Binnie.I18N.localise(ExtraTrees.instance, "block.stainedglass.name", design.getDesign().getName());
|
||||
}
|
||||
}
|
||||
@@ -144,7 +144,7 @@ public class ControlTileSelect extends Control implements IControlValue<IDesign>
|
||||
|
||||
@Override
|
||||
public void getTooltip(Tooltip tooltip) {
|
||||
tooltip.add(Binnie.Language.localise(BinnieCore.instance, "gui.designer.pattern", getValue().getName()));
|
||||
tooltip.add(Binnie.I18N.localise(BinnieCore.instance, "gui.designer.pattern", getValue().getName()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,18 +17,7 @@ public class WorldGenPalm {
|
||||
width = 1.55f;
|
||||
}
|
||||
|
||||
float f = 0.0f;
|
||||
float h = leafSpawn;
|
||||
leafSpawn = h - 1.0f;
|
||||
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
|
||||
float f2 = 0.0f;
|
||||
float h2 = leafSpawn;
|
||||
leafSpawn = h2 - 1.0f;
|
||||
generateCylinder(new Vector(f2, h2, 0.0f), width, 1, leaf, false);
|
||||
float f3 = 0.0f;
|
||||
float h3 = leafSpawn;
|
||||
leafSpawn = h3 - 1.0f;
|
||||
generateCylinder(new Vector(f3, h3, 0.0f), width - 0.6f, 1, leaf, false);
|
||||
generateCylinder(new Vector(0, leafSpawn, 0.0f), width - 0.6f, 1, leaf, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -173,18 +173,19 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
Candlenut("aleurites", "moluccana", 0x8aa36c, 0x8aa36c, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Candlenut, WorldGenLazy.Tree.class),
|
||||
DwarfHazel("Corylus", "americana", 0x9bb552, 0x9be152, ILogType.ExtraTreeLog.Hazel, ExtraTreeFruitGene.Hazelnut, WorldGenShrub.Shrub.class);
|
||||
|
||||
ArrayList<IFruitFamily> families;
|
||||
int girth;
|
||||
Class<? extends WorldGenerator> gen;
|
||||
IAlleleFruit fruit;
|
||||
IAllele[] template;
|
||||
int color;
|
||||
String binomial;
|
||||
String uid;
|
||||
ILogType wood;
|
||||
String branchName;
|
||||
IClassification branch;
|
||||
int colorPollineted;
|
||||
protected ArrayList<IFruitFamily> families;
|
||||
protected int girth;
|
||||
protected Class<? extends WorldGenerator> gen;
|
||||
protected IAlleleFruit fruit;
|
||||
protected IAllele[] template;
|
||||
protected int color;
|
||||
protected String binomial;
|
||||
protected String uid;
|
||||
protected ILogType wood;
|
||||
protected String branchName;
|
||||
protected IClassification branch;
|
||||
protected int colorPollineted;
|
||||
|
||||
private LeafType leafType;
|
||||
private SaplingType saplingType;
|
||||
|
||||
@@ -985,7 +986,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
|
||||
ExtraTreeSpecies.Coconut
|
||||
.addFamily(familyJungle)
|
||||
.setHeight(ForestryAllele.TreeHeight.Smaller)
|
||||
.setHeight(ForestryAllele.TreeHeight.Larger)
|
||||
.setFertility(ForestryAllele.Saplings.Low)
|
||||
.setYield(ForestryAllele.Yield.Average)
|
||||
.setMaturation(ForestryAllele.Maturation.Fast);
|
||||
@@ -1248,7 +1249,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
|
||||
public WorldGenerator getGenerator(ITreeGenData tree) {
|
||||
if (gen != null) {
|
||||
try {
|
||||
return gen.getConstructor(ITree.class).newInstance(tree);
|
||||
return gen.getConstructor(ITreeGenData.class).newInstance(tree);
|
||||
} catch (Exception ex) {
|
||||
// ignored
|
||||
}
|
||||
|
||||
@@ -107,7 +107,7 @@ public class AnalystPageSoil extends ControlAnalystPage {
|
||||
new ControlToleranceBar<EnumMoisture>(parent, x, y, w, h, EnumMoisture.class) {
|
||||
@Override
|
||||
protected String getName(EnumMoisture value) {
|
||||
return Binnie.Language.localise(value);
|
||||
return Binnie.I18N.localise(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -121,7 +121,7 @@ public class AnalystPageSoil extends ControlAnalystPage {
|
||||
new ControlToleranceBar<EnumAcidity>(parent, x, y, w, h, EnumAcidity.class) {
|
||||
@Override
|
||||
protected String getName(EnumAcidity value) {
|
||||
return Binnie.Language.localise(value);
|
||||
return Binnie.I18N.localise(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -35,17 +35,19 @@ import java.util.Random;
|
||||
|
||||
public class Sequencer {
|
||||
public static int[] slotReserve = new int[]{1, 2, 3, 4};
|
||||
public static int slotDye = 0;
|
||||
public static int slotTarget = 5;
|
||||
public static int slotDone = 6;
|
||||
public static int slotDyeIndex = 0;
|
||||
public static int slotTargetIndex = 5;
|
||||
public static int slotDoneIndex = 6;
|
||||
public static BinnieIcon fxSeqA;
|
||||
public static BinnieIcon fxSeqG;
|
||||
public static BinnieIcon fxSeqT;
|
||||
public static BinnieIcon fxSeqC;
|
||||
|
||||
private static ComponentSequencerLogic logic;
|
||||
|
||||
public static class PackageSequencer extends GeneticMachine.PackageGeneticBase implements IMachineInformation {
|
||||
public PackageSequencer() {
|
||||
super("sequencer", GeneticsTexture.Sequencer, 12058418, true);
|
||||
super("sequencer", GeneticsTexture.Sequencer, 0xb7ff32, true);
|
||||
Sequencer.fxSeqA = Binnie.Resource.getBlockIcon(Genetics.instance, "fx/sequencer.a");
|
||||
Sequencer.fxSeqG = Binnie.Resource.getBlockIcon(Genetics.instance, "fx/sequencer.g");
|
||||
Sequencer.fxSeqT = Binnie.Resource.getBlockIcon(Genetics.instance, "fx/sequencer.t");
|
||||
@@ -56,30 +58,34 @@ public class Sequencer {
|
||||
public void createMachine(Machine machine) {
|
||||
new ComponentGeneticGUI(machine, GeneticsGUI.Sequencer);
|
||||
ComponentInventorySlots inventory = new ComponentInventorySlots(machine);
|
||||
inventory.addSlot(0, "dye");
|
||||
inventory.getSlot(0).setValidator(new SlotValidator.Item(GeneticsItems.FluorescentDye.get(1), ModuleMachine.IconDye));
|
||||
inventory.getSlot(0).forbidExtraction();
|
||||
inventory.addSlotArray(Sequencer.slotReserve, "input");
|
||||
|
||||
for (InventorySlot slot : inventory.getSlots(Sequencer.slotReserve)) {
|
||||
InventorySlot slotDye = inventory.addSlot(slotDyeIndex, "dye");
|
||||
slotDye.setValidator(new SlotValidator.Item(GeneticsItems.FluorescentDye.get(1), ModuleMachine.IconDye));
|
||||
slotDye.forbidExtraction();
|
||||
|
||||
inventory.addSlotArray(slotReserve, "input");
|
||||
for (InventorySlot slot : inventory.getSlots(slotReserve)) {
|
||||
slot.setValidator(new SlotValidatorUnsequenced());
|
||||
slot.forbidExtraction();
|
||||
}
|
||||
|
||||
inventory.addSlot(5, "process");
|
||||
inventory.getSlot(5).setValidator(new SlotValidatorUnsequenced());
|
||||
inventory.getSlot(5).setReadOnly();
|
||||
inventory.getSlot(5).forbidInteraction();
|
||||
InventorySlot slotTarget = inventory.addSlot(slotTargetIndex, "process");
|
||||
slotTarget.setValidator(new SlotValidatorUnsequenced());
|
||||
slotTarget.setReadOnly();
|
||||
slotTarget.forbidInteraction();
|
||||
|
||||
inventory.addSlot(6, "output");
|
||||
inventory.getSlot(6).setReadOnly();
|
||||
InventorySlot slotDone = inventory.addSlot(slotDoneIndex, "output");
|
||||
slotDone.setReadOnly();
|
||||
|
||||
ComponentInventoryTransfer transfer = new ComponentInventoryTransfer(machine);
|
||||
transfer.addRestock(Sequencer.slotReserve, 5, 1);
|
||||
new ComponentChargedSlots(machine).addCharge(0);
|
||||
transfer.addRestock(slotReserve, slotTargetIndex, 1);
|
||||
|
||||
new ComponentChargedSlots(machine).addCharge(slotDyeIndex);
|
||||
new ComponentPowerReceptor(machine, 10000);
|
||||
new ComponentSequencerLogic(machine);
|
||||
logic = new ComponentSequencerLogic(machine);
|
||||
new ComponentSequencerFX(machine);
|
||||
|
||||
transfer.setTransferListener(logic);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -88,16 +94,17 @@ public class Sequencer {
|
||||
}
|
||||
}
|
||||
|
||||
public static class ComponentSequencerLogic extends ComponentProcess implements IProcess {
|
||||
public static class ComponentSequencerLogic extends ComponentProcess implements IProcess, ComponentInventoryTransfer.ITransferRestockListener {
|
||||
public ComponentSequencerLogic(Machine machine) {
|
||||
super(machine);
|
||||
}
|
||||
|
||||
public float getSequenceStrength() {
|
||||
ItemStack stack = getUtil().getStack(5);
|
||||
ItemStack stack = getUtil().getStack(slotTargetIndex);
|
||||
if (stack == null) {
|
||||
return 1.0f;
|
||||
}
|
||||
|
||||
float mult = 1.0f - stack.getItemDamage() % 6 / 5.0f;
|
||||
return 1.0f - mult * mult * 0.75f;
|
||||
}
|
||||
@@ -114,8 +121,8 @@ public class Sequencer {
|
||||
|
||||
@Override
|
||||
public ErrorState canWork() {
|
||||
if (getUtil().isSlotEmpty(5)) {
|
||||
return new ErrorState.NoItem("No DNA sequence", 5);
|
||||
if (getUtil().isSlotEmpty(slotTargetIndex)) {
|
||||
return new ErrorState.NoItem("No DNA sequence", slotTargetIndex);
|
||||
}
|
||||
return super.canWork();
|
||||
}
|
||||
@@ -125,19 +132,26 @@ public class Sequencer {
|
||||
if (getMachine().getOwner() == null) {
|
||||
return new ErrorState("No Owner", "Replace this block to claim this machine");
|
||||
}
|
||||
if (getUtil().getSlotCharge(0) == 0.0f) {
|
||||
return new ErrorState.NoItem("Insufficient Dye", 0);
|
||||
if (getUtil().getSlotCharge(slotDyeIndex) == 0.0f) {
|
||||
return new ErrorState.NoItem("Insufficient Dye", slotDyeIndex);
|
||||
}
|
||||
if (getUtil().getStack(6) != null && getUtil().getStack(6).stackSize >= 64) {
|
||||
return new ErrorState.NoSpace("No space for empty sequences", new int[]{6});
|
||||
|
||||
ItemStack stack = getUtil().getStack(slotDoneIndex);
|
||||
if (stack != null && stack.stackSize >= 64) {
|
||||
return new ErrorState.NoSpace("No space for empty sequences", new int[]{slotDoneIndex});
|
||||
}
|
||||
return super.canProgress();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onRestock(int target) {
|
||||
onStartTask();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStartTask() {
|
||||
super.onStartTask();
|
||||
ItemStack item = getUtil().getStack(5);
|
||||
ItemStack item = getUtil().getStack(slotTargetIndex);
|
||||
SequencerItem seqItem = new SequencerItem(item);
|
||||
int seq = seqItem.sequenced;
|
||||
if (seq != 0) {
|
||||
@@ -149,26 +163,26 @@ public class Sequencer {
|
||||
protected void onFinishTask() {
|
||||
super.onFinishTask();
|
||||
updateSequence();
|
||||
SequencerItem seqItem = new SequencerItem(getUtil().getStack(5));
|
||||
SequencerItem seqItem = new SequencerItem(getUtil().getStack(slotTargetIndex));
|
||||
GeneTracker.getTracker(getMachine().getWorld(), getMachine().getOwner()).registerGene(seqItem.getGene());
|
||||
getUtil().decreaseStack(5, 1);
|
||||
getUtil().decreaseStack(slotTargetIndex, 1);
|
||||
|
||||
if (getUtil().getStack(6) == null) {
|
||||
getUtil().setStack(6, GeneticsItems.EmptySequencer.get(1));
|
||||
if (getUtil().getStack(slotDoneIndex) == null) {
|
||||
getUtil().setStack(slotDoneIndex, GeneticsItems.EmptySequencer.get(1));
|
||||
} else {
|
||||
getUtil().decreaseStack(6, -1);
|
||||
getUtil().decreaseStack(slotDoneIndex, -1);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onTickTask() {
|
||||
updateSequence();
|
||||
getUtil().useCharge(0, 0.4f * getProgressPerTick() / 100.0f);
|
||||
getUtil().useCharge(slotDyeIndex, 0.4f * getProgressPerTick() / 100.0f);
|
||||
}
|
||||
|
||||
private void updateSequence() {
|
||||
int prog = (int) getProgress();
|
||||
ItemStack item = getUtil().getStack(5);
|
||||
ItemStack item = getUtil().getStack(slotTargetIndex);
|
||||
SequencerItem seqItem = new SequencerItem(item);
|
||||
int seq = seqItem.sequenced;
|
||||
if (prog != seq) {
|
||||
@@ -189,6 +203,7 @@ public class Sequencer {
|
||||
if (!getUtil().getProcess().isInProgress()) {
|
||||
return;
|
||||
}
|
||||
|
||||
BinnieCore.proxy.getMinecraftInstance().effectRenderer.addEffect(new EntityFX(world, x + 0.5, y + 1.2 + rand.nextDouble() * 0.2, z + 0.5, 0.0, 0.0, 0.0) {
|
||||
double axisX = posX;
|
||||
double axisZ = posZ;
|
||||
@@ -237,7 +252,13 @@ public class Sequencer {
|
||||
particleGravity = 0.0f;
|
||||
noClip = true;
|
||||
particleScale = 2.0f;
|
||||
setParticleIcon((new BinnieIcon[]{Sequencer.fxSeqA, Sequencer.fxSeqG, Sequencer.fxSeqC, Sequencer.fxSeqT})[rand.nextInt(4)].getIcon());
|
||||
|
||||
setParticleIcon((new BinnieIcon[]{
|
||||
fxSeqA,
|
||||
fxSeqG,
|
||||
fxSeqC,
|
||||
fxSeqT
|
||||
})[rand.nextInt(4)].getIcon());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in new issue
Block a user