Tabnine Logo
ItemStackList.get
Code IndexAdd Tabnine to your IDE (free)

How to use
get
method
in
slimeknights.mantle.util.ItemStackList

Best Java code snippets using slimeknights.mantle.util.ItemStackList.get (Showing top 5 results out of 315)

origin: SlimeKnights/TinkersConstruct

 protected ItemStackList getDemoTools(ItemStack[][] inputItems) {
  ItemStackList demo = ItemStackList.withSize(tool.size());

  for(int i = 0; i < tool.size(); i++) {
   if(tool.get(i) instanceof ToolCore) {
    ToolCore core = (ToolCore) tool.get(i);
    List<Material> mats = ImmutableList.of(TinkerMaterials.wood, TinkerMaterials.cobalt, TinkerMaterials.ardite, TinkerMaterials.manyullyn);
    mats = mats.subList(0, core.getRequiredComponents().size());
    demo.set(i, ((ToolCore) tool.get(i)).buildItemForRendering(mats));
   }
   else if(tool != null) {
    demo.set(i, new ItemStack(tool.get(i)));
   }

   if(!demo.get(i).isEmpty()) {
    modifier.apply(demo.get(i));
   }
  }

  return demo;
 }
}
origin: SlimeKnights/TinkersConstruct

 @Override
 protected ItemStackList getDemoTools(ItemStack[][] inputItems) {
  if(inputItems.length == 0) {
   return ItemStackList.create();
  }

  ItemStackList demo = super.getDemoTools(inputItems);

  ItemStackList out = ItemStackList.create();

  for(int i = 0; i < inputItems[0].length; i++) {
   if(inputItems[0][i].getItem() == TinkerTools.sharpeningKit) {
    Material material = TinkerTools.sharpeningKit.getMaterial(inputItems[0][i]);
    IModifier modifier = TinkerRegistry.getModifier("fortify" + material.getIdentifier());
    if(modifier != null) {
     ItemStack stack = demo.get(i % demo.size()).copy();
     modifier.apply(stack);
     out.add(stack);
    }
   }
  }

  return out;
 }
}
origin: SlimeKnights/Mantle

/**
 * Checks if an Itemstack at a specific index is not empty
 *
 * @param index The index to check
 * @return true if the itemstack at index <i>index</i> is not empty, false otherwise or if the index is out of bounds
 */
public boolean hasItem(int index) {
 return index >= 0 && index < size() && !get(index).isEmpty();
}
origin: SlimeKnights/Mantle

/**
 * Creates a new list with the same content. ItemStacks are shared between lists!
 * @param fixed If true the list will have fixed size
 */
public ItemStackList copy(boolean fixed) {
 ItemStackList copy = fixed ? withSize(this.size()) : create();
 for(int i = 0; i < size(); i++) {
  copy.set(i, get(i));
 }
 return copy;
}
origin: SlimeKnights/Mantle

 /**
  * Creates a new list with the same content, but Itemstacks are copied too,
  * meaning changes to the copy will not affect the itemstacks in the original list.
  * @param fixed If true the list will have fixed size
  */
 public ItemStackList deepCopy(boolean fixed) {
  ItemStackList copy = fixed ? withSize(this.size()) : create();
  for(int i = 0; i < size(); i++) {
   copy.set(i, get(i).copy());
  }
  return copy;
 }
}
slimeknights.mantle.utilItemStackListget

Popular methods of ItemStackList

  • add
  • create
  • set
  • size
  • withSize
    Create an empty ItemStackList with the given size
  • <init>
  • addAll
  • of
    Create an ItemStackList from the given elements.

Popular in Java

  • Start an intent from android
  • setContentView (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSupportFragmentManager (FragmentActivity)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now