001package com.ericlam.mc.eld.services; 002 003import net.md_5.bungee.api.chat.BaseComponent; 004import net.md_5.bungee.api.chat.hover.content.Content; 005 006/** 007 * 訊息編輯器 008 */ 009public interface MessageService { 010 011 /** 012 * 編輯訊息 013 * 014 * @param msg 訊息 015 * @return this 016 */ 017 MessageFactory edit(String... msg); 018 019 interface MessageFactory { 020 021 /** 022 * 新增訊息 023 * 024 * @param msg 訊息 025 * @return this 026 */ 027 MessageFactory add(String... msg); 028 029 /** 030 * 新增可點擊網址 031 * 032 * @param website 網址 033 * @return this 034 */ 035 MessageFactory url(String website); 036 037 /** 038 * 新增指令執行 039 * 040 * @param command 指令 041 * @return this 042 */ 043 MessageFactory command(String command); 044 045 /** 046 * 新增建議訊息 047 * 048 * @param suggest 建議訊息 049 * @return this 050 */ 051 MessageFactory suggest(String suggest); 052 053 /** 054 * 新增換頁操作 055 * 056 * @param page 頁數 057 * @return this 058 */ 059 MessageFactory page(String page); 060 061 /** 062 * 新增浮動文字 063 * 064 * @param hoverTxt 浮動文字 065 * @return this 066 */ 067 MessageFactory hoverText(Content... hoverTxt); 068 069 /** 070 * 換行 071 * 072 * @return this 073 */ 074 MessageFactory nextLine(); 075 076 /** 077 * 生成訊息 078 * 079 * @return 訊息 080 */ 081 BaseComponent[] build(); 082 083 } 084}