wgaylord / AutoCrafters

Bug tracker for AutoCrafters
2 stars 1 forks source link

Autocrafters turn into regular dispensers after server restart #16

Closed Sidpatchy closed 3 years ago

Sidpatchy commented 4 years ago

MC Version : 1.16.1 (All paper 1.16.1 versions and the first version of spigot for 1.16.1)

Plugin Version : 2.0

The problem? : Autocrafters stop working and behave like regular dispensers after a server restart.

What you expect to happen : Autocrafters retain their state as an autocrafter, including those in inventories.

What actually happened : Autocrafters turned into named dispensers

Steps to reproduce : Restart server using any method (not reload) and then try to use autocrafters that were already crafted or placed down.

wgaylord commented 4 years ago

I will take a look. And most likely put out an update. I beat something happened with how I save in world crafters. (Maybe an event changed.)

Question do you have any errors or any statements in the logs?

Sidpatchy commented 4 years ago

Yes, I didn't think to check the logs for some reason. Here's what I get from the plugin when the server loads up without any autocrafters placed down (or on first startup): https://gist.github.com/Sidpatchy/72986b3381644d1649440f7c5f6835c4

If you place one down and then restart you get this (https://gist.github.com/Sidpatchy/4a84974c9ba6e6773920107f21dcb0b9) error, it's the same across paper (and spigot) versions.

Also, I just noticed that autocrafters, despite still being craftable, are no longer working upon crafting new ones or placing them down after the error occurs. It appears I was mistaken in the original post. The plugin gets disabled so autocrafters don't work, however, if you restart the server the plugin is able to be enabled, thus making it appear as though the plugin was not registering the autocrafters.

The same issue still stands however, any autocrafters that were crafted or placed before a server restart are still broken when you restart. However, new ones work fine for some reason.

wgaylord commented 4 years ago

This seems to be an issue caused by some change in the Bukkit API between when I release that latest version of AUtoCrafters (When 1.15 came out) and now. I will have to do some updating. (I will probably do that tomorrow as I work will 7:30 pm CST today.) Thanks for the report.

wgaylord commented 3 years ago

Can you send me your data.json from the AutoCrafters folder in your plugin folder? Specifically the one that causes the plugin to error.

I loaded up in 1.16.1 with the build for 1.15 and it works perfectly without error. So it might be something that paper is doing messing stuff up. I will investigate more.

Sidpatchy commented 3 years ago

data.zip It is in a non-standard world. Makes me wonder if there is an issue with custom world names/worlds?

Sidpatchy commented 3 years ago

Makes me wonder if there is an issue with custom world names/worlds?

Only placed autocrafters in the default world (named 'world') and nothing broke.

wgaylord commented 3 years ago

What plugin do you use for adding the non-standard worlds? I think AutoCrafters is being loaded before it loads so that worlds don't exist when the data is loaded.

Can you try adding a z to the start of the Autocraft's jar files name. This should trick spigot into loading it later. (Provided the plugin adding the new worlds has a letter before z in the alphabet first.)

Sidpatchy commented 3 years ago

I'm using IridiumSkyblock. I tried adding a z at the beginning of the file and the same error occurred as described earlier.

wgaylord commented 3 years ago

AutoCrafters 2.0.zip

Can you try using this custom build of AutoCrafters. (There is a jar inside the zip because github does not allow uploading jars.) I added some extra debugging statements into it. Hopefully it will help me figure out whats going in.

Sidpatchy commented 3 years ago

Sorry for taking so long to respond. I've searched the whole log file for "AutoCrafter" and copied all sections that contain that. If I have missed something, I can DM you the whole log. It appears that the plugin doesn't get disabled with this version, however, autocrafters in the custom world are still being removed, ones in the world named world are not.

Log before any autocrafters are placed: https://gist.github.com/Sidpatchy/2e7d36e11164500c926833667cbf5a23 Log after autocrafters are placed: https://gist.github.com/Sidpatchy/193d7c6299cec63449270bb40f8dd4aa

wgaylord commented 3 years ago

Okay the second log definitely concludes its a load order issue. Because that listing shows all the worlds that are registered with the server when it attempts to load the data file. I will see what I can do to fix this issue. I work tomorrow so I will work on the fix over the course of Wednesday. Thank you for being so helpful with figuring out the cause.

wgaylord commented 3 years ago

I think I managed to fix it. There will be some warnings in the log about loading initially but once a crafter tries to craft it will load the crafter properly.

AutoCrafters 2.0.1.zip

If this works I will publish it as an official update.

Sidpatchy commented 3 years ago

That seems to have fixed the problem. Here's a copy of what the plugin did in the console for anyone interested. I also noted a typo and the plugin reporting v2.0.0 instead of v2.0.1: https://gist.github.com/Sidpatchy/94edc79cc5afcbe71ef8cc8b17a47976

Thanks for the help, and for maintaining the plugin!

wgaylord commented 3 years ago

Okay. Good to know I fixed the problem. I will be publishing an official update later this week to get this fix out and also see if I can get double chests working again.