Skip to content

Commit cfc8d7b

Browse files
committed
Remove unrecognized cape messages
1 parent 214b55d commit cfc8d7b

File tree

5 files changed

+4
-52
lines changed

5 files changed

+4
-52
lines changed

common/src/main/java/dev/terminalmc/nocapes/NoCapes.java

Lines changed: 4 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,11 @@
2222
import dev.terminalmc.nocapes.util.ModLogger;
2323
import net.minecraft.ChatFormatting;
2424
import net.minecraft.client.Minecraft;
25-
import net.minecraft.network.chat.ClickEvent;
2625
import net.minecraft.network.chat.Component;
27-
import net.minecraft.network.chat.HoverEvent;
28-
import net.minecraft.network.chat.MutableComponent;
2926
import org.jetbrains.annotations.Nullable;
3027

3128
import java.util.*;
3229

33-
import static dev.terminalmc.nocapes.util.Localization.localized;
34-
3530
public class NoCapes {
3631
public static final String MOD_ID = "nocapes";
3732
public static final String MOD_NAME = "NoCapes";
@@ -109,40 +104,10 @@ public static boolean blockCape(GameProfile profile) {
109104
if (blockAll) return true;
110105

111106
String capeId = getCapeId(profile);
112-
if (capeId == null) return false;
113-
114-
@Nullable Boolean render = Config.get().options.capes.get(capeId);
115-
if (render == null) {
116-
Config.get().options.capes.put(capeId, true);
117-
Config.save();
118-
sendNewCapeMessages(capeId);
119-
return false;
120-
} else {
121-
return !render;
107+
if (capeId != null) {
108+
@Nullable Boolean render = Config.get().options.capes.get(capeId);
109+
return render != null && !render;
122110
}
123-
}
124-
125-
private static void sendNewCapeMessages(String capeId) {
126-
Minecraft mc = Minecraft.getInstance();
127-
MutableComponent msg = PREFIX.copy();
128-
msg.append(localized("message", "unknown",
129-
capeId.substring(capeId.length() - 5)));
130-
mc.gui.getChat().addMessage(msg);
131-
132-
msg = PREFIX.copy();
133-
msg.append(localized("message", "copy")).withStyle(msg.getStyle()
134-
.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
135-
localized("message", "copy.tooltip")))
136-
.withClickEvent(new ClickEvent(
137-
ClickEvent.Action.COPY_TO_CLIPBOARD, capeId)));
138-
mc.gui.getChat().addMessage(msg);
139-
140-
msg = PREFIX.copy();
141-
msg.append(localized("message", "contact")).withStyle(msg.getStyle()
142-
.withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT,
143-
localized("message", "contact.tooltip")))
144-
.withClickEvent(new ClickEvent(
145-
ClickEvent.Action.OPEN_URL, "https://terminalmc.dev")));
146-
mc.gui.getChat().addMessage(msg);
111+
return false;
147112
}
148113
}

common/src/main/java/dev/terminalmc/nocapes/mixin/MixinCapeLayer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ private void wrapRender(PoseStack poseStack, MultiBufferSource buffer, int packe
3737
AbstractClientPlayer player, float limbSwing, float limbSwingAmount,
3838
float partialTicks, float ageInTicks, float netHeadYaw, float headPitch,
3939
Operation<Void> original) {
40-
// Skip the check if the cape wouldn't be rendered anyway
4140
if (
4241
!player.isInvisible()
4342
&& player.isModelPartShown(PlayerModelPart.CAPE)

common/src/main/java/dev/terminalmc/nocapes/mixin/MixinElytraLayer.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ public class MixinElytraLayer {
4242
private @Nullable ResourceLocation nullIfBlocked(PlayerSkin instance,
4343
Operation<ResourceLocation> original,
4444
@Local AbstractClientPlayer player) {
45-
// Skip the check if the cape texture wouldn't be rendered anyway
4645
if (
4746
instance.capeTexture() != null
4847
&& (

common/src/main/resources/assets/nocapes/lang/en_us.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,6 @@
1010
"option.nocapes.show": "Show",
1111
"option.nocapes.hide": "Hide",
1212

13-
"message.nocapes.unknown": "Detected unrecognized cape ending in %s",
14-
"message.nocapes.copy": "Please click this message to copy the cape ID",
15-
"message.nocapes.copy.tooltip": "Copy ID",
16-
"message.nocapes.contact": "Then click this message to contact the developer",
17-
"message.nocapes.contact.tooltip": "Open link",
18-
1913
"option.nocapes.hideCape": "Hide Cape",
2014
"option.nocapes.hideElytra": "Hide Elytra",
2115
"cape.nocapes.all": "All Capes",

gradle.properties

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ clothconfig_version=15.0.140
5151
clothconfig_versions_fabric=>=15
5252
clothconfig_versions_neoforge=[15,)
5353

54-
# YACL https://modrinth.com/mod/1eAoo2KR/versions
55-
yacl_version=3.6.2+1.21
56-
yacl_versions_fabric=>=3.5.0
57-
yacl_versions_neoforge=[3.5.0,)
58-
5954
# ModMenu https://modrinth.com/mod/mOgUt4GM/versions
6055
modmenu_version=11.0.3
6156
modmenu_versions_fabric=>=11.0.0-beta.1

0 commit comments

Comments
 (0)