Java 类net.minecraft.server.MojangsonParser 实例源码

项目:CardinalPGM    文件:CardinalNotifications.java   
public void UpdateNotificationAndBook(){
    Bukkit.getScheduler().runTaskAsynchronously(Cardinal.getInstance(), new Runnable() {
        @Override
        public void run() {
            try {
                chat = ComponentSerializer.parse(GitUtil.getUpdateMessage(notificationUrl));

                ItemStack NMSbook = new ItemStack(Item.getById(387));
                try {
                    NBTBase nbtbase = MojangsonParser.parse(ChatColor.translateAlternateColorCodes('`', GitUtil.getUpdateMessage(bookUrl)));
                    NMSbook.setTag((NBTTagCompound) nbtbase);
                } catch (MojangsonParseException mojangsonparseexception) {
                    Bukkit.getConsoleSender().sendMessage(mojangsonparseexception.getMessage());
                    return;
                }
                book = CraftItemStack.asBukkitCopy(NMSbook);
            } catch (IOException ignored) {
            }
        }
    });
}
项目:Craftbukkit    文件:CraftMagicNumbers.java   
@Override
public ItemStack modifyItemStack(ItemStack stack, String arguments) {
    net.minecraft.server.ItemStack nmsStack = CraftItemStack.asNMSCopy(stack);

    try {
        nmsStack.setTag((NBTTagCompound) MojangsonParser.parse(arguments));
    } catch (MojangsonParseException ex) {
        Logger.getLogger(CraftMagicNumbers.class.getName()).log(Level.SEVERE, null, ex);
    }

    stack.setItemMeta(CraftItemStack.getItemMeta(nmsStack));

    return stack;
}
项目:SpigotSource    文件:CraftMagicNumbers.java   
@Override
public ItemStack modifyItemStack(ItemStack stack, String arguments) {
    net.minecraft.server.ItemStack nmsStack = CraftItemStack.asNMSCopy(stack);

    try {
        nmsStack.setTag((NBTTagCompound) MojangsonParser.parse(arguments));
    } catch (MojangsonParseException ex) {
        Logger.getLogger(CraftMagicNumbers.class.getName()).log(Level.SEVERE, null, ex);
    }

    stack.setItemMeta(CraftItemStack.getItemMeta(nmsStack));

    return stack;
}
项目:CraftBukkit    文件:CraftMagicNumbers.java   
@Override
public ItemStack modifyItemStack(ItemStack stack, String arguments) {
    net.minecraft.server.ItemStack nmsStack = CraftItemStack.asNMSCopy(stack);

    nmsStack.setTag((NBTTagCompound) MojangsonParser.parse(arguments));

    stack.setItemMeta(CraftItemStack.getItemMeta(nmsStack));

    return stack;
}
项目:Tweakkit-Server    文件:CraftMagicNumbers.java   
@Override
public ItemStack modifyItemStack(ItemStack stack, String arguments) {
    net.minecraft.server.ItemStack nmsStack = CraftItemStack.asNMSCopy(stack);

    nmsStack.setTag((NBTTagCompound) MojangsonParser.parse(arguments));

    stack.setItemMeta(CraftItemStack.getItemMeta(nmsStack));

    return stack;
}