APDevTeam / Movecraft

The original movement plugin for Paper. Reloaded. Again.
GNU General Public License v3.0
122 stars 79 forks source link

The # wildcard isn't recognized in lists with git-Paper-61 #602

Closed prestonhashworth closed 1 year ago

prestonhashworth commented 1 year ago

Describe the bug

TL;DR My concern is that there is an API change in Paper that is not recognizing how Movecraft feeds in wildcard prefixes.

I haven't reviewed your code to understand how the config file translates into behavior regarding allowed blocks so I can't definitively pinpoint where the break is.

This could be a paper bug, but for your visibility the commit hash that started this on the Paper repo can be found at https://github.com/PaperMC/Paper/commit/171ba7ccf321ac2be372a3eb3651e4fa6c8b9145

The main issue I've narrowed down is when loading craft files on a server running git-Paper-61 (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT) (Git: 171ba7c) it appears that any block that uses the "#[BLOCKNAME]" wildcard in the craft file is unrecognized and produces an error output like below. This does not happen on git-Paper-60.

> movecraft reloadtypes
[08:50:36 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'Elevator.craft': Entry #carpets is not a valid tag!
[08:50:36 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'HyperShip.craft': Entry #carpets is not a valid tag!
[08:50:36 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'Torpedo.craft': Entry #chests is not a valid tag!
[08:50:36 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'HyperFighter.craft': Entry #chests is not a valid tag!
[08:50:36 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'Airship.craft': Entry #concrete is not a valid tag!
[08:50:36 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'Truck.craft': Entry #carpets is not a valid tag!
[08:50:36 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'BigTruck.craft': Entry #carpets is not a valid tag!
[08:50:36 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'BigSubAirship.craft': No enum constant org.bukkit.Material.GLASS_PANE"
[08:50:36 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'Ship.craft': Entry #concrete is not a valid tag!
[08:50:36 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'SubAirship.craft': No enum constant org.bukkit.Material.GLASS_PANE    - LAPIS_BLOCK
[08:50:36 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'FlyingTurret.craft': Entry #carpets is not a valid tag!
[08:50:36 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'Endskiff.craft': Entry #concrete is not a valid tag!
[08:50:36 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'Endship.craft': Entry #concrete is not a valid tag!
[08:50:36 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'BigAirship.craft': Entry #concrete is not a valid tag!
[08:50:36 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'escapepod.craft': Entry #carpets is not a valid tag!
[08:50:36 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'Submarine.craft': Entry #concrete is not a valid tag!
[08:50:36 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'Airskiff.craft': Entry #chests is not a valid tag!

To Reproduce Steps to reproduce the behavior: I deploy my servers as pods, leveraging James Chambers Minecraft Java Paper Server repo with a local image build. The repo can be found at:

# Minecraft Java Paper Server Docker Container
# Author: James A. Chambers - https://jamesachambers.com/legendary-paper-minecraft-java-container/
# GitHub Repository: https://github.com/TheRemote/Legendary-Java-Minecraft-Paper

I've edited the amd64.Dockerfile that is in the repo to specify the Paper Minecraft Version Env variable for 1.20.1. The craft file errors began when I incorporated a new pod with a fresh image build and I noticed the behavior change in error logging then.

Expected behavior For the craft files to recognize the "#[BLOCKNAME]" wildcard convention

Versions (please complete the following information):

> movecraft
[09:13:04 INFO]: [Movecraft] Movecraft 8.0.0_beta-2_snapshot by [cccm5, BaccaYarro, TylerS1066, eirik1996, drfiveminusmint, HumorousFool]
> paper version
[08:44:12 INFO]: Checking version, please wait...
[08:44:12 INFO]: This server is running Paper version git-Paper-60 (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT) (Git: f2c1e13)
You are 1 version(s) behind
Download the new version at: https://papermc.io/downloads/paper
Previous version: git-Paper-54 (MC: 1.20.1)

Additional context There are other plugins installed but the delta in behavior follows the Paper version

Issue submitted for your awareness. Thanks for an awesome plugin!

TylerS1066 commented 1 year ago

Interesting, can you confirm that the Movecraft datapack is loaded via /datapack list both before and after the change? If it is, try running /movecraft reloadtypes and see if it errors out.

I am very confused as to why this would stop working.

prestonhashworth commented 1 year ago

Ack, this issue is showing up on on git-Paper-60 as well. I disabled the paperclip update in the start.sh script and manually injected the git-Paper-60 jar and am still getting the same error.

> paper version
[09:46:52 INFO]: Checking version, please wait...
[09:46:53 INFO]: This server is running Paper version git-Paper-60 (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT) (Git: f2c1e13)
You are 1 version(s) behind
Download the new version at: https://papermc.io/downloads/paper
Previous version: git-Paper-61 (MC: 1.20.1)
> movecraft reloadtypes
[09:47:01 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'Elevator.craft': Entry #carpets is not a valid tag!
[09:47:01 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'HyperShip.craft': Entry #carpets is not a valid tag!
[09:47:01 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'Torpedo.craft': Entry #chests is not a valid tag!
[09:47:01 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'HyperFighter.craft': Entry #chests is not a valid tag!
[09:47:01 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'Airship.craft': Entry #concrete is not a valid tag!
[09:47:01 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'Truck.craft': Entry #carpets is not a valid tag!
[09:47:01 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'BigTruck.craft': Entry #carpets is not a valid tag!
[09:47:01 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'BigSubAirship.craft': No enum constant org.bukkit.Material.GLASS_PANE"
[09:47:01 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'Ship.craft': Entry #concrete is not a valid tag!
[09:47:01 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'SubAirship.craft': Entry #heads is not a valid tag!
[09:47:01 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'FlyingTurret.craft': Entry #carpets is not a valid tag!
[09:47:01 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'Endskiff.craft': Entry #concrete is not a valid tag!
[09:47:01 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'Endship.craft': Entry #concrete is not a valid tag!
[09:47:01 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'BigAirship.craft': Entry #concrete is not a valid tag!
[09:47:01 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'escapepod.craft': Entry #carpets is not a valid tag!
[09:47:01 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'Submarine.craft': Entry #concrete is not a valid tag!
[09:47:01 ERROR]: [Movecraft] ERROR PARSING CRAFT FILE: 'Airskiff.craft': Entry #chests is not a valid tag!
[09:47:01 INFO]: [Movecraft] Loaded 4 Craft files
[09:47:01 INFO]: [Movecraft] Reloaded types.
prestonhashworth commented 1 year ago

Good intuition for finding another delta. TL;DR EDIT: Datapack is missing on erroring server.

On a working server/pod:

> datapack list
[09:52:17 INFO]: There are 3 data pack(s) enabled: [vanilla (built-in)], [file/bukkit (world)], [file/movecraft-data.zip (world)]
[09:52:17 INFO]: There are no more data packs available

On the erroring server/pod:

> datapack list
[09:51:43 INFO]: There are 2 data pack(s) enabled: [vanilla (built-in)], [file/bukkit (world)]
[09:51:43 INFO]: There are no more data packs available
prestonhashworth commented 1 year ago

Dude you nailed it. I copied the data pack from a working server and it is working. Not sure why the datapack got yeeted or never written. I will do some step recreation and see if I can reproduce the issue. What I can say is that this pod was deployed more recently so maybe the datapack creation got bugged in a more recent dev release of the plugin?

prestonhashworth commented 1 year ago

@TylerS1066 I am happy to mark this closed and can try a fresh server deploy on a different system to see if the datapack gets written or not... if not I can open a separate issue.

TylerS1066 commented 1 year ago

Not sure why the datapack got yeeted or never written. I will do some step recreation and see if I can reproduce the issue. What I can say is that this pod was deployed more recently so maybe the datapack creation got bugged in a more recent dev release of the plugin?

Glad to hear that the datapack was the issue. Unfortunately, the datapack has been a continual source of issues for a while (#434, #526, #530, #559, #447). So much so that we've dedicated a section on our FAQ page about it. Neither Paper or Spigot have a clean method to embed a datapack and deploy it from a plugin, so our best attempt is to copy it out of our jar and attempt to load it by command, but oftentimes this fails for unknown reasons.

If you are able to find a reproducible method to fail generation, then we might be able to take more of a look into it but unfortunately I've spent multiple days trying to resolve the issue to no effect.

prestonhashworth commented 1 year ago

Thanks a bunch @TylerS1066!