本文整理汇总了Java中net.minecraft.tileentity.TileEntityBanner.getBaseColor方法的典型用法代码示例。如果您正苦于以下问题:Java TileEntityBanner.getBaseColor方法的具体用法?Java TileEntityBanner.getBaseColor怎么用?Java TileEntityBanner.getBaseColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.tileentity.TileEntityBanner
的用法示例。
在下文中一共展示了TileEntityBanner.getBaseColor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDrops
import net.minecraft.tileentity.TileEntityBanner; //导入方法依赖的package包/类
@Override
public java.util.List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune)
{
TileEntity te = world.getTileEntity(pos);
java.util.List<ItemStack> ret = new java.util.ArrayList<ItemStack>();
if (te instanceof TileEntityBanner)
{
TileEntityBanner banner = (TileEntityBanner)te;
ItemStack item = new ItemStack(Items.BANNER, 1, banner.getBaseColor());
NBTTagCompound nbt = new NBTTagCompound();
TileEntityBanner.setBaseColorAndPatterns(nbt, banner.getBaseColor(), banner.getPatterns());
item.setTagInfo("BlockEntityTag", nbt);
ret.add(item);
}
else
{
ret.add(new ItemStack(Items.BANNER, 1, 0));
}
return ret;
}
示例2: matches
import net.minecraft.tileentity.TileEntityBanner; //导入方法依赖的package包/类
public boolean matches(InventoryCrafting inv, World worldIn)
{
ItemStack itemstack = null;
ItemStack itemstack1 = null;
for (int i = 0; i < inv.getSizeInventory(); ++i)
{
ItemStack itemstack2 = inv.getStackInSlot(i);
if (itemstack2 != null)
{
if (itemstack2.getItem() != Items.banner)
{
return false;
}
if (itemstack != null && itemstack1 != null)
{
return false;
}
int j = TileEntityBanner.getBaseColor(itemstack2);
boolean flag = TileEntityBanner.getPatterns(itemstack2) > 0;
if (itemstack != null)
{
if (flag)
{
return false;
}
if (j != TileEntityBanner.getBaseColor(itemstack))
{
return false;
}
itemstack1 = itemstack2;
}
else if (itemstack1 != null)
{
if (!flag)
{
return false;
}
if (j != TileEntityBanner.getBaseColor(itemstack1))
{
return false;
}
itemstack = itemstack2;
}
else if (flag)
{
itemstack = itemstack2;
}
else
{
itemstack1 = itemstack2;
}
}
}
return itemstack != null && itemstack1 != null;
}
示例3: matches
import net.minecraft.tileentity.TileEntityBanner; //导入方法依赖的package包/类
/**
* Used to check if a recipe matches current crafting inventory
*/
public boolean matches(InventoryCrafting inv, World worldIn)
{
ItemStack itemstack = null;
ItemStack itemstack1 = null;
for (int i = 0; i < inv.getSizeInventory(); ++i)
{
ItemStack itemstack2 = inv.getStackInSlot(i);
if (itemstack2 != null)
{
if (itemstack2.getItem() != Items.BANNER)
{
return false;
}
if (itemstack != null && itemstack1 != null)
{
return false;
}
int j = TileEntityBanner.getBaseColor(itemstack2);
boolean flag = TileEntityBanner.getPatterns(itemstack2) > 0;
if (itemstack != null)
{
if (flag)
{
return false;
}
if (j != TileEntityBanner.getBaseColor(itemstack))
{
return false;
}
itemstack1 = itemstack2;
}
else if (itemstack1 != null)
{
if (!flag)
{
return false;
}
if (j != TileEntityBanner.getBaseColor(itemstack1))
{
return false;
}
itemstack = itemstack2;
}
else if (flag)
{
itemstack = itemstack2;
}
else
{
itemstack1 = itemstack2;
}
}
}
return itemstack != null && itemstack1 != null;
}