[SPIGOT-4141] Filled maps not saving in 1.13 Created: 24/Jul/18  Updated: 25/Jul/18  Resolved: 25/Jul/18

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Nathan Wolf Assignee: md_5
Resolution: Fixed Votes: 0
Labels: 1.13, maps
Environment:

Linux / Mac OS


Attachments: PNG File Screen Shot 2018-07-24 at 2.40.15 PM.png    
Version: git-Spigot-a85f7ec-5870145

 Description   

Using Bukkit.createMap returns a new MapView with a fresh id, but unless a FILLED_MAP ItemStack is created and given to a player, that map id will not be saved in a vanilla world/data/map_XX.dat file. This will cause that map to fail to load on server restart.

Prior to 1.13, the map data file would always get created.

Test plugin: https://github.com/NathanWolf/Bukkit-Unit-Tests/tree/1.13-Maps

jar: https://github.com/NathanWolf/Bukkit-Unit-Tests/releases/tag/1.13-Maps

 

Use /createmap to see the problem. A new mapview and id will be created, but no .dat file appears. If attempting to load that map on reload, it will fail (the plugin does not test this)

Using /givemap instead, this will create an ItemStack and give it to the player, which will cause a .dat file to be created.

Also, friendly reminder that it'd be nice to have a MapMeta.get/setId, and that maybe MapView.getId shouldn't be deprecated (I would bet maps will always have an integer id, though I think maybe they can go outside the bounds of a short now?)

 



 Comments   
Comment by Nathan Wolf [ 25/Jul/18 ]

Tested in version git-Spigot-0b44fa0-9646d8d, seems to have fixed my issue. Thank you very much!

Comment by Nathan Wolf [ 24/Jul/18 ]

Modified test plugin for 1.12: https://github.com/NathanWolf/Bukkit-Unit-Tests/tree/1.12-Maps

 

In this case, /createmap (which doesn't create a map item) is all that is required to get a new map_X.dat file to appear. All this command does is call Bukkit.createMap().

Comment by Nathan Wolf [ 24/Jul/18 ]

I am 99% sure that this is a new issue in 1.13, my plugin creates maps in the background and they work on reload (and appear in the world data file).

I'll tweak my test plugin to work in 1.12 and make sure!

Comment by md_5 [ 24/Jul/18 ]

MapMeta was already updated.

Also is this issue new in 1.13?

Plugin maps never saved to the map dat file afaik

Generated at Tue Apr 22 03:43:28 UTC 2025 using Jira 10.3.5#10030005-sha1:190c783f2bd6c69cd5accdb70f97e48812a78d14.