本文整理汇总了Java中org.bukkit.Material.LAVA_BUCKET属性的典型用法代码示例。如果您正苦于以下问题:Java Material.LAVA_BUCKET属性的具体用法?Java Material.LAVA_BUCKET怎么用?Java Material.LAVA_BUCKET使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.bukkit.Material
的用法示例。
在下文中一共展示了Material.LAVA_BUCKET属性的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onInteract
@EventHandler
public void onInteract(PlayerBucketEmptyEvent e){
Player p = e.getPlayer();
for(Entity en : p.getNearbyEntities (4D, 4D, 4D)){
if (en instanceof Player){
if(en == p) continue;
if(e.getBucket() == Material.LAVA_BUCKET){
if(Files.user.getBoolean("Users." + en.getName() + ".pvp") == false){
p.sendMessage(Message.prefix + ChatColor.DARK_RED + " No puedes poner ese bloque cerca de un jugador con el pvp desactivado.");
e.setCancelled(true);
}
}
}
}
}
示例2: isInteractableItem
/**
* checks if this item is interactable
*/
public static boolean isInteractableItem(ItemStack item) {
if (item == null || item.getType() == Material.AIR) {
return false;
}
if (item.getType().isBlock()) {
return true;
}
if (item.getType() == Material.REDSTONE || item.getType() == Material.WATER_BUCKET || item.getType() == Material.LAVA_BUCKET) {
return true;
}
if (item.getType() == Material.MONSTER_EGG) {
return true;
}
if (item.getType() == Material.EGG || item.getType() == Material.SNOW_BALL || item.getType() == Material.BOW || item.getType() == Material.ENDER_PEARL || item.getType() == Material.EYE_OF_ENDER || item.getType() == Material.POTION || item.getType() == Material.SPLASH_POTION || item.getType() == Material.EXP_BOTTLE || item.getType() == Material.FIREWORK_CHARGE) {
return true;
}
if (item.getType().isEdible()) {
return true;
}
return false;
}
示例3: onDamageSkull
@EventHandler
public void onDamageSkull(PlayerInteractEvent e) {
if (cm.isAntiDamageSkull) {
if (Action.RIGHT_CLICK_BLOCK == e.getAction()) {
if (e.getItem() != null) {
Material type = e.getItem().getType();
if (Material.LAVA_BUCKET == type || Material.WATER_BUCKET == type) {
fixSkull(e.getClickedBlock().getRelative(BlockFace.UP));
} else if (Material.ANVIL == type) {
for (BlockFace face : BLOCKFACE) {
fixSkull(e.getClickedBlock().getRelative(face));
}
}
}
}
}
}
示例4: onInteract
@EventHandler
public void onInteract(PlayerBucketEmptyEvent e){
Player p = e.getPlayer();
for(Entity en : p.getNearbyEntities (4D, 4D, 4D)){
if (en instanceof Player){
if(en == p) continue;
if(e.getBucket() == Material.LAVA_BUCKET){
if(Files.user.getBoolean("Users." + en.getName() + ".pvp") == false){
p.sendMessage(Utils.colorize(PAData.SURVIVAL.getPrefix() + ChatColor.DARK_RED + " No puedes poner ese bloque cerca de un jugador con el pvp desactivado."));
e.setCancelled(true);
}
}
}
}
}
示例5: Fireman
@EventHandler
public void Fireman(PlayerInteractEvent event) {
// LAVA: 12
Player p = event.getPlayer();
if (!Kit.getKit(p).getName().equalsIgnoreCase("fireman") && event.getItem() != null && event.getItem().getType() == Material.LAVA_BUCKET) {
event.setCancelled(true);
Chat.player(p, "&cOnly players with the \"Fireman\" kit can use lava!");
}
}
示例6: onPlayerInteract
@EventHandler
public void onPlayerInteract(PlayerInteractEvent event) {
if (Walls.getSpectators().contains(event.getPlayer().getName())) {
event.setCancelled(true);
return;
}
if (event.getItem()==null)
return;
if (!State.PVP && (event.getItem().getType()==Material.FLINT_AND_STEEL || event.getItem().getType()==Material.FIREBALL || event.getItem().getType()==Material.LAVA_BUCKET)) {
Chat.player(event.getPlayer(), "&cYou are not allowed to use fire before the walls drop!");
event.setCancelled(true);
}
}
示例7: handleCategoryInventoryClick
private void handleCategoryInventoryClick(InventoryClickEvent ice,
Game game, Player player) {
int catSize = getCategoriesSize(player);
int sizeCategories = getInventorySize(catSize) + 9;
int rawSlot = ice.getRawSlot();
if ((rawSlot >= getInventorySize(catSize))
&& (rawSlot < sizeCategories)) {
ice.setCancelled(true);
if (ice.getCurrentItem().getType() == Material.BUCKET) {
game.getPlayerSettings(player).setOneStackPerShift(false);
player.playSound(player.getLocation(),
SoundMachine.get("CLICK", "UI_BUTTON_CLICK"), 10.0F,
1.0F);
openCategoryInventory(player);
return;
}
if (ice.getCurrentItem().getType() == Material.LAVA_BUCKET) {
game.getPlayerSettings(player).setOneStackPerShift(true);
player.playSound(player.getLocation(),
SoundMachine.get("CLICK", "UI_BUTTON_CLICK"), 10.0F,
1.0F);
openCategoryInventory(player);
return;
}
}
if (rawSlot >= sizeCategories) {
if (ice.isShiftClick()) {
ice.setCancelled(true);
return;
}
ice.setCancelled(false);
return;
}
MerchantCategory clickedCategory = getCategoryByMaterial(ice
.getCurrentItem().getType());
if (clickedCategory == null) {
if (ice.isShiftClick()) {
ice.setCancelled(true);
return;
}
ice.setCancelled(false);
return;
}
openBuyInventory(clickedCategory, player, game);
}
示例8: isBucket
public static boolean isBucket(Material bucket) {
return bucket == Material.BUCKET || bucket == Material.LAVA_BUCKET || bucket == Material.WATER_BUCKET || bucket == Material.MILK_BUCKET;
}