-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
stop chat from being cleared when the client enters a configuration p…
…hase
- Loading branch information
1 parent
6ba719b
commit a4a5c44
Showing
5 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ noxesium_version=1.1.1 | |
adventure_version=5.10.0 | ||
|
||
org.gradle.jvmargs=-Xmx4000m | ||
mod_version=1.8.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/kotlin/de/derniklaas/buildbugs/mixin/ClearChatOnDisconnectMixin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package de.derniklaas.buildbugs.mixin | ||
|
||
import de.derniklaas.buildbugs.BuildBugsClientEntrypoint | ||
import net.minecraft.client.MinecraftClient | ||
import org.spongepowered.asm.mixin.Mixin | ||
import org.spongepowered.asm.mixin.injection.At | ||
import org.spongepowered.asm.mixin.injection.Inject | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo | ||
|
||
@Mixin(MinecraftClient::class) | ||
abstract class ClearChatOnDisconnectMixin { | ||
|
||
// Clear the chat when disconnecting from a server | ||
// This is done to prevent the chat from being filled with messages from the previous server | ||
@Inject(at = [At("HEAD")], method = ["Lnet/minecraft/class_310;method_18096(Lnet/minecraft/class_437;)V"]) | ||
fun onDisconnect(info: CallbackInfo) { | ||
// ignore if IslandUtils is present as it will also clear the chat | ||
if(BuildBugsClientEntrypoint.hasIslandUtils) return | ||
// Clear the chat when disconnecting from a server | ||
MinecraftClient.getInstance().inGameHud.clear() | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters