當前位置: 首頁>>代碼示例>>Java>>正文


Java BaubleType.RING屬性代碼示例

本文整理匯總了Java中baubles.api.BaubleType.RING屬性的典型用法代碼示例。如果您正苦於以下問題:Java BaubleType.RING屬性的具體用法?Java BaubleType.RING怎麽用?Java BaubleType.RING使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在baubles.api.BaubleType的用法示例。


在下文中一共展示了BaubleType.RING屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: isItemValid

@Override
public boolean isItemValid(ItemStack stack) {
    Item item = stack.getItem();
    if (type >= ARMOR_HELMET && type <= ARMOR_BOOTS) {
        return item != null && item.isValidArmor(stack, type, null);
    } else if (GearSwap.baubles && type >= BAUBLE_RING && type <= BAUBLE_BELT) {
        if (item == null) {
            return false;
        }
        if (!(item instanceof IBauble)) {
            return false;
        }
        IBauble bauble = (IBauble) item;
        BaubleType baubleType = bauble.getBaubleType(stack);
        return (baubleType == BaubleType.AMULET && type == BAUBLE_AMULET) ||
                (baubleType == BaubleType.RING && type == BAUBLE_RING) ||
                (baubleType == BaubleType.BELT && type == BAUBLE_BELT);
    } else {
        return true;
    }
}
 
開發者ID:McJty,項目名稱:GearSwapper1.8,代碼行數:21,代碼來源:GhostSlot.java

示例2: isItemValidForSlot

/**
 * Returns true if automation is allowed to insert the given stack (ignoring
 * stack size) into the given slot.
 */
@Override
public boolean isItemValidForSlot(int i, ItemStack stack) {
	if (stack == null || !(stack.getItem() instanceof IBauble)
			|| !((IBauble) stack.getItem()).canEquip(stack, player.get()))
		return false;
	if (i == 0
			&& ((IBauble) stack.getItem()).getBaubleType(stack) == BaubleType.AMULET)
		return true;
	if ((i == 1 || i == 2)
			&& ((IBauble) stack.getItem()).getBaubleType(stack) == BaubleType.RING)
		return true;
	if (i == 3
			&& ((IBauble) stack.getItem()).getBaubleType(stack) == BaubleType.BELT)
		return true;
	return false;
}
 
開發者ID:Romejanic,項目名稱:RuneMagic,代碼行數:20,代碼來源:InventoryBaubles.java

示例3: matches

@Override
public boolean matches(@Nonnull InventoryCrafting inv, @Nonnull World worldIn) {
	List<ItemStack> ingredients = new ArrayList<>();
	for (int i = 0; i < inv.getSizeInventory(); i++) {
		ItemStack stack = inv.getStackInSlot(i);
		if (stack != null) {
			if (stack.getItem() instanceof IBauble && ((IBauble)stack.getItem()).getBaubleType(stack) == BaubleType.RING) {
				ingredients.add(stack);
			}
		}
	}

	if (ingredients.size() != 2) return false;

	ItemStack ringHolder;
	ItemStack ring;
	if (isItemStackHolder(ingredients.get(0)) && !isItemStackHolder(ingredients.get(1))) {
		ringHolder = ingredients.get(0);
		ring = ingredients.get(1);
	} else if (isItemStackHolder(ingredients.get(1)) && !isItemStackHolder(ingredients.get(0))) {
		ringHolder = ingredients.get(1);
		ring = ingredients.get(0);
	} else return false;

	if (ring == null || ringHolder == null) return false;

	boolean canAttachRing = false;
	List<ItemStack> attachedRings = getAttachedRings(ringHolder);
	if (attachedRings.get(0) == null) {
		canAttachRing = true;
	} else if (isAdvancedHolder(ringHolder) && attachedRings.get(1) == null) {
		if (!ItemStack.areItemStacksEqual(ring, attachedRings.get(0))) {
			canAttachRing = true;
		}
	} else return false;

	return !ItemStack.areItemStacksEqual(ring, ringHolder) && canAttachRing;

}
 
開發者ID:yolp900,項目名稱:ItsJustaCharm1.10.2Dead,代碼行數:39,代碼來源:RingAttachmentRecipe.java

示例4: getBaubleType

@Override
public BaubleType getBaubleType(ItemStack stack) {
	if (stack.getItemDamage() <= 1) {
		return BaubleType.RING;
	} else {
		return null;
	}
}
 
開發者ID:TeamAmeriFrance,項目名稱:Electro-Magic-Tools,代碼行數:8,代碼來源:ItemIC2Baubles.java

示例5: getBaubleType

@Override
public BaubleType getBaubleType(ItemStack itemstack) {
    return BaubleType.RING;
}
 
開發者ID:inifire201,項目名稱:MagicWinds,代碼行數:4,代碼來源:ItemTestRing.java

示例6: getBaubleType

public BaubleType getBaubleType(final ItemStack itemstack) {
    return BaubleType.RING;
}
 
開發者ID:sameer,項目名稱:ExtraUtilities,代碼行數:3,代碼來源:ItemAngelRing.java

示例7: getCraftingResult

@Nullable
@Override
public ItemStack getCraftingResult(@Nonnull InventoryCrafting inv) {
	List<ItemStack> ingredients = new ArrayList<>();
	for (int i = 0; i < inv.getSizeInventory(); i++) {
		ItemStack stack = inv.getStackInSlot(i);
		if (stack != null) {
			if (stack.getItem() instanceof IBauble && ((IBauble) stack.getItem()).getBaubleType(stack) == BaubleType.RING) {
				ingredients.add(stack);
			}
		}
	}

	if (ingredients.size() != 2) return null;

	ItemStack ringHolder;
	ItemStack ring;
	if (isItemStackHolder(ingredients.get(0)) && !isItemStackHolder(ingredients.get(1))) {
		ringHolder = ingredients.get(0);
		ring = ingredients.get(1);
	} else if (isItemStackHolder(ingredients.get(1)) && !isItemStackHolder(ingredients.get(0))) {
		ringHolder = ingredients.get(1);
		ring = ingredients.get(0);
	} else return null;

	if (ring == null || ringHolder == null) return null;

	ItemStack output;
	boolean advanced;
	boolean firstStored;
	if (ringHolder.getItem() == ModItems.BaubleRingHolder) {
		output = ring.copy();
		advanced = ringHolder.getItemDamage() == ItemBaubleRingHolder.EnumType.Advanced.ordinal();
		firstStored = true;
	} else {
		output = ringHolder.copy();
		advanced = NBTHelper.getBoolean(output, IJCConstants.NBT.ADVANCED_BAUBLE_HOLDER);
		firstStored = false;
	}

	NBTHelper.setBoolean(output, IJCConstants.NBT.BAUBLE_HOLDER, true);
	NBTHelper.setBoolean(output, IJCConstants.NBT.ADVANCED_BAUBLE_HOLDER, advanced);

	if (!firstStored) {
		if (NBTHelper.getItemStack(output, IJCConstants.NBT.BAUBLE_ATTACHED(0)) == null) {
			NBTHelper.setItemStack(output, IJCConstants.NBT.BAUBLE_ATTACHED(0), ring.copy());
		} else if (advanced && NBTHelper.getItemStack(output, IJCConstants.NBT.BAUBLE_ATTACHED(1)) == null) {
			NBTHelper.setItemStack(output, IJCConstants.NBT.BAUBLE_ATTACHED(1), ring.copy());
		} else {
			return null;
		}
	}

	return output;
}
 
開發者ID:yolp900,項目名稱:ItsJustaCharm1.10.2Dead,代碼行數:55,代碼來源:RingAttachmentRecipe.java

示例8: getBaubleType

@Override
public BaubleType getBaubleType(ItemStack stack) {
	return BaubleType.RING;
}
 
開發者ID:yolp900,項目名稱:ItsJustaCharm1.10.2Dead,代碼行數:4,代碼來源:ItemBaubleRingHolder.java

示例9: getBaubleType

@Override
public BaubleType getBaubleType(ItemStack itemstack) {
	return BaubleType.RING;
}
 
開發者ID:yolp900,項目名稱:ItsJustaCharm1.10.2Dead,代碼行數:4,代碼來源:ItemLavaWaveEmitterRing.java

示例10: getBaubleType

@Override
public BaubleType getBaubleType(ItemStack itemstack) { return BaubleType.RING; }
 
開發者ID:NekoCaffeine,項目名稱:Alchemy,代碼行數:2,代碼來源:AlchemyItemBauble.java

示例11: getBaubleType

@Override
public BaubleType getBaubleType(ItemStack stack) 
{
	return BaubleType.RING;
}
 
開發者ID:TheXFactor117,項目名稱:Lost-Eclipse-Outdated,代碼行數:5,代碼來源:ItemRing.java

示例12: getBaubleType

@Override
public BaubleType getBaubleType(ItemStack arg0) {
    return BaubleType.RING;
}
 
開發者ID:GTNewHorizons,項目名稱:NewHorizonsCoreMod,代碼行數:4,代碼來源:WitherProtectionRing.java

示例13: getBaubleType

@Override
public BaubleType getBaubleType( ItemStack arg0 )
{
  return BaubleType.RING;
}
 
開發者ID:GTNewHorizons,項目名稱:NewHorizonsCoreMod,代碼行數:5,代碼來源:OvenGlove.java

示例14: getBaubleType

@Override
// Tells Baubles What slot Rings Can Be Equiped To
public BaubleType getBaubleType(ItemStack itemstack)
{
	return BaubleType.RING;
}
 
開發者ID:TeamC4,項目名稱:Talismans2,代碼行數:6,代碼來源:ItemTalismanRings.java

示例15: getBaubleType

@Override
public BaubleType getBaubleType(ItemStack itemStack) {
    return BaubleType.RING;
}
 
開發者ID:AdlyTempleton,項目名稱:Aura-Cascade,代碼行數:4,代碼來源:ItemFairyRing.java


注:本文中的baubles.api.BaubleType.RING屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。