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


Java EnumDyeColor.BLUE屬性代碼示例

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


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

示例1: initializeInventories

@Override
protected void initializeInventories() {
    super.initializeInventories();
    modeList = new LinkedHashMap<>();
    EnumDyeColor[] colors = new EnumDyeColor[]{EnumDyeColor.YELLOW, EnumDyeColor.BLUE, EnumDyeColor.GREEN, EnumDyeColor.ORANGE, EnumDyeColor.PURPLE};
    for (int i = 0; i < 5; ++i) {
        ItemStackHandler item = new ItemStackHandler(2);
        this.addInventory(new CustomColoredItemHandler(item, colors[i], "Material process", 50 + 24 * i, 25, 1, 2) {
            @Override
            public boolean canInsertItem(int slot, ItemStack stack) {
                return false;
            }
        });
        this.addInventoryToStorage(item, "item" + i);
        modeList.put(item, Mode.NONE);
    }
}
 
開發者ID:Buuz135,項目名稱:Industrial-Foregoing,代碼行數:17,代碼來源:MaterialStoneWorkFactoryTile.java

示例2: transferStackInSlot

/**
 * Take a stack from the specified inventory slot.
 */
public ItemStack transferStackInSlot(EntityPlayer playerIn, int index)
{
    ItemStack itemstack = null;
    Slot slot = (Slot)this.inventorySlots.get(index);

    if (slot != null && slot.getHasStack())
    {
        ItemStack itemstack1 = slot.getStack();
        itemstack = itemstack1.copy();

        if (index == 0)
        {
            if (!this.mergeItemStack(itemstack1, 2, 38, true))
            {
                return null;
            }
        }
        else if (index == 1)
        {
            if (!this.mergeItemStack(itemstack1, 2, 38, true))
            {
                return null;
            }
        }
        else if (itemstack1.getItem() == Items.dye && EnumDyeColor.byDyeDamage(itemstack1.getMetadata()) == EnumDyeColor.BLUE)
        {
            if (!this.mergeItemStack(itemstack1, 1, 2, true))
            {
                return null;
            }
        }
        else
        {
            if (((Slot)this.inventorySlots.get(0)).getHasStack() || !((Slot)this.inventorySlots.get(0)).isItemValid(itemstack1))
            {
                return null;
            }

            if (itemstack1.hasTagCompound() && itemstack1.stackSize == 1)
            {
                ((Slot)this.inventorySlots.get(0)).putStack(itemstack1.copy());
                itemstack1.stackSize = 0;
            }
            else if (itemstack1.stackSize >= 1)
            {
                ((Slot)this.inventorySlots.get(0)).putStack(new ItemStack(itemstack1.getItem(), 1, itemstack1.getMetadata()));
                --itemstack1.stackSize;
            }
        }

        if (itemstack1.stackSize == 0)
        {
            slot.putStack((ItemStack)null);
        }
        else
        {
            slot.onSlotChanged();
        }

        if (itemstack1.stackSize == itemstack.stackSize)
        {
            return null;
        }

        slot.onPickupFromSlot(playerIn, itemstack1);
    }

    return itemstack;
}
 
開發者ID:Notoh,項目名稱:DecompiledMinecraft,代碼行數:72,代碼來源:ContainerEnchantment.java

示例3: apply

public boolean apply(EntitySheep p_apply_1_)
{
    return p_apply_1_.getFleeceColor() == EnumDyeColor.BLUE;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:4,代碼來源:EntityEvoker.java

示例4: transferStackInSlot

/**
 * Take a stack from the specified inventory slot.
 */
public ItemStack transferStackInSlot(EntityPlayer playerIn, int index)
{
    ItemStack itemstack = ItemStack.field_190927_a;
    Slot slot = (Slot)this.inventorySlots.get(index);

    if (slot != null && slot.getHasStack())
    {
        ItemStack itemstack1 = slot.getStack();
        itemstack = itemstack1.copy();

        if (index == 0)
        {
            if (!this.mergeItemStack(itemstack1, 2, 38, true))
            {
                return ItemStack.field_190927_a;
            }
        }
        else if (index == 1)
        {
            if (!this.mergeItemStack(itemstack1, 2, 38, true))
            {
                return ItemStack.field_190927_a;
            }
        }
        else if (itemstack1.getItem() == Items.DYE && EnumDyeColor.byDyeDamage(itemstack1.getMetadata()) == EnumDyeColor.BLUE)
        {
            if (!this.mergeItemStack(itemstack1, 1, 2, true))
            {
                return ItemStack.field_190927_a;
            }
        }
        else
        {
            if (((Slot)this.inventorySlots.get(0)).getHasStack() || !((Slot)this.inventorySlots.get(0)).isItemValid(itemstack1))
            {
                return ItemStack.field_190927_a;
            }

            if (itemstack1.hasTagCompound() && itemstack1.func_190916_E() == 1)
            {
                ((Slot)this.inventorySlots.get(0)).putStack(itemstack1.copy());
                itemstack1.func_190920_e(0);
            }
            else if (!itemstack1.func_190926_b())
            {
                ((Slot)this.inventorySlots.get(0)).putStack(new ItemStack(itemstack1.getItem(), 1, itemstack1.getMetadata()));
                itemstack1.func_190918_g(1);
            }
        }

        if (itemstack1.func_190926_b())
        {
            slot.putStack(ItemStack.field_190927_a);
        }
        else
        {
            slot.onSlotChanged();
        }

        if (itemstack1.func_190916_E() == itemstack.func_190916_E())
        {
            return ItemStack.field_190927_a;
        }

        slot.func_190901_a(playerIn, itemstack1);
    }

    return itemstack;
}
 
開發者ID:sudofox,項目名稱:Backmemed,代碼行數:72,代碼來源:ContainerEnchantment.java

示例5: transferStackInSlot

/**
 * Take a stack from the specified inventory slot.
 */
@Nullable
public ItemStack transferStackInSlot(EntityPlayer playerIn, int index)
{
    ItemStack itemstack = null;
    Slot slot = (Slot)this.inventorySlots.get(index);

    if (slot != null && slot.getHasStack())
    {
        ItemStack itemstack1 = slot.getStack();
        itemstack = itemstack1.copy();

        if (index == 0)
        {
            if (!this.mergeItemStack(itemstack1, 2, 38, true))
            {
                return null;
            }
        }
        else if (index == 1)
        {
            if (!this.mergeItemStack(itemstack1, 2, 38, true))
            {
                return null;
            }
        }
        else if (itemstack1.getItem() == Items.DYE && EnumDyeColor.byDyeDamage(itemstack1.getMetadata()) == EnumDyeColor.BLUE)
        {
            if (!this.mergeItemStack(itemstack1, 1, 2, true))
            {
                return null;
            }
        }
        else
        {
            if (((Slot)this.inventorySlots.get(0)).getHasStack() || !((Slot)this.inventorySlots.get(0)).isItemValid(itemstack1))
            {
                return null;
            }

            if (itemstack1.hasTagCompound() && itemstack1.stackSize == 1)
            {
                ((Slot)this.inventorySlots.get(0)).putStack(itemstack1.copy());
                itemstack1.stackSize = 0;
            }
            else if (itemstack1.stackSize >= 1)
            {
                ((Slot)this.inventorySlots.get(0)).putStack(new ItemStack(itemstack1.getItem(), 1, itemstack1.getMetadata()));
                --itemstack1.stackSize;
            }
        }

        if (itemstack1.stackSize == 0)
        {
            slot.putStack((ItemStack)null);
        }
        else
        {
            slot.onSlotChanged();
        }

        if (itemstack1.stackSize == itemstack.stackSize)
        {
            return null;
        }

        slot.onPickupFromSlot(playerIn, itemstack1);
    }

    return itemstack;
}
 
開發者ID:F1r3w477,項目名稱:CustomWorldGen,代碼行數:73,代碼來源:ContainerEnchantment.java


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