diff --git a/TwosideKeeper.jar b/TwosideKeeper.jar index f2085a0..c3489f4 100644 Binary files a/TwosideKeeper.jar and b/TwosideKeeper.jar differ diff --git a/src/sig/plugin/TwosideKeeper/CustomDamage.java b/src/sig/plugin/TwosideKeeper/CustomDamage.java index 292962b..478073c 100644 --- a/src/sig/plugin/TwosideKeeper/CustomDamage.java +++ b/src/sig/plugin/TwosideKeeper/CustomDamage.java @@ -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))) { diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/Habitation.java b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/Habitation.java index 59bf7ca..00e847f 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/Habitation.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/Habitation.java @@ -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!", diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java index 10c74ae..4c6bcf3 100644 --- a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java +++ b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java @@ -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) {