Skip to content

Commit

Permalink
this is the end of my journey
Browse files Browse the repository at this point in the history
  • Loading branch information
not-coded committed Feb 26, 2024
1 parent d32b470 commit 467150c
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 13 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ dependencies {

include "org.slf4j:slf4j-api:1.8.0-beta4"

include 'org.apache.commons:commons-collections4:4.1'
include 'org.apache.commons:commons-collections4:4.4'
include 'com.neovisionaries:nv-websocket-client:2.14'
include 'com.squareup.okhttp3:okhttp:3.14.9'
include 'com.squareup.okio:okio:1.17.2'
//include 'com.squareup.okio:okio-jvm:3.7.0'
include 'com.fasterxml.jackson.core:jackson-databind:2.10.1'
include 'com.fasterxml.jackson.core:jackson-annotations:2.10.1'
include 'com.fasterxml.jackson.core:jackson-core:2.10.1'
include 'com.fasterxml.jackson.core:jackson-databind:2.16.1'
include 'com.fasterxml.jackson.core:jackson-annotations:2.16.1'
include 'com.fasterxml.jackson.core:jackson-core:2.16.1'
include "net.sf.trove4j:trove4j:3.0.3"

include 'org.json:json:20231013'
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ archives_base_name = Fabric-Discord-Link

# Dependencies
fabric_version=0.25.0+build.415-1.16
jda_version=5.0.0-beta.12
jda_version=5.0.0-beta.20
emoji_version=5.1.1
webhook_version=0.8.4
9 changes: 4 additions & 5 deletions src/main/java/fr/catcore/fdlink/FDLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import fr.catcore.fdlink.discord.bot.DiscordBot;
import fr.catcore.fdlink.discord.webhook.DiscordWebhook;
import net.fabricmc.api.DedicatedServerModInitializer;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerLifecycleEvents;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
import net.minecraft.text.BaseText;
import net.minecraft.text.Text;
Expand Down Expand Up @@ -97,10 +96,10 @@ private static void initializeVersion() {
server.sendMessageToAll(new MessagePacketCompat(literalText, MessagePacket.MessageType.CHAT, UUID.randomUUID()));
});

ServerLifecycleEvents.SERVER_STARTING.register(minecraftServer -> FDLink.getMessageSender().serverStarting());
ServerLifecycleEvents.SERVER_STARTED.register((server -> FDLink.getMessageSender().serverStarted()));
ServerLifecycleEvents.SERVER_STOPPING.register(minecraftServer -> FDLink.getMessageSender().serverStopping());
ServerLifecycleEvents.SERVER_STOPPED.register((server -> FDLink.getMessageSender().serverStopped()));
//ServerLifecycleEvents.SERVER_STARTING.register(minecraftServer -> FDLink.getMessageSender().serverStarting());
//ServerLifecycleEvents.SERVER_STARTED.register((server -> FDLink.getMessageSender().serverStarted()));
//ServerLifecycleEvents.SERVER_STOPPING.register(minecraftServer -> FDLink.getMessageSender().serverStopping());
//ServerLifecycleEvents.SERVER_STOPPED.register((server -> FDLink.getMessageSender().serverStopped()));

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ public DiscordWebhook(String webhookURL, Config config, DiscordBot messageReader
builder.setAllowedMentions(this.allowedMentions);

if (author != null) {

//builder.setAvatarUrl("https://crafatar.com/avatars/" + author + "?&overlay");
// ^^ doesn't work

builder.setAvatarUrl("https://mc-heads.net/avatar/" + author + "/160");

try {
if (FDLink.getMessageReceiver() != null && FDLink.getMessageReceiver().getServer() != null) {
MinecraftServerCompat minecraftServer = FDLink.getMessageReceiver().getServer();
Expand All @@ -63,9 +69,7 @@ public DiscordWebhook(String webhookURL, Config config, DiscordBot messageReader
builder.setUsername("Could not get player username");
}

System.out.println(author);

builder.setAvatarUrl("https://crafatar.com/avatars/" + author + "?&overlay");
}

builder.setContent(message);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"fabricloader": ">=0.14.21",
"fabric": "*",
"minecraft": "1.16.x",
"java": ">=8"
"java": ">=17"
},

"authors": [
Expand Down

0 comments on commit 467150c

Please sign in to comment.