Reload when the config is changed from the back

This commit is contained in:
Sollace 2024-07-25 15:46:17 +02:00
parent eb25692aef
commit 55bf4e209f
No known key found for this signature in database
GPG key ID: E52FACE7B5C773DB
2 changed files with 6 additions and 1 deletions

View file

@ -90,6 +90,7 @@ public class MineLittlePony implements ClientModInitializer {
ScreenInitCallback.EVENT.register(this::onScreenInit); ScreenInitCallback.EVENT.register(this::onScreenInit);
config.load(); config.load();
config.onChangedExternally(c -> initialized = false);
Channel.bootstrap(); Channel.bootstrap();
ModelType.bootstrap(); ModelType.bootstrap();
@ -101,6 +102,10 @@ public class MineLittlePony implements ClientModInitializer {
if (!initialized) { if (!initialized) {
initialized = true; initialized = true;
renderDispatcher.initialise(client.getEntityRenderDispatcher(), false); renderDispatcher.initialise(client.getEntityRenderDispatcher(), false);
if (client.currentScreen instanceof PonySettingsScreen screen) {
screen.init(client, screen.width, screen.height);
}
} }
boolean inGame = client.world != null && client.player != null && client.currentScreen == null; boolean inGame = client.world != null && client.player != null && client.currentScreen == null;

View file

@ -75,7 +75,7 @@ public class ArmourTextureResolver implements ArmourTextureLookup, IdentifiableR
.filter(ArmourTexture::validate) .filter(ArmourTexture::validate)
.findFirst() .findFirst()
.or(() -> { .or(() -> {
MineLittlePony.logger.warn("Could not identify correct texture to use for {}. Was none of: [" + System.lineSeparator() + "{}" + System.lineSeparator() + "]", id, options.stream() MineLittlePony.LOGGER.warn("Could not identify correct texture to use for {}. Was none of: [" + System.lineSeparator() + "{}" + System.lineSeparator() + "]", id, options.stream()
.map(ArmourTexture::texture) .map(ArmourTexture::texture)
.map(Identifier::toString) .map(Identifier::toString)
.collect(Collectors.joining("," + System.lineSeparator()))); .collect(Collectors.joining("," + System.lineSeparator())));