Habitat levels properly work again.

This commit is contained in:
sigonasr2 2017-09-28 21:03:46 -05:00
parent 65f025a640
commit ae2148bed7
4 changed files with 8 additions and 3 deletions

Binary file not shown.

View File

@ -685,6 +685,10 @@ public class CustomDamage {
TwosideKeeper.log("Sending out "+(damage+TwosideKeeper.CUSTOM_DAMAGE_IDENTIFIER)+" damage.",5);
target.damage(damage+TwosideKeeper.CUSTOM_DAMAGE_IDENTIFIER,getDamagerEntity(damager));
PlayerStructure pd = PlayerStructure.GetPlayerStructure((Player)getDamagerEntity(damager));
if (!(target instanceof Player)) {
LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(target);
les.SetTarget(getDamagerEntity(damager));
}
EntityUtils.applyDamageIndicator(target, damage, (isFlagSet(pd.lasthitproperties,IS_CRIT))?IndicatorType.CRIT:IndicatorType.REGULAR);
} else
if (!(getDamagerEntity(damager) instanceof LivingEntity) || (damage!=0 && isFlagSet(flags,SPECIALATTACK))) {

View File

@ -95,6 +95,7 @@ public class Habitation {
public void addKillToLocation(Location location) {
String locationHash = getLocationHash(location);
TwosideKeeper.log("Location hash is "+locationHash, 0);
locationhashes.put(locationHash, locationhashes.getOrDefault(locationHash, 0) + 1);
}
@ -132,7 +133,7 @@ public class Habitation {
public String getLocationHash(Location location) {
if (location != null) {
return location.getChunk().getX() + ' ' + String.valueOf((int)location.getY() / 16) + ' ' + location.getChunk().getZ() + ' ' + location.getWorld().toString();
return location.getChunk().getX() + ' ' + String.valueOf((int)location.getY() / 16) + ' ' + location.getChunk().getZ() + ' ' + location.getWorld().getName();
} else {
TwosideKeeper.log(
"[ERROR][Habitat]Could not get Location Hash!!! Probably undefined Player->Enemy hit interaction!",

View File

@ -8824,7 +8824,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
}
}
if (ms!=null && (ms.GetTarget() instanceof Player)) {
if (ms!=null) {
if ((m instanceof Slime) ||
(m instanceof MagmaCube)) {
if (m instanceof Slime) {
@ -8845,8 +8845,8 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
//log("Killed by a player.",0);
killedByPlayer = true;
Player p = (Player)ms.GetTarget();
AwardDeathAchievements(p,ev.getEntity());
if (p!=null) {
AwardDeathAchievements(p,ev.getEntity());
if (GenericFunctions.isArtifactEquip(p.getEquipment().getItemInMainHand()) &&
GenericFunctions.isArtifactWeapon(p.getEquipment().getItemInMainHand()) &&
p.getEquipment().getItemInMainHand().getType()==Material.BOW) {