mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-30 16:19:03 +01:00
Undeprecate Server#getMap (#9185)
The only way to get a map is via its id, which is not a magic value. This implementation isn't going to be changing anytime soon, so it should be undeprecated.
This commit is contained in:
parent
b7479c89c3
commit
4e67df5164
1 changed files with 56 additions and 0 deletions
|
@ -12,6 +12,17 @@ diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Buk
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/org/bukkit/Bukkit.java
|
--- a/src/main/java/org/bukkit/Bukkit.java
|
||||||
+++ b/src/main/java/org/bukkit/Bukkit.java
|
+++ b/src/main/java/org/bukkit/Bukkit.java
|
||||||
|
@@ -0,0 +0,0 @@ public final class Bukkit {
|
||||||
|
*
|
||||||
|
* @param id the id of the map to get
|
||||||
|
* @return a map view if it exists, or null otherwise
|
||||||
|
- * @deprecated Magic value
|
||||||
|
*/
|
||||||
|
- @Deprecated
|
||||||
|
+ //@Deprecated // Paper - Not a magic value
|
||||||
|
@Nullable
|
||||||
|
public static MapView getMap(int id) {
|
||||||
|
return server.getMap(id);
|
||||||
@@ -0,0 +0,0 @@ public final class Bukkit {
|
@@ -0,0 +0,0 @@ public final class Bukkit {
|
||||||
* @param name the name the player to retrieve
|
* @param name the name the player to retrieve
|
||||||
* @return an offline player
|
* @return an offline player
|
||||||
|
@ -178,6 +189,17 @@ diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Ser
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
--- a/src/main/java/org/bukkit/Server.java
|
--- a/src/main/java/org/bukkit/Server.java
|
||||||
+++ b/src/main/java/org/bukkit/Server.java
|
+++ b/src/main/java/org/bukkit/Server.java
|
||||||
|
@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||||
|
*
|
||||||
|
* @param id the id of the map to get
|
||||||
|
* @return a map view if it exists, or null otherwise
|
||||||
|
- * @deprecated Magic value
|
||||||
|
*/
|
||||||
|
- @Deprecated
|
||||||
|
+ //@Deprecated // Paper - Not a magic value
|
||||||
|
@Nullable
|
||||||
|
public MapView getMap(int id);
|
||||||
|
|
||||||
@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
@@ -0,0 +0,0 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||||
* @param name the name the player to retrieve
|
* @param name the name the player to retrieve
|
||||||
* @return an offline player
|
* @return an offline player
|
||||||
|
@ -870,6 +892,40 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||||
+ @Deprecated // Paper - Deprecate old localized API
|
+ @Deprecated // Paper - Deprecate old localized API
|
||||||
void setLocalizedName(@Nullable String name);
|
void setLocalizedName(@Nullable String name);
|
||||||
|
|
||||||
|
/**
|
||||||
|
diff --git a/src/main/java/org/bukkit/inventory/meta/MapMeta.java b/src/main/java/org/bukkit/inventory/meta/MapMeta.java
|
||||||
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
--- a/src/main/java/org/bukkit/inventory/meta/MapMeta.java
|
||||||
|
+++ b/src/main/java/org/bukkit/inventory/meta/MapMeta.java
|
||||||
|
@@ -0,0 +0,0 @@ public interface MapMeta extends ItemMeta {
|
||||||
|
*
|
||||||
|
* @return true if this has a map ID number.
|
||||||
|
* @see #hasMapView()
|
||||||
|
- * @deprecated These methods are poor API: They rely on the caller to pass
|
||||||
|
- * in an only an integer property, and have poorly defined implementation
|
||||||
|
- * behavior if that integer is not a valid map (the current implementation
|
||||||
|
- * for example will generate a new map with a different ID). The xxxMapView
|
||||||
|
- * family of methods should be used instead.
|
||||||
|
*/
|
||||||
|
- @Deprecated
|
||||||
|
+ //@Deprecated // Paper
|
||||||
|
boolean hasMapId();
|
||||||
|
|
||||||
|
/**
|
||||||
|
@@ -0,0 +0,0 @@ public interface MapMeta extends ItemMeta {
|
||||||
|
*
|
||||||
|
* @return the map ID that is set
|
||||||
|
* @see #getMapView()
|
||||||
|
- * @deprecated These methods are poor API: They rely on the caller to pass
|
||||||
|
- * in an only an integer property, and have poorly defined implementation
|
||||||
|
- * behavior if that integer is not a valid map (the current implementation
|
||||||
|
- * for example will generate a new map with a different ID). The xxxMapView
|
||||||
|
- * family of methods should be used instead.
|
||||||
|
*/
|
||||||
|
- @Deprecated
|
||||||
|
+ //@Deprecated // Paper
|
||||||
|
int getMapId();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
diff --git a/src/main/java/org/bukkit/material/Step.java b/src/main/java/org/bukkit/material/Step.java
|
diff --git a/src/main/java/org/bukkit/material/Step.java b/src/main/java/org/bukkit/material/Step.java
|
||||||
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
|
||||||
|
|
Loading…
Reference in a new issue