当前位置: 首页>>代码示例>>Java>>正文


Java Dye.setColor方法代码示例

本文整理汇总了Java中org.bukkit.material.Dye.setColor方法的典型用法代码示例。如果您正苦于以下问题:Java Dye.setColor方法的具体用法?Java Dye.setColor怎么用?Java Dye.setColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bukkit.material.Dye的用法示例。


在下文中一共展示了Dye.setColor方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getCraftingRecipes

import org.bukkit.material.Dye; //导入方法依赖的package包/类
@Override
public Iterable<Recipe> getCraftingRecipes()
{
    ShapedRecipe portalRecipe = new ShapedRecipe(makeItem(getAmountPerCraft()));

    portalRecipe.shape("BOB", "PCP", "OPO");

    Dye purpleDye = new Dye(Material.INK_SACK);
    purpleDye.setColor(DyeColor.PURPLE);

    portalRecipe.setIngredient('B', Material.BLAZE_POWDER);
    portalRecipe.setIngredient('O', Material.OBSIDIAN);
    portalRecipe.setIngredient('P', Material.ENDER_PEARL);
    portalRecipe.setIngredient('C', purpleDye.toItemStack(1).getData());

    return Collections.singletonList((Recipe) portalRecipe);
}
 
开发者ID:zDevelopers,项目名称:BelovedBlocks,代码行数:18,代码来源:NetherPortalBlock.java

示例2: getDrops

import org.bukkit.material.Dye; //导入方法依赖的package包/类
@Override
public Collection<ItemStack> getDrops() {
    
    Dye dye = new Dye();
    dye.setColor(DyeColor.BROWN);
    ItemStack item = new ItemStack(Material.INK_SACK, 3, dye.getData());
    return GenericCrop.getDrops(item);
}
 
开发者ID:StarQuestMinecraft,项目名称:StarQuestCode,代码行数:9,代码来源:CropCocoa.java

示例3: parseMatAndData

import org.bukkit.material.Dye; //导入方法依赖的package包/类
private static MaterialData parseMatAndData(String matData) {
    String[] fields = matData.split("[:()]");
    Material mat = Material.matchMaterial(fields[0]);
    if (mat == null) {
        throw new DHUtilsException("Unknown material " + fields[0]);
    }
    MaterialData res = new MaterialData(mat);
    if (fields.length > 1) {
        if (StringUtils.isNumeric(fields[1])) {
            res.setData(Byte.parseByte(fields[1]));
        } else {
            switch (mat) {
                case INK_SACK:
                    Dye dye = new Dye();
                    dye.setColor(DyeColor.valueOf(fields[1].toUpperCase()));
                    res = dye;
                    break;
                case WOOL:
                case CARPET:
                case STAINED_GLASS:
                case STAINED_GLASS_PANE:
                case STAINED_CLAY:
                    // maybe one day these will all implement Colorable...
                    DyeColor dc2 = DyeColor.valueOf(fields[1].toUpperCase());
                    res.setData(dc2.getWoolData());
                    break;
                case SAPLING:
                case WOOD:
                    TreeSpecies ts = TreeSpecies.valueOf(fields[1].toUpperCase());
                    res.setData(ts.getData());
                    break;
            }
        }
    }
    return res;
}
 
开发者ID:desht,项目名称:sensibletoolbox,代码行数:37,代码来源:STBUtil.java

示例4: getRecipe

import org.bukkit.material.Dye; //导入方法依赖的package包/类
@Override
public Recipe getRecipe() {
    ShapedRecipe recipe = new ShapedRecipe(toItemStack());
    Dye d = new Dye();
    d.setColor(DyeColor.WHITE);
    recipe.shape("SM ", "SBS", " S ");
    recipe.setIngredient('S', Material.STONE);
    recipe.setIngredient('M', d);
    recipe.setIngredient('B', Material.BOWL);
    return recipe;
}
 
开发者ID:desht,项目名称:sensibletoolbox,代码行数:12,代码来源:WateringCan.java

示例5: getRecipe

import org.bukkit.material.Dye; //导入方法依赖的package包/类
@Override
public Recipe getRecipe() {
    Dye greenDye = new Dye();
    greenDye.setColor(DyeColor.GREEN);
    ShapelessRecipe recipe = new ShapelessRecipe(toItemStack(2));
    recipe.addIngredient(Material.STONE_PLATE);
    recipe.addIngredient(greenDye);
    return recipe;
}
 
开发者ID:desht,项目名称:sensibletoolbox,代码行数:10,代码来源:CircuitBoard.java

示例6: getLapis

import org.bukkit.material.Dye; //导入方法依赖的package包/类
private ItemStack getLapis(){
	Dye dye = new Dye();
	dye.setColor(DyeColor.BLUE);
	return dye.toItemStack(64);
}
 
开发者ID:gvlfm78,项目名称:BukkitOldCombatMechanics,代码行数:6,代码来源:ModuleNoLapisEnchantments.java

示例7: makeDye

import org.bukkit.material.Dye; //导入方法依赖的package包/类
protected static Dye makeDye(DyeColor color) {
    Dye dye = new Dye();
    dye.setColor(color);
    return dye;
}
 
开发者ID:desht,项目名称:sensibletoolbox,代码行数:6,代码来源:ItemRouterModule.java


注:本文中的org.bukkit.material.Dye.setColor方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。