Skip to content

Commit 981d051

Browse files
committed
26.2添加Voicechat
1 parent 2d05101 commit 981d051

5 files changed

Lines changed: 70 additions & 70 deletions

File tree

client/fabric_26_2/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dependencies {
1212
implementation("net.fabricmc.fabric-api:fabric-api:0.152.1+26.2")
1313

1414
// compileOnly("icyllis.modernui:ModernUI-Fabric:26.1.2-3.13.0.4")
15-
// compileOnly("de.maxhenkel.voicechat:voicechat-api:2.6.0")
15+
compileOnly("de.maxhenkel.voicechat:voicechat-api:2.6.0")
1616
}
1717

1818
tasks {
Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
//package com.coloryr.allmusic.client.others;
2-
//
3-
//import com.coloryr.allmusic.client.core.AllMusicCore;
4-
//import de.maxhenkel.voicechat.api.VoicechatPlugin;
5-
//import de.maxhenkel.voicechat.api.events.ClientReceiveSoundEvent;
6-
//import de.maxhenkel.voicechat.api.events.EventRegistration;
7-
//
8-
//public class VoiceChat implements VoicechatPlugin {
9-
// @Override
10-
// public String getPluginId() {
11-
// return "allmusic";
12-
// }
13-
//
14-
// @Override
15-
// public void registerEvents(EventRegistration registration) {
16-
// registration.registerEvent(ClientReceiveSoundEvent.EntitySound.class, this::play);
17-
// registration.registerEvent(ClientReceiveSoundEvent.LocationalSound.class, this::play);
18-
// registration.registerEvent(ClientReceiveSoundEvent.StaticSound.class, this::play);
19-
// }
20-
//
21-
// public void play(ClientReceiveSoundEvent.EntitySound event) {
22-
// AllMusicCore.chat();
23-
// }
24-
//
25-
// public void play(ClientReceiveSoundEvent.LocationalSound event) {
26-
// AllMusicCore.chat();
27-
// }
28-
//
29-
// public void play(ClientReceiveSoundEvent.StaticSound event) {
30-
// AllMusicCore.chat();
31-
// }
32-
//}
1+
package com.coloryr.allmusic.client.others;
2+
3+
import com.coloryr.allmusic.client.core.AllMusicCore;
4+
import de.maxhenkel.voicechat.api.VoicechatPlugin;
5+
import de.maxhenkel.voicechat.api.events.ClientReceiveSoundEvent;
6+
import de.maxhenkel.voicechat.api.events.EventRegistration;
7+
8+
public class VoiceChat implements VoicechatPlugin {
9+
@Override
10+
public String getPluginId() {
11+
return "allmusic";
12+
}
13+
14+
@Override
15+
public void registerEvents(EventRegistration registration) {
16+
registration.registerEvent(ClientReceiveSoundEvent.EntitySound.class, this::play);
17+
registration.registerEvent(ClientReceiveSoundEvent.LocationalSound.class, this::play);
18+
registration.registerEvent(ClientReceiveSoundEvent.StaticSound.class, this::play);
19+
}
20+
21+
public void play(ClientReceiveSoundEvent.EntitySound event) {
22+
AllMusicCore.chat();
23+
}
24+
25+
public void play(ClientReceiveSoundEvent.LocationalSound event) {
26+
AllMusicCore.chat();
27+
}
28+
29+
public void play(ClientReceiveSoundEvent.StaticSound event) {
30+
AllMusicCore.chat();
31+
}
32+
}

client/neoforge_26_2/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ dependencies {
2020
neoForge("net.neoforged:neoforge:26.2.0.1-beta")
2121

2222
// compileOnly("icyllis.modernui:ModernUI-NeoForge:26.1.2-3.13.0.4")
23-
// compileOnly("de.maxhenkel.voicechat:voicechat-api:2.6.0")
23+
compileOnly("de.maxhenkel.voicechat:voicechat-api:2.6.0")
2424
}
2525

2626
tasks {
Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
1-
//package com.coloryr.allmusic.client.others;
2-
//
3-
//import com.coloryr.allmusic.client.core.AllMusicCore;
4-
//import de.maxhenkel.voicechat.api.ForgeVoicechatPlugin;
5-
//import de.maxhenkel.voicechat.api.VoicechatPlugin;
6-
//import de.maxhenkel.voicechat.api.events.ClientReceiveSoundEvent;
7-
//import de.maxhenkel.voicechat.api.events.EventRegistration;
8-
//
9-
//@ForgeVoicechatPlugin
10-
//public class VoiceChat implements VoicechatPlugin {
11-
// @Override
12-
// public String getPluginId() {
13-
// return "allmusic";
14-
// }
15-
//
16-
// @Override
17-
// public void registerEvents(EventRegistration registration) {
18-
// registration.registerEvent(ClientReceiveSoundEvent.EntitySound.class, this::play);
19-
// registration.registerEvent(ClientReceiveSoundEvent.LocationalSound.class, this::play);
20-
// registration.registerEvent(ClientReceiveSoundEvent.StaticSound.class, this::play);
21-
// }
22-
//
23-
// public void play(ClientReceiveSoundEvent.EntitySound event) {
24-
// AllMusicCore.chat();
25-
// }
26-
//
27-
// public void play(ClientReceiveSoundEvent.LocationalSound event) {
28-
// AllMusicCore.chat();
29-
// }
30-
//
31-
// public void play(ClientReceiveSoundEvent.StaticSound event) {
32-
// AllMusicCore.chat();
33-
// }
34-
//}
1+
package com.coloryr.allmusic.client.others;
2+
3+
import com.coloryr.allmusic.client.core.AllMusicCore;
4+
import de.maxhenkel.voicechat.api.ForgeVoicechatPlugin;
5+
import de.maxhenkel.voicechat.api.VoicechatPlugin;
6+
import de.maxhenkel.voicechat.api.events.ClientReceiveSoundEvent;
7+
import de.maxhenkel.voicechat.api.events.EventRegistration;
8+
9+
@ForgeVoicechatPlugin
10+
public class VoiceChat implements VoicechatPlugin {
11+
@Override
12+
public String getPluginId() {
13+
return "allmusic";
14+
}
15+
16+
@Override
17+
public void registerEvents(EventRegistration registration) {
18+
registration.registerEvent(ClientReceiveSoundEvent.EntitySound.class, this::play);
19+
registration.registerEvent(ClientReceiveSoundEvent.LocationalSound.class, this::play);
20+
registration.registerEvent(ClientReceiveSoundEvent.StaticSound.class, this::play);
21+
}
22+
23+
public void play(ClientReceiveSoundEvent.EntitySound event) {
24+
AllMusicCore.chat();
25+
}
26+
27+
public void play(ClientReceiveSoundEvent.LocationalSound event) {
28+
AllMusicCore.chat();
29+
}
30+
31+
public void play(ClientReceiveSoundEvent.StaticSound event) {
32+
AllMusicCore.chat();
33+
}
34+
}

settings.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ include(":server:fabric_1_21_11")
3030
include(":server:fabric_26_1")
3131
include(":server:fabric_26_2")
3232

33-
//include(":server:forge_1_7_10")
34-
//include(":server:forge_1_12_2")
33+
include(":server:forge_1_7_10")
34+
include(":server:forge_1_12_2")
3535
include(":server:forge_1_16_5")
3636
include(":server:forge_1_20_1")
3737

0 commit comments

Comments
 (0)