本文整理汇总了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;
}
}
示例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;
}
示例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;
}
示例4: getBaubleType
@Override
public BaubleType getBaubleType(ItemStack stack) {
if (stack.getItemDamage() <= 1) {
return BaubleType.RING;
} else {
return null;
}
}
示例5: getBaubleType
@Override
public BaubleType getBaubleType(ItemStack itemstack) {
return BaubleType.RING;
}
示例6: getBaubleType
public BaubleType getBaubleType(final ItemStack itemstack) {
return BaubleType.RING;
}
示例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;
}
示例8: getBaubleType
@Override
public BaubleType getBaubleType(ItemStack stack) {
return BaubleType.RING;
}
示例9: getBaubleType
@Override
public BaubleType getBaubleType(ItemStack itemstack) {
return BaubleType.RING;
}
示例10: getBaubleType
@Override
public BaubleType getBaubleType(ItemStack itemstack) { return BaubleType.RING; }
示例11: getBaubleType
@Override
public BaubleType getBaubleType(ItemStack stack)
{
return BaubleType.RING;
}
示例12: getBaubleType
@Override
public BaubleType getBaubleType(ItemStack arg0) {
return BaubleType.RING;
}
示例13: getBaubleType
@Override
public BaubleType getBaubleType( ItemStack arg0 )
{
return BaubleType.RING;
}
示例14: getBaubleType
@Override
// Tells Baubles What slot Rings Can Be Equiped To
public BaubleType getBaubleType(ItemStack itemstack)
{
return BaubleType.RING;
}
示例15: getBaubleType
@Override
public BaubleType getBaubleType(ItemStack itemStack) {
return BaubleType.RING;
}