Skip to content

Commit

Permalink
remove entrypoint part
Browse files Browse the repository at this point in the history
  • Loading branch information
TexBlock committed Jun 25, 2024
1 parent 3206e23 commit 52fe697
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 182 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ public static Path getConfigDirectory() {
throw new AssertionError();
}

@ExpectPlatform
public static <T> List<T> getEntrypoints(String key, Class<T> type) {
// Just throw an error, the content should get replaced at runtime.
throw new AssertionError();
}
// @ExpectPlatform
// public static <T> List<T> getEntrypoints(String key, Class<T> type) {
// // Just throw an error, the content should get replaced at runtime.
// throw new AssertionError();
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ public static void init() {
serializerMap.put("toml", TomlSerializer.INSTANCE);
serializerMap.put("json5", Json5Serializer.INSTANCE);

for (Serializer serializer : AzusaConfigExpectPlatform.getEntrypoints("config_serializer", Serializer.class)) {
Serializer oldValue = serializerMap.put(serializer.getFileExtension(), serializer);

if (oldValue != null) {
LOGGER.warn(AzusaConfigMod.MARKER, "Replacing {} serializer {} with {}", serializer.getFileExtension(), oldValue.getClass(), serializer.getClass());
}
}
// for (Serializer serializer : AzusaConfigExpectPlatform.getEntrypoints("config_serializer", Serializer.class)) {
// Serializer oldValue = serializerMap.put(serializer.getFileExtension(), serializer);
//
// if (oldValue != null) {
// LOGGER.warn(AzusaConfigMod.MARKER, "Replacing {} serializer {} with {}", serializer.getFileExtension(), oldValue.getClass(), serializer.getClass());
// }
// }

String globalConfigExtension = System.getProperty("azusaconfig.globalConfigExtension");
String defaultConfigExtension = System.getProperty("azusaconfig.defaultConfigExtension");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public static Path getConfigDirectory() {
return FabricLoader.getInstance().getConfigDir();
}

public static <T> List<T> getEntrypoints(String key, Class<T> type) {
return FabricLoader.getInstance().getEntrypoints(key, type);
}
// public static <T> List<T> getEntrypoints(String key, Class<T> type) {
// return FabricLoader.getInstance().getEntrypoints(key, type);
// }
}
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ enabled_platforms=fabric,neoforge
yarn_mappings=1.20.4+build.3

archives_base_name=AzusaConfig
mod_version=0.1.1
mod_version=0.1.2
maven_group=ho.artisan.azusaconfig

fabric_loader_version=0.15.2
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ho.artisan.azusaconfig.neoforge;

import ho.artisan.azusaconfig.neoforge.entrypoint.impl.EntrypointStorage;
//import ho.artisan.azusaconfig.neoforge.entrypoint.impl.EntrypointStorage;
import net.neoforged.fml.loading.FMLPaths;

import java.nio.file.Path;
Expand All @@ -11,7 +11,7 @@ public static Path getConfigDirectory() {
return FMLPaths.CONFIGDIR.get();
}

public static <T> List<T> getEntrypoints(String key, Class<T> type) {
return (List<T>) EntrypointStorage.getEntrypointContainers(key, type);
}
// public static <T> List<T> getEntrypoints(String key, Class<T> type) {
// return (List<T>) EntrypointStorage.getEntrypointContainers(key, type);
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import ho.artisan.azusaconfig.AzusaConfigMod;
import ho.artisan.azusaconfig.impl.config.AzusaConfigImpl;
import ho.artisan.azusaconfig.neoforge.impl.entrypoint.EntrypointStorage;
//import ho.artisan.azusaconfig.neoforge.entrypoint.impl.EntrypointStorage;
import net.neoforged.fml.IExtensionPoint;
import net.neoforged.fml.ModLoadingContext;
import net.neoforged.fml.common.Mod;
Expand All @@ -12,7 +12,7 @@ public class AzusaConfigModNeoForge {

public AzusaConfigModNeoForge() {
ModLoadingContext.get().registerExtensionPoint(IExtensionPoint.DisplayTest.class, () -> new IExtensionPoint.DisplayTest(() -> IExtensionPoint.DisplayTest.IGNORESERVERONLY, (a, b) -> true));
EntrypointStorage.loadAll();
// EntrypointStorage.loadAll();
AzusaConfigImpl.init();
}
}

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit 52fe697

Please sign in to comment.