List all mod versions from server and client
This commit is contained in:
parent
032b4187bd
commit
a53c503c4e
4 changed files with 81 additions and 6 deletions
|
@ -1,5 +1,6 @@
|
|||
package ru.bclib.api.dataexchange;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents;
|
||||
|
@ -7,9 +8,11 @@ import net.fabricmc.fabric.api.networking.v1.ServerPlayConnectionEvents;
|
|||
import net.minecraft.network.FriendlyByteBuf;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class DataExchangeAPI {
|
||||
private final static List<String> MODS = Lists.newArrayList();
|
||||
private static DataExchangeAPI instance;
|
||||
private ConnectorServerside server;
|
||||
private ConnectorClientside client;
|
||||
|
@ -46,6 +49,23 @@ public class DataExchangeAPI {
|
|||
ServerPlayConnectionEvents.DISCONNECT.register(server::onPlayDisconnect);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register a mod to participate in the DataExchange.
|
||||
*
|
||||
* @param modID - {@link String} modID.
|
||||
*/
|
||||
public static void registerMod(String modID) {
|
||||
MODS.add(modID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the IDs of all registered Mods.
|
||||
* @return List of modIDs
|
||||
*/
|
||||
public static List<String> registeredMods(){
|
||||
return MODS;
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new Descriptor for a DataHandler.
|
||||
* @param desc The Descriptor you want to add.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue