Habitat levels properly work again.

master
sigonasr2 8 years ago
parent 65f025a640
commit ae2148bed7
  1. BIN
      TwosideKeeper.jar
  2. 4
      src/sig/plugin/TwosideKeeper/CustomDamage.java
  3. 3
      src/sig/plugin/TwosideKeeper/HelperStructures/Common/Habitation.java
  4. 4
      src/sig/plugin/TwosideKeeper/TwosideKeeper.java

Binary file not shown.

@ -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))) {

@ -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!",

@ -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) {

Loading…
Cancel
Save