mirror of
				https://e.coding.net/circlecloud/MiaoLobby.git
				synced 2025-11-03 17:36:01 +00:00 
			
		
		
		
	
							
								
								
									
										7
									
								
								pom.xml
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								pom.xml
									
									
									
									
									
								
							@@ -3,7 +3,7 @@
 | 
				
			|||||||
    <modelVersion>4.0.0</modelVersion>
 | 
					    <modelVersion>4.0.0</modelVersion>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <artifactId>MiaoLobby</artifactId>
 | 
					    <artifactId>MiaoLobby</artifactId>
 | 
				
			||||||
    <version>2.0</version>
 | 
					    <version>2.1</version>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    <parent>
 | 
					    <parent>
 | 
				
			||||||
        <groupId>pw.yumc</groupId>
 | 
					        <groupId>pw.yumc</groupId>
 | 
				
			||||||
@@ -24,11 +24,12 @@
 | 
				
			|||||||
    <properties>
 | 
					    <properties>
 | 
				
			||||||
        <update.description>§a正式版本 §bv${project.version}</update.description>
 | 
					        <update.description>§a正式版本 §bv${project.version}</update.description>
 | 
				
			||||||
        <update.changes>
 | 
					        <update.changes>
 | 
				
			||||||
 | 
					            §621-04-01 §a新增: 重复传送限制 离线清理数据;
 | 
				
			||||||
 | 
					        </update.changes>
 | 
				
			||||||
 | 
					        <update.changelog>
 | 
				
			||||||
            §617-07-05 §a新增: 添加对MOD服和1.12的ActionBar支持;
 | 
					            §617-07-05 §a新增: 添加对MOD服和1.12的ActionBar支持;
 | 
				
			||||||
            §617-07-05 §a新增: 未混淆的API接口;
 | 
					            §617-07-05 §a新增: 未混淆的API接口;
 | 
				
			||||||
            §617-07-03 §a新增: 传送前事件 PreLobbyTpEvent
 | 
					            §617-07-03 §a新增: 传送前事件 PreLobbyTpEvent
 | 
				
			||||||
        </update.changes>
 | 
					 | 
				
			||||||
        <update.changelog>
 | 
					 | 
				
			||||||
        </update.changelog>
 | 
					        </update.changelog>
 | 
				
			||||||
        <env.GIT_COMMIT>DEV</env.GIT_COMMIT>
 | 
					        <env.GIT_COMMIT>DEV</env.GIT_COMMIT>
 | 
				
			||||||
    </properties>
 | 
					    </properties>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -30,7 +30,7 @@ public class MiaoLobby extends JavaPlugin implements Executor, Listener {
 | 
				
			|||||||
    @Cmd(permission = "MiaoLobby.default", executor = Cmd.Executor.PLAYER)
 | 
					    @Cmd(permission = "MiaoLobby.default", executor = Cmd.Executor.PLAYER)
 | 
				
			||||||
    @Help("进行随机服务器传送")
 | 
					    @Help("进行随机服务器传送")
 | 
				
			||||||
    public boolean def(final Player player) {
 | 
					    public boolean def(final Player player) {
 | 
				
			||||||
        Util.random(player);
 | 
					        Util.delayTp(player);
 | 
				
			||||||
        return true;
 | 
					        return true;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,6 +8,7 @@ import org.bukkit.scheduler.BukkitRunnable;
 | 
				
			|||||||
import org.bukkit.scheduler.BukkitTask;
 | 
					import org.bukkit.scheduler.BukkitTask;
 | 
				
			||||||
import pw.yumc.MiaoLobby.config.Config;
 | 
					import pw.yumc.MiaoLobby.config.Config;
 | 
				
			||||||
import pw.yumc.MiaoLobby.event.PreLobbyTpEvent;
 | 
					import pw.yumc.MiaoLobby.event.PreLobbyTpEvent;
 | 
				
			||||||
 | 
					import pw.yumc.YumCore.bukkit.Log;
 | 
				
			||||||
import pw.yumc.YumCore.bukkit.P;
 | 
					import pw.yumc.YumCore.bukkit.P;
 | 
				
			||||||
import pw.yumc.YumCore.bukkit.compatible.C;
 | 
					import pw.yumc.YumCore.bukkit.compatible.C;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -28,6 +29,10 @@ public class Util {
 | 
				
			|||||||
    private static Map<String, BukkitTask> tasks = new HashMap<>();
 | 
					    private static Map<String, BukkitTask> tasks = new HashMap<>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public static void delayTp(final Player player) {
 | 
					    public static void delayTp(final Player player) {
 | 
				
			||||||
 | 
					        if (tasks.containsKey(player.getName())) {
 | 
				
			||||||
 | 
					            Log.sender(player, config.TPing);
 | 
				
			||||||
 | 
					            return;
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
        tasks.put(player.getName(), new BukkitRunnable() {
 | 
					        tasks.put(player.getName(), new BukkitRunnable() {
 | 
				
			||||||
            int delay = config.AutoTPDelay;
 | 
					            int delay = config.AutoTPDelay;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -41,7 +46,7 @@ public class Util {
 | 
				
			|||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    random(player);
 | 
					                    random(player);
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                cancel();
 | 
					                this.cancel();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }.runTaskTimerAsynchronously(plugin, 0, 20));
 | 
					        }.runTaskTimerAsynchronously(plugin, 0, 20));
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@@ -56,7 +61,7 @@ public class Util {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    public static void cancel(Player player) {
 | 
					    public static void cancel(Player player) {
 | 
				
			||||||
        if (player != null) {
 | 
					        if (player != null) {
 | 
				
			||||||
            BukkitTask task = tasks.get(player.getName());
 | 
					            BukkitTask task = tasks.remove(player.getName());
 | 
				
			||||||
            if (task != null) {
 | 
					            if (task != null) {
 | 
				
			||||||
                task.cancel();
 | 
					                task.cancel();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
@@ -94,7 +99,8 @@ public class Util {
 | 
				
			|||||||
                    i++;
 | 
					                    i++;
 | 
				
			||||||
                    return;
 | 
					                    return;
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
                cancel();
 | 
					                Util.cancel(player);
 | 
				
			||||||
 | 
					                this.cancel();
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }.runTaskTimerAsynchronously(plugin, 0, config.WaitTime);
 | 
					        }.runTaskTimerAsynchronously(plugin, 0, config.WaitTime);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,9 +1,9 @@
 | 
				
			|||||||
package pw.yumc.MiaoLobby.config;
 | 
					package pw.yumc.MiaoLobby.config;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import java.util.List;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
import pw.yumc.YumCore.config.inject.InjectConfig;
 | 
					import pw.yumc.YumCore.config.inject.InjectConfig;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * 配置文件
 | 
					 * 配置文件
 | 
				
			||||||
 *
 | 
					 *
 | 
				
			||||||
@@ -16,6 +16,7 @@ public class Config extends InjectConfig {
 | 
				
			|||||||
    public String Message;
 | 
					    public String Message;
 | 
				
			||||||
    public String TimeOut;
 | 
					    public String TimeOut;
 | 
				
			||||||
    public String TPDelay;
 | 
					    public String TPDelay;
 | 
				
			||||||
 | 
					    public String TPing;
 | 
				
			||||||
    public String Unavailable;
 | 
					    public String Unavailable;
 | 
				
			||||||
    public Boolean AutoTP;
 | 
					    public Boolean AutoTP;
 | 
				
			||||||
    public Boolean LoginAutoTP;
 | 
					    public Boolean LoginAutoTP;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,4 +19,5 @@ ReTry: true
 | 
				
			|||||||
Message: '&a请稍候 正在传送至服务器 %s ...'
 | 
					Message: '&a请稍候 正在传送至服务器 %s ...'
 | 
				
			||||||
TimeOut: '&c传送超时 正在切换到服务器 %s ...'
 | 
					TimeOut: '&c传送超时 正在切换到服务器 %s ...'
 | 
				
			||||||
TPDelay: '&a登陆成功 正在为您匹配服务器 剩余 %s 秒...'
 | 
					TPDelay: '&a登陆成功 正在为您匹配服务器 剩余 %s 秒...'
 | 
				
			||||||
 | 
					TPing: '&c正在为您选择可用大厅 请稍候重试!'
 | 
				
			||||||
Unavailable: '&4已尝试所有可用服务器 传送失败!'
 | 
					Unavailable: '&4已尝试所有可用服务器 传送失败!'
 | 
				
			||||||
		Reference in New Issue
	
	Block a user