-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
30 changed files
with
780 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
src/main/java/fr/catcore/fdlink/api/discord/MinecraftToDiscordFunction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
src/main/java/fr/catcore/fdlink/api/discord/handlers/CommandHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
src/main/java/fr/catcore/fdlink/api/discord/handlers/StringHandler.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/main/java/fr/catcore/fdlink/api/minecraft/CompatText.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package fr.catcore.fdlink.api.minecraft; | ||
|
||
import com.google.common.collect.Lists; | ||
|
||
import java.util.List; | ||
|
||
public interface CompatText { | ||
|
||
String fabric_Discord_Link$getMessage(); | ||
|
||
default String getTranslationKey() { | ||
return ""; | ||
} | ||
|
||
default List getArgs() { | ||
return Lists.newArrayList(); | ||
} | ||
|
||
|
||
} |
18 changes: 18 additions & 0 deletions
18
src/main/java/fr/catcore/fdlink/api/minecraft/MessagePacket.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package fr.catcore.fdlink.api.minecraft; | ||
|
||
import java.util.UUID; | ||
|
||
public interface MessagePacket { | ||
|
||
Message getMessage(); | ||
|
||
MessageType getMessageType(); | ||
|
||
UUID getUUID(); | ||
|
||
enum MessageType { | ||
CHAT, | ||
SYSTEM, | ||
INFO; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/fr/catcore/fdlink/api/minecraft/MessageSender.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package fr.catcore.fdlink.api.minecraft; | ||
|
||
import fr.catcore.fdlink.api.minecraft.compat.MinecraftServerCompat; | ||
import fr.catcore.fdlink.api.minecraft.style.Style; | ||
|
||
public interface MessageSender { | ||
|
||
void sendMessageToChat(MinecraftServerCompat server, String message, Style style); | ||
} |
26 changes: 26 additions & 0 deletions
26
src/main/java/fr/catcore/fdlink/api/minecraft/MinecraftServer.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package fr.catcore.fdlink.api.minecraft; | ||
|
||
import java.io.File; | ||
import java.util.List; | ||
import java.util.UUID; | ||
|
||
public interface MinecraftServer { | ||
|
||
String getMotd(); | ||
|
||
int getPlayerCount(); | ||
|
||
int getMaxPlayerCount(); | ||
|
||
List<PlayerEntity> getPlayers(); | ||
|
||
void sendMessageToAll(MessagePacket messagePacket); | ||
|
||
String getIp(); | ||
|
||
File getIcon(); | ||
|
||
PlayerEntity getPlayerFromUsername(String username); | ||
|
||
String getUsernameFromUUID(UUID uuid); | ||
} |
10 changes: 10 additions & 0 deletions
10
src/main/java/fr/catcore/fdlink/api/minecraft/PlayerEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package fr.catcore.fdlink.api.minecraft; | ||
|
||
import java.util.UUID; | ||
|
||
public interface PlayerEntity { | ||
|
||
String getPlayerName(); | ||
|
||
UUID getUUID(); | ||
} |
21 changes: 21 additions & 0 deletions
21
src/main/java/fr/catcore/fdlink/api/minecraft/VersionHelper.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package fr.catcore.fdlink.api.minecraft; | ||
|
||
import fr.catcore.fdlink.api.minecraft.compat.MinecraftServerCompat; | ||
import fr.catcore.fdlink.api.minecraft.style.Style; | ||
import net.minecraft.server.MinecraftServer; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public class VersionHelper { | ||
private static final List<MessageSender> MESSAGE_SENDERS = new ArrayList<>(); | ||
|
||
public static void registerMessageSender(MessageSender messageSender) { | ||
MESSAGE_SENDERS.add(messageSender); | ||
} | ||
|
||
public static void sendMessageToChat(MinecraftServerCompat server, String message, Style style) { | ||
MessageSender messageSender = MESSAGE_SENDERS.get(0); | ||
messageSender.sendMessageToChat(server, message, style); | ||
} | ||
} |
Oops, something went wrong.