chore(release): v0.1.6
### Fixed - Global Chat Issue: - Resolved bugs affecting the functionality of the global chat.
This commit is contained in:
parent
dd248095d6
commit
ce52c98668
|
@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file.
|
||||||
|
|
||||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/).
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/).
|
||||||
|
|
||||||
|
## [0.1.6] - 2024-10-21
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- **Global Chat Issue**:
|
||||||
|
- Resolved bugs affecting the functionality of the global chat.
|
||||||
|
|
||||||
## [0.1.5] - 2024-10-21
|
## [0.1.5] - 2024-10-21
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
|
@ -4,6 +4,13 @@
|
||||||
|
|
||||||
Формат основан на [Keep a Changelog](https://keepachangelog.com/ru/1.0.0/), и этот проект придерживается [Семантического Версионирования](https://semver.org/lang/ru/).
|
Формат основан на [Keep a Changelog](https://keepachangelog.com/ru/1.0.0/), и этот проект придерживается [Семантического Версионирования](https://semver.org/lang/ru/).
|
||||||
|
|
||||||
|
## [0.1.6] - 2024-10-21
|
||||||
|
|
||||||
|
### Исправлено
|
||||||
|
|
||||||
|
- **Проблема с глобальным чатом**:
|
||||||
|
- Исправлены ошибки, влияющие на работу глобального чата.
|
||||||
|
|
||||||
## [0.1.5] - 2024-10-21
|
## [0.1.5] - 2024-10-21
|
||||||
|
|
||||||
### Исправлено
|
### Исправлено
|
||||||
|
|
|
@ -38,7 +38,7 @@ mod_name=ChatIT
|
||||||
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
|
||||||
mod_license=All Rights Reserved
|
mod_license=All Rights Reserved
|
||||||
# The mod version. See https://semver.org/
|
# The mod version. See https://semver.org/
|
||||||
mod_version=0.1.5-BETA
|
mod_version=0.1.6-BETA
|
||||||
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
|
||||||
# This should match the base package used for the mod sources.
|
# This should match the base package used for the mod sources.
|
||||||
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
|
||||||
|
|
|
@ -48,26 +48,38 @@ public class ChatEventHandler {
|
||||||
MutableComponent adultComponent = createAdultMessage();
|
MutableComponent adultComponent = createAdultMessage();
|
||||||
sender.sendSystemMessage(adultComponent);
|
sender.sendSystemMessage(adultComponent);
|
||||||
} else {
|
} else {
|
||||||
boolean messageSent = false;
|
boolean localMessageSent = false;
|
||||||
for (ServerPlayer receiver : server.getPlayerList().getPlayers()) {
|
for (ServerPlayer receiver : server.getPlayerList().getPlayers()) {
|
||||||
PlayerConfigManager.ensurePlayerExists(receiver);
|
PlayerConfigManager.ensurePlayerExists(receiver);
|
||||||
|
|
||||||
if (profanityScore > threshold && !PlayerConfigManager.hasAdultContentEnabled(receiver)) {
|
if (profanityScore > threshold && !PlayerConfigManager.hasAdultContentEnabled(receiver)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (((receiver.getCommandSenderWorld() == sender.getCommandSenderWorld() && receiver.position().distanceTo(sender.position()) <= 50) && (sender != receiver)) || isGlobal) {
|
|
||||||
|
if (isGlobal) {
|
||||||
receiver.sendSystemMessage(chatComponent);
|
receiver.sendSystemMessage(chatComponent);
|
||||||
messageSent = true;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (receiver.getCommandSenderWorld() != sender.getCommandSenderWorld() ||
|
||||||
|
receiver.position().distanceTo(sender.position()) > 50 ||
|
||||||
|
receiver == sender) {
|
||||||
|
continue;
|
||||||
}
|
}
|
||||||
if (!messageSent) {
|
|
||||||
|
receiver.sendSystemMessage(chatComponent);
|
||||||
|
localMessageSent = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isGlobal) {
|
||||||
|
if (!localMessageSent) {
|
||||||
MutableComponent errorComponent = createErrorMessage(Config.messageLocal);
|
MutableComponent errorComponent = createErrorMessage(Config.messageLocal);
|
||||||
sender.sendSystemMessage(errorComponent);
|
sender.sendSystemMessage(errorComponent);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
sender.sendSystemMessage(chatComponent);
|
sender.sendSystemMessage(chatComponent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}).exceptionally(ex -> {
|
}).exceptionally(ex -> {
|
||||||
|
|
Loading…
Reference in New Issue