Tweaked a few things

This commit is contained in:
bm01 2012-06-12 06:08:54 +02:00
parent 5cff6ed67b
commit 534a165c45
6 changed files with 24 additions and 26 deletions

View File

@ -26,7 +26,7 @@ public class PlayerProfile {
/* HUD */
private HUDType hud;
private int xpbarinc = 0;
private int xpbarinc;
private SkillType lastgained;
private SkillType skillLock;
@ -35,16 +35,16 @@ public class PlayerProfile {
private Party invite;
/* Toggles */
private boolean loaded = false;
private boolean partyhud = true, spoutcraft = false, xpbarlocked = false;
private boolean placedAnvil = false;
private boolean partyChatMode = false, adminChatMode = false;
private boolean godMode = false;
private boolean loaded;
private boolean partyhud = true, spoutcraft, xpbarlocked;
private boolean placedAnvil;
private boolean partyChatMode, adminChatMode;
private boolean godMode;
private boolean greenTerraMode, treeFellerMode, superBreakerMode, gigaDrillBreakerMode, serratedStrikesMode, skullSplitterMode, berserkMode;
private boolean greenTerraInformed = true, berserkInformed = true, skullSplitterInformed = true, gigaDrillBreakerInformed = true,
superBreakerInformed = true, blastMiningInformed = true, serratedStrikesInformed = true, treeFellerInformed = true;
private boolean hoePreparationMode = false, shovelPreparationMode = false, swordsPreparationMode = false, fistsPreparationMode = false,
pickaxePreparationMode = false, axePreparationMode = false;
private boolean hoePreparationMode, shovelPreparationMode, swordsPreparationMode, fistsPreparationMode,
pickaxePreparationMode, axePreparationMode;
private boolean abilityuse = true;
/* Timestamps */
@ -864,12 +864,16 @@ public class PlayerProfile {
* Recently Hurt
*/
public long getRecentlyHurt() {
public int getRecentlyHurt() {
return recentlyHurt;
}
public void setRecentlyHurt(long newvalue) {
recentlyHurt = (int) (newvalue / 1000);
public void setRecentlyHurt(int value) {
recentlyHurt = value;
}
public void actualizeRecentlyHurt() {
respawnATS = (int) (System.currentTimeMillis() / 1000);
}
/*
@ -914,7 +918,7 @@ public class PlayerProfile {
return respawnATS;
}
public void ActualizeRespawnATS() {
public void actualizeRespawnATS() {
respawnATS = (int) (System.currentTimeMillis() / 1000);
}

View File

@ -137,7 +137,7 @@ public class EntityListener implements Listener {
}
if (event.getDamage() >= 1) {
PP.setRecentlyHurt(System.currentTimeMillis());
PP.actualizeRecentlyHurt();
}
}
} else if (lEntity instanceof Tameable) {

View File

@ -124,7 +124,7 @@ public class PlayerListener implements Listener {
*/
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerLogin(PlayerLoginEvent event) {
Users.addUser(event.getPlayer()).ActualizeRespawnATS();
Users.addUser(event.getPlayer()).actualizeRespawnATS();
}
/**
@ -197,7 +197,7 @@ public class PlayerListener implements Listener {
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public void onPlayerRespawn(PlayerRespawnEvent event) {
Users.getProfile(event.getPlayer()).ActualizeRespawnATS();
Users.getProfile(event.getPlayer()).actualizeRespawnATS();
}
/**

View File

@ -38,7 +38,7 @@ public class AcrobaticsManager {
eventHandler.sendAbilityMessage();
eventHandler.processXPGain(eventHandler.damage * Acrobatics.ROLL_XP_MODIFIER);
}
else if (!eventHandler.isFatal(event.getDamage())){
else if (!eventHandler.isFatal(event.getDamage()) && permHandler.canGainXP()){
eventHandler.processXPGain(eventHandler.damage * Acrobatics.FALL_XP_MODIFIER);
}
}
@ -59,7 +59,7 @@ public class AcrobaticsManager {
eventHandler.modifyEventDamage();
eventHandler.sendAbilityMessage();
if (System.currentTimeMillis() >= profile.getRespawnATS() + 5) {
if (System.currentTimeMillis() >= profile.getRespawnATS() + 5 && permHandler.canGainXP()) {
eventHandler.processXPGain(eventHandler.damage * Acrobatics.DODGE_XP_MODIFIER);
}
}

View File

@ -38,8 +38,6 @@ public class DodgeEventHandler extends AcrobaticsEventHandler{
}
protected void processXPGain(int xp) {
if (manager.getPermissionsHandler().canGainXP()) {
Skills.xpProcessing(player, manager.getProfile(), SkillType.ACROBATICS, xp);
}
Skills.xpProcessing(player, manager.getProfile(), SkillType.ACROBATICS, xp);
}
}

View File

@ -8,13 +8,11 @@ import com.gmail.nossr50.util.Misc;
import com.gmail.nossr50.util.Skills;
public class RollEventHandler extends AcrobaticsEventHandler{
private AcrobaticsPermissionsHandler permHandler;
private boolean isGraceful;
private int damageThreshold;
protected RollEventHandler(AcrobaticsManager manager, EntityDamageEvent event) {
super(manager, event);
this.permHandler = manager.getPermissionsHandler();
isGracefulRoll();
calculateSkillModifier();
@ -63,16 +61,14 @@ public class RollEventHandler extends AcrobaticsEventHandler{
protected void processXPGain(int xpGain) {
if (permHandler.canGainXP()) {
Skills.xpProcessing(player, manager.getProfile(), SkillType.ACROBATICS, xpGain);
}
Skills.xpProcessing(player, manager.getProfile(), SkillType.ACROBATICS, xpGain);
}
/**
* Check if this is a graceful roll.
*/
private void isGracefulRoll() {
if (permHandler.canGracefulRoll()) {
if (manager.getPermissionsHandler().canGracefulRoll()) {
this.isGraceful = player.isSneaking();
}
else {