当前位置: 首页>>代码示例>>Java>>正文


Java PotionMeta.setDisplayName方法代码示例

本文整理汇总了Java中org.bukkit.inventory.meta.PotionMeta.setDisplayName方法的典型用法代码示例。如果您正苦于以下问题:Java PotionMeta.setDisplayName方法的具体用法?Java PotionMeta.setDisplayName怎么用?Java PotionMeta.setDisplayName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.bukkit.inventory.meta.PotionMeta的用法示例。


在下文中一共展示了PotionMeta.setDisplayName方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getSeaWater

import org.bukkit.inventory.meta.PotionMeta; //导入方法依赖的package包/类
/**
 * l.add("��2��ˮ,����...");
	l.add("��4�������ܽ��,��l���м�������!");
	l.add("��b��Ҫ�þ�ˮװ�����������������!");
 * @return ��ˮ
 */
public static ItemStack getSeaWater(){
	ItemStack sw=new ItemStack(Material.POTION);
	PotionMeta im = (PotionMeta) sw.getItemMeta();
	im.setColor(Color.fromRGB(15, 103, 219));
	im.setDisplayName("��1��l��ˮ");
	List<String> l=new LinkedList<String>();
	l.add("��a��l"+rs.getLoreTabel("Thirst")+": ��b��l-"+Utils.random(2, 20)+"%");
	l.add("��2��l"+rs.getLoreTabel("SickKind")+": ��c��l"+rs.defSick.split(";")[(int)Utils.random(0, rs.defSick.split(";").length)]);
	l.add("��2��l"+rs.getLoreTabel("Sickness")+": ��c��l"+Utils.random(20, 30)+"%");
	l.add("");
	l.add("��7��l"+rs.getLoreTabel("Weight")+": 1");
	l.add("");
	l.add("��2��ˮ,����...");
	l.add("��4�������ܽ��,��l���м�������!");
	l.add("��b��Ҫ�þ�ˮװ�����������������!");
	im.setLore(l);
	sw.setItemMeta(im);
	return sw;
}
 
开发者ID:SchoolUniform,项目名称:RealSurvival,代码行数:26,代码来源:Items.java

示例2: getLakeWater

import org.bukkit.inventory.meta.PotionMeta; //导入方法依赖的package包/类
/**
 * l.add("��2��ˮ,�����ճɿ�ˮ");
	l.add("��4��lֱ�Ӻ��м�������!");
	l.add("��b��Ҫ�á�e��l��ˮװ�á�b���������������!");
 * @return��ˮ
 */
public static ItemStack getLakeWater(){
	ItemStack sw=new ItemStack(Material.POTION);
	PotionMeta im = (PotionMeta) sw.getItemMeta();
	im.setColor(Color.fromRGB(36, 165, 229));
	im.setDisplayName("��2��l��ˮ");
	List<String> l=new LinkedList<String>();
	l.add("��2��l"+rs.getLoreTabel("Thirst")+": ��b��l"+Utils.random(5, 20)+"%");
	l.add("��2��l"+rs.getLoreTabel("SickKind")+": ��c��l"+rs.defSick.split(";")[(int)Utils.random(0, rs.defSick.split(";").length)]);
	l.add("��2��l"+rs.getLoreTabel("Sickness")+": ��c��l"+Utils.random(5, 15)+"%");
	l.add("");
	l.add("��7��l"+rs.getLoreTabel("Weight")+": 1");
	l.add("");
	l.add("��4��lֱ�Ӻ��м�������!");
	l.add("��b��Ҫ�á�e��l��ˮװ�á�b���������������!");
	im.setLore(l);
	sw.setItemMeta(im);
	return sw;
}
 
开发者ID:SchoolUniform,项目名称:RealSurvival,代码行数:25,代码来源:Items.java

示例3: getHotWater

import org.bukkit.inventory.meta.PotionMeta; //导入方法依赖的package包/类
/**
 * l.add("��2����ֱ������");
	l.add("��a��l���Ի������Ƽ���!");
	l.add("��c������ů����!");
 * @return ��ˮ
 */
public static ItemStack getHotWater(){
	ItemStack sw=new ItemStack(Material.POTION);
	PotionMeta im = (PotionMeta) sw.getItemMeta();
	im.setColor(Color.fromRGB(36, 165, 229));
	im.setDisplayName("��d��l��ˮ");
	List<String> l=new LinkedList<String>();
	l.add("��a��l"+rs.getLoreTabel("Thirst")+": ��b��l"+Utils.random(10, 25)+"%");
	l.add("��c��l"+rs.getLoreTabel("Tem")+": ��b��l"+Utils.random(0.1, 1.5));
	l.add("");
	l.add("��7��l"+rs.getLoreTabel("Weight")+": 1");
	l.add("");
	l.add("��2����ֱ������");
	l.add("��a��l���Ի������Ƽ���!");
	l.add("��c������ů����!");
	im.setLore(l);
	sw.setItemMeta(im);
	return sw;
}
 
开发者ID:SchoolUniform,项目名称:RealSurvival,代码行数:25,代码来源:Items.java

示例4: getIceWater

import org.bukkit.inventory.meta.PotionMeta; //导入方法依赖的package包/类
/**
 * l.add("��2����ֱ������");
	l.add("��b��l���Ը����彵��!");
 * @return ��ˮ
 */
public static ItemStack getIceWater(){
	ItemStack sw=new ItemStack(Material.POTION);
	PotionMeta im = (PotionMeta) sw.getItemMeta();
	im.setColor(Color.fromRGB(36, 165, 229));
	im.setDisplayName("��3��l��ˮ");
	List<String> l=new LinkedList<String>();
	l.add("��a��l"+rs.getLoreTabel("Thirst")+": ��b��l"+Utils.random(10, 25)+"%");
	l.add("��3��l"+rs.getLoreTabel("Tem")+": ��c��l-"+Utils.random(0.1, 1.5)+"%");
	l.add("");
	l.add("��7��l"+rs.getLoreTabel("Weight")+": 1");
	l.add("");
	l.add("��2����ֱ������");
	l.add("��b��l���Ը����彵��!");
	im.setLore(l);
	sw.setItemMeta(im);
	return sw;
}
 
开发者ID:SchoolUniform,项目名称:RealSurvival,代码行数:23,代码来源:Items.java

示例5: getFreshWater

import org.bukkit.inventory.meta.PotionMeta; //导入方法依赖的package包/类
/**
 * l.add("��2����ֱ������");
 * @return ��ˮ
 */
public static ItemStack getFreshWater(){
	ItemStack sw=new ItemStack(Material.POTION);
	PotionMeta im = (PotionMeta) sw.getItemMeta();
	im.setColor(Color.fromRGB(36, 165, 229));
	im.setDisplayName("��3��l��ˮ");
	List<String> l=new LinkedList<String>();
	l.add("��a��l"+rs.getLoreTabel("Thirst")+": ��b��l"+Utils.random(10, 25)+"%");
	l.add("");
	l.add("��7��l"+rs.getLoreTabel("Weight")+": 1");
	l.add("");
	l.add("��2����ֱ������");
	im.setLore(l);
	sw.setItemMeta(im);
	return sw;
}
 
开发者ID:SchoolUniform,项目名称:RealSurvival,代码行数:20,代码来源:Items.java

示例6: getSwamplandWater

import org.bukkit.inventory.meta.PotionMeta; //导入方法依赖的package包/类
/**
 *l.add("��2��Ȼ���Խ��,����...");
	l.add("��e���������....");
 * @return ����ˮ
 */
public static ItemStack getSwamplandWater(){
	ItemStack sw=new ItemStack(Material.POTION);
	PotionMeta im = (PotionMeta) sw.getItemMeta();
	im.setColor(Color.fromRGB(50, 69, 107));
	im.setDisplayName("��8��l����ˮ");
	List<String> l=new LinkedList<String>();
	l.add("��a��l"+rs.getLoreTabel("Thirst")+": ��b��l"+Utils.random(2, 15)+"%");
	l.add("��2��l"+rs.getLoreTabel("SickKind")+": ��c��l"+rs.defSick.split(";")[(int)Utils.random(0, rs.defSick.split(";").length)]);
	l.add("��2��l"+rs.getLoreTabel("Sickness")+": ��c��l"+Utils.random(30, 50)+"%");
	l.add("");
	l.add("��7��l"+rs.getLoreTabel("Weight")+": 1");
	l.add("");
	l.add("��2��Ȼ���Խ��,����...");
	l.add("��e���������....");
	im.setLore(l);
	sw.setItemMeta(im);
	return sw;
}
 
开发者ID:SchoolUniform,项目名称:RealSurvival,代码行数:24,代码来源:Items.java

示例7: getRainwater

import org.bukkit.inventory.meta.PotionMeta; //导入方法依赖的package包/类
/**
	l.add("��2��ˮ�����˵���DZȽϸɾ���");
	l.add("��b���ǻ����н�С���ʵò�");
 * @return ��ˮ
 */
public static ItemStack getRainwater(){
	ItemStack sw=new ItemStack(Material.POTION);
	PotionMeta im = (PotionMeta) sw.getItemMeta();
	im.setColor(Color.fromRGB(36, 165, 229));
	im.setDisplayName("��b��l��ˮ");
	List<String> l=new LinkedList<String>();
	l.add("��a��l"+rs.getLoreTabel("Thirst")+": ��b��l"+Utils.random(5, 25)+"%");
	l.add("��2��l"+rs.getLoreTabel("SickKind")+": ��c��l"+rs.defSick.split(";")[(int)Utils.random(0, rs.defSick.split(";").length)]);
	l.add("��2��l"+rs.getLoreTabel("Sickness")+": ��c��l"+Utils.random(2, 10)+"%");
	l.add("");
	l.add("��7��l"+rs.getLoreTabel("Weight")+": 1");
	l.add("");
	l.add("��2��ˮ�����˵���DZȽϸɾ���");
	l.add("��b���ǻ����н�С���ʵò�");
	im.setLore(l);
	sw.setItemMeta(im);
	return sw;
}
 
开发者ID:SchoolUniform,项目名称:RealSurvival,代码行数:24,代码来源:Items.java

示例8: LuckyPotion

import org.bukkit.inventory.meta.PotionMeta; //导入方法依赖的package包/类
public void LuckyPotion(BlockBreakEvent event){
    Location loc = event.getBlock().getLocation();
    World world = loc.getWorld();
    ItemStack energyPotion = new ItemStack(Material.POTION, 1);
    PotionMeta energyPotionMeta = (PotionMeta) energyPotion.getItemMeta();
    energyPotionMeta.setDisplayName("§6Lucky Potion");
    List<String> lore = new ArrayList<String>();
    lore.add("§6"+ LuckyBlocksMainController.instance.language.getString("POTION_DURATION"));
    energyPotionMeta.setLore(lore);
    energyPotionMeta.addCustomEffect(new PotionEffect(PotionEffectType.SPEED, 20*60, 1), true);
    energyPotionMeta.addCustomEffect(new PotionEffect(PotionEffectType.INCREASE_DAMAGE, 20*60, 1), true);
    energyPotionMeta.addCustomEffect(new PotionEffect(PotionEffectType.ABSORPTION, 20*60, 1), true);
    energyPotionMeta.addCustomEffect(new PotionEffect(PotionEffectType.HEAL, 20*60, 1), true);
    energyPotionMeta.addCustomEffect(new PotionEffect(PotionEffectType.HEALTH_BOOST, 20*60, 1), true);
    energyPotionMeta.addCustomEffect(new PotionEffect(PotionEffectType.DAMAGE_RESISTANCE, 20*60, 1), true);
    energyPotionMeta.addCustomEffect(new PotionEffect(PotionEffectType.JUMP, 20*60, 3), true);
    energyPotionMeta.addCustomEffect(new PotionEffect(PotionEffectType.WATER_BREATHING, 20*60, 3), true);
    energyPotion.setItemMeta(energyPotionMeta);
    Potion po = new Potion((byte) 8258);
    po.apply(energyPotion);
    world.dropItemNaturally(loc,energyPotion);
}
 
开发者ID:josegrobles,项目名称:LuckyBlocksBukkit,代码行数:23,代码来源:LuckyBlocksActionController.java

示例9: toItemStack

import org.bukkit.inventory.meta.PotionMeta; //导入方法依赖的package包/类
public ItemStack toItemStack(int amount) {
    ItemStack potion = new ItemStack(Material.POTION, amount, this.getDataValue());
    PotionMeta meta = (PotionMeta) potion.getItemMeta();

    if (this.getName() != null) {
        meta.setDisplayName(this.getName());
    }

    if (this.getLore() != null && !this.getLore().isEmpty()) {
        meta.setLore(this.getLore());
    }

    if (!this.getEffects().isEmpty()) {
        for (PotionEffect effect : this.getEffects()) {
            meta.addCustomEffect(effect, true);
        }
    }

    potion.setItemMeta(meta);
    return potion;
}
 
开发者ID:Pershonkey,项目名称:McMMOPlus,代码行数:22,代码来源:AlchemyPotion.java

示例10: createItem

import org.bukkit.inventory.meta.PotionMeta; //导入方法依赖的package包/类
public static ItemStack createItem(LootType type) {
	if (type == LootType.RANDOM) type = types.get(CSCoreLib.randomizer().nextInt(types.size()));
	if (type == LootType.SLIMEFUN && !Bukkit.getPluginManager().isPluginEnabled("Slimefun")) type = LootType.TREASURE;
	
	ItemStack item = new ItemStack(Material.AIR);
	try {
		switch(type) {
		case BOOK: {
			item.setType(Material.ENCHANTED_BOOK);
			item = applyTier(item, LootTier.getRandom());
			break;
		}
		case TREASURE: {
			item.setType(TREASURE.get(CSCoreLib.randomizer().nextInt(TREASURE.size())));
			item.setAmount(CSCoreLib.randomizer().nextInt(max_items - min_items) + min_items);
			break;
		}
		case POTION: {
			item.setType(Material.POTION);
			item.setDurability(CSCoreLib.randomizer().nextInt(100) > 50 ? (short) 8194: 16386);
			String name = COLOR.get(CSCoreLib.randomizer().nextInt(COLOR.size())) + PREFIX.get(CSCoreLib.randomizer().nextInt(PREFIX.size())) + " " + SUFFIX.get(CSCoreLib.randomizer().nextInt(SUFFIX.size()));
			PotionMeta meta = (PotionMeta) item.getItemMeta();
			meta.setMainEffect(PotionEffectType.HEAL);
			meta.setDisplayName(ChatColor.translateAlternateColorCodes('&', name));
			for (int i = 0; i < CSCoreLib.randomizer().nextInt(max_potions - min_potions) + min_potions; i++) {
				PotionEffectType e = POTIONEFFECTS.get(CSCoreLib.randomizer().nextInt(POTIONEFFECTS.size()));
				meta.addCustomEffect(new PotionEffect(e, (CSCoreLib.randomizer().nextInt(max_items - min_items) + min_items) * 10 * 20, CSCoreLib.randomizer().nextInt(MagicLoot.getMaxLevel(e) - 1) + 1), true);
			}
			item.setItemMeta(meta);
			break;
		}
		case TOOL: {
			if (CSCoreLib.randomizer().nextInt(100) < 10) item = new ItemStack(Material.ARROW, 4 + CSCoreLib.randomizer().nextInt(20));
			else {
				item.setType(TOOLS.get(CSCoreLib.randomizer().nextInt(TOOLS.size())));
				if (item.getType().getMaxDurability() == 0) break;
				item = applyTier(item, LootTier.getRandom());
				
				item.setDurability((short) (CSCoreLib.randomizer().nextInt(item.getType().getMaxDurability() / 4) * 3));
			}
			break;
		}
		case SLIMEFUN: {
			item = SLIMEFUN.get(CSCoreLib.randomizer().nextInt(SLIMEFUN.size())).clone();
			item.setAmount(CSCoreLib.randomizer().nextInt(max_slimefun - min_slimefun) + min_slimefun);
			if (!item.getType().equals(Material.SKULL_ITEM) && item.getType().getMaxStackSize() < item.getAmount()) item.setAmount(item.getType().getMaxStackSize());
			break;
		}
		case UNANALIZED: {
			item.setType(TOOLS.get(CSCoreLib.randomizer().nextInt(TOOLS.size())));
			ItemMeta im = item.getItemMeta();
			im.setDisplayName(ChatColor.translateAlternateColorCodes('&', "&7&kMEH WANNA BE EXAMINED"));
			List<String> lore = new ArrayList<String>();
			lore.add("");
			lore.add("�8Tier: �b�d�e�cUnknown");
			im.setLore(lore);
			item.setItemMeta(im);
			if (item.getType().getMaxDurability() > 0) item.setDurability((short) (CSCoreLib.randomizer().nextInt(item.getType().getMaxDurability() / 4) * 3));
			break;
		}
		default:
			break;
		}
	} catch(Exception x) {
		x.printStackTrace();
	}
	return item;
}
 
开发者ID:TheBusyBiscuit,项目名称:MagicLoot3,代码行数:69,代码来源:ItemManager.java


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