From 6e887cd942b03044000f2fb9fe38ffd21e6f36c6 Mon Sep 17 00:00:00 2001 From: LukBukkit Date: Sat, 26 Nov 2016 19:23:20 +0100 Subject: [PATCH] Added method for spawning a falling block with the BlockData --- src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 3cbf09e61c..3c2e97cd9f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -52,6 +52,7 @@ import org.bukkit.event.world.SpawnChangeEvent; import org.bukkit.generator.BlockPopulator; import org.bukkit.generator.ChunkGenerator; import org.bukkit.inventory.ItemStack; +import org.bukkit.material.MaterialData; import org.bukkit.metadata.MetadataValue; import org.bukkit.plugin.Plugin; import org.bukkit.plugin.messaging.StandardMessenger; @@ -852,6 +853,12 @@ public class CraftWorld implements World { return spawn(location, clazz, SpawnReason.CUSTOM); } + @Override + public FallingBlock spawnFallingBlock(Location location, MaterialData data) throws IllegalArgumentException { + Validate.notNull(data, "MaterialData cannot be null"); + return spawnFallingBlock(location, data.getItemType(), data.getData()); + } + public FallingBlock spawnFallingBlock(Location location, org.bukkit.Material material, byte data) throws IllegalArgumentException { Validate.notNull(location, "Location cannot be null"); Validate.notNull(material, "Material cannot be null");