pmmp / PocketMine-MP

A server software for Minecraft: Bedrock Edition in PHP
https://pmmp.io
GNU Lesser General Public License v3.0
3.27k stars 1.54k forks source link

Resource pack with metadata entry in manifest.json does not load #3933

Closed inxomnyaa closed 3 years ago

inxomnyaa commented 3 years ago

Issue description

Steps to reproduce the issue

  1. Create a dummy resource pack
  2. Add format_version, header and modules to manifest.json
  3. Load server : success
  4. Add optional metadata to manifest.json
  5. Pack does not load

Code that causes the issue

https://github.com/pmmp/PocketMine-MP/blob/master/src/resourcepacks/json/Manifest.php is missing optional metadata https://github.com/pmmp/PocketMine-MP/blob/70b0d832583c162484458e1ef4dbc70c174ea7b4/src/resourcepacks/ZippedResourcePack.php#L111-L116 Throws misleading error ("missing required fields" at any time) https://github.com/pmmp/PocketMine-MP/blob/70b0d832583c162484458e1ef4dbc70c174ea7b4/src/resourcepacks/ZippedResourcePack.php#L113 Can not map successfully and throws JsonMapper_Exception if additional fields are provided

OS and versions

Plugins

Plugins (4): DEVirion v1.2.5-ALPHA13, DevTools v1.15.0+dev, FormImagesFix v0.0.1, xendevtools2 v0.0.0

Crashdump, backtrace or other files

dktapps commented 3 years ago

Is the metadata field an officially accepted thing? There's no spec on this stuff so I'm never sure.

ZizzyZizzy commented 3 years ago

Yup

https://minecraft.gamepedia.com/Bedrock_Edition_add-on_documentation

image

dktapps commented 3 years ago

Thanks, I didn't know that documentation existed.

dktapps commented 3 years ago

Fixed by 07dc0f2dd56c07b3c52e6bec976e12ad8b071250.