Skip to content

Commit

Permalink
Hello, No fun allowed!
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Oct 19, 2024
1 parent d0c88f0 commit 3a8fe39
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ repositories {
exclusiveMaven("https://maven.ladysnake.org/releases", "dev.onyxstudios.cardinal-components-api") // Cardinal Components
exclusiveMaven("https://maven.wispforest.io", "me.alphamode")
exclusiveMaven("https://maven.terraformersmc.com/releases/", "com.terraformersmc")
exclusiveMaven("https://repo.erdbeerbaerlp.de/repository/maven-public/", "de.erdbeerbaerlp")
flatDir {
dirs(setOf("libs"))
}
Expand Down Expand Up @@ -61,6 +62,11 @@ dependencies {
// Compat
modImplementation("maven.modrinth:banhammer:0.7.1+1.20.1")
modImplementation(":ACME_Admin-0.1.0-beta.1+fabric-mc1.20.1-local")

modImplementation("de.erdbeerbaerlp:dcintegration.common:3.0.7") {
isChanging = true
isTransitive = false
}
}

tasks.processResources {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package dev.ithundxr.railwaystweaks.mixin.compat.dcintegration;

import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import dcshadow.net.kyori.adventure.text.Component;
import dcshadow.net.kyori.adventure.text.TextReplacementConfig;
import de.erdbeerbaerlp.dcintegration.common.util.ComponentUtils;
import de.erdbeerbaerlp.dcintegration.common.util.McServerInterface;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;

@Mixin(targets = "de.erdbeerbaerlp.dcintegration.common.DiscordEventListener")
public class DiscordEventListenerMixin {
@WrapOperation(method = "onEvent", at = @At(value = "INVOKE", target = "Lde/erdbeerbaerlp/dcintegration/common/util/McServerInterface;sendIngameMessage(Ldcshadow/net/kyori/adventure/text/Component;)V"))
private void railwayTweaks$addBlockedChars(McServerInterface instance, Component component, Operation<Void> original) {
TextReplacementConfig replacementConfig = ComponentUtils.replaceLiteral("§", "[no]");
original.call(instance, component.replaceText(replacementConfig));
}
}
1 change: 1 addition & 0 deletions src/main/resources/railwaystweaks.mixins.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"ServerPlayerMixin",
"ServerStatusPacketListenerImplMixin",
"compat.appleskin.SyncHandlerMixin",
"compat.dcintegration.DiscordEventListenerMixin",
"compat.tconstruct.SimpleChannelAccessor"
],
"client": [
Expand Down

0 comments on commit 3a8fe39

Please sign in to comment.