@Override public boolean isValid(ItemStack value) { return AlleleManager.alleleRegistry.isIndividual(value) || Binnie.GENETICS.getConversion(value) != null; } }
@Nullable private Integer getInputSlotIndex() { for (int slotIndex = 0; slotIndex < invInput.getSizeInventory(); slotIndex++) { ItemStack inputStack = invInput.getStackInSlot(slotIndex); if (AlleleManager.alleleRegistry.isIndividual(inputStack)) { return slotIndex; } } return null; }
@Override public boolean canSlotAccept(int slotIndex, ItemStack itemStack) { if (SlotUtil.isSlotInRange(slotIndex, SLOT_INPUT_1, SLOT_INPUT_COUNT)) { return AlleleManager.alleleRegistry.isIndividual(itemStack) || GeneticsUtil.getGeneticEquivalent(itemStack) != null; } else if (slotIndex == SLOT_CAN) { FluidStack fluid = FluidUtil.getFluidContained(itemStack); return fluid != null && tile.getTankManager().canFillFluidType(fluid); } return false; }
private void refreshSpecies() { final ItemStack item = this.getWindowInventory().getStackInSlot(INDIVIDUAL_SLOT); if (item.isEmpty() || !AlleleManager.alleleRegistry.isIndividual(item)) { return;
@Override public void setInventorySlotContents(int slotIndex, ItemStack itemstack) { super.setInventorySlotContents(slotIndex, itemstack); if (slotIndex == SLOT_ANALYZE) { if (!AlleleManager.alleleRegistry.isIndividual(getStackInSlot(SLOT_ANALYZE)) && !getStackInSlot(SLOT_ANALYZE).isEmpty()) { ItemStack ersatz = GeneticsUtil.convertToGeneticEquivalent(getStackInSlot(SLOT_ANALYZE)); if (AlleleManager.alleleRegistry.isIndividual(ersatz)) { super.setInventorySlotContents(SLOT_ANALYZE, ersatz); } } World world = tile.getWorld(); if (world != null && !world.isRemote) { EscritoireGame game = tile.getGame(); game.initialize(getStackInSlot(SLOT_ANALYZE)); } } } }
@Override public boolean canSlotAccept(int slotIndex, ItemStack itemStack) { if (slotIndex >= SLOT_INPUT_1 && slotIndex < SLOT_INPUT_1 + tile.getGame().getSampleSize(SLOTS_INPUT_COUNT)) { ItemStack specimen = getStackInSlot(SLOT_ANALYZE); if (specimen.isEmpty()) { return false; } IIndividual individual = AlleleManager.alleleRegistry.getIndividual(specimen); return individual != null && individual.getGenome().getPrimary().getResearchSuitability(itemStack) > 0; } return slotIndex == SLOT_ANALYZE && (AlleleManager.alleleRegistry.isIndividual(itemStack) || GeneticsUtil.getGeneticEquivalent(itemStack) != null); }
if (focusValue instanceof ItemStack) { ItemStack focusStack = (ItemStack) focusValue; if (AlleleManager.alleleRegistry.isIndividual(focusStack)) { if (focus.getMode() == IFocus.Mode.INPUT) { ItemStack serum = recipeWrapper.getInputSerum();