Skip to content

Commit c021f5b

Browse files
committed
Merge branch 'develop'
2 parents ccca7cc + e32afaa commit c021f5b

File tree

1 file changed

+1
-34
lines changed

1 file changed

+1
-34
lines changed

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

+1-34
Original file line numberDiff line numberDiff line change
@@ -149,39 +149,6 @@ protected void growTree(Block b) {
149149
}
150150
}
151151
}
152-
153-
protected boolean bigTreeSaplings(Block b) {
154-
Material treeType = b.getType();
155-
TreeType type = SAPLING_TO_BIG_TREE_TYPE.get(treeType);
156-
for (List<BlockFace> q : QUADS) {
157-
if (q.stream().map(b::getRelative).allMatch(c -> c.getType().equals(treeType))) {
158-
// All the same sapling type found in this quad
159-
q.stream().map(b::getRelative).forEach(c -> c.setType(Material.AIR));
160-
// Get the tree planting location
161-
Location l = b.getRelative(q.get(0)).getLocation();
162-
if (b.getWorld().generateTree(l, RAND, type,
163-
bs -> Flags.TREES_GROWING_OUTSIDE_RANGE.isSetForWorld(bs.getWorld())
164-
|| addon.getIslands().getProtectedIslandAt(bs.getLocation()).isPresent())) {
165-
if (addon.getSettings().isEffectsEnabled()) {
166-
showSparkles(b);
167-
}
168-
if (addon.getSettings().isSoundsEnabled()) {
169-
b.getWorld().playSound(b.getLocation(), addon.getSettings().getSoundsGrowingBigTreeSound(),
170-
(float)addon.getSettings().getSoundsGrowingBigTreeVolume(), (float)addon.getSettings().getSoundsGrowingBigTreePitch());
171-
}
172-
return true;
173-
} else {
174-
// Generation failed, reset saplings
175-
q.stream().map(b::getRelative).forEach(c -> c.setType(treeType));
176-
}
177-
}
178-
}
179-
return false;
180-
}
181-
182-
protected void showSparkles(Block b) {
183-
AROUND.stream().map(b::getRelative).map(Block::getLocation).forEach(x -> x.getWorld().playEffect(x, addon.getSettings().getEffectsTwerk(), 0));
184-
}
185152

186153
protected boolean bigTreeSaplings(Block b) {
187154
Material treeType = b.getType();
@@ -323,4 +290,4 @@ private void getNearbySaplings(Player player, Island i) {
323290
}
324291

325292
}
326-
}
293+
}

0 commit comments

Comments
 (0)