SPIGOT-4496: Undeprecate MapView.getId and make int

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2018-11-23 11:50:48 +11:00
parent dcef5ef747
commit 273056bd1a
2 changed files with 11 additions and 2 deletions

View File

@@ -31,11 +31,12 @@ public final class CraftMapView implements MapView {
addRenderer(new CraftMapRenderer(this, worldMap));
}
public short getId() {
@Override
public int getId() {
String text = worldMap.getId();
if (text.startsWith("map_")) {
try {
return Short.parseShort(text.substring("map_".length()));
return Integer.parseInt(text.substring("map_".length()));
}
catch (NumberFormatException ex) {
throw new IllegalStateException("Map has non-numeric ID");