1
mirror of https://github.com/Shiewk/ViewServerResources.git synced 2026-04-28 03:44:17 +02:00

Add setting for showing URLs in chat

This commit is contained in:
Shy
2024-08-24 16:56:59 +02:00
parent f09aeadc6e
commit ee4407928e
4 changed files with 72 additions and 21 deletions
@@ -1,5 +1,6 @@
package de.shiewk.resourcepackprivacy.mixin;
import de.shiewk.resourcepackprivacy.client.ResourcePackPrivacyClient;
import de.shiewk.resourcepackprivacy.event.ChatAnnouncer;
import net.minecraft.client.resource.server.ServerResourcePackLoader;
import net.minecraft.text.Text;
@@ -17,9 +18,11 @@ public class MixinServerResourcePackLoader {
@Inject(at = @At("HEAD"), method = "addResourcePack(Ljava/util/UUID;Ljava/net/URL;Ljava/lang/String;)V")
public void onResourcePackAdd(UUID id, URL url, String hash, CallbackInfo ci){
ChatAnnouncer.announce(Text.translatable("gui.resourcepackprivacy.downloading",
Text.literal(url.toString()))
.withColor(Color.ORANGE.getRGB())
);
if (ResourcePackPrivacyClient.isBroadcastDownloads()){
ChatAnnouncer.announce(Text.translatable("gui.resourcepackprivacy.downloading",
Text.literal(url.toString()))
.withColor(Color.ORANGE.getRGB())
);
}
}
}