Skip to content

Commit 9b6f159

Browse files
committed
revert adventure changes
1 parent c45d185 commit 9b6f159

File tree

5 files changed

+371
-371
lines changed

5 files changed

+371
-371
lines changed
Lines changed: 92 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -1,92 +1,92 @@
1-
///*
2-
// * This file is a part of project QuickShop, the name is QuickChat.java
3-
// * Copyright (C) PotatoCraft Studio and contributors
4-
// *
5-
// * This program is free software: you can redistribute it and/or modify it
6-
// * under the terms of the GNU General Public License as published by the
7-
// * Free Software Foundation, either version 3 of the License, or
8-
// * (at your option) any later version.
9-
// *
10-
// * This program is distributed in the hope that it will be useful, but WITHOUT
11-
// * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12-
// * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13-
// * for more details.
14-
// *
15-
// * You should have received a copy of the GNU General Public License
16-
// * along with this program. If not, see <http://www.gnu.org/licenses/>.
17-
// *
18-
// */
19-
//
20-
//package org.maxgamer.quickshop.chat;
21-
//
22-
//import org.bukkit.command.CommandSender;
23-
//import org.bukkit.entity.Player;
24-
//import org.bukkit.inventory.ItemStack;
25-
//import org.jetbrains.annotations.NotNull;
26-
//import org.jetbrains.annotations.Nullable;
27-
//import org.maxgamer.quickshop.shop.Shop;
28-
//
29-
///**
30-
// * QuickChat is a system to allow us to processing plain text and also MineDown
31-
// */
32-
//public interface QuickChat {
33-
// /**
34-
// * Send plain text to specified receiver
35-
// *
36-
// * @param receiver The receiver will receive this message
37-
// * @param message The plain text to be sent
38-
// */
39-
// void send(@NotNull CommandSender receiver, @Nullable String message);
40-
//
41-
// /**
42-
// * Send QuickComponent to specified receiver
43-
// *
44-
// * @param receiver The receiver will receive this message
45-
// * @param component The plain text to be sent
46-
// */
47-
// void send(@NotNull CommandSender receiver, @Nullable QuickComponent component);
48-
//
49-
// /**
50-
// * Send chat with hover-item to specified receiver
51-
// *
52-
// * @param player The PLAYER will receive this message
53-
// * @param text The text will sent
54-
// * @param itemStack The ItemStack will append to text in message
55-
// */
56-
// void sendItemHologramChat(
57-
// @NotNull Player player,
58-
// @NotNull String text,
59-
// @NotNull ItemStack itemStack);
60-
//
61-
// @NotNull QuickComponent getItemHologramChat(@NotNull Shop shop, @NotNull ItemStack itemStack, @NotNull Player player, @NotNull String message);
62-
//
63-
// /**
64-
// * Create chat with hover-item to specified receiver
65-
// *
66-
// * @param player The PLAYER will receive this message
67-
// * @param text The text will sent
68-
// * @param itemStack The ItemStack will append to text in message
69-
// * @return The QuickComponent created by this method
70-
// */
71-
// @NotNull QuickComponent getItemTextComponent(@NotNull Player player, @NotNull ItemStack itemStack, @NotNull String text);
72-
//
73-
// /**
74-
// * Send click-run-command chat to specified receiver
75-
// *
76-
// * @param receiver The PLAYER will receive this message
77-
// * @param message The text will sent
78-
// * @param hoverText The will show when hover on chat
79-
// * @param command The command when click to be run
80-
// */
81-
// void sendExecutableChat(@NotNull CommandSender receiver, @NotNull String message, @NotNull String hoverText, @NotNull String command);
82-
//
83-
// /**
84-
// * Send click-suggest-command chat to specified receiver
85-
// *
86-
// * @param receiver The PLAYER will receive this message
87-
// * @param message The text will sent
88-
// * @param command The command when click to be suggest
89-
// */
90-
// void sendSuggestedChat(@NotNull CommandSender receiver, @NotNull String message, @NotNull String hoverText, @NotNull String command);
91-
//
92-
//}
1+
/*
2+
* This file is a part of project QuickShop, the name is QuickChat.java
3+
* Copyright (C) PotatoCraft Studio and contributors
4+
*
5+
* This program is free software: you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License as published by the
7+
* Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful, but WITHOUT
11+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13+
* for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*
18+
*/
19+
20+
package org.maxgamer.quickshop.chat;
21+
22+
import org.bukkit.command.CommandSender;
23+
import org.bukkit.entity.Player;
24+
import org.bukkit.inventory.ItemStack;
25+
import org.jetbrains.annotations.NotNull;
26+
import org.jetbrains.annotations.Nullable;
27+
import org.maxgamer.quickshop.shop.Shop;
28+
29+
/**
30+
* QuickChat is a system to allow us to processing plain text and also MineDown
31+
*/
32+
public interface QuickChat {
33+
/**
34+
* Send plain text to specified receiver
35+
*
36+
* @param receiver The receiver will receive this message
37+
* @param message The plain text to be sent
38+
*/
39+
void send(@NotNull CommandSender receiver, @Nullable String message);
40+
41+
/**
42+
* Send QuickComponent to specified receiver
43+
*
44+
* @param receiver The receiver will receive this message
45+
* @param component The plain text to be sent
46+
*/
47+
void send(@NotNull CommandSender receiver, @Nullable QuickComponent component);
48+
49+
/**
50+
* Send chat with hover-item to specified receiver
51+
*
52+
* @param player The PLAYER will receive this message
53+
* @param text The text will sent
54+
* @param itemStack The ItemStack will append to text in message
55+
*/
56+
void sendItemHologramChat(
57+
@NotNull Player player,
58+
@NotNull String text,
59+
@NotNull ItemStack itemStack);
60+
61+
@NotNull QuickComponent getItemHologramChat(@NotNull Shop shop, @NotNull ItemStack itemStack, @NotNull Player player, @NotNull String message);
62+
63+
/**
64+
* Create chat with hover-item to specified receiver
65+
*
66+
* @param player The PLAYER will receive this message
67+
* @param text The text will sent
68+
* @param itemStack The ItemStack will append to text in message
69+
* @return The QuickComponent created by this method
70+
*/
71+
@NotNull QuickComponent getItemTextComponent(@NotNull Player player, @NotNull ItemStack itemStack, @NotNull String text);
72+
73+
/**
74+
* Send click-run-command chat to specified receiver
75+
*
76+
* @param receiver The PLAYER will receive this message
77+
* @param message The text will sent
78+
* @param hoverText The will show when hover on chat
79+
* @param command The command when click to be run
80+
*/
81+
void sendExecutableChat(@NotNull CommandSender receiver, @NotNull String message, @NotNull String hoverText, @NotNull String command);
82+
83+
/**
84+
* Send click-suggest-command chat to specified receiver
85+
*
86+
* @param receiver The PLAYER will receive this message
87+
* @param message The text will sent
88+
* @param command The command when click to be suggest
89+
*/
90+
void sendSuggestedChat(@NotNull CommandSender receiver, @NotNull String message, @NotNull String hoverText, @NotNull String command);
91+
92+
}
Lines changed: 70 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,70 @@
1-
///*
2-
// * This file is a part of project QuickShop, the name is QuickChatType.java
3-
// * Copyright (C) PotatoCraft Studio and contributors
4-
// *
5-
// * This program is free software: you can redistribute it and/or modify it
6-
// * under the terms of the GNU General Public License as published by the
7-
// * Free Software Foundation, either version 3 of the License, or
8-
// * (at your option) any later version.
9-
// *
10-
// * This program is distributed in the hope that it will be useful, but WITHOUT
11-
// * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12-
// * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13-
// * for more details.
14-
// *
15-
// * You should have received a copy of the GNU General Public License
16-
// * along with this program. If not, see <http://www.gnu.org/licenses/>.
17-
// *
18-
// */
19-
//
20-
//package org.maxgamer.quickshop.chat;
21-
//
22-
//import org.jetbrains.annotations.NotNull;
23-
//import org.maxgamer.quickshop.chat.platform.minedown.AdventureQuickChat;
24-
//
25-
//public enum QuickChatType {
26-
// /*
27-
// * BUNGEECHAT = Use the chat lib that Spigot offered.
28-
// * ADVENTURE = Use the chat lib Adventure, it can resolve player disconnected issue but have no message output bug.
29-
// */
30-
// //BUNGEECHAT(0),
31-
// ADVENTURE(1);
32-
//
33-
// private final int id;
34-
//
35-
// QuickChatType(int id) {
36-
// this.id = id;
37-
// }
38-
//
39-
// public static @NotNull QuickChatType fromID(int id) {
40-
// for (QuickChatType type : QuickChatType.values()) {
41-
// if (type.id == id) {
42-
// return type;
43-
// }
44-
// }
45-
// return ADVENTURE;
46-
// }
47-
//
48-
// public static int toID(@NotNull QuickChatType type) {
49-
// return type.id;
50-
// }
51-
//
52-
// public static QuickChat createById(int id) {
53-
// QuickChatType type = fromID(id);
54-
// if (type == QuickChatType.ADVENTURE) {
55-
// return new AdventureQuickChat();
56-
// }
57-
// return new AdventureQuickChat();
58-
// // return new BungeeQuickChat();
59-
// }
60-
//
61-
// public static QuickChat createByType(QuickChatType type) {
62-
// if (type == QuickChatType.ADVENTURE) {
63-
// return new AdventureQuickChat();
64-
// }
65-
// return new AdventureQuickChat();
66-
// }
67-
// public int toID() {
68-
// return id;
69-
// }
70-
//}
1+
/*
2+
* This file is a part of project QuickShop, the name is QuickChatType.java
3+
* Copyright (C) PotatoCraft Studio and contributors
4+
*
5+
* This program is free software: you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License as published by the
7+
* Free Software Foundation, either version 3 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful, but WITHOUT
11+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13+
* for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17+
*
18+
*/
19+
20+
package org.maxgamer.quickshop.chat;
21+
22+
import org.jetbrains.annotations.NotNull;
23+
import org.maxgamer.quickshop.chat.platform.minedown.AdventureQuickChat;
24+
25+
public enum QuickChatType {
26+
/*
27+
* BUNGEECHAT = Use the chat lib that Spigot offered.
28+
* ADVENTURE = Use the chat lib Adventure, it can resolve player disconnected issue but have no message output bug.
29+
*/
30+
//BUNGEECHAT(0),
31+
ADVENTURE(1);
32+
33+
private final int id;
34+
35+
QuickChatType(int id) {
36+
this.id = id;
37+
}
38+
39+
public static @NotNull QuickChatType fromID(int id) {
40+
for (QuickChatType type : QuickChatType.values()) {
41+
if (type.id == id) {
42+
return type;
43+
}
44+
}
45+
return ADVENTURE;
46+
}
47+
48+
public static int toID(@NotNull QuickChatType type) {
49+
return type.id;
50+
}
51+
52+
public static QuickChat createById(int id) {
53+
QuickChatType type = fromID(id);
54+
if (type == QuickChatType.ADVENTURE) {
55+
return new AdventureQuickChat();
56+
}
57+
return new AdventureQuickChat();
58+
// return new BungeeQuickChat();
59+
}
60+
61+
public static QuickChat createByType(QuickChatType type) {
62+
if (type == QuickChatType.ADVENTURE) {
63+
return new AdventureQuickChat();
64+
}
65+
return new AdventureQuickChat();
66+
}
67+
public int toID() {
68+
return id;
69+
}
70+
}

0 commit comments

Comments
 (0)