mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-02-12 04:20:41 +00:00
Minor perf tweak.
This commit is contained in:
parent
d927d04765
commit
a97b3abca3
1 changed files with 4 additions and 2 deletions
|
@ -32,6 +32,8 @@ public class EssentialsPlayerListener implements Listener
|
||||||
{
|
{
|
||||||
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
private static final Logger LOGGER = Logger.getLogger("Minecraft");
|
||||||
private final transient IEssentials ess;
|
private final transient IEssentials ess;
|
||||||
|
private static final int AIR = Material.AIR.getId();
|
||||||
|
private static final int BED = Material.BED_BLOCK.getId();
|
||||||
|
|
||||||
public EssentialsPlayerListener(final IEssentials parent)
|
public EssentialsPlayerListener(final IEssentials parent)
|
||||||
{
|
{
|
||||||
|
@ -342,14 +344,14 @@ public class EssentialsPlayerListener implements Listener
|
||||||
switch (event.getAction())
|
switch (event.getAction())
|
||||||
{
|
{
|
||||||
case RIGHT_CLICK_BLOCK:
|
case RIGHT_CLICK_BLOCK:
|
||||||
if (!event.isCancelled() && event.getClickedBlock().getTypeId() == Material.BED_BLOCK.getId() && ess.getSettings().getUpdateBedAtDaytime())
|
if (!event.isCancelled() && event.getClickedBlock().getTypeId() == BED && ess.getSettings().getUpdateBedAtDaytime())
|
||||||
{
|
{
|
||||||
event.getPlayer().setBedSpawnLocation(event.getClickedBlock().getLocation());
|
event.getPlayer().setBedSpawnLocation(event.getClickedBlock().getLocation());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case LEFT_CLICK_AIR:
|
case LEFT_CLICK_AIR:
|
||||||
case LEFT_CLICK_BLOCK:
|
case LEFT_CLICK_BLOCK:
|
||||||
if (event.getItem() != null && event.getItem().getTypeId() != Material.AIR.getId())
|
if (event.getItem() != null && event.getItem().getTypeId() != AIR)
|
||||||
{
|
{
|
||||||
final User user = ess.getUser(event.getPlayer());
|
final User user = ess.getUser(event.getPlayer());
|
||||||
if (user.hasPowerTools() && user.arePowerToolsEnabled() && usePowertools(user, event.getItem().getTypeId()))
|
if (user.hasPowerTools() && user.arePowerToolsEnabled() && usePowertools(user, event.getItem().getTypeId()))
|
||||||
|
|
Loading…
Reference in a new issue