Shulker Box Tooltip [Fabric/Forge/NeoForge]

Shulker Box Tooltip [Fabric/Forge/NeoForge]

7M Downloads

Config is not read/saved when config dir is a symlink (Windows 10)

Senth opened this issue ยท 1 comments

commented

Issue Description:

It seems since updating to Java 16 and Minecraft 1.17 and to the latest ShulkerBoxTooltip the config is no longer read and saved.

I share the configuration across multiple instances (and computers) so I have the config dir as a symlink. After updating to 1.17 (which also required an update to Java 16) I noticed that this mod doesn't read/save the config. The other mods seem to do this fine.

I tried to remove the symlink and copy the contents, when doing this it can read the existing config, and save any changes.

I know carpet mod have had the same issue when checking if the directory exists or not since you have to do another check if the directory is a symlink.

What happens:

Configuration in-game is always the default after restarting Minecraft.

What you expected to happen:

Configuration can be saved/read.

Steps to reproduce:

  1. Create a link to config dir in cmd.exe (with admin privileges) mklink /D config C:\your\path\to\config
  2. Start Minecraft and change config
  3. Restart Minecraft and config is back to default (no config file is saved)

Affected Versions (Do not use "latest"):

  • ShulkerBoxTooltip: 3.0.0-alpha.4+1.17
  • Minecraft: 1.17
  • Fabric Loader: 0.11.6
  • Fabric API: 0.35.1+1.17
  • Windows: 10

Crash log

[17:45:05] [Render thread/ERROR]: Failed to save config 'class com.misterpemodder.shulkerboxtooltip.impl.config.Configuration'
me.shedaniel.autoconfig.serializer.ConfigSerializer$SerializationException: java.nio.file.FileAlreadyExistsException: D:\games\MultiMC\instances\Fabric 1.17\.minecraft\config
	at com.misterpemodder.shulkerboxtooltip.impl.config.ShulkerBoxTooltipConfigSerializer.serialize(ShulkerBoxTooltipConfigSerializer.java:116) ~[shulkerboxtooltip-3.0.0-alpha.4+1.17.jar:?]
	at com.misterpemodder.shulkerboxtooltip.impl.config.ShulkerBoxTooltipConfigSerializer.serialize(ShulkerBoxTooltipConfigSerializer.java:29) ~[shulkerboxtooltip-3.0.0-alpha.4+1.17.jar:?]
	at me.shedaniel.autoconfig.ConfigManager.save(ConfigManager.java:83) ~[cloth-config-5.0.34-fabric.jar:?]
	at me.shedaniel.autoconfig.ConfigManager.<init>(ConfigManager.java:54) ~[cloth-config-5.0.34-fabric.jar:?]
	at me.shedaniel.autoconfig.AutoConfig.register(AutoConfig.java:66) ~[cloth-config-5.0.34-fabric.jar:?]
	at com.misterpemodder.shulkerboxtooltip.impl.config.ConfigurationHandler.register(ConfigurationHandler.java:59) ~[shulkerboxtooltip-3.0.0-alpha.4+1.17.jar:?]
	at com.misterpemodder.shulkerboxtooltip.impl.ShulkerBoxTooltip.onInitialize(ShulkerBoxTooltip.java:54) ~[shulkerboxtooltip-3.0.0-alpha.4+1.17.jar:?]
	at net.fabricmc.loader.entrypoint.minecraft.hooks.EntrypointUtils.invoke0(EntrypointUtils.java:47) [fabric-loader-0.11.6.jar:?]
	at net.fabricmc.loader.entrypoint.minecraft.hooks.EntrypointUtils.invoke(EntrypointUtils.java:33) [fabric-loader-0.11.6.jar:?]
	at net.fabricmc.loader.entrypoint.minecraft.hooks.EntrypointClient.start(EntrypointClient.java:33) [fabric-loader-0.11.6.jar:?]
	at net.minecraft.class_310.<init>(class_310.java:459) [intermediary-minecraft-1.17-client.jar:?]
	at net.minecraft.client.main.Main.main(Main.java:179) [intermediary-minecraft-1.17-client.jar:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:567) ~[?:?]
	at net.fabricmc.loader.game.MinecraftGameProvider.launch(MinecraftGameProvider.java:234) [fabric-loader-0.11.6.jar:?]
	at net.fabricmc.loader.launch.knot.Knot.launch(Knot.java:153) [fabric-loader-0.11.6.jar:?]
	at net.fabricmc.loader.launch.knot.KnotClient.main(KnotClient.java:28) [fabric-loader-0.11.6.jar:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:78) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:567) ~[?:?]
	at org.multimc.onesix.OneSixLauncher.launchWithMainClass(OneSixLauncher.java:196) [NewLaunch.jar:?]
	at org.multimc.onesix.OneSixLauncher.launch(OneSixLauncher.java:231) [NewLaunch.jar:?]
	at org.multimc.EntryPoint.listen(EntryPoint.java:143) [NewLaunch.jar:?]
	at org.multimc.EntryPoint.main(EntryPoint.java:34) [NewLaunch.jar:?]
Caused by: java.nio.file.FileAlreadyExistsException: D:\games\MultiMC\instances\Fabric 1.17\.minecraft\config
	at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:87) ~[?:?]
	at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103) ~[?:?]
	at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108) ~[?:?]
	at sun.nio.fs.WindowsFileSystemProvider.createDirectory(WindowsFileSystemProvider.java:519) ~[?:?]
	at java.nio.file.Files.createDirectory(Files.java:694) ~[?:?]
	at java.nio.file.Files.createAndCheckIsDirectory(Files.java:801) ~[?:?]
	at java.nio.file.Files.createDirectories(Files.java:747) ~[?:?]
	at com.misterpemodder.shulkerboxtooltip.impl.config.ShulkerBoxTooltipConfigSerializer.serialize(ShulkerBoxTooltipConfigSerializer.java:109) ~[shulkerboxtooltip-3.0.0-alpha.4+1.17.jar:?]
	... 26 more
commented

Fixed it! I will release a patch for both 1.16 and 1.17 branches