aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorMy-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com>2021-09-05 15:45:44 -0400
committerMy-Name-Is-Jeff <37018278+My-Name-Is-Jeff@users.noreply.github.com>2021-09-05 15:45:44 -0400
commit27175a39114a39b7f079f24c8dd929c676c8b0bd (patch)
tree23f42a32f1d1b5f0baa348fc5abd677fb88af623 /src/main
parent324400ff4afbe753349f8598400c7028f31ccde1 (diff)
downloadSkytilsMod-27175a39114a39b7f079f24c8dd929c676c8b0bd.tar.gz
SkytilsMod-27175a39114a39b7f079f24c8dd929c676c8b0bd.tar.bz2
SkytilsMod-27175a39114a39b7f079f24c8dd929c676c8b0bd.zip
change dsm colored names check
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/skytils/skytilsmod/mixins/transformers/dsm/MixinColoredNames.java38
-rw-r--r--src/main/resources/mixins.skytils.json1
2 files changed, 39 insertions, 0 deletions
diff --git a/src/main/java/skytils/skytilsmod/mixins/transformers/dsm/MixinColoredNames.java b/src/main/java/skytils/skytilsmod/mixins/transformers/dsm/MixinColoredNames.java
new file mode 100644
index 00000000..0284519d
--- /dev/null
+++ b/src/main/java/skytils/skytilsmod/mixins/transformers/dsm/MixinColoredNames.java
@@ -0,0 +1,38 @@
+/*
+ * Skytils - Hypixel Skyblock Quality of Life Mod
+ * Copyright (C) 2021 Skytils
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published
+ * by the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+package skytils.skytilsmod.mixins.transformers.dsm;
+
+import net.minecraft.entity.Entity;
+import org.spongepowered.asm.mixin.Dynamic;
+import org.spongepowered.asm.mixin.Mixin;
+import org.spongepowered.asm.mixin.Pseudo;
+import org.spongepowered.asm.mixin.injection.At;
+import org.spongepowered.asm.mixin.injection.Redirect;
+import skytils.skytilsmod.utils.StringUtilsKt;
+
+@Pseudo
+@Mixin(targets = "me.Danker.features.ColouredNames", remap = false)
+public class MixinColoredNames {
+ @Dynamic
+ @Redirect(method = "onRenderLiving", at = @At(value = "INVOKE", target = "Lnet/minecraft/entity/Entity;hasCustomName()Z"))
+ private boolean replaceColoredNameCheck(Entity entity) {
+ String customName = entity.getCustomNameTag();
+ return customName.length() > 0 && !customName.endsWith("§c❤") && !StringUtilsKt.stripControlCodes(customName).endsWith(" Hits");
+ }
+}
diff --git a/src/main/resources/mixins.skytils.json b/src/main/resources/mixins.skytils.json
index e406e495..a60df41d 100644
--- a/src/main/resources/mixins.skytils.json
+++ b/src/main/resources/mixins.skytils.json
@@ -18,6 +18,7 @@
"accessors.AccessorWorldInfo",
"audio.MixinSoundManager",
"crash.MixinCrashReport",
+ "dsm.MixinColoredNames",
"entity.MixinAbstractClientPlayer",
"entity.MixinBossStatus",
"entity.MixinEntityBlaze",