Fixed the top block of bamboo growth not being logged (#129)
This commit is contained in:
parent
55fec1d092
commit
64188f5a75
1 changed files with 4 additions and 3 deletions
|
|
@ -9,6 +9,7 @@ import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
import org.bukkit.event.block.BlockSpreadEvent;
|
import org.bukkit.event.block.BlockSpreadEvent;
|
||||||
|
|
||||||
|
import net.coreprotect.bukkit.BukkitAdapter;
|
||||||
import net.coreprotect.config.Config;
|
import net.coreprotect.config.Config;
|
||||||
import net.coreprotect.consumer.Queue;
|
import net.coreprotect.consumer.Queue;
|
||||||
import net.coreprotect.model.BlockGroup;
|
import net.coreprotect.model.BlockGroup;
|
||||||
|
|
@ -59,7 +60,7 @@ public final class BlockSpreadListener extends Queue implements Listener {
|
||||||
Location below = sourceBlock.getLocation().clone();
|
Location below = sourceBlock.getLocation().clone();
|
||||||
below.setY(below.getY() - 2);
|
below.setY(below.getY() - 2);
|
||||||
for (int i = 0; i < 2; i++) {
|
for (int i = 0; i < 2; i++) {
|
||||||
if (below.getY() >= 0) {
|
if (below.getY() >= BukkitAdapter.ADAPTER.getMinHeight(block.getWorld())) {
|
||||||
Block belowBlock = below.getBlock();
|
Block belowBlock = below.getBlock();
|
||||||
if (belowBlock.getType().equals(Material.BAMBOO)) {
|
if (belowBlock.getType().equals(Material.BAMBOO)) {
|
||||||
Queue.queueBlockPlaceDelayed("#bamboo", belowBlock.getLocation(), belowBlock.getType(), null, belowBlock.getState(), 0);
|
Queue.queueBlockPlaceDelayed("#bamboo", belowBlock.getLocation(), belowBlock.getType(), null, belowBlock.getState(), 0);
|
||||||
|
|
@ -69,8 +70,8 @@ public final class BlockSpreadListener extends Queue implements Listener {
|
||||||
}
|
}
|
||||||
below = null;
|
below = null;
|
||||||
|
|
||||||
Queue.queueBlockPlaceDelayed("#bamboo", sourceBlock.getLocation(), sourceBlock.getType(), null, sourceBlock.getState(), 0);
|
Queue.queueBlockPlaceDelayed("#bamboo", sourceBlock.getLocation(), type, null, sourceBlock.getState(), 0);
|
||||||
Queue.queueBlockPlaceDelayed("#bamboo", block.getLocation(), block.getType(), null, block.getState(), 0);
|
Queue.queueBlockPlaceDelayed("#bamboo", block.getLocation(), type, null, block.getState(), 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue