mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-25 18:17:46 +01:00
Compact our checks.
This commit is contained in:
parent
4c44b72f78
commit
9463e210b8
@ -650,11 +650,7 @@ public class McMMOPlayer {
|
||||
* @return Modified experience
|
||||
*/
|
||||
private int modifyXpGain(SkillType skillType, int xp) {
|
||||
if (player.getGameMode() == GameMode.CREATIVE) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ((skillType.getMaxLevel() < profile.getSkillLevel(skillType) + 1) || (Config.getInstance().getPowerLevelCap() < getPowerLevel() + 1)) {
|
||||
if (player.getGameMode() == GameMode.CREATIVE || (skillType.getMaxLevel() < profile.getSkillLevel(skillType) + 1) || (Config.getInstance().getPowerLevelCap() < getPowerLevel() + 1)) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -131,11 +131,7 @@ public class BlockListener implements Listener {
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (Misc.isNPCEntity(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.getGameMode() == GameMode.CREATIVE) {
|
||||
if (Misc.isNPCEntity(player) || player.getGameMode() == GameMode.CREATIVE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -208,11 +204,7 @@ public class BlockListener implements Listener {
|
||||
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (Misc.isNPCEntity(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.getGameMode() == GameMode.CREATIVE) {
|
||||
if (Misc.isNPCEntity(player) || player.getGameMode() == GameMode.CREATIVE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -279,11 +279,7 @@ public class PlayerListener implements Listener {
|
||||
public void onPlayerInteractLowest(PlayerInteractEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (Misc.isNPCEntity(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.getGameMode() == GameMode.CREATIVE) {
|
||||
if (Misc.isNPCEntity(player) || player.getGameMode() == GameMode.CREATIVE) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -342,11 +338,7 @@ public class PlayerListener implements Listener {
|
||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||
Player player = event.getPlayer();
|
||||
|
||||
if (Misc.isNPCEntity(player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (player.getGameMode() == GameMode.CREATIVE) {
|
||||
if (Misc.isNPCEntity(player) || player.getGameMode() == GameMode.CREATIVE) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user