WolfyScript / CustomCrafting

Spigot based plugin to create your own custom Recipes & Items. Designed to be easy to use with in-game GUI and tons of configuration possibilities.
https://modrinth.com/plugin/customcrafting
GNU General Public License v3.0
114 stars 35 forks source link

Unsupported copy option #381

Closed Khotul closed 1 month ago

Khotul commented 1 month ago

What happened?

Custom Crafting 4.16.9.1 WolfyUtils 4.17-beta.1 paper-1.18.2 OpenJDK 17 Windows 10

I'm migrating my local server I made 2 years ago from 1.17.1 to 1.18.2. I updated CustomCrafting from an (at least) 2 year old version, however it didn't work out of the box, as the plugin crashed on server startup because of

java.lang.UnsupportedOperationException: Unsupported copy option

I've looked at the relevant code and it seems that this line is what triggers the error Files.move(recipeBookFileJson.toPath(), recipeBookFile.toPath(), StandardCopyOption.REPLACE_EXISTING, StandardCopyOption.COPY_ATTRIBUTES);

I've solved this manually on my end by renaming every recipe in my folder from "*.json" to "*.conf" which worked out and the plugin is working properly now. Still I opened this issue to let the developer(s) about the error.

How can the bug be reproduced?

Create a server on 1.17.1 with a 2 year old version of CustomCrafting, create some recipes, migrate the server to 1.18.2 with a newer version of the plugin.

Expected Behaviour?

Plugin should rename *.json recipe files to *.conf without crashing.

Plugin version

Custom Crafting 4.16.9.1, WolfyUtils 4.17-beta.1

Server software

Paper 1.18.2

Relevant log output

[18:54:10] [Server thread/INFO]: [CustomCrafting] Enabling CustomCrafting v4.16.9.1
[18:54:10] [Server thread/INFO]: [CustomCrafting] Loaded fallback language "en_US" v6.1.0 translated by WolfyScript
[18:54:10] [Server thread/INFO]: [CustomCrafting] Loaded active language "en_US" v6.1.0 translated by WolfyScript
[18:54:10] [Server thread/ERROR]: Error occurred while enabling CustomCrafting v4.16.9.1 (Is it up to date?)
java.lang.UnsupportedOperationException: Unsupported copy option
    at sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:293) ~[?:?]
    at sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:293) ~[?:?]
    at java.nio.file.Files.move(Files.java:1432) ~[?:?]
    at me.wolfyscript.customcrafting.handlers.ConfigHandler.loadRecipeBookConfig(ConfigHandler.java:90) ~[customcrafting-spigot-4.16.9.1.jar:?]
    at me.wolfyscript.customcrafting.handlers.ConfigHandler.load(ConfigHandler.java:69) ~[customcrafting-spigot-4.16.9.1.jar:?]
    at me.wolfyscript.customcrafting.CustomCrafting.onEnable(CustomCrafting.java:345) ~[customcrafting-spigot-4.16.9.1.jar:?]
    at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:370) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:541) ~[paper-api-1.18.2-R0.1-SNAPSHOT.jar:?]
    at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugin(CraftServer.java:560) ~[paper-1.18.2.jar:git-Paper-388]
    at org.bukkit.craftbukkit.v1_18_R2.CraftServer.enablePlugins(CraftServer.java:474) ~[paper-1.18.2.jar:git-Paper-388]
    at net.minecraft.server.MinecraftServer.loadWorld0(MinecraftServer.java:665) ~[paper-1.18.2.jar:git-Paper-388]
    at net.minecraft.server.MinecraftServer.loadLevel(MinecraftServer.java:432) ~[paper-1.18.2.jar:git-Paper-388]
    at net.minecraft.server.dedicated.DedicatedServer.initServer(DedicatedServer.java:316) ~[paper-1.18.2.jar:git-Paper-388]
    at net.minecraft.server.MinecraftServer.runServer(MinecraftServer.java:1164) ~[paper-1.18.2.jar:git-Paper-388]
    at net.minecraft.server.MinecraftServer.lambda$spin$0(MinecraftServer.java:316) ~[paper-1.18.2.jar:git-Paper-388]
    at java.lang.Thread.run(Thread.java:833) ~[?:?]
[18:54:10] [Server thread/INFO]: [CustomCrafting] Disabling CustomCrafting v4.16.9.1

Submit issue

WolfyScript commented 1 month ago

This error should be fixed with CustomCarfting v4.16.11. In fact that update was released just for that issue alone. I also noticed that your WolfyUtils is a bit out of date too. I'd recommend to get the latest beta version for that one.

You can find the updates for both plugins on Modrinth.