3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-14 18:40:10 +01:00

Undeprecate and fix Boat#getBoatMaterial (#8217)

Dieser Commit ist enthalten in:
Maddy Miller 2022-08-01 23:02:23 +10:00 committet von GitHub
Ursprung fd557b7d51
Commit babffb5a46
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
2 geänderte Dateien mit 4 neuen und 6 gelöschten Zeilen

Datei anzeigen

@ -5,10 +5,10 @@ Subject: [PATCH] Add API to get Material from Boats and Minecarts
diff --git a/src/main/java/org/bukkit/entity/Boat.java b/src/main/java/org/bukkit/entity/Boat.java diff --git a/src/main/java/org/bukkit/entity/Boat.java b/src/main/java/org/bukkit/entity/Boat.java
index e5d5d2c944df1e9a81b38d3854fbe70c166588d1..3f848572935a73f637c6a91a97fa70041b0c6361 100644 index e5d5d2c944df1e9a81b38d3854fbe70c166588d1..3e458b96d5c15a78d3d411d5b88a716213588a94 100644
--- a/src/main/java/org/bukkit/entity/Boat.java --- a/src/main/java/org/bukkit/entity/Boat.java
+++ b/src/main/java/org/bukkit/entity/Boat.java +++ b/src/main/java/org/bukkit/entity/Boat.java
@@ -173,4 +173,16 @@ public interface Boat extends Vehicle { @@ -173,4 +173,14 @@ public interface Boat extends Vehicle {
ON_LAND, ON_LAND,
IN_AIR; IN_AIR;
} }
@ -18,9 +18,7 @@ index e5d5d2c944df1e9a81b38d3854fbe70c166588d1..3f848572935a73f637c6a91a97fa7004
+ * Gets the {@link Material} that represents this Boat type. + * Gets the {@link Material} that represents this Boat type.
+ * + *
+ * @return the boat material. + * @return the boat material.
+ * @deprecated use {@link #getBoatType()} and {@link Type#getMaterial()}
+ */ + */
+ @Deprecated
+ @NotNull + @NotNull
+ public Material getBoatMaterial(); + public Material getBoatMaterial();
+ // Paper end + // Paper end

Datei anzeigen

@ -5,7 +5,7 @@ Subject: [PATCH] Implement API to get Material from Boats and Minecarts
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java
index 5871cd149fe07e97c5d68ffd83dae4d3fc6bcf03..40debf1130a8e6cc9510061976a01050cd8ddc05 100644 index 5871cd149fe07e97c5d68ffd83dae4d3fc6bcf03..f2896aa6fa5a5282b4be106320c0dad9dd6036c5 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftBoat.java
@@ -80,6 +80,13 @@ public class CraftBoat extends CraftVehicle implements Boat { @@ -80,6 +80,13 @@ public class CraftBoat extends CraftVehicle implements Boat {
@ -15,7 +15,7 @@ index 5871cd149fe07e97c5d68ffd83dae4d3fc6bcf03..40debf1130a8e6cc9510061976a01050
+ // Paper start + // Paper start
+ @Override + @Override
+ public org.bukkit.Material getBoatMaterial() { + public org.bukkit.Material getBoatMaterial() {
+ return this.getBoatType().getMaterial(); + return org.bukkit.craftbukkit.util.CraftMagicNumbers.getMaterial(this.getHandle().getDropItem());
+ } + }
+ // Paper end + // Paper end
+ +