Skip to content

Commit

Permalink
Jungle trees are now 1x1.
Browse files Browse the repository at this point in the history
Note that Bukkit API Javadoc for tree type COCOA_TREE is incorrect. It's
a 4x4 tree, not a 1x1 tree.
  • Loading branch information
tastybento committed Dec 11, 2019
1 parent ad4eb34 commit b6bbfdf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
<!-- Revision variable removes warning about dynamic version -->
<revision>${build.version}-SNAPSHOT</revision>
<!-- This allows to change between versions and snapshots. -->
<build.version>1.0.3</build.version>
<build.version>1.0.4</build.version>
<build.number>-LOCAL</build.number>
</properties>

Expand Down
4 changes: 3 additions & 1 deletion src/main/java/world/bentobox/twerk/events/TreeGrowEvent.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class TreeGrowEvent implements Listener {
Map<Material, TreeType> conv = new EnumMap<>(Material.class);
conv.put(Material.ACACIA_SAPLING, TreeType.ACACIA);
conv.put(Material.BIRCH_SAPLING, TreeType.BIRCH);
conv.put(Material.JUNGLE_SAPLING, TreeType.COCOA_TREE);
conv.put(Material.JUNGLE_SAPLING, TreeType.SMALL_JUNGLE);
conv.put(Material.OAK_SAPLING, TreeType.TREE);
conv.put(Material.SPRUCE_SAPLING, TreeType.REDWOOD);
SAPLING_TO_TREE_TYPE = Collections.unmodifiableMap(conv);
Expand Down Expand Up @@ -111,6 +111,7 @@ private void growTree(Block b) {
b.setType(Material.AIR);
b.getWorld().generateTree(b.getLocation(), type);
showSparkles(b);
addon.getPlugin().logDebug("Growing 1x1 tree " + type);
b.getWorld().playSound(b.getLocation(), Sound.BLOCK_BUBBLE_COLUMN_UPWARDS_AMBIENT, 1F, 1F);
}
}
Expand All @@ -121,6 +122,7 @@ private boolean bigTreeSaplings(Block b) {
if (q.stream().map(b::getRelative).allMatch(c -> c.getType().equals(b.getType()))) {
// All the same sapling type found in this quad
q.stream().map(b::getRelative).forEach(c -> c.setType(Material.AIR));
addon.getPlugin().logDebug("Growing big tree");
// Get the tree planting location
Location l = b.getRelative(q.get(0)).getLocation();
b.getWorld().generateTree(l, type);
Expand Down

0 comments on commit b6bbfdf

Please sign in to comment.