本文整理汇总了Java中cn.nukkit.block.Block.getDrops方法的典型用法代码示例。如果您正苦于以下问题:Java Block.getDrops方法的具体用法?Java Block.getDrops怎么用?Java Block.getDrops使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cn.nukkit.block.Block
的用法示例。
在下文中一共展示了Block.getDrops方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: BlockBreakEvent
import cn.nukkit.block.Block; //导入方法依赖的package包/类
public BlockBreakEvent(Player player, Block block, Item item, boolean instaBreak, boolean fastBreak) {
super(block);
this.item = item;
this.player = player;
this.instaBreak = instaBreak;
this.blockDrops = player.isSurvival() ? block.getDrops(item) : new Item[0];
this.fastBreak = fastBreak;
}
示例2: BlockBreakEvent
import cn.nukkit.block.Block; //导入方法依赖的package包/类
public BlockBreakEvent(Player player, Block block, Item item, boolean instaBreak, boolean fastBreak, int dropExp) {
super(block);
this.item = item;
this.player = player;
this.instaBreak = instaBreak;
this.blockDrops = player.isSurvival() ? block.getDrops(item) : new Item[0];
this.fastBreak = fastBreak;
this.dropExp = dropExp;
}
示例3: BlockBreakEvent
import cn.nukkit.block.Block; //导入方法依赖的package包/类
public BlockBreakEvent(Player player, Block block, Item item, boolean instaBreak, boolean fastBreak) {
super(block);
this.item = item;
this.player = player;
this.instaBreak = instaBreak;
int[][] drops = player.isSurvival() ? block.getDrops(item) : new int[0][0];
List<Item> list = new ArrayList<>();
for (int[] i : drops) {
list.add(Item.get(i[0], i[1], i[2]));
}
this.blockDrops = list.toArray(new Item[list.size()]);
this.fastBreak = fastBreak;
}