Package net.mcft.copy.betterstorage.item

Examples of net.mcft.copy.betterstorage.item.IDyeableItem


    boolean hasArmor = false;
    boolean hasDyes = false;
    for (int i = 0; i < crafting.getSizeInventory(); i++) {
      ItemStack stack = crafting.getStackInSlot(i);
      if (stack == null) continue;
      IDyeableItem dyeable = ((stack.getItem() instanceof IDyeableItem)
          ? (IDyeableItem)stack.getItem() : null);
      if ((dyeable != null) && dyeable.canDye(stack)) {
        if (hasArmor) return false;
        hasArmor = true;
      } else if (DyeUtils.isDye(stack)) hasDyes = true;
      else return false;
    }
View Full Code Here


  }
 
  @Override
  public ItemStack getCraftingResult(InventoryCrafting crafting) {
    ItemStack armor = null;
    IDyeableItem dyeable = null;
    List<ItemStack> dyes = new ArrayList<ItemStack>();
    for (int i = 0; i < crafting.getSizeInventory(); i++) {
      ItemStack stack = crafting.getStackInSlot(i);
      if (stack == null) continue;
      dyeable = ((stack.getItem() instanceof IDyeableItem)
          ? (IDyeableItem)stack.getItem() : null);
      if ((dyeable != null) && dyeable.canDye(stack)) {
        if (armor != null) return null;
        armor = stack.copy();
      } else if (DyeUtils.isDye(stack)) dyes.add(stack);
      else return null;
    }
View Full Code Here

   
    // Use cauldron to remove color from dyable items
    if (rightClick && (block == Blocks.cauldron)) {
      int metadata = world.getBlockMetadata(x, y, z);
      if (metadata > 0) {
        IDyeableItem dyeable = (((holding != null) && (holding.getItem() instanceof IDyeableItem))
            ? (IDyeableItem)holding.getItem() : null);
        if ((dyeable != null) && (dyeable.canDye(holding))) {
          StackUtils.remove(holding, "display", "color");
          world.setBlockMetadataWithNotify(x, y, z, metadata - 1, 2);
          world.func_147453_f(x, y, z, block);
         
          event.useBlock = Result.DENY;
View Full Code Here

TOP

Related Classes of net.mcft.copy.betterstorage.item.IDyeableItem

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.