本文整理汇总了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);
}
示例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);
}
示例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;
}
示例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;
}
示例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;
}
示例6: getLapis
import org.bukkit.material.Dye; //导入方法依赖的package包/类
private ItemStack getLapis(){
Dye dye = new Dye();
dye.setColor(DyeColor.BLUE);
return dye.toItemStack(64);
}
示例7: makeDye
import org.bukkit.material.Dye; //导入方法依赖的package包/类
protected static Dye makeDye(DyeColor color) {
Dye dye = new Dye();
dye.setColor(color);
return dye;
}