Skip to content

Commit

Permalink
Fix Neoforge mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
allanf181 committed Jan 27, 2025
1 parent 9f429aa commit ac88d9f
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
public class MixinServerGamePacketListenerImpl {
@Shadow public ServerPlayer player;

@Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/server/players/PlayerList;broadcastChatMessage(Lnet/minecraft/network/chat/PlayerChatMessage;Lnet/minecraft/server/level/ServerPlayer;Lnet/minecraft/network/chat/ChatType$Bound;)V"), method = "broadcastChatMessage", cancellable = true)
@Inject(at = @At(value = "INVOKE", target = "Lnet/minecraft/server/players/PlayerList;broadcastChatMessage(Lnet/minecraft/network/chat/PlayerChatMessage;Lnet/minecraft/server/level/ServerPlayer;Lnet/minecraft/network/chat/ChatType$Bound;)V"), method = "broadcastChatMessage(Lnet/minecraft/network/chat/PlayerChatMessage;)V", cancellable = true)
private void broadcastChatMessage(PlayerChatMessage message, CallbackInfo ci) {
CompoundEventResult<Component> eventResult = ServerChat.RECEIVED.invoker().received(this.player, message.decoratedContent());
if (eventResult.isPresent()) {
Expand Down
2 changes: 1 addition & 1 deletion fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
]
},
"mixins": [
"dischatbridge.mixins.json"
"disfabric.mixins.json"
],
"depends": {
"fabricloader": ">=0.16.10",
Expand Down
2 changes: 1 addition & 1 deletion forge/src/main/resources/META-INF/neoforge.mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ A barebones Discord <-> Minecraft chat bridge.
side = "SERVER"

[[mixins]]
config = "dischatbridge.mixins.json"
config = "disforge.mixins.json"
12 changes: 12 additions & 0 deletions forge/src/main/resources/disforge.mixins.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"required": true,
"package": "one.armelin.dischatbridge.mixins",
"compatibilityLevel": "JAVA_21",
"mixins": [
"MixinServerGamePacketListenerImpl",
"MixinCrashReport"
],
"injectors": {
"defaultRequire": 1
}
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ org.gradle.jvmargs=-Xmx4G
minecraft_version=1.21.1

archives_base_name=DisChatBridge
mod_version=2.3.2
mod_version=2.3.3
maven_group=one.armelin.dischatbridge

architectury_version = 13.0.8
Expand Down

0 comments on commit ac88d9f

Please sign in to comment.