本文整理汇总了Java中net.minecraft.server.NBTTagString类的典型用法代码示例。如果您正苦于以下问题:Java NBTTagString类的具体用法?Java NBTTagString怎么用?Java NBTTagString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
NBTTagString类属于net.minecraft.server包,在下文中一共展示了NBTTagString类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: applyToItem
import net.minecraft.server.NBTTagString; //导入依赖的package包/类
@Overridden
void applyToItem(NBTTagCompound itemTag) {
if (hasDisplayName()) {
setDisplayTag(itemTag, NAME.NBT, new NBTTagString(displayName));
}
if (hasLore()) {
setDisplayTag(itemTag, LORE.NBT, createStringList(lore));
}
applyEnchantments(enchantments, itemTag, ENCHANTMENTS);
if (hasRepairCost()) {
itemTag.setInt(REPAIR.NBT, repairCost);
}
if (attributes != null) {
itemTag.set(ATTRIBUTES.NBT, attributes);
}
}
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:21,代码来源:CraftMetaItem.java
示例2: applyToItem
import net.minecraft.server.NBTTagString; //导入依赖的package包/类
@Overridden
void applyToItem(NBTTagCompound itemTag) {
if (hasDisplayName()) {
setDisplayTag(itemTag, NAME.NBT, new NBTTagString(displayName));
}
if (hasLore()) {
setDisplayTag(itemTag, LORE.NBT, createStringList(lore));
}
if (hideFlag != 0) {
itemTag.setInt(HIDEFLAGS.NBT, hideFlag);
}
applyEnchantments(enchantments, itemTag, ENCHANTMENTS);
if (hasRepairCost()) {
itemTag.setInt(REPAIR.NBT, repairCost);
}
for (Map.Entry<String, NBTBase> e : unhandledTags.entrySet()) {
itemTag.set(e.getKey(), e.getValue());
}
}
开发者ID:tgnmc,项目名称:Craftbukkit,代码行数:25,代码来源:CraftMetaItem.java
示例3: applyToItem
import net.minecraft.server.NBTTagString; //导入依赖的package包/类
@Overridden
void applyToItem(NBTTagCompound itemTag) {
if (hasDisplayName()) {
setDisplayTag(itemTag, NAME.NBT, new NBTTagString(NAME.NBT, displayName));
}
if (hasLore()) {
setDisplayTag(itemTag, LORE.NBT, createStringList(lore, LORE));
}
applyEnchantments(enchantments, itemTag, ENCHANTMENTS);
if (hasRepairCost()) {
itemTag.setInt(REPAIR.NBT, repairCost);
}
if (attributes != null) {
itemTag.set(ATTRIBUTES.NBT, attributes);
}
}
开发者ID:AlmuraDev,项目名称:Almura-Server,代码行数:21,代码来源:CraftMetaItem.java
示例4: CraftMetaBook
import net.minecraft.server.NBTTagString; //导入依赖的package包/类
CraftMetaBook(NBTTagCompound tag) {
super(tag);
if (tag.hasKey(BOOK_TITLE.NBT)) {
this.title = tag.getString(BOOK_TITLE.NBT);
}
if (tag.hasKey(BOOK_AUTHOR.NBT)) {
this.author = tag.getString(BOOK_AUTHOR.NBT);
}
if (tag.hasKey(BOOK_PAGES.NBT)) {
NBTTagList pages = tag.getList(BOOK_PAGES.NBT);
String[] pageArray = new String[pages.size()];
for (int i = 0; i < pages.size(); i++) {
String page = ((NBTTagString) pages.get(i)).data;
pageArray[i] = page;
}
addPage(pageArray);
}
}
开发者ID:AlmuraDev,项目名称:Almura-Server,代码行数:24,代码来源:CraftMetaBook.java
示例5: CraftMetaItem
import net.minecraft.server.NBTTagString; //导入依赖的package包/类
CraftMetaItem(NBTTagCompound tag) {
if (tag.hasKey(DISPLAY.NBT)) {
NBTTagCompound display = tag.getCompound(DISPLAY.NBT);
if (display.hasKey(NAME.NBT)) {
displayName = display.getString(NAME.NBT);
}
if (display.hasKey(LORE.NBT)) {
NBTTagList list = display.getList(LORE.NBT);
lore = new ArrayList<String>(list.size());
for (int index = 0; index < list.size(); index++) {
String line = ((NBTTagString) list.get(index)).data;
lore.add(line);
}
}
}
this.enchantments = buildEnchantments(tag, ENCHANTMENTS);
if (tag.hasKey(REPAIR.NBT)) {
repairCost = tag.getInt(REPAIR.NBT);
}
}
开发者ID:didoupimpon,项目名称:Craft-city,代码行数:26,代码来源:CraftMetaItem.java
示例6: applyToItem
import net.minecraft.server.NBTTagString; //导入依赖的package包/类
@Overridden
void applyToItem(NBTTagCompound itemTag) {
if (hasDisplayName()) {
setDisplayTag(itemTag, NAME.NBT, new NBTTagString(NAME.NBT, displayName));
}
if (hasLore()) {
setDisplayTag(itemTag, LORE.NBT, createStringList(lore, LORE));
}
applyEnchantments(enchantments, itemTag, ENCHANTMENTS);
if (hasRepairCost()) {
itemTag.setInt(REPAIR.NBT, repairCost);
}
}
开发者ID:didoupimpon,项目名称:Craft-city,代码行数:17,代码来源:CraftMetaItem.java
示例7: createStringList
import net.minecraft.server.NBTTagString; //导入依赖的package包/类
static NBTTagList createStringList(List<String> list) {
if (list == null || list.isEmpty()) {
return null;
}
NBTTagList tagList = new NBTTagList();
for (String value : list) {
tagList.add(new NBTTagString(value));
}
return tagList;
}
开发者ID:OvercastNetwork,项目名称:CraftBukkit,代码行数:13,代码来源:CraftMetaItem.java
示例8: applyToItem
import net.minecraft.server.NBTTagString; //导入依赖的package包/类
@Override
void applyToItem(NBTTagCompound itemData) {
super.applyToItem(itemData, false);
if (hasTitle()) {
itemData.setString(BOOK_TITLE.NBT, this.title);
} else {
itemData.setString(BOOK_TITLE.NBT, " ");
}
if (hasAuthor()) {
itemData.setString(BOOK_AUTHOR.NBT, this.author);
} else {
itemData.setString(BOOK_AUTHOR.NBT, " ");
}
if (hasPages()) {
NBTTagList list = new NBTTagList();
for (IChatBaseComponent page : pages) {
list.add(new NBTTagString(
ChatSerializer.a(page)
));
}
itemData.set(BOOK_PAGES.NBT, list);
}
itemData.setBoolean(RESOLVED.NBT, true);
if (generation != null) {
itemData.setInt(GENERATION.NBT, generation);
} else {
itemData.setInt(GENERATION.NBT, 0);
}
}
开发者ID:tgnmc,项目名称:Craftbukkit,代码行数:34,代码来源:CraftMetaBookSigned.java
示例9: applyToItem
import net.minecraft.server.NBTTagString; //导入依赖的package包/类
void applyToItem(NBTTagCompound itemData, boolean handlePages) {
super.applyToItem(itemData);
if (hasTitle()) {
itemData.setString(BOOK_TITLE.NBT, this.title);
}
if (hasAuthor()) {
itemData.setString(BOOK_AUTHOR.NBT, this.author);
}
if (handlePages) {
if (hasPages()) {
NBTTagList list = new NBTTagList();
for (IChatBaseComponent page : pages) {
list.add(new NBTTagString(CraftChatMessage.fromComponent(page)));
}
itemData.set(BOOK_PAGES.NBT, list);
}
itemData.remove(RESOLVED.NBT);
}
if (generation != null) {
itemData.setInt(GENERATION.NBT, generation);
}
}
开发者ID:tgnmc,项目名称:Craftbukkit,代码行数:28,代码来源:CraftMetaBook.java
示例10: createStringList
import net.minecraft.server.NBTTagString; //导入依赖的package包/类
static NBTTagList createStringList(List<String> list, ItemMetaKey key) {
if (list == null || list.isEmpty()) {
return null;
}
NBTTagList tagList = new NBTTagList(key.NBT);
for (String value : list) {
tagList.add(new NBTTagString("", value));
}
return tagList;
}
开发者ID:AlmuraDev,项目名称:Almura-Server,代码行数:13,代码来源:CraftMetaItem.java
示例11: applyToItem
import net.minecraft.server.NBTTagString; //导入依赖的package包/类
@Overridden
void applyToItem(NBTTagCompound itemTag) {
if (hasDisplayName()) {
setDisplayTag(itemTag, NAME.NBT, new NBTTagString(displayName));
}
if (hasLore()) {
setDisplayTag(itemTag, LORE.NBT, createStringList(lore));
}
if (hideFlag != 0) {
itemTag.setInt(HIDEFLAGS.NBT, hideFlag);
}
applyEnchantments(enchantments, itemTag, ENCHANTMENTS);
// Spigot start
if ( spigot.isUnbreakable() )
{
itemTag.setBoolean( UNBREAKABLE.NBT, true );
}
// Spigot end
if (hasRepairCost()) {
itemTag.setInt(REPAIR.NBT, repairCost);
}
for (Map.Entry<String, NBTBase> e : unhandledTags.entrySet()) {
itemTag.set(e.getKey(), e.getValue());
}
}
开发者ID:bergerkiller,项目名称:SpigotSource,代码行数:33,代码来源:CraftMetaItem.java
注:本文中的net.minecraft.server.NBTTagString类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论