当我制作一个equalsIgnorecase
无法识别的字符串数组时,在eclipse中它建议我将数组更改为其他内容,反之亦然。
public void onChat(PlayerChatEvent event) {
Player player = event.getPlayer();
String[] curse = new String[] {"rude1", "rude2", "rudeN"};
if (event.getMessage().equalsIgnoreCase(curse)) {
event.setCancelled(true);
player.sendMessage("Don't Swear");
}
}
}
这是我的视频游戏的诅咒过滤器。我究竟做错了什么?