本文整理了Java中org.bukkit.Server.getItemFactory()
方法的一些代码示例,展示了Server.getItemFactory()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Server.getItemFactory()
方法的具体详情如下:
包路径:org.bukkit.Server
类名称:Server
方法名:getItemFactory
[英]Gets the instance of the item factory (for ItemMeta).
[中]获取项工厂的实例(对于ItemMeta)。
代码示例来源:origin: Bukkit/Bukkit
/**
* @see Server#getItemFactory()
*/
public static ItemFactory getItemFactory() {
return server.getItemFactory();
}
代码示例来源:origin: GlowstoneMC/Glowstone
public ImmutableItemStack(int type) {
super(type);
itemMeta = ServerProvider.getServer().getItemFactory().getItemMeta(getType()).clone();
}
代码示例来源:origin: SpigotMC/Spigot-API
/**
* @see Server#getItemFactory()
*/
public static ItemFactory getItemFactory() {
return server.getItemFactory();
}
代码示例来源:origin: EngineHub/CommandHelper
@Override
public MCItemFactory getItemFactory() {
return new BukkitMCItemFactory(s.getItemFactory());
}
代码示例来源:origin: CitizensDev/CitizensAPI
@SuppressWarnings("unchecked")
private static <T extends ItemMeta> T ensureMeta(ItemStack stack) {
if (!stack.hasItemMeta()) {
stack.setItemMeta(Bukkit.getServer().getItemFactory().getItemMeta(stack.getType()));
}
return (T) stack.getItemMeta();
}
代码示例来源:origin: Co0sh/BetonQuest
if (!armorMeta.getColor().equals(Bukkit.getServer().getItemFactory().getDefaultLeatherColor())) {
DyeColor c = DyeColor.getByColor(armorMeta.getColor());
color = " color:" + (c == null ? '#' + Integer.toHexString(armorMeta.getColor().asRGB()) : c.toString());
代码示例来源:origin: catageek/ByteCart
static private BookFile create(Inventory inventory, ItemStack mystack, int index, boolean binary, String name) {
if (mystack == null || ! mystack.getType().equals(Material.WRITTEN_BOOK)) {
mystack = new ItemStack(Material.WRITTEN_BOOK);
}
final BookMeta mybook = (BookMeta) Bukkit.getServer().getItemFactory().getItemMeta(Material.WRITTEN_BOOK);
if (name != null) {
final String myauthor = prefix + "." + name;
mybook.setAuthor(myauthor);
}
else {
mybook.setAuthor(prefix);
}
mystack.setItemMeta(mybook);
inventory.setItem(index, mystack);
return new BookFile(inventory, index, binary);
}
内容来源于网络,如有侵权,请联系作者删除!