Metadata does nothing, apparently.

This commit is contained in:
gmcferrin 2013-01-08 17:24:09 -05:00
parent a5219055ef
commit b78299bbbd
3 changed files with 11 additions and 10 deletions

View File

@ -13,7 +13,7 @@ import com.gmail.nossr50.config.AdvancedConfig;
import com.gmail.nossr50.util.Misc;
public class Archery {
static AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
private static AdvancedConfig advancedConfig = AdvancedConfig.getInstance();
private static Random random = new Random();
private static List<TrackedEntity> trackedEntities = new ArrayList<TrackedEntity>();
@ -30,14 +30,13 @@ public class Archery {
protected static void incrementTrackerValue(LivingEntity livingEntity) {
for (TrackedEntity trackedEntity : trackedEntities) {
if (trackedEntity.getLivingEntity() == livingEntity) {
if (trackedEntity.getLivingEntity().getEntityId() == livingEntity.getEntityId()) {
trackedEntity.incrementArrowCount();
return;
}
}
//If the entity isn't tracked yet
addToTracker(livingEntity);
addToTracker(livingEntity); //If the entity isn't tracked yet
}
protected static void addToTracker(LivingEntity livingEntity) {

View File

@ -14,13 +14,11 @@ public class ArcheryBonusDamageEventHandler {
}
protected void calculateDamageBonus() {
double damageBonus = ((manager.getSkillLevel() / Archery.BONUS_DAMAGE_INCREASE_LEVEL) * Archery.BONUS_DAMAGE_INCREASE_PERCENT);
this.damageBonusPercent = ((manager.getSkillLevel() / Archery.BONUS_DAMAGE_INCREASE_LEVEL) * Archery.BONUS_DAMAGE_INCREASE_PERCENT);
if (damageBonus > Archery.BONUS_DAMAGE_MAX_BONUS_PERCENTAGE) {
damageBonus = Archery.BONUS_DAMAGE_MAX_BONUS_PERCENTAGE;
if (damageBonusPercent > Archery.BONUS_DAMAGE_MAX_BONUS_PERCENTAGE) {
damageBonusPercent = Archery.BONUS_DAMAGE_MAX_BONUS_PERCENTAGE;
}
this.damageBonusPercent = damageBonus;
}
protected void modifyEventDamage() {

View File

@ -26,7 +26,11 @@ public class Misc {
public static final int PLAYER_RESPAWN_COOLDOWN_SECONDS = 5;
public static boolean isCitizensNPC(Player player) {
return player.hasMetadata("NPC");
if (player == null || Users.getProfile(player) == null) {
return true;
}
return false;
}
/**