update finish method
This commit is contained in:
parent
bb38b69ad7
commit
3b0f87afbc
@ -19,9 +19,6 @@ locale: 'US'
|
||||
lang: 'en'
|
||||
#This controls the message when left click a bug
|
||||
auto-sendback-msg: '&eThanks for your reporting'
|
||||
#This controls the stop sign of reporting
|
||||
#Only support number,english letter,some punctuation
|
||||
stop-sign: '#end#'
|
||||
#Report Alias
|
||||
alias: 'r'
|
||||
#If you use bungeecord, please set this to true and set database to mysql
|
||||
|
||||
@ -3,9 +3,9 @@ rep-suc: '&e成功提交,编号#%serial%'
|
||||
get-help: '&e使用&a/bug help &f获得更多帮助'
|
||||
must-player-run: '&c这个命令必须由玩家使用!'
|
||||
input-bug-info: '&e请输入你要提交的内容'
|
||||
continue-input: '&e请继续提交,输入&a #end# &f完成提交'
|
||||
continue-input: '&e请继续提交,移动以完成提交'
|
||||
illegal-char: '&c你的输入含有非法字符,请检查并重新提交!'
|
||||
not-complete: '&c请先完成提交! 输入&a #end#&c 即可'
|
||||
not-complete: '&c请先完成提交!'
|
||||
gui-name: '&c浏览全部'
|
||||
history-name: '&b历史记录'
|
||||
last-page: '&e上一页'
|
||||
|
||||
@ -3,9 +3,9 @@ rep-suc: '&eSuccessfully report bug serial #%serial%'
|
||||
get-help: '&eUse &a/bug help &fto get help'
|
||||
must-player-run: '&cThis command must be run as player!'
|
||||
input-bug-info: '&ePlease input bug information. You can divide it in several parts if its too long.'
|
||||
continue-input: '&eContinue input and use &a%stopsign% &fto stop this input'
|
||||
continue-input: '&eContinue input and try to move to stop this input'
|
||||
illegal-char: '&cYour input contains illegal character, please check and retry!'
|
||||
not-complete: '&cPlease finish reporting first! Chat with&a %stopsign%&c may help'
|
||||
not-complete: '&cPlease finish reporting first!'
|
||||
gui-name: '&cBug View'
|
||||
history-name: '&bHistory View'
|
||||
last-page: '&eLast Page'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
name: BugRepGUI
|
||||
main: com.ilummc.bugrepgui.Main
|
||||
version: 1.6
|
||||
version: 1.7
|
||||
author: IzzelAliz
|
||||
website: https://www.spigotmc.org/resources/bugreportgui-better-than-rating.35119/
|
||||
commands:
|
||||
|
||||
@ -20,6 +20,7 @@ public class EventListener implements org.bukkit.event.Listener {
|
||||
this.alias = msg;
|
||||
return this;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onCommand(PlayerCommandPreprocessEvent evt) {
|
||||
if (evt.getMessage().equalsIgnoreCase("/"+alias)) {
|
||||
@ -40,32 +41,19 @@ public class EventListener implements org.bukkit.event.Listener {
|
||||
@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = false)
|
||||
public void onChat(AsyncPlayerChatEvent evt) {
|
||||
String regex2 = "[^']+";
|
||||
String regex = Storage.getConfig().getString("stop-sign");
|
||||
String regex3 = Storage.transfer(regex);
|
||||
Pattern pattern2 = Pattern.compile(regex2);
|
||||
Matcher m2 = pattern2.matcher(evt.getMessage());
|
||||
if (Storage.map.containsKey(evt.getPlayer().getUniqueId().toString())) {
|
||||
evt.setCancelled(true);
|
||||
if (m2.matches() && (!evt.getMessage().matches(regex3))) {
|
||||
if (m2.matches()) {
|
||||
Bug bug = Storage.map.get(evt.getPlayer().getUniqueId().toString());
|
||||
bug.append(evt.getMessage());
|
||||
evt.getPlayer().sendMessage(Storage.getMsg("continue-input").replaceAll("%stopsign%", regex));
|
||||
evt.getPlayer().sendMessage(Storage.getMsg("continue-input"));
|
||||
return;
|
||||
} else if (!evt.getMessage().matches(regex3)) {
|
||||
} else {
|
||||
Storage.send(evt.getPlayer(), "illegal-char");
|
||||
return;
|
||||
}
|
||||
if (evt.getMessage().matches(regex3)) {
|
||||
Bug bug = Storage.map.get(evt.getPlayer().getUniqueId().toString());
|
||||
Database.insert(bug);
|
||||
evt.getPlayer().sendMessage(Storage.getPrefix()
|
||||
+ Storage.getMsg("rep-suc").replaceAll("%serial%", Database.getSerial(evt.getPlayer())));
|
||||
if (!Storage.getConfig().getBoolean("use-bungee")) {
|
||||
Notify.notifyt(evt.getPlayer());
|
||||
}
|
||||
Storage.map.remove(evt.getPlayer().getUniqueId().toString());
|
||||
return;
|
||||
}
|
||||
}
|
||||
if (Storage.back.containsKey(evt.getPlayer().getUniqueId().toString())) {
|
||||
evt.setCancelled(true);
|
||||
@ -84,8 +72,15 @@ public class EventListener implements org.bukkit.event.Listener {
|
||||
public void onMove(PlayerMoveEvent evt) {
|
||||
if (Storage.map.containsKey(evt.getPlayer().getUniqueId().toString())) {
|
||||
evt.setCancelled(true);
|
||||
evt.getPlayer().sendMessage(Storage.getMsg("not-complete").replaceAll("%stopsign%",
|
||||
Storage.getConfig().getString("stop-sign")));
|
||||
Bug bug = Storage.map.get(evt.getPlayer().getUniqueId().toString());
|
||||
Database.insert(bug);
|
||||
evt.getPlayer().sendMessage(Storage.getPrefix()
|
||||
+ Storage.getMsg("rep-suc").replaceAll("%serial%", Database.getSerial(evt.getPlayer())));
|
||||
if (!Storage.getConfig().getBoolean("use-bungee")) {
|
||||
Notify.notifyt(evt.getPlayer());
|
||||
}
|
||||
Storage.map.remove(evt.getPlayer().getUniqueId().toString());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -17,7 +17,6 @@ public class Main extends JavaPlugin {
|
||||
this);
|
||||
getCommand("bug").setExecutor(new cmdExe());
|
||||
getCommand("bugrepgui").setExecutor(new cmdExe());
|
||||
this.getCommand(alias).setExecutor(new cmdExe());
|
||||
if (this.getConfig().getBoolean("check-update"))
|
||||
UpdateChecker.check(this.getDescription().getVersion(), this.getDescription().getWebsite());
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user