• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Llama类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.bukkit.entity.Llama的典型用法代码示例。如果您正苦于以下问题:Java Llama类的具体用法?Java Llama怎么用?Java Llama使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Llama类属于org.bukkit.entity包,在下文中一共展示了Llama类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: LlamaMenu

import org.bukkit.entity.Llama; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public LlamaMenu(Plot plot, Llama llama) {
    super(plot, llama);

    //color
    ItemStack color = new ItemStack(Material.CONCRETE_POWDER, 1, (short) 1);
    ItemMeta colorMeta = color.getItemMeta();
    colorMeta.setDisplayName(ChatColor.GREEN + "Change the color");
    color.setItemMeta(colorMeta);

    insertItem(color, event -> {
        new LlamaColorSelectionMenu(llama).open((Player) event.getWhoClicked());

        event.setCancelled(true);
    }, 0);
}
 
开发者ID:stefvanschie,项目名称:buildinggame,代码行数:19,代码来源:LlamaMenu.java


示例2: get

import org.bukkit.entity.Llama; //导入依赖的package包/类
@Override
@Nullable
protected Llama.Color[] get(Event e) {
	if (llama.getSingle(e) instanceof Llama) {
		return new Llama.Color[]{((Llama) llama.getSingle(e)).getColor()};
	}
	return null;
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:9,代码来源:ExprLlamaColorType.java


示例3: change

import org.bukkit.entity.Llama; //导入依赖的package包/类
@Override
public void change(Event e, Object[] delta, Changer.ChangeMode mode){
	if (mode == ChangeMode.SET) {
		if (!(llama.getSingle(e) instanceof Llama)) {
			return;
		}
		((Llama) llama.getSingle(e)).setColor((Llama.Color)delta[0]);
	}
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:10,代码来源:ExprLlamaColorType.java


示例4: acceptChange

import org.bukkit.entity.Llama; //导入依赖的package包/类
@Override
public Class<?>[] acceptChange(final Changer.ChangeMode mode) {
	if (mode == ChangeMode.SET) {
		return CollectionUtils.array(Llama.Color.class);
	}
	return null;
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:8,代码来源:ExprLlamaColorType.java


示例5: get

import org.bukkit.entity.Llama; //导入依赖的package包/类
@Override
@Nullable
protected LlamaInventory[] get(Event e) {
	if (llama.getSingle(e) instanceof Llama) {
		return new LlamaInventory[]{((Llama) llama.getSingle(e)).getInventory()};
	}
	return null;
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:9,代码来源:ExprLlamaInventory.java


示例6: getReturnType

import org.bukkit.entity.Llama; //导入依赖的package包/类
@Override
public Class<? extends Llama.Color> getReturnType() {
	return Llama.Color.class;
}
 
开发者ID:TheLimeGlass,项目名称:Skellett,代码行数:5,代码来源:ExprLlamaColorType.java


示例7: LlamaColorSelectionMenu

import org.bukkit.entity.Llama; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
LlamaColorSelectionMenu(Llama llama) {
    super(null, 9, ChatColor.GREEN + "Change the llama color", 1);

    setStartingPoint(2);

    //brown
    ItemStack brown = new Wool(DyeColor.BROWN).toItemStack(1);
    ItemMeta brownMeta = brown.getItemMeta();
    brownMeta.setDisplayName(ChatColor.GREEN + "Brown");
    brown.setItemMeta(brownMeta);

    addItem(brown, event -> {
        llama.setColor(Llama.Color.BROWN);

        event.setCancelled(true);
    });

    //creamy
    ItemStack creamy = new ItemStack(Material.SANDSTONE);
    ItemMeta creamyMeta = creamy.getItemMeta();
    creamyMeta.setDisplayName(ChatColor.GREEN + "Creamy");
    creamy.setItemMeta(creamyMeta);

    addItem(creamy, event -> {
        llama.setColor(Llama.Color.CREAMY);

        event.setCancelled(true);
    });

    setStartingPoint(5);

    //gray
    ItemStack gray = new Wool(DyeColor.GRAY).toItemStack(1);
    ItemMeta grayMeta = gray.getItemMeta();
    grayMeta.setDisplayName(ChatColor.GREEN + "Gray");
    gray.setItemMeta(grayMeta);

    addItem(gray, event -> {
        llama.setColor(Llama.Color.GRAY);

        event.setCancelled(true);
    });

    //white
    ItemStack white = new Wool(DyeColor.WHITE).toItemStack(1);
    ItemMeta whiteMeta = white.getItemMeta();
    whiteMeta.setDisplayName(ChatColor.GREEN + "White");
    white.setItemMeta(whiteMeta);

    addItem(white, event -> {
        llama.setColor(Llama.Color.WHITE);

        event.setCancelled(true);
    });
}
 
开发者ID:stefvanschie,项目名称:buildinggame,代码行数:59,代码来源:LlamaColorSelectionMenu.java


示例8: validateMovementAndUpdateDistance

import org.bukkit.entity.Llama; //导入依赖的package包/类
/**
 * Update distances and store them into server's memory until player disconnects.
 * 
 * @param player
 */
private void validateMovementAndUpdateDistance(Player player) {
	String uuid = player.getUniqueId().toString();
	Location previousLocation = playerLocations.get(uuid);

	// Update new location.
	playerLocations.put(uuid, player.getLocation());

	// If player location not found or if player has changed world, ignore previous location.
	// Evaluating distance would give an exception.
	if (previousLocation == null || !previousLocation.getWorld().getName().equals(player.getWorld().getName())) {
		return;
	}

	// If player is in restricted game mode or is in a blocked world, don't update distances.
	if (!shouldIncreaseBeTakenIntoAccountNoPermissions(player)) {
		return;
	}

	int difference = getDistanceDifference(player, previousLocation);
	// Player has not moved.
	if (difference == 0L) {
		return;
	}

	if (player.getVehicle() instanceof Horse) {
		updateDistance(difference, player, NormalAchievements.DISTANCEHORSE);
	} else if (player.getVehicle() instanceof Pig) {
		updateDistance(difference, player, NormalAchievements.DISTANCEPIG);
	} else if (player.getVehicle() instanceof Minecart) {
		updateDistance(difference, player, NormalAchievements.DISTANCEMINECART);
	} else if (player.getVehicle() instanceof Boat) {
		updateDistance(difference, player, NormalAchievements.DISTANCEBOAT);
	} else if (plugin.getServerVersion() >= 11 && player.getVehicle() instanceof Llama) {
		updateDistance(difference, player, NormalAchievements.DISTANCELLAMA);
	} else if (!player.isFlying() && (plugin.getServerVersion() < 9 || !player.isGliding())) {
		updateDistance(difference, player, NormalAchievements.DISTANCEFOOT);
	} else if (plugin.getServerVersion() >= 9 && player.isGliding()) {
		updateDistance(difference, player, NormalAchievements.DISTANCEGLIDING);
	}
}
 
开发者ID:PyvesB,项目名称:AdvancedAchievements,代码行数:46,代码来源:AchieveDistanceRunnable.java


示例9: LorePacker

import org.bukkit.entity.Llama; //导入依赖的package包/类
/**
 * Assembles an ArrayList of the properties for the specified Entity that
 * is to be used for a spawn egg. All instanceof checks are done internally
 * by the LorePackager, so no type checking is required prior to calling
 * this method. Null Entities will throw an IllegalArgumentException. <b>The
 * actual ArrayList is returned by {@link #getLore() LorePacker.getLore()}.
 * </b>
 * @param livingEntity - The Entity to assemble a lore for.
 * @return An ArrayList of Strings
 * @throws IllegalArgumentException If entity parameter is null
 */
public LorePacker(LivingEntity livingEntity) throws IllegalArgumentException {
    if (livingEntity == null) {
        throw new IllegalArgumentException("Can't assemble lore for a null entity!");
    }
    
    lore = new ArrayList<String>();
    // This needs to always be on top of an egg's lore
    lore.add("Identifier: SimpleEgg." + livingEntity.getType().getEntityClass().getSimpleName() + "." + Main.getSelf().getDescription().getVersion());
    lore.addAll(livingEntity(livingEntity));
    
    if (livingEntity instanceof Ageable) {
        lore.addAll(ageable((Ageable) livingEntity));
        
        if (livingEntity instanceof Sheep) {
            lore.addAll(sheep((Sheep) livingEntity));
        } else if (livingEntity instanceof Pig) {
            lore.addAll(pig((Pig) livingEntity));
        } else if (livingEntity instanceof Rabbit) {
            lore.addAll(rabbit((Rabbit) livingEntity));
        } else if (livingEntity instanceof Villager) {
            lore.addAll(villager((Villager) livingEntity));
        } else if (livingEntity instanceof Tameable) {
            lore.addAll(tameable((Tameable) livingEntity));
            
            if (livingEntity instanceof AbstractHorse) {
                lore.addAll(abstractHorse((AbstractHorse) livingEntity));
                
                if (livingEntity instanceof Horse) {
                    lore.addAll(horse((Horse) livingEntity));
                } else if (livingEntity instanceof ChestedHorse) {
                    lore.addAll(chestedHorse((ChestedHorse) livingEntity));
                    
                    if (livingEntity instanceof Llama) {
                        lore.addAll(llama((Llama) livingEntity));
                    }
                }
            } else if (livingEntity instanceof Sittable) {
                lore.addAll(sittable((Sittable) livingEntity));
                
                if (livingEntity instanceof Wolf) {
                    lore.addAll(wolf((Wolf) livingEntity));
                } else if (livingEntity instanceof Ocelot) {
                    lore.addAll(ocelot((Ocelot) livingEntity));
                } else if (livingEntity instanceof Parrot) {
                    lore.addAll(parrot((Parrot) livingEntity));
                }
            }
        }
    } else if (livingEntity instanceof Slime) {
        lore.addAll(slime((Slime) livingEntity));
    } else if (livingEntity instanceof Creeper) {
        lore.addAll(creeper((Creeper) livingEntity));
    } else if (livingEntity instanceof Zombie) {
        lore.addAll(zombie((Zombie) livingEntity));
        
        if (livingEntity instanceof PigZombie) {
            lore.addAll(pigZombie((PigZombie) livingEntity));
        } else if (livingEntity instanceof ZombieVillager) {
            lore.addAll(zombieVillager((ZombieVillager) livingEntity));
        }
    } else if (livingEntity instanceof Spellcaster) {
        lore.addAll(spellCaster((Spellcaster) livingEntity));
    } else if (livingEntity instanceof IronGolem) {
        lore.addAll(ironGolem((IronGolem) livingEntity));
    } else if (livingEntity instanceof Snowman) {
        lore.addAll(snowman((Snowman) livingEntity));
    }
}
 
开发者ID:RedPanda4552,项目名称:SimpleEgg,代码行数:80,代码来源:LorePacker.java



注:本文中的org.bukkit.entity.Llama类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MongoRepositoryFactory类代码示例发布时间:2022-05-22
下一篇:
Java ConsumerContext类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap