qruet / AnvilLot

Allows for vanilla anvils to extend beyond the vanilla price cap of 39 experience in a non intrusive way.
6 stars 4 forks source link

Lots of warning and not working + error on disable #5

Closed arboriginal closed 4 years ago

arboriginal commented 5 years ago

Hi,

I've just discovered your plugin and tested it on my dev server (localhost). Unfortunately, it seems not working with last version of Paper 1.14.4, nor with a recent one of Spigot 1.14.4.

Hope this report will help you to fix it. Let me know if I forgot to give you an information.

Server Version For my first and main tests: Paper version git-Paper-209 (MC: 1.14.4) (Implementing API version 1.14.4-R0.1-SNAPSHOT)

Also tested then with a fresh Spigot without other plugins nor datapacks: CraftBukkit version git-Spigot-9de398a-9c887d4 (MC: 1.14.4) (Implementing API version 1.14.4-R0.1-SNAPSHOT)

(Same results with Paper and Spigot)

Plugin Version

[01:25:33 INFO]: [MaxRepairCost] ╼----------- MaxRepairCost 2.136 -----------╾
[01:25:33 INFO]: [MaxRepairCost] 〶 Checking Server Version...
[01:25:33 INFO]: [MaxRepairCost] 〶 Hooking into version v1_14_R1
[01:25:33 INFO]: [MaxRepairCost] 〶 Deserializing config data...
[01:25:33 INFO]: [MaxRepairCost] 〶 Success!
[01:25:33 INFO]: [MaxRepairCost] 〶 Instantiating a few things...
[01:25:33 INFO]: [MaxRepairCost] 〶 Success!
[01:25:33 INFO]: [MaxRepairCost] 〶 Thank you for installing MaxRepairCost! If you're experiencing any issues please report it (see config for details)

Note: No warnings, nor errors during the startup.

Describe the bug The console is spammed by the same error (see below) when I'm using an anvil, and I cannot enchant item more than default limits. The only thing I've seen with this plugin (except the warnings) is that the "too expansive" message is no more displayed, but the right slot where I'm supposed to get the resulting item is empty + the arrow has the red cross over it.

To Reproduce The warning appears several times each time (I mean for example I do 1 action, I receive it 5x), the minimum seems to be 2x, and I got it 8x the first one I've seen it.

  1. Open an anvil GUI
  2. Placing a diamond sword (non enchanted at all yet) in the first slot => Got warnings (5x)
  3. Placing a book in the second slot => Got warnings (2x)
  4. Takes the resulting sword => Got warnings (2x) but it's applied
  5. ... repeat with other books ... same happens (but they're applied)
  6. (vanilla limit reached) I can't apply other books but don't have the message "too expansive". Instead the right slot is empty and the arrow is crossed out

So, it's not breaking vanilla mechanisms, but produces warnings, don't avoid the limit and hide the "too expansive" message which could be confucius for users.

Media Warning spammed in the console: https://gist.github.com/arboriginal/4a64a47ab7c0bf05cba85a6f2892199e [01:08:26 WARN]: java.lang.NoSuchFieldException: modifiers

Error when stopping the server: (not each times) https://gist.github.com/arboriginal/9a4fc5e0f855fd8e6d8c4f180366344f Plugin attempted to register task while disabled

Screenshot when I've reached the vanilla limit: screenshot.png

Additional context

arboriginal commented 5 years ago

I've quickly check the code, but as I discover it, for now I got no idea to fix it...

In case it helps:

arboriginal commented 5 years ago

OK, because of the last comment, I've installed a second version of Java on my computer and test to launch my server with it... The plugin works.

So, the "warning bug" is for Java 12. It works fine with Java 8.

But the "error bug" can still happen. If I'm right, this is when a player has anvil GUI open when the plugin is disabling: It tries to launch new tasks but it not supposed too. Maybe checking plugin.isEnabled() or something like that could be enough, depending on what those tasks do...

Edit: Easy way to reproduce: (with Plugman)

  1. Open an anvil
  2. Place an item in it
  3. Type /plugman reload MaxRepairCost

You'll see the error given in my first post when disabling the plugin. This let the player in creative mode.

qruet commented 5 years ago

I'll look into this as I am writing the update to further support for 1.14 and clear out previous bugs. Since the plugin is largely being entirely rewritten and directly overriding pre-existing vanilla anvil mechanics instead of externally messing with values with Reflection, I would expect improved performance and fewer bugs. I will keep this report in mind and ensure that such errors do not occur in the future.

In terms of Java 12 support. I may look into adding such support in the future, however I currently use Java 8 for all of my development environments since it is the most commonly used, and as far as I am aware, it's the recommended Java version by Oracle.

qruet commented 4 years ago

This issue was resolved a while ago but I never closed this issue. Please check some of the latest pre-releases. Support for the latest versions of Java was already added.