13
0
geforkt von Mirrors/Paper

Add visual blockdata api for primed tnt (#10146)

Dieser Commit ist enthalten in:
Lulu13022002 2024-01-20 00:01:12 +01:00
Ursprung 66431e1300
Commit 8b532bad3a
2 geänderte Dateien mit 53 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -1115,6 +1115,37 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
*/
-public interface Salmon extends Fish { }
+public interface Salmon extends io.papermc.paper.entity.SchoolableFish { } // Paper - Schooling Fish API
diff --git a/src/main/java/org/bukkit/entity/TNTPrimed.java b/src/main/java/org/bukkit/entity/TNTPrimed.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/TNTPrimed.java
+++ b/src/main/java/org/bukkit/entity/TNTPrimed.java
@@ -0,0 +0,0 @@ public interface TNTPrimed extends Explosive {
default org.bukkit.Location getSourceLoc() {
return this.getOrigin();
}
+
+ // Paper start
+ /**
+ * Sets the visual block data of this
+ * primed tnt.
+ * <br>
+ * The explosion of the tnt stays the
+ * same and is not affected by this change.
+ *
+ * @param data the visual block data
+ */
+ void setBlockData(@org.jetbrains.annotations.NotNull org.bukkit.block.data.BlockData data);
+
+ /**
+ * Gets the visual block data of this
+ * primed tnt.
+ *
+ * @return the visual block data
+ */
+ @org.jetbrains.annotations.NotNull
+ org.bukkit.block.data.BlockData getBlockData();
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/entity/Tadpole.java b/src/main/java/org/bukkit/entity/Tadpole.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/entity/Tadpole.java

Datei anzeigen

@ -1118,6 +1118,28 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
public CraftSalmon(CraftServer server, net.minecraft.world.entity.animal.Salmon entity) {
super(server, entity);
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTNTPrimed.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTNTPrimed.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTNTPrimed.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftTNTPrimed.java
@@ -0,0 +0,0 @@ public class CraftTNTPrimed extends CraftEntity implements TNTPrimed {
this.getHandle().owner = null;
}
}
+
+ // Paper start
+ @Override
+ public void setBlockData(org.bukkit.block.data.BlockData data) {
+ com.google.common.base.Preconditions.checkArgument(data != null, "The visual block data of this tnt cannot be null. To reset it just set to the TNT default block data");
+ this.getHandle().setBlockState(((org.bukkit.craftbukkit.block.data.CraftBlockData) data).getState());
+ }
+
+ @Override
+ public org.bukkit.block.data.BlockData getBlockData() {
+ return org.bukkit.craftbukkit.block.data.CraftBlockData.fromData(this.getHandle().getBlockState());
+ }
+ // Paper end
}
diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftTadpole.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftTadpole.java
index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftTadpole.java