congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
BaubleType
Code IndexAdd Tabnine to your IDE (free)

How to use
BaubleType
in
baubles.api

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

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: SleepyTrousers/EnderIO

@Override
@Method(modid = "Baubles|API")
public BaubleType getBaubleType(ItemStack itemstack) {
 BaubleType t = null;
 try {
  t = BaubleType.valueOf(ItemConfig.magnetBaublesType.get());
 } catch (Exception e) {
  // NOP
 }
 return t != null ? t : BaubleType.AMULET;
}
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: PrinceOfAmber/Cyclic

@Override
@Optional.Method(modid = "baubles")
public baubles.api.BaubleType getBaubleType(ItemStack arg0) {
 try {
  if (baubles.api.BaubleType.values().length >= 4) { //length is 4 if trinket
   return baubles.api.BaubleType.TRINKET;
  }
  else {
   return baubles.api.BaubleType.RING;
  }
 }
 catch (Exception e) {
  return baubles.api.BaubleType.RING;
 }
}
origin: Azanor/Baubles

/**
 * Returns true if automation is allowed to insert the given stack (ignoring
 * stack size) into the given slot.
 */
@Override
public boolean isItemValidForSlot(int slot, ItemStack stack, EntityLivingBase player) {
  if (stack==null || stack.isEmpty() || !stack.hasCapability(BaublesCapabilities.CAPABILITY_ITEM_BAUBLE, null))
    return false;
  IBauble bauble = stack.getCapability(BaublesCapabilities.CAPABILITY_ITEM_BAUBLE, null);
  return bauble.canEquip(stack, player) && bauble.getBaubleType(stack).hasSlot(slot);
}
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.apiBaubleType

Most used methods

  • getValidSlots
  • values
  • hasSlot
  • valueOf

Popular in Java

  • Reactive rest calls using spring rest template
  • getExternalFilesDir (Context)
  • setScale (BigDecimal)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • Container (java.awt)
    A generic Abstract Window Toolkit(AWT) container object is a component that can contain other AWT co
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • JFrame (javax.swing)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Github Copilot alternatives
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