Set metadata on all leaves to prevent them from decaying

This commit is contained in:
Spencer 2017-12-30 21:47:05 -05:00 committed by Alexander Meech
parent ffc019eb8c
commit 91d4f1526e
1 changed files with 9 additions and 0 deletions

View File

@ -157,6 +157,15 @@ public class Parse
block.getRelative(BlockFace.DOWN).setTypeId(0); 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 //Spawns + Borders
if (block.getTypeId() == 147) if (block.getTypeId() == 147)