|
|
|
|
@ -1,5 +1,7 @@ |
|
|
|
|
package xyz.mineconomia.mineconomiacore.BookHandler; |
|
|
|
|
|
|
|
|
|
import net.md_5.bungee.api.chat.*; |
|
|
|
|
import org.bukkit.ChatColor; |
|
|
|
|
import org.bukkit.Material; |
|
|
|
|
import org.bukkit.command.Command; |
|
|
|
|
import org.bukkit.command.CommandExecutor; |
|
|
|
|
@ -7,6 +9,7 @@ import org.bukkit.command.CommandSender; |
|
|
|
|
import org.bukkit.entity.Player; |
|
|
|
|
import org.bukkit.inventory.ItemStack; |
|
|
|
|
import org.bukkit.inventory.meta.BookMeta; |
|
|
|
|
import xyz.upperlevel.spigot.book.BookUtil; |
|
|
|
|
|
|
|
|
|
public class BookCommand implements CommandExecutor { |
|
|
|
|
@Override |
|
|
|
|
@ -15,31 +18,47 @@ public class BookCommand implements CommandExecutor { |
|
|
|
|
Player player = (Player) sender; |
|
|
|
|
|
|
|
|
|
//Create a Book
|
|
|
|
|
ItemStack book = new ItemStack(Material.WRITTEN_BOOK); |
|
|
|
|
BookMeta bookMeta = (BookMeta) book.getItemMeta(); |
|
|
|
|
ItemStack book = BookUtil.writtenBook() |
|
|
|
|
.author("Temný řád serveru Mineconomia") |
|
|
|
|
.title("Příručka nejen pro začátečníky") |
|
|
|
|
.pages( |
|
|
|
|
|
|
|
|
|
//Book Info (irrelevant)
|
|
|
|
|
bookMeta.setTitle("POMOC"); |
|
|
|
|
bookMeta.setAuthor("SERVER"); |
|
|
|
|
new BookUtil.PageBuilder() |
|
|
|
|
.newLine() |
|
|
|
|
.add(new TextComponent(ChatColor.GOLD + String.valueOf(ChatColor.BOLD)+ "MINECONOMIA")) |
|
|
|
|
.newLine() |
|
|
|
|
.add(ChatColor.ITALIC + "" + ChatColor.GRAY + "Economy server") |
|
|
|
|
.newLine() |
|
|
|
|
.newLine() |
|
|
|
|
.add(ChatColor.GOLD + "■■■■■■■■■■■■■■■■■■■") |
|
|
|
|
.newLine() |
|
|
|
|
.add(ChatColor.GRAY + "Užitečná příručka nejen pro nové hráče") |
|
|
|
|
.newLine() |
|
|
|
|
.add(ChatColor.GOLD + "■■■■■■■■■■■■■■■■■■■") |
|
|
|
|
.newLine() |
|
|
|
|
.newLine() |
|
|
|
|
.newLine() |
|
|
|
|
.newLine() |
|
|
|
|
.add(ChatColor.GOLD + String.valueOf(ChatColor.BOLD) + "TIP: " + ChatColor.BLACK + "pro rychlou navigaci klikej na položky v obsahu") |
|
|
|
|
.build(), |
|
|
|
|
new BookUtil.PageBuilder() |
|
|
|
|
.add(ChatColor.GOLD + String.valueOf(ChatColor.BOLD) +"OBSAH (1/2)") |
|
|
|
|
.newLine().newLine().newLine() |
|
|
|
|
.add(ChatColor.GRAY + "- Kde vzít peníze?") |
|
|
|
|
.newLine().newLine() |
|
|
|
|
.add(ChatColor.GRAY + "- Tvůj první pozemek") |
|
|
|
|
.newLine().newLine() |
|
|
|
|
.add(ChatColor.GRAY + "- Co je to pravítko") |
|
|
|
|
.newLine().newLine() |
|
|
|
|
.add(ChatColor.GRAY + "- Tvůj první obchod") |
|
|
|
|
.newLine().newLine() |
|
|
|
|
.add(ChatColor.GRAY + "- Využij pozemek") |
|
|
|
|
|
|
|
|
|
//PG1
|
|
|
|
|
bookMeta.addPage("§l§11text\n" + |
|
|
|
|
"§o§21text text\n" + |
|
|
|
|
"§l§31text:text\n" + |
|
|
|
|
"§o§41texttexttexttext.\n" + |
|
|
|
|
"§l§51text -- text\n" + |
|
|
|
|
"§o§61text x text"); |
|
|
|
|
.build() |
|
|
|
|
) |
|
|
|
|
.build(); |
|
|
|
|
|
|
|
|
|
//PG2
|
|
|
|
|
bookMeta.addPage("§l§72text\n" + |
|
|
|
|
"§o§82text text\n" + |
|
|
|
|
"§l§92text:text\n" + |
|
|
|
|
"§o§02texttexttexttext.\n" + |
|
|
|
|
"§l§12text -- text\n" + |
|
|
|
|
"§o§22text x text"); |
|
|
|
|
|
|
|
|
|
book.setItemMeta(bookMeta); //Gluing The Book Together
|
|
|
|
|
player.openBook(book); //Opening Book After Typing Command
|
|
|
|
|
BookUtil.openPlayer(player, book); |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|