From 91d4f1526e992513f488501204209d1707c42caf Mon Sep 17 00:00:00 2001 From: Spencer Date: Sat, 30 Dec 2017 21:47:05 -0500 Subject: [PATCH] Set metadata on all leaves to prevent them from decaying --- .../Mineplex.MapParser/src/mineplex/mapparser/Parse.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/Parse.java b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/Parse.java index 27184accb..0126ff20e 100644 --- a/Plugins/Mineplex.MapParser/src/mineplex/mapparser/Parse.java +++ b/Plugins/Mineplex.MapParser/src/mineplex/mapparser/Parse.java @@ -157,6 +157,15 @@ public class Parse block.getRelative(BlockFace.DOWN).setTypeId(0); } } + else if (block.getType() == Material.LEAVES || block.getType() == Material.LEAVES_2) + { + if (block.getData() <= 3) + { + // https://minecraft.gamepedia.com/Java_Edition_data_values#Leaves + // For leaves, you add 4 to get the no decay version + block.setData((byte) ((int)block.getData() + 4)); + } + } //Spawns + Borders if (block.getTypeId() == 147)