Package forestry.api.genetics

Examples of forestry.api.genetics.ISpeciesRoot


  public boolean onItemPickup(EntityPlayer entityPlayer, EntityItem entityitem) {
    ItemStack itemstack = entityitem.getEntityItem();
    if (itemstack == null || itemstack.stackSize <= 0)
      return false;

    ISpeciesRoot root = AlleleManager.alleleRegistry.getSpeciesRoot(itemstack);
    if(root != null)
      root.getBreedingTracker(entityitem.worldObj, entityPlayer.getGameProfile()).registerPickup(root.getMember(itemstack));

    return true;
  }
View Full Code Here


    return null;
  }

  public GuiNaturalistInventory getNaturalistChestGui(String rootUID, EntityPlayer player, World world, int x, int y, int z, int page) {
    TileNaturalistChest tile = (TileNaturalistChest) getTileForestry(world, x, y, z);
    ISpeciesRoot speciesRoot = AlleleManager.alleleRegistry.getSpeciesRoot(rootUID);
    return new GuiNaturalistInventory(speciesRoot, player, new ContainerNaturalistInventory(speciesRoot, player.inventory, tile, page, 25), tile, page, 5);
  }
View Full Code Here

    ISpeciesRoot speciesRoot = AlleleManager.alleleRegistry.getSpeciesRoot(rootUID);
    return new GuiNaturalistInventory(speciesRoot, player, new ContainerNaturalistInventory(speciesRoot, player.inventory, tile, page, 25), tile, page, 5);
  }

  public ContainerNaturalistInventory getNaturalistChestContainer(String rootUID, EntityPlayer player, World world, int x, int y, int z, int page) {
    ISpeciesRoot speciesRoot = AlleleManager.alleleRegistry.getSpeciesRoot(rootUID);
    speciesRoot.getBreedingTracker(world, player.getGameProfile()).synchToPlayer(player);
    return new ContainerNaturalistInventory(speciesRoot,
        player.inventory, (TileNaturalistChest) getTileForestry(world, x, y, z), page, 25);
  }
View Full Code Here

    case ApiaristBackpackGUI:
      equipped = getBackpackItem(player);
      if (equipped == null)
        return null;
      ISpeciesRoot speciesRoot = AlleleManager.alleleRegistry.getSpeciesRoot("rootBees");
      PagedInventory inventory = new PagedInventory(ItemBackpack.class, Defaults.SLOTS_BACKPACK_APIARIST, equipped, x, y, z, cleanId);
      return new GuiNaturalistInventory(speciesRoot, player, new ContainerNaturalistBackpack(speciesRoot, player.inventory, inventory, guiData, 25), inventory, guiData, 5);

    case BackpackGUI:
      equipped = getBackpackItem(player);
View Full Code Here

    case ApiaristBackpackGUI:
      equipped = getBackpackItem(player);
      if (equipped == null)
        return null;

      ISpeciesRoot speciesRoot = AlleleManager.alleleRegistry.getSpeciesRoot("rootBees");
      speciesRoot.getBreedingTracker(world, player.getGameProfile()).synchToPlayer(player);
      return new ContainerNaturalistBackpack(speciesRoot, player.inventory, new PagedInventory(ItemBackpack.class, Defaults.SLOTS_BACKPACK_APIARIST, equipped, x, y, z, cleanId), guiData, 25);

    case BackpackGUI:
      equipped = getBackpackItem(player);
      if (equipped == null)
        return null;

      return new ContainerBackpack(player, new ItemInventory(ItemBackpack.class, Defaults.SLOTS_BACKPACK_DEFAULT, equipped));

    case BackpackT2GUI:
      equipped = getBackpackItem(player);
      if (equipped == null)
        return null;

      return new ContainerBackpack(player, new ItemInventory(ItemBackpack.class, Defaults.SLOTS_BACKPACK_T2, equipped));

    case LepidopteristBackpackGUI:
      equipped = getBackpackItem(player);
      if (equipped == null)
        return null;

      speciesRoot = AlleleManager.alleleRegistry.getSpeciesRoot("rootButterflies");
      speciesRoot.getBreedingTracker(world, player.getGameProfile()).synchToPlayer(player);
      return new ContainerNaturalistBackpack(speciesRoot, player.inventory, new PagedInventory(ItemBackpack.class, Defaults.SLOTS_BACKPACK_APIARIST, equipped, x, y, z, cleanId), guiData, 25);

    default:
      return null;
View Full Code Here

    EntityPlayer player = Proxies.common.getPlayer();
    IBreedingTracker tracker = null;
    String type = packet.getTagCompound().getString("TYPE");

    ISpeciesRoot root = AlleleManager.alleleRegistry.getSpeciesRoot(type);
    if(root != null)
      tracker = root.getBreedingTracker(Proxies.common.getRenderWorld(), player.getGameProfile());
    if (tracker != null) {
      tracker.decodeFromNBT(packet.getTagCompound());
      MinecraftForge.EVENT_BUS.post(new ForestryEvent.SyncedBreedingTracker(tracker, player));
    }
  }
View Full Code Here

    return getSpeciesRoot(stack) != null;
  }

  @Override
  public IIndividual getIndividual(ItemStack stack) {
    ISpeciesRoot root = getSpeciesRoot(stack);
    if(root == null)
      return null;

    return root.getMember(stack);
  }
View Full Code Here

    isEnded = false;
    bountyLevel = BOUNTY_MAX;
    gameTokens = new GameToken[boardSize];

    ISpeciesRoot root = individual.getGenome().getPrimary().getRoot();
    ArrayList<ItemStack> pairs = new ArrayList<ItemStack>();
    for(int i = 0; i < boardSize / 2; i++) {
      IIndividual token = root.templateAsIndividual(root.getRandomTemplate(rand));
      pairs.add(root.getMemberStack(token, 0));
    }

    boolean first = true;
    for(ItemStack pair : pairs) {
      if(first) {
View Full Code Here

TOP

Related Classes of forestry.api.genetics.ISpeciesRoot

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.