Fixed config reload event not being subscribed.
This commit is contained in:
@ -41,12 +41,27 @@ public final class Config {
|
|||||||
XpTools.getFMLJavaModLoadingContext().registerConfig(ModConfig.Type.SERVER, SERVER_SPEC);
|
XpTools.getFMLJavaModLoadingContext().registerConfig(ModConfig.Type.SERVER, SERVER_SPEC);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SubscribeEvent
|
||||||
|
public static void onConfigReloadEvent(ModConfigEvent event) {
|
||||||
|
if (event.getConfig().getSpec() == CLIENT_SPEC) {
|
||||||
|
Client.onConfigReload();
|
||||||
|
} else if (event.getConfig().getSpec() == COMMON_SPEC) {
|
||||||
|
Common.onConfigReload();
|
||||||
|
} else if (event.getConfig().getSpec() == SERVER_SPEC) {
|
||||||
|
Server.onConfigReload();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static class Client {
|
public static class Client {
|
||||||
Client(ForgeConfigSpec.Builder builder) {}
|
Client(ForgeConfigSpec.Builder builder) {}
|
||||||
|
|
||||||
|
private static void onConfigReload() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Common {
|
public static class Common {
|
||||||
Common(ForgeConfigSpec.Builder builder) {}
|
Common(ForgeConfigSpec.Builder builder) {}
|
||||||
|
|
||||||
|
private static void onConfigReload() {}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Server {
|
public static class Server {
|
||||||
@ -70,13 +85,10 @@ public final class Config {
|
|||||||
builder.pop();
|
builder.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SubscribeEvent
|
private static void onConfigReload() {
|
||||||
public static void onServerConfigReload(ModConfigEvent event) {
|
blockBreakOperationItems = new ArrayList<>();
|
||||||
if (event.getConfig().getSpec() == SERVER_SPEC) {
|
for (String s : blockBreakOperationsRaw.get()) {
|
||||||
blockBreakOperationItems = new ArrayList<>();
|
blockBreakOperationItems.add(new OperationItem(s));
|
||||||
for (String s : blockBreakOperationsRaw.get()) {
|
|
||||||
blockBreakOperationItems.add(new OperationItem(s));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user