当前位置: 首页>>代码示例>>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;未经允许,请勿转载。