Never place decaying leaves

This commit is contained in:
Daniel Mills 2020-01-26 18:05:15 -05:00
parent 5d410764e1
commit 1c7a7f6edf

View File

@ -16,6 +16,7 @@ import org.bukkit.Material;
import org.bukkit.block.BlockFace;
import org.bukkit.material.Directional;
import org.bukkit.material.Ladder;
import org.bukkit.material.Leaves;
import org.bukkit.material.MaterialData;
import org.bukkit.material.Stairs;
import org.bukkit.material.Vine;
@ -337,6 +338,7 @@ public class GenObject
return place(l.getBlockX(), l.getBlockY(), l.getBlockZ(), placer);
}
@SuppressWarnings("deprecation")
public Location place(int wx, int wy, int wz, IPlacer placer)
{
Location start = new Location(placer.getWorld(), wx, wy, wz).clone().add(0, sh(h) + 1, 0);
@ -361,6 +363,15 @@ public class GenObject
for(SBlockVector i : s.keySet())
{
MB b = getSchematic().get(i);
if(b.material.equals(Material.LEAVES) || b.material.equals(Material.LEAVES_2))
{
Leaves l = new Leaves(b.material, b.data);
l.setDecayable(false);
l.setDecaying(false);
b = new MB(l.getItemType(), l.getData());
}
Location f = start.clone().add(i.toBlockVector());
if(gravity)