本文整理汇总了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);
}
}
示例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;
}
示例3: apply
public boolean apply(EntitySheep p_apply_1_)
{
return p_apply_1_.getFleeceColor() == EnumDyeColor.BLUE;
}
示例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;
}
示例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;
}