Tabnine Logo
BaubleType.getValidSlots
Code IndexAdd Tabnine to your IDE (free)

How to use
getValidSlots
method
in
baubles.api.BaubleType

Best Java code snippets using baubles.api.BaubleType.getValidSlots (Showing top 5 results out of 315)

origin: SquidDev-CC/plethora

@Nullable
@Optional.Method(modid = Baubles.MODID)
public static TinySlot getBauble(@Nonnull EntityPlayer player) {
  IBaublesItemHandler handler = BaublesApi.getBaublesHandler(player);
  for (int slot : getBaubleType().getValidSlots()) {
    ItemStack stack = handler.getStackInSlot(slot);
    if (stack.getItem() == Registry.itemNeuralInterface) {
      return new TinySlot.BaublesSlot(stack, handler, slot);
    }
  }
  return null;
}
origin: TeamWizardry/Wizardry

  @Override
  @Optional.Method(modid = "baubles")
  public Iterable<ItemStack> get(EntityLivingBase entity) {
    if (!(entity instanceof EntityPlayer)) return entity.getArmorInventoryList();
    if (BaublesApi.getBaublesHandler((EntityPlayer) entity) == null) return entity.getArmorInventoryList();
    ImmutableList.Builder<ItemStack> stacks = ImmutableList.builder();
    IBaublesItemHandler inv = BaublesApi.getBaublesHandler((EntityPlayer) entity);
    for (BaubleType type : BaubleType.values())
      for (int slot : type.getValidSlots()) {
        stacks.add(inv.getStackInSlot(slot));
      }
    return stacks.build();
  }
}
origin: SquidDev-CC/plethora

@Override
@Optional.Method(modid = Baubles.MODID)
public void onWornTick(ItemStack stack, EntityLivingBase player) {
  if (!(player instanceof EntityPlayer)) return;
  IBaublesItemHandler handler = BaublesApi.getBaublesHandler((EntityPlayer) player);
  for (int slot : NeuralHelpers.getBaubleType().getValidSlots()) {
    ItemStack slotStack = handler.getStackInSlot(slot);
    if (slotStack == stack) {
      onUpdate(stack, new TinySlot.BaublesSlot(stack, handler, slot), player, true);
    }
  }
}
origin: SquidDev-CC/plethora

@Override
@Nonnull
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, @Nonnull EnumHand hand) {
  // Check if the entity we've just hit has a stack in the first slot. If so, use that instead.
  ItemStack stack = player.getHeldItem(hand);
  RayTraceResult hit = PlayerHelpers.findHitGuess(player);
  Entity entity = hit.entityHit;
  if (hit.typeOfHit == RayTraceResult.Type.ENTITY && !(entity instanceof EntityPlayer) && entity instanceof EntityLivingBase) {
    if (((EntityLivingBase) entity).getItemStackFromSlot(NeuralHelpers.ARMOR_SLOT).isEmpty() && stack.getCount() == 1) {
      return ActionResult.newResult(EnumActionResult.SUCCESS, stack);
    }
  }
  if (LoadedCache.hasBaubles()) {
    IBaublesItemHandler handler = BaublesApi.getBaublesHandler(player);
    for (int slot : NeuralHelpers.getBaubleType().getValidSlots()) {
      if (handler.getStackInSlot(slot).isEmpty()) {
        if (!world.isRemote) {
          handler.setStackInSlot(slot, stack.copy());
          if (!player.capabilities.isCreativeMode) stack.grow(-1);
        }
        return ActionResult.newResult(EnumActionResult.SUCCESS, stack);
      }
    }
  }
  return super.onItemRightClick(world, player, hand);
}
origin: Azanor/Baubles

for (int baubleSlot : bauble.getBaubleType(itemstack).getValidSlots()) {
  if ( bauble.canEquip(itemstack1, thePlayer) && !((Slot)this.inventorySlots.get(baubleSlot+9)).getHasStack() &&
      !this.mergeItemStack(itemstack1, baubleSlot+9, baubleSlot + 10, false))
baubles.apiBaubleTypegetValidSlots

Popular methods of BaubleType

  • values
  • hasSlot
  • valueOf

Popular in Java

  • Running tasks concurrently on multiple threads
  • addToBackStack (FragmentTransaction)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • getSystemService (Context)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • ConcurrentHashMap (java.util.concurrent)
    A plug-in replacement for JDK1.5 java.util.concurrent.ConcurrentHashMap. This version is based on or
  • 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
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • Loader (org.hibernate.loader)
    Abstract superclass of object loading (and querying) strategies. This class implements useful common
  • Top 12 Jupyter Notebook extensions
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