mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-11-27 04:25:14 +01:00
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:
parent
2b3a4b2bd3
commit
e5953cd740
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user