mirror of
https://github.com/lukasabbe/VoiceChatGroupMsg.git
synced 2026-04-30 10:50:53 +00:00
Compare commits
9 Commits
1.21-1.0.0
...
1.21.4
| Author | SHA1 | Date | |
|---|---|---|---|
| 7075963597 | |||
| 1c487409a1 | |||
| da64223e29 | |||
| e3141bef06 | |||
| 2b650b5e89 | |||
| 7633b6918d | |||
| 434e07e62e | |||
| c3116f0f6f | |||
| 0e084d7e7c |
+1
-1
@@ -1,5 +1,5 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'fabric-loom' version '1.6-SNAPSHOT'
|
id 'fabric-loom' version '1.8-SNAPSHOT'
|
||||||
id 'maven-publish'
|
id 'maven-publish'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+6
-6
@@ -3,19 +3,19 @@ org.gradle.jvmargs=-Xmx1G
|
|||||||
|
|
||||||
# Fabric Properties
|
# Fabric Properties
|
||||||
# check these on https://modmuss50.me/fabric.html
|
# check these on https://modmuss50.me/fabric.html
|
||||||
minecraft_version=1.21
|
minecraft_version=1.21.4-rc3
|
||||||
yarn_mappings=1.21+build.9
|
yarn_mappings=1.21.4-rc3+build.3
|
||||||
loader_version=0.15.11
|
loader_version=0.16.9
|
||||||
|
|
||||||
# Mod Properties
|
# Mod Properties
|
||||||
mod_version = 1.0
|
mod_version = 1.0.1+1.21.4
|
||||||
maven_group = me.lukasabbe
|
maven_group = me.lukasabbe
|
||||||
archives_base_name = VoiceChatGroupMsg
|
archives_base_name = VoiceChatGroupMsg
|
||||||
|
|
||||||
#mod dev
|
#mod dev
|
||||||
voicechat_version=1.21-2.5.17
|
voicechat_version=1.21.4-rc3-2.5.26
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
# check this on https://modmuss50.me/fabric.html
|
# check this on https://modmuss50.me/fabric.html
|
||||||
fabric_version=0.100.7+1.21
|
fabric_version=0.110.2+1.21.4
|
||||||
voicechat_api_version=2.5.0
|
voicechat_api_version=2.5.0
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
|||||||
@@ -17,11 +17,9 @@ import java.util.List;
|
|||||||
|
|
||||||
public class Commands {
|
public class Commands {
|
||||||
public static void CreateGroupMsgCommand(CommandDispatcher<ServerCommandSource> dispatcher, CommandRegistryAccess commandRegistryAccess, CommandManager.RegistrationEnvironment registrationEnvironment) {
|
public static void CreateGroupMsgCommand(CommandDispatcher<ServerCommandSource> dispatcher, CommandRegistryAccess commandRegistryAccess, CommandManager.RegistrationEnvironment registrationEnvironment) {
|
||||||
dispatcher.register(
|
dispatcher.register(CommandManager
|
||||||
CommandManager
|
|
||||||
.literal("msgvc")
|
.literal("msgvc")
|
||||||
.then(
|
.then(CommandManager
|
||||||
CommandManager
|
|
||||||
.argument("message", MessageArgumentType.message())
|
.argument("message", MessageArgumentType.message())
|
||||||
.executes(Commands::runCommand)));
|
.executes(Commands::runCommand)));
|
||||||
}
|
}
|
||||||
@@ -40,10 +38,16 @@ public class Commands {
|
|||||||
Group group = VoiceChatGroupMsg.getPlayerGroup(player);
|
Group group = VoiceChatGroupMsg.getPlayerGroup(player);
|
||||||
List<ServerPlayerEntity> players = VoiceChatGroupMsg.GroupPlayers(group.getId(), source.getWorld());
|
List<ServerPlayerEntity> players = VoiceChatGroupMsg.GroupPlayers(group.getId(), source.getWorld());
|
||||||
MessageArgumentType.getSignedMessage(ctx, "message", signedMessage -> {
|
MessageArgumentType.getSignedMessage(ctx, "message", signedMessage -> {
|
||||||
player.sendChatMessage(SentMessage.of(signedMessage),true, MessageType.params(MessageType.TEAM_MSG_COMMAND_OUTGOING,source).withTargetName(Text.of(group.getName())));
|
player.sendChatMessage(
|
||||||
|
SentMessage.of(signedMessage),
|
||||||
|
true,
|
||||||
|
MessageType.params(MessageType.TEAM_MSG_COMMAND_OUTGOING,source).withTargetName(Text.of(group.getName())));
|
||||||
players.forEach(player1 -> {
|
players.forEach(player1 -> {
|
||||||
if(!player1.getUuid().equals(source.getPlayer().getUuid())){
|
if(!player1.getUuid().equals(player.getUuid())){
|
||||||
player1.sendChatMessage(SentMessage.of(signedMessage),true, MessageType.params(MessageType.TEAM_MSG_COMMAND_INCOMING,source).withTargetName(Text.of(group.getName())));
|
player1.sendChatMessage(
|
||||||
|
SentMessage.of(signedMessage),
|
||||||
|
true,
|
||||||
|
MessageType.params(MessageType.TEAM_MSG_COMMAND_INCOMING,source).withTargetName(Text.of(group.getName())));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ public class VoiceChatGroupMsg implements DedicatedServerModInitializer, Voicech
|
|||||||
}
|
}
|
||||||
public static boolean isPlayerInGroup(ServerPlayerEntity player, UUID groupID){
|
public static boolean isPlayerInGroup(ServerPlayerEntity player, UUID groupID){
|
||||||
try{
|
try{
|
||||||
if(!API.getConnectionOf(player.getUuid()).isInGroup())return false;
|
if(!API.getConnectionOf(player.getUuid()).isInGroup()) return false;
|
||||||
return API.getConnectionOf(player.getUuid()).getGroup().getId().equals(groupID);
|
return API.getConnectionOf(player.getUuid()).getGroup().getId().equals(groupID);
|
||||||
|
|
||||||
}catch (NullPointerException ignore){
|
}catch (NullPointerException ignore){
|
||||||
|
|||||||
@@ -2,11 +2,11 @@
|
|||||||
"schemaVersion": 1,
|
"schemaVersion": 1,
|
||||||
"id": "voicechatgroupmsg",
|
"id": "voicechatgroupmsg",
|
||||||
"version": "${version}",
|
"version": "${version}",
|
||||||
"name": "VoiceChatGroupMsg",
|
"name": "Voice Chat Group Msg",
|
||||||
"description": "",
|
"description": "Adds a way to message a whole group if you don't have a microphone. When you are in a group you can now use /msgvc <message>",
|
||||||
"authors": [],
|
"authors": ["Lukasabbe"],
|
||||||
"contact": {
|
"contact": {
|
||||||
"repo": "https://github.com/lukas/VoiceChatGroupMsg"
|
"repo": "https://github.com/lukasabbe/VoiceChatGroupMsg"
|
||||||
},
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"icon": "assets/voicechatgroupmsg/icon.png",
|
"icon": "assets/voicechatgroupmsg/icon.png",
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
"depends": {
|
"depends": {
|
||||||
"fabricloader": ">=${loader_version}",
|
"fabricloader": ">=${loader_version}",
|
||||||
"fabric": "*",
|
"fabric": "*",
|
||||||
"minecraft": "${minecraft_version}",
|
"minecraft": ">=${minecraft_version}",
|
||||||
"voicechat": ">=${minecraft_version}-${voicechat_api_version}"
|
"voicechat": ">=${minecraft_version}-${voicechat_api_version}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user