Skip to content

Commit

Permalink
1.2.2更新
Browse files Browse the repository at this point in the history
1.2.2更新
  • Loading branch information
LinearBit authored Mar 19, 2023
1 parent 7e1f8ae commit 60d5dd8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package org.linear.linearbot.event.server;

import org.bukkit.Location;
import org.bukkit.configuration.file.YamlConfiguration;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
Expand Down Expand Up @@ -50,7 +51,22 @@ public void onJoin(PlayerJoinEvent event){

String realName = StringTool.filterColor(player.getName());

if (Args.WhitelistMode()==1){
/*if (Args.WhitelistMode()==1){
if (Config.getWhitelistYaml().getString(realName)==null){
player.kickPlayer(Config.getConfigYaml().getString("Whitelist.kickMsg"));
}
List<Long> groups = Config.getGroupQQs();
for (long groupID : groups){
Bot.sendMsg("玩家"+name+"因为未在白名单中被踢出",groupID);
}
return;
}*/
boolean whitelisted = true;
YamlConfiguration white = YamlConfiguration.loadConfiguration(Config.WhitelistFile());
List<String> names = white.getStringList("name");
whitelisted = names.contains(event.getPlayer().getName());

if(!whitelisted){
if (Config.getWhitelistYaml().getString(realName)==null){
player.kickPlayer(Config.getConfigYaml().getString("Whitelist.kickMsg"));
}
Expand Down
3 changes: 1 addition & 2 deletions LinearBot-bukkit/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ DieReport: false
#白名单
WhiteList:
enable: false
mode: 0 #mode设置为0则使用原版游戏自带白名单,设置为1则使用插件自带白名单
kickMsg: "请加入qq群:xxx申请白名单" #当mode为1时且玩家因未在白名单中被踢出时显示的消息
kickMsg: "请加入qq群:xxx申请白名单"

#执行命令功能
CMD: true
Expand Down

0 comments on commit 60d5dd8

Please sign in to comment.