本文整理汇总了Java中cn.nukkit.item.Item.DIAMOND属性的典型用法代码示例。如果您正苦于以下问题:Java Item.DIAMOND属性的具体用法?Java Item.DIAMOND怎么用?Java Item.DIAMOND使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类cn.nukkit.item.Item
的用法示例。
在下文中一共展示了Item.DIAMOND属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDrops
@Override
public int[][] getDrops(Item item) {
if (item.isPickaxe() && item.getTier() >= ItemTool.TIER_IRON) {
return new int[][]{
{Item.DIAMOND, 0, 1}
};
} else {
return new int[0][0];
}
}
示例2: registerArmor
protected void registerArmor() {
int[][] types = {
{Item.LEATHER, Item.FIRE, Item.IRON_INGOT, Item.DIAMOND, Item.GOLD_INGOT},
{Item.LEATHER_CAP, Item.CHAIN_HELMET, Item.IRON_HELMET, Item.DIAMOND_HELMET, Item.GOLD_HELMET},
{Item.LEATHER_TUNIC, Item.CHAIN_CHESTPLATE, Item.IRON_CHESTPLATE, Item.DIAMOND_CHESTPLATE, Item.GOLD_CHESTPLATE},
{Item.LEATHER_PANTS, Item.CHAIN_LEGGINGS, Item.IRON_LEGGINGS, Item.DIAMOND_LEGGINGS, Item.GOLD_LEGGINGS},
{Item.LEATHER_BOOTS, Item.CHAIN_BOOTS, Item.IRON_BOOTS, Item.DIAMOND_BOOTS, Item.GOLD_BOOTS},
};
String[][] shapes = new String[][]{
new String[]{
"XXX",
"X X",
" "
},
new String[]{
"X X",
"XXX",
"XXX"
},
new String[]{
"XXX",
"X X",
"X X"
},
new String[]{
" ",
"X X",
"X X"
}
};
for (int i = 1; i < 5; ++i) {
for (int j = 0; j < types[i].length; j++) {
int type = types[i][j];
this.registerRecipe((new BigShapedRecipe(Item.get(type, 0, 1), shapes[i - 1])).setIngredient("X", Item.get(types[0][j], 0, 1)));
}
}
}
示例3: registerWeapons
protected void registerWeapons() {
int[][] types = {
{Item.WOODEN_PLANK, Item.COBBLESTONE, Item.IRON_INGOT, Item.DIAMOND, Item.GOLD_INGOT},
{Item.WOODEN_SWORD, Item.STONE_SWORD, Item.IRON_SWORD, Item.DIAMOND_SWORD, Item.GOLD_SWORD},
};
for (int i = 1; i < 2; ++i) {
for (int j = 0; j < types[i].length; j++) {
int type = types[i][j];
this.registerRecipe((new BigShapedRecipe(Item.get(type, 0, 1),
" X ",
" X ",
" I "
)).setIngredient("X", Item.get(types[0][j], null)).setIngredient("I", Item.get(Item.STICK)));
}
}
this.registerRecipe((new BigShapedRecipe(Item.get(Item.ARROW, 0, 1),
" F ",
" S ",
" P "
)).setIngredient("S", Item.get(Item.STICK)).setIngredient("F", Item.get(Item.FLINT)).setIngredient("P", Item.get(Item.FEATHER)));
this.registerRecipe((new BigShapedRecipe(Item.get(Item.BOW, 0, 1),
" X~",
"X ~",
" X~"
)).setIngredient("~", Item.get(Item.STRING)).setIngredient("X", Item.get(Item.STICK)));
}
示例4: registerIngots
protected void registerIngots() {
int[][] ingots = new int[][]{
{Item.GOLD_BLOCK, Item.GOLD_INGOT},
{Item.GOLD_INGOT, Item.GOLD_NUGGET},
{Item.IRON_BLOCK, Item.IRON_INGOT},
{Item.DIAMOND_BLOCK, Item.DIAMOND},
{Item.EMERALD_BLOCK, Item.EMERALD},
{Item.REDSTONE_BLOCK, Item.REDSTONE_DUST},
{Item.COAL_BLOCK, Item.COAL},
{Item.HAY_BALE, Item.WHEAT},
{Item.LAPIS_BLOCK, Item.DYE, 4}
};
for (int[] e : ingots) {
int block = e[0];
int ingot = e[1];
int ingot_meta = e.length > 2 ? e[2] : 0;
this.registerRecipe((new ShapedRecipe(Item.get(ingot, ingot_meta, 9),
"X"
)).setIngredient("X", Item.get(block, 0, 1)));
this.registerRecipe((new BigShapedRecipe(Item.get(block, 0, 1),
"XXX",
"XXX",
"XXX"
)).setIngredient("X", Item.get(ingot, ingot_meta, 1)));
}
}
示例5: registerTools
protected void registerTools() {
int[][] types = {
{Item.WOODEN_PLANK, Item.COBBLESTONE, Item.IRON_INGOT, Item.DIAMOND, Item.GOLD_INGOT},
{Item.WOODEN_PICKAXE, Item.STONE_PICKAXE, Item.IRON_PICKAXE, Item.DIAMOND_PICKAXE, Item.GOLD_PICKAXE},
{Item.WOODEN_SHOVEL, Item.STONE_SHOVEL, Item.IRON_SHOVEL, Item.DIAMOND_SHOVEL, Item.GOLD_SHOVEL},
{Item.WOODEN_AXE, Item.STONE_AXE, Item.IRON_AXE, Item.DIAMOND_AXE, Item.GOLD_AXE},
{Item.WOODEN_HOE, Item.STONE_HOE, Item.IRON_HOE, Item.DIAMOND_HOE, Item.GOLD_HOE},
};
String[][] shapes = new String[][]{
new String[]{
"XXX",
" I ",
" I "
},
new String[]{
" X ",
" I ",
" I "
},
new String[]{
"XX ",
"XI ",
" I "
},
new String[]{
"XX ",
" I ",
" I "
}
};
for (int i = 1; i < 5; ++i) {
for (int j = 0; j < types[i].length; j++) {
int type = types[i][j];
this.registerRecipe((new BigShapedRecipe(Item.get(type, 0, 1), shapes[i - 1])).setIngredient('X', Item.get(types[0][j], null)).setIngredient('I', Item.get(Item.STICK)));
}
}
this.registerRecipe((new ShapedRecipe(Item.get(Item.FLINT_AND_STEEL, 0, 1),
" S",
"F "
)).setIngredient('F', Item.get(Item.FLINT)).setIngredient("S", Item.get(Item.IRON_INGOT)));
this.registerRecipe((new ShapedRecipe(Item.get(Item.SHEARS, 0, 1),
" X",
"X "
)).setIngredient("X", Item.get(Item.IRON_INGOT)));
}