Skip to content

Commit a7e548c

Browse files
authored
33 prevent extra dirt (#34)
* Version 1.5.1 * Prevents extra dirt being created when tree is grown. Fixes #33
1 parent e32afaa commit a7e548c

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<!-- Revision variable removes warning about dynamic version -->
5555
<revision>${build.version}-SNAPSHOT</revision>
5656
<!-- This allows to change between versions and snapshots. -->
57-
<build.version>1.5.0</build.version>
57+
<build.version>1.5.1</build.version>
5858
<build.number>-LOCAL</build.number>
5959
<sonar.organization>bentobox-world</sonar.organization>
6060
<sonar.host.url>https://sonarcloud.io</sonar.host.url>

src/main/java/world/bentobox/twerk/listeners/TreeGrowListener.java

+4-2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import org.bukkit.event.world.StructureGrowEvent;
3232
import org.eclipse.jdt.annotation.NonNull;
3333

34+
import world.bentobox.bentobox.BentoBox;
3435
import world.bentobox.bentobox.database.objects.Island;
3536
import world.bentobox.bentobox.lists.Flags;
3637
import world.bentobox.bentobox.util.Util;
@@ -134,8 +135,9 @@ protected void growTree(Block b) {
134135
b.setType(Material.AIR);
135136

136137
if (b.getWorld().generateTree(b.getLocation(), RAND, type,
137-
bs -> Flags.TREES_GROWING_OUTSIDE_RANGE.isSetForWorld(bs.getWorld())
138-
|| addon.getIslands().getProtectedIslandAt(bs.getLocation()).isPresent())) {
138+
bs -> bs.getType() != Material.DIRT
139+
&& (Flags.TREES_GROWING_OUTSIDE_RANGE.isSetForWorld(bs.getWorld())
140+
|| addon.getIslands().getProtectedIslandAt(bs.getLocation()).isPresent()))) {
139141
if (addon.getSettings().isEffectsEnabled()) {
140142
showSparkles(b);
141143
}

0 commit comments

Comments
 (0)