Speed up the isSign method

Theoretically, block.getState() returns a thread-safe instance of a
block, so getting it when not needed might have hurt performance of
ChestShop
This commit is contained in:
Andrzej Pomirski 2015-07-05 21:48:17 +02:00
parent 2b3a4b2bd3
commit e5953cd740

View File

@ -1,5 +1,6 @@
package com.Acrobot.Breeze.Utils;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.block.Chest;
import org.bukkit.block.DoubleChest;
@ -20,7 +21,8 @@ public class BlockUtil {
* @return Is this block a sign?
*/
public static boolean isSign(Block block) {
return block.getState() instanceof Sign;
return block.getType() == Material.SIGN_POST
|| block.getType() == Material.WALL_SIGN;
}
/**