Get all logs in Tree Feller, and optimize performance

Tree Feller has been shown, both anecdotally and with timings, to put a strain on the server, and therefore is worthy of the effort of optimization.
Prior to this change, on jungle trees, Tree Feller would take around 20-40 milliseconds to process a Jungle Tree after the JIT kicked in, and around 15-25 milliseconds for a normal tree.

Additionally, logs would be left up in the air for jungle trees.

After this change, Tree Feller takes 2-5 milliseconds on normal trees, and 10-15 milliseconds on jungle trees, and no logs are left up in the air.
This commit is contained in:
riking
2013-10-14 12:32:12 -07:00
committed by TfT_02
parent b9c652ef2b
commit b4f4de4628
4 changed files with 87 additions and 87 deletions

View File

@ -199,16 +199,6 @@ public final class BlockUtils {
}
}
/**
* Determine if a given block should be affected by Tree Feller
*
* @param blockState The {@link BlockState} of the block to check
* @return true if the block should affected by Tree Feller, false otherwise
*/
public static boolean affectedByTreeFeller(BlockState blockState) {
return isLog(blockState) || isLeaves(blockState);
}
/**
* Check if a given block is a log
*