3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-11-14 20:10:05 +01:00
Paper/patches/api/0225-Add-API-to-get-Material-from-Boats-and-Minecarts.patch

53 Zeilen
1.7 KiB
Diff

2021-06-11 14:02:28 +02:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Madeline Miller <mnmiller1@me.com>
2021-06-11 14:02:28 +02:00
Date: Thu, 31 Dec 2020 12:48:38 +1000
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
2024-10-22 18:23:19 +02:00
index dbdd2c1ad74a4d56e282736cd06d6937701f2e5c..a0fb3c44405f6362f8a1613661d507e448f7ba6b 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/org/bukkit/entity/Boat.java
+++ b/src/main/java/org/bukkit/entity/Boat.java
2024-10-22 18:23:19 +02:00
@@ -181,4 +181,14 @@ public interface Boat extends Vehicle {
ON_LAND,
IN_AIR;
}
2021-06-11 14:02:28 +02:00
+
+ // Paper start
+ /**
+ * Gets the {@link Material} that represents this Boat type.
+ *
+ * @return the boat material.
+ */
+ @NotNull
+ public Material getBoatMaterial();
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/entity/Minecart.java b/src/main/java/org/bukkit/entity/Minecart.java
index d9ad5fd48eec569eb4aef2aaf527ba24d2db3254..c3c94a5694f1e8d79e5acc45af1cd2e0fa6a621f 100644
2021-06-11 14:02:28 +02:00
--- a/src/main/java/org/bukkit/entity/Minecart.java
+++ b/src/main/java/org/bukkit/entity/Minecart.java
2024-10-22 18:23:19 +02:00
@@ -1,6 +1,7 @@
2021-06-11 14:02:28 +02:00
package org.bukkit.entity;
2024-10-22 18:23:19 +02:00
import org.bukkit.GameRule;
2021-06-11 14:02:28 +02:00
+import org.bukkit.Material;
import org.bukkit.block.data.BlockData;
import org.bukkit.material.MaterialData;
import org.bukkit.util.Vector;
@@ -148,4 +149,14 @@ public interface Minecart extends Vehicle {
2021-06-11 14:02:28 +02:00
* @return the current block offset for this minecart.
*/
public int getDisplayBlockOffset();
+
+ // Paper start
+ /**
+ * Gets the {@link Material} that represents this Minecart type.
+ *
+ * @return the minecart material.
+ */
+ @NotNull
+ public Material getMinecartMaterial();
+ // Paper end
}