本文整理汇总了Java中org.bukkit.Material.LAPIS_ORE属性的典型用法代码示例。如果您正苦于以下问题:Java Material.LAPIS_ORE属性的具体用法?Java Material.LAPIS_ORE怎么用?Java Material.LAPIS_ORE使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.Material
的用法示例。
在下文中一共展示了Material.LAPIS_ORE属性的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onBlockBreak
/**
*
* @param e BlockBreakEvent
* @since 4.2.0
*/
@EventHandler
public void onBlockBreak(BlockBreakEvent e) {
List<ItemStack> drops = new ArrayList<ItemStack>();
ItemStack item = e.getPlayer().getInventory().getItemInMainHand();
int fortune = 1;
if (item != null) {
if (item.getEnchantments().containsKey(Enchantment.LOOT_BONUS_BLOCKS) && !item.getEnchantments().containsKey(Enchantment.SILK_TOUCH)) {
fortune = SlimefunStartup.randomize(item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) + 2) - 1;
if (fortune <= 0) fortune = 1;
fortune = (e.getBlock().getType() == Material.LAPIS_ORE ? 4 + SlimefunStartup.randomize(5) : 1) * (fortune + 1);
}
if (!item.getEnchantments().containsKey(Enchantment.SILK_TOUCH) && e.getBlock().getType().toString().endsWith("_ORE")) {
if (Talisman.checkFor(e, SlimefunItem.getByID("MINER_TALISMAN"))) {
if (drops.isEmpty()) drops = (List<ItemStack>) e.getBlock().getDrops();
for (ItemStack drop : new ArrayList<ItemStack>(drops)) {
if (!drop.getType().isBlock()) drops.add(new CustomItem(drop, fortune * 2));
}
}
}
}
}
示例2: onCommand
public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) {
if (cmd.getName().equalsIgnoreCase("klotentoren")) {
sender.sendMessage("ja hoor");
Player p = (Player) sender;
ArmorStand armorStand = (ArmorStand) p.getLocation().getWorld().spawn(p.getLocation(), ArmorStand.class);
ItemStack is = new ItemStack(Material.LAPIS_ORE, 64);
armorStand.setHelmet(is);
armorStand.setPassenger((Entity) sender);
armorStand.setBasePlate(false);
ArmorStand armorStand2 = (ArmorStand) p.getLocation().getWorld().spawn(p.getLocation(), ArmorStand.class);
armorStand2.setHelmet(is);
armorStand2.setBasePlate(false);
ArmorStand armorStand3 = (ArmorStand) p.getLocation().getWorld().spawn(p.getLocation(), ArmorStand.class);
armorStand3.setHelmet(is);
armorStand3.setBasePlate(false);
ArmorStand armorStand4 = (ArmorStand) p.getLocation().getWorld().spawn(p.getLocation(), ArmorStand.class);
armorStand4.setHelmet(is);
armorStand4.setBasePlate(false);
degree = 0;
flyingheight = 28;
direction = false;
rotating = false;
uploopcounter = 0;
Bukkit.getScheduler().scheduleSyncRepeatingTask(main.getPL(), new Runnable() {
@Override
public void run() {
if (rotating == true) {
degree++;
degree++;
}
if (degree == 360 || degree > 360) {
degree = 0;
}
moveEntity(armorStand, degree + 1 * 90);
moveEntity(armorStand2, degree + 2 * 90);
moveEntity(armorStand3, degree + 3 * 90);
moveEntity(armorStand4, degree + 4 * 90);
}
}, 0, 1);
Bukkit.getScheduler().scheduleSyncRepeatingTask(main.getPL(), new Runnable() {
@Override
public void run() {
if (flyingheight == 60) {
direction = true;
} else if (flyingheight == 28 || flyingheight < 35) {
direction = false;
}
if (direction == true) {
rotating = true;
flyingheight--;
//flyingheight--;
} else {
smallBittUp();
}
}
}, 90, 1);
} else {}
return false;
}