mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-06-28 03:34:43 +02:00
== is faster than .equals() for enums.
This commit is contained in:
@ -312,7 +312,7 @@ public final class BlockChecks {
|
||||
}
|
||||
|
||||
public static boolean isLog(Block block) {
|
||||
if (block.getType().equals(Material.LOG) || (configInstance.getBlockModsEnabled() && ModChecks.isCustomLogBlock(block))) {
|
||||
if (block.getType() == Material.LOG || (configInstance.getBlockModsEnabled() && ModChecks.isCustomLogBlock(block))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -320,7 +320,7 @@ public final class BlockChecks {
|
||||
}
|
||||
|
||||
public static boolean isLeaves(Block block) {
|
||||
if (block.getType().equals(Material.LEAVES) || (configInstance.getBlockModsEnabled() && ModChecks.isCustomLeafBlock(block))) {
|
||||
if (block.getType() == Material.LEAVES || (configInstance.getBlockModsEnabled() && ModChecks.isCustomLeafBlock(block))) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -35,14 +35,14 @@ public final class ChimaeraWing {
|
||||
player.setItemInHand(new ItemStack(Config.getInstance().getChimaeraItemId(), amount - Config.getInstance().getChimaeraCost()));
|
||||
|
||||
for (int y = 1; block.getY() + y < player.getWorld().getMaxHeight(); y++) {
|
||||
if (!block.getRelative(0, y, 0).getType().equals(Material.AIR)) {
|
||||
if (!(block.getRelative(0, y, 0).getType() == Material.AIR)) {
|
||||
player.sendMessage(LocaleLoader.getString("Item.ChimaeraWing.Fail"));
|
||||
player.teleport(block.getRelative(0, y - 1, 0).getLocation());
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (player.getBedSpawnLocation() != null && player.getBedSpawnLocation().getBlock().getType().equals(Material.BED_BLOCK)) {
|
||||
if (player.getBedSpawnLocation() != null && player.getBedSpawnLocation().getBlock().getType() == Material.BED_BLOCK) {
|
||||
player.teleport(player.getBedSpawnLocation());
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user