mirror of
https://github.com/Multiverse/Multiverse-Core.git
synced 2024-11-05 18:29:34 +01:00
Cow using EnumSet for maximum performance!!!!
This commit is contained in:
parent
74947a7efd
commit
4ce503f55e
@ -18,7 +18,7 @@ import org.bukkit.entity.Minecart;
|
||||
import org.bukkit.entity.Vehicle;
|
||||
import org.bukkit.material.Bed;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.Set;
|
||||
|
||||
@ -27,11 +27,18 @@ import java.util.Set;
|
||||
*/
|
||||
public class SimpleBlockSafety implements BlockSafety {
|
||||
private final Core plugin;
|
||||
private static final Set<BlockFace> AROUND_BLOCK = new HashSet<BlockFace>() { {
|
||||
add(BlockFace.NORTH); add(BlockFace.NORTH_EAST); add(BlockFace.EAST); add(BlockFace.SOUTH_EAST);
|
||||
add(BlockFace.SOUTH); add(BlockFace.SOUTH_WEST); add(BlockFace.WEST); add(BlockFace.NORTH_WEST);
|
||||
}
|
||||
};
|
||||
private static final Set<BlockFace> AROUND_BLOCK = EnumSet.noneOf(BlockFace.class);
|
||||
|
||||
static {
|
||||
AROUND_BLOCK.add(BlockFace.NORTH);
|
||||
AROUND_BLOCK.add(BlockFace.NORTH_EAST);
|
||||
AROUND_BLOCK.add(BlockFace.EAST);
|
||||
AROUND_BLOCK.add(BlockFace.SOUTH_EAST);
|
||||
AROUND_BLOCK.add(BlockFace.SOUTH);
|
||||
AROUND_BLOCK.add(BlockFace.SOUTH_WEST);
|
||||
AROUND_BLOCK.add(BlockFace.WEST);
|
||||
AROUND_BLOCK.add(BlockFace.NORTH_WEST);
|
||||
}
|
||||
|
||||
public SimpleBlockSafety(Core plugin) {
|
||||
this.plugin = plugin;
|
||||
|
Loading…
Reference in New Issue
Block a user