geforkt von Mirrors/Paper
Add visual blockdata api for primed tnt (#10146)
Dieser Commit ist enthalten in:
Ursprung
66431e1300
Commit
8b532bad3a
@ -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
|
||||
|
@ -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
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren