コミットを比較
| 作成者 | SHA1 | 日付 | |
|---|---|---|---|
|
|
1735ba5386 | ||
|
|
90b0a33c0f | ||
|
|
4cf64c2318 | ||
|
|
9099ac968e | ||
|
|
bdd148f313 | ||
|
|
81b75f3f0f | ||
|
|
ff722c79a1 | ||
|
|
f95cf9da33 | ||
|
|
18c47505c7 | ||
|
|
a7234efe84 | ||
|
|
9d5fd5ceb5 |
検索条件に一致するファイルはありません
@@ -0,0 +1,33 @@
|
||||
---
|
||||
name: Bug report/バグ報告
|
||||
about: Create a report to help us improve/バグ報告をしたい場合はこちらを選択してください
|
||||
title: ''
|
||||
labels: バグ
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug/バグの概要**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**Server and version/サーバーとバージョン**
|
||||
- Server: Spigot / Paper / BungeeCord / Waterfall / etc...
|
||||
- Server version (Minecraft version) : 1.16.1 / 1.15.2 / etc...
|
||||
- Other plugins:
|
||||
- LunaChat version :
|
||||
|
||||
**To Reproduce/再現手順**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior/期待する結果**
|
||||
A clear and concise description of what you expected to happen./上記の再現手順に書いた状態について、何か期待と違っていたのか、どこに問題があったのかを、明確に記載してください。
|
||||
|
||||
**Screenshots/スクリーンショット**
|
||||
If applicable, add screenshots to help explain your problem./スクリーンショットがあれば添付してください。ブラウザに画像ファイルをドラッグアンドドロップしてアップロードできます。
|
||||
|
||||
**Additional context/備考**
|
||||
Add any other context about the problem here.
|
||||
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request/機能追加リクエスト
|
||||
about: Suggest an idea for this project/機能追加要望をしたい場合はこちらを選択してください
|
||||
title: ''
|
||||
labels: 機能追加・要望
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
@@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.github.ucchyocean</groupId>
|
||||
<artifactId>LunaChat</artifactId>
|
||||
<version>3.0.3</version>
|
||||
<version>3.0.6</version>
|
||||
<description>A powerfull chat channel plugin with IME (Kana-Kanji conversion) support</description>
|
||||
<url>https://github.com/ucchyocean/LunaChat</url>
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ public class LunaChatBukkit extends JavaPlugin implements PluginInterface {
|
||||
return messageCommand.execute(ChannelMember.getChannelMember(sender), label, args);
|
||||
} else if ( command.getName().equals("reply") ) {
|
||||
return replyCommand.execute(ChannelMember.getChannelMember(sender), label, args);
|
||||
} else if ( command.getName().equals("lcjapanize") ) {
|
||||
} else if ( command.getName().equals("japanize") ) {
|
||||
return lcjapanizeCommand.execute(ChannelMember.getChannelMember(sender), label, args);
|
||||
}
|
||||
|
||||
|
||||
@@ -116,6 +116,9 @@ public class LunaChatConfig {
|
||||
/** 通常チャットで、カラーコードを使用可能にするかどうか */
|
||||
private boolean enableNormalChatColorCode;
|
||||
|
||||
/** 通常チャットを、クリック可能にするかどうか */
|
||||
private boolean enableNormalChatClickable;
|
||||
|
||||
/** Japanize変換のタイプ<br/>
|
||||
* none = 日本語変換をしない<br/>
|
||||
* kana = カナ変換のみする<br/>
|
||||
@@ -241,6 +244,8 @@ public class LunaChatConfig {
|
||||
config.getString("normalChatMessageFormat", "&f%prefix%username%suffix&a:&f %msg");
|
||||
enableNormalChatColorCode =
|
||||
config.getBoolean("enableNormalChatColorCode", true);
|
||||
enableNormalChatClickable =
|
||||
config.getBoolean("enableNormalChatClickable", false);
|
||||
|
||||
japanizeType = JapanizeType.fromID(config.getString("japanizeType"), null);
|
||||
japanizeDisplayLine = config.getInt("japanizeDisplayLine", 2);
|
||||
@@ -564,6 +569,14 @@ public class LunaChatConfig {
|
||||
return enableNormalChatColorCode;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通常チャットを、クリック可能にするかどうか
|
||||
* @return enableNormalChatClickable
|
||||
*/
|
||||
public boolean isEnableNormalChatClickable() {
|
||||
return enableNormalChatClickable;
|
||||
}
|
||||
|
||||
/**
|
||||
* 指定された文字列から、対応するEventPriorityを返す。
|
||||
* @param value 文字列
|
||||
|
||||
@@ -301,19 +301,6 @@ public class BukkitEventListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
// チャットフォーマット装飾の適用
|
||||
ClickableFormat format;
|
||||
if ( config.isEnableNormalChatMessageFormat() ) {
|
||||
String f = config.getNormalChatMessageFormat();
|
||||
format = ClickableFormat.makeFormat(f, ChannelMember.getChannelMember(event.getPlayer()));
|
||||
// event.setFormat(format);
|
||||
} else {
|
||||
String f = event.getFormat()
|
||||
.replace("%1$s", "%displayName")
|
||||
.replace("%2$s", "%msg");
|
||||
format = ClickableFormat.makeFormat(f, ChannelMember.getChannelMember(event.getPlayer()));
|
||||
}
|
||||
|
||||
// カラーコード置き換え
|
||||
// 置き換え設定になっていて、発言者がパーミッションを持っているなら、置き換えする
|
||||
if ( config.isEnableNormalChatColorCode() &&
|
||||
@@ -376,21 +363,48 @@ public class BukkitEventListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
// 発言内容の設定
|
||||
// event.setMessage(message);
|
||||
if ( config.isEnableNormalChatClickable() ) {
|
||||
// クリック可能チャットで発言
|
||||
|
||||
// 発言内容の送信
|
||||
format.replace("%msg", message);
|
||||
BaseComponent[] comps = format.makeTextComponent();
|
||||
for ( Player recipient : event.getRecipients() ) {
|
||||
ChannelMember cm = ChannelMember.getChannelMember(recipient);
|
||||
if ( cm != null ) {
|
||||
cm.sendMessage(comps);
|
||||
// チャットフォーマット装飾の適用
|
||||
ClickableFormat format;
|
||||
if ( config.isEnableNormalChatMessageFormat() ) {
|
||||
String f = config.getNormalChatMessageFormat();
|
||||
format = ClickableFormat.makeFormat(f, ChannelMember.getChannelMember(event.getPlayer()));
|
||||
} else {
|
||||
String f = event.getFormat()
|
||||
.replace("%1$s", "%displayName")
|
||||
.replace("%2$s", "%msg");
|
||||
format = ClickableFormat.makeFormat(f, ChannelMember.getChannelMember(event.getPlayer()));
|
||||
}
|
||||
}
|
||||
|
||||
// イベントのキャンセル
|
||||
event.setCancelled(true);
|
||||
// 発言内容の送信
|
||||
format.replace("%msg", message);
|
||||
BaseComponent[] comps = format.makeTextComponent();
|
||||
for ( Player recipient : event.getRecipients() ) {
|
||||
ChannelMember cm = ChannelMember.getChannelMember(recipient);
|
||||
if ( cm != null ) {
|
||||
cm.sendMessage(comps);
|
||||
}
|
||||
}
|
||||
|
||||
// イベントのキャンセル
|
||||
event.setCancelled(true);
|
||||
|
||||
} else {
|
||||
// 通常チャットイベントで発言
|
||||
|
||||
// チャットフォーマット装飾の適用
|
||||
if ( config.isEnableNormalChatMessageFormat() ) {
|
||||
String f = config.getNormalChatMessageFormat();
|
||||
f = ClickableFormat.replaceForNormalChatFormat(
|
||||
f, ChannelMember.getChannelMember(event.getPlayer()));
|
||||
event.setFormat(Utility.replaceColorCode(f));
|
||||
}
|
||||
|
||||
// 発言内容の設定
|
||||
event.setMessage(message);
|
||||
}
|
||||
|
||||
// ロギング
|
||||
logNormalChat(message, player.getName());
|
||||
|
||||
@@ -13,11 +13,10 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.logging.Level;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import com.github.ucchyocean.lc3.LunaChat;
|
||||
@@ -399,7 +398,7 @@ public abstract class Channel {
|
||||
}
|
||||
|
||||
// キーワード置き換え
|
||||
ClickableFormat msgFormat = ClickableFormat.makeFormat(getFormat(), new ChannelMemberOther(name));
|
||||
ClickableFormat msgFormat = ClickableFormat.makeFormat(getFormat(), new ChannelMemberOther(name), this, false);
|
||||
|
||||
// カラーコード置き換え チャンネルで許可されている場合に置き換える。
|
||||
if ( isAllowCC() ) {
|
||||
@@ -443,9 +442,10 @@ public abstract class Channel {
|
||||
// パーミッション lunachat-admin.listen-all-channels を持つプレイヤーを
|
||||
// 受信者に加える。
|
||||
if ( config.isOpListenAllChannel() ) {
|
||||
for ( Player p : Bukkit.getOnlinePlayers() ) {
|
||||
ChannelMember cp = ChannelMember.getChannelMember(p);
|
||||
if ( cp.hasPermission("lunachat-admin.listen-all-channels")
|
||||
for ( String playerName : LunaChat.getPlugin().getOnlinePlayerNames() ) {
|
||||
ChannelMember cp = ChannelMember.getChannelMember(playerName);
|
||||
if ( cp != null
|
||||
&& cp.hasPermission("lunachat-admin.listen-all-channels")
|
||||
&& !recipients.contains(cp) ) {
|
||||
recipients.add(cp);
|
||||
}
|
||||
@@ -470,7 +470,7 @@ public abstract class Channel {
|
||||
|
||||
// 設定に応じて、コンソールに出力する
|
||||
if ( config.isDisplayChatOnConsole() ) {
|
||||
Bukkit.getLogger().info(makePlainText(message));
|
||||
LunaChat.getPlugin().log(Level.INFO, makePlainText(message));
|
||||
}
|
||||
|
||||
// ロギング
|
||||
|
||||
@@ -129,11 +129,11 @@ public class ChannelMemberProxiedPlayer extends ChannelMemberBungee {
|
||||
|
||||
LuckPermsBridge luckperms = LunaChatBungee.getInstance().getLuckPerms();
|
||||
if ( luckperms != null ) {
|
||||
return luckperms.getPlayerPrefix(id);
|
||||
return luckperms.getPlayerSuffix(id);
|
||||
}
|
||||
BungeePermsBridge bungeeperms = LunaChatBungee.getInstance().getBungeePerms();
|
||||
if ( bungeeperms != null ) {
|
||||
return bungeeperms.userPrefix(id.toString(), null, null);
|
||||
return bungeeperms.userSuffix(id.toString(), null, null);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@@ -149,6 +149,12 @@ public class ClickableFormat {
|
||||
return new ClickableFormat(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* チャンネルチャットのメッセージ用のフォーマットを置き換えする
|
||||
* @param format フォーマット
|
||||
* @param channelName チャンネル名
|
||||
* @return 置き換え結果
|
||||
*/
|
||||
public static ClickableFormat makeChannelClickableMessage(String format, String channelName) {
|
||||
|
||||
KeywordReplacer msg = new KeywordReplacer(format);
|
||||
@@ -162,6 +168,18 @@ public class ClickableFormat {
|
||||
return new ClickableFormat(msg);
|
||||
}
|
||||
|
||||
/**
|
||||
* チャットフォーマット内のキーワードをBukkitの通常チャットイベント用に置き換えする
|
||||
* @param format 置き換え元のチャットフォーマット
|
||||
* @param member 発言者
|
||||
* @return 置き換え結果
|
||||
*/
|
||||
public static String replaceForNormalChatFormat(String format, ChannelMember member) {
|
||||
format = format.replace("%displayName", "%1$s");
|
||||
format = format.replace("%username", "%1$s");
|
||||
format = format.replace("%msg", "%2$s");
|
||||
return makeFormat(format, member, null, false).toLegacyText();
|
||||
}
|
||||
|
||||
public BaseComponent[] makeTextComponent() {
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ ngword: []
|
||||
ngwordAction: mask
|
||||
|
||||
|
||||
# -------------------- Chat decoration settings --------------------
|
||||
# -------------------- Normal chat settings --------------------
|
||||
|
||||
# Whether to decorate normal chat (non-channel chat) from LunaChat.
|
||||
enableNormalChatMessageFormat: true
|
||||
@@ -170,6 +170,12 @@ normalChatMessageFormat: '&f%prefix%displayname%suffix&a:&f %msg'
|
||||
# Whether to enable. If set to false, color codes will not be converted.
|
||||
enableNormalChatColorCode: true
|
||||
|
||||
# Whether normal chat (non-channel chat) is clickable.
|
||||
# If it is clickable, you can click the player name to send a private message,
|
||||
# but plugin will cancel the normal chat and send another clickable message,
|
||||
# so you may not use other chat related plugins.
|
||||
# Note that channel chats are always clickable, regardless of this setting.
|
||||
enableNormalChatClickable: false
|
||||
|
||||
|
||||
# -------------------- Japanize conversion settings --------------------
|
||||
|
||||
@@ -152,7 +152,7 @@ ngwordAction: mask
|
||||
|
||||
|
||||
|
||||
# -------------------- チャット装飾設定 --------------------
|
||||
# -------------------- 通常チャット設定 --------------------
|
||||
|
||||
# 通常チャット(非チャンネルチャット)の装飾を、LunaChatから行うかどうか。
|
||||
enableNormalChatMessageFormat: true
|
||||
@@ -175,6 +175,12 @@ normalChatMessageFormat: '&f%prefix%displayname%suffix&a:&f %msg'
|
||||
# 使用可能にするかどうか。falseに設定すると、カラーコードは変換されません。
|
||||
enableNormalChatColorCode: true
|
||||
|
||||
# 通常チャット(非チャンネルチャット)をクリック可能にするかどうか。
|
||||
# クリック可能にすると、プレイヤー名をクリックしてプライベートメッセージを送ることができるようになりますが、
|
||||
# 通常チャットをキャンセルしてクリック可能な別のメッセージを流すので、他のチャット関連プラグインとの連携が
|
||||
# うまくいかなくなる可能性があります。
|
||||
# なお、この設定に関係なく、チャンネルチャットは常にクリック可能です。
|
||||
enableNormalChatClickable: false
|
||||
|
||||
|
||||
# -------------------- Japanize変換設定 --------------------
|
||||
|
||||
@@ -23,9 +23,12 @@ import net.md_5.bungee.api.chat.BaseComponent;
|
||||
*/
|
||||
public class ClickableFormatTest extends TestCase {
|
||||
|
||||
private static final String DATA_FOLDER = "target" + File.separator + "LunaChatTest";
|
||||
private static final String MESSAGES_FOLDER = "target" + File.separator + "classes";
|
||||
|
||||
public void testChannelChatKeyword() {
|
||||
|
||||
File dataFolder = new File("target\\LunaChatTest");
|
||||
File dataFolder = new File(DATA_FOLDER);
|
||||
System.out.println("dataFolder : " + dataFolder.getAbsolutePath());
|
||||
if ( !dataFolder.exists() ) {
|
||||
dataFolder.mkdirs();
|
||||
@@ -34,7 +37,7 @@ public class ClickableFormatTest extends TestCase {
|
||||
LunaChatStandalone lunachat = new LunaChatStandalone(dataFolder);
|
||||
lunachat.onEnable();
|
||||
|
||||
Messages.initialize(new File("target\\classes"), null, "ja");
|
||||
Messages.initialize(new File(MESSAGES_FOLDER), null, "ja");
|
||||
|
||||
String format = "&f[%color%ch&f]%prefix%displayname%suffix&a:&f %msg";
|
||||
ChannelMember member = new ChannelMemberDummy();
|
||||
@@ -59,7 +62,7 @@ public class ClickableFormatTest extends TestCase {
|
||||
String format = "&f%prefix%displayname%suffix&a:&f %msg";
|
||||
ChannelMember member = new ChannelMemberDummy();
|
||||
|
||||
Messages.initialize(new File("target\\classes"), null, "ja");
|
||||
Messages.initialize(new File(MESSAGES_FOLDER), null, "ja");
|
||||
|
||||
ClickableFormat f = ClickableFormat.makeFormat(format, member);
|
||||
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする