diff --git a/TwosideKeeper.jar b/TwosideKeeper.jar index 2548cbf..0de83a6 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 478073c..98b3797 100644 --- a/src/sig/plugin/TwosideKeeper/CustomDamage.java +++ b/src/sig/plugin/TwosideKeeper/CustomDamage.java @@ -688,6 +688,7 @@ public class CustomDamage { if (!(target instanceof Player)) { LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(target); les.SetTarget(getDamagerEntity(damager)); + les.lastHitbyPlayer = TwosideKeeper.getServerTickTime(); } EntityUtils.applyDamageIndicator(target, damage, (isFlagSet(pd.lasthitproperties,IS_CRIT))?IndicatorType.CRIT:IndicatorType.REGULAR); } else diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java index fb90e7b..00f0bc5 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/Common/GenericFunctions.java @@ -45,6 +45,7 @@ import org.bukkit.entity.Spider; import org.bukkit.entity.Wither; import org.bukkit.entity.Zombie; import org.bukkit.inventory.Inventory; +import org.bukkit.inventory.InventoryView; import org.bukkit.inventory.ItemFlag; import org.bukkit.inventory.ItemStack; import org.bukkit.inventory.meta.ItemMeta; @@ -100,6 +101,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.ItemSet; import sig.plugin.TwosideKeeper.HelperStructures.PlayerMode; import sig.plugin.TwosideKeeper.HelperStructures.WorldShop; import sig.plugin.TwosideKeeper.HelperStructures.Effects.WindSlash; +import sig.plugin.TwosideKeeper.HelperStructures.Items.Scepter; import sig.plugin.TwosideKeeper.HelperStructures.Utils.ArrayUtils; import sig.plugin.TwosideKeeper.HelperStructures.Utils.ArtifactUtils; import sig.plugin.TwosideKeeper.HelperStructures.Utils.BlockUtils; @@ -5716,4 +5718,19 @@ public class GenericFunctions { } } } + + public static boolean onlyHoldingScepter(Player p) { + return ((p.getEquipment().getItemInMainHand()!=null || p.getEquipment().getItemInMainHand().getType()!=Material.AIR) && Scepter.isScepter(p.getEquipment().getItemInMainHand())) + ^ + ((p.getEquipment().getItemInOffHand()!=null || p.getEquipment().getItemInOffHand().getType()!=Material.AIR) && Scepter.isScepter(p.getEquipment().getItemInOffHand())); + } + + public static void refreshInventoryView(Player p) { + InventoryView view = p.getOpenInventory(); + //TwosideKeeper.log("View size: "+view.countSlots(), 1); + for (int i=0;iLEASHRANGE_SQUARED) { + ent.teleport(owner.getLocation()); + } + if (targetLoc!=null && ent.getLocation().distanceSquared(targetLoc)>1) { + Vector dirToMove = MovementUtils.getVelocityTowardsLocation(ent.getLocation(), targetLoc, moveSpd); + ent.setVelocity(dirToMove); + } + } + + public void setTargetLocation(Location loc) { + this.targetLoc=loc; + } + + public void setMoveSpeed(double spd) { + this.moveSpd = spd; + } + + public void setNickname(String nickname) { + this.name=nickname; + this.ent.setCustomName(nickname); + } + + public String getNickname() { + return name; + } + + public Location getTargetLocation() { + return targetLoc; + } + + public LivingEntity getEntity() { + return ent; + } + + public void cleanup() { + ent.remove(); + } +} diff --git a/src/sig/plugin/TwosideKeeper/HelperStructures/PlayerMode.java b/src/sig/plugin/TwosideKeeper/HelperStructures/PlayerMode.java index 3cfc949..f702aa3 100644 --- a/src/sig/plugin/TwosideKeeper/HelperStructures/PlayerMode.java +++ b/src/sig/plugin/TwosideKeeper/HelperStructures/PlayerMode.java @@ -17,8 +17,8 @@ public enum PlayerMode { BARBARIAN(ChatColor.GOLD,"B","Barbarian",Book.BARBARIANGUIDE ), SLAYER(ChatColor.DARK_BLUE,"SL","Slayer",Book.SLAYERGUIDE), - /*SUMMONER(ChatColor.DARK_PURPLE,"SM","Summoner", - Book.SUMMONERGUIDE),*/ + SUMMONER(ChatColor.DARK_PURPLE,"SM","Summoner", + Book.SUMMONERGUIDE), NORMAL(ChatColor.WHITE,"A","Adventurer",Book.ADVENTURERGUIDE); ; @@ -62,6 +62,9 @@ public enum PlayerMode { } else if (Check_isRanger(p)) { pd.lastmode=PlayerMode.RANGER; + } else + if (Check_isSummoner(p)) { + pd.lastmode=PlayerMode.SUMMONER; } else { pd.lastmode=PlayerMode.NORMAL; } @@ -146,6 +149,19 @@ public enum PlayerMode { } } + public static boolean isSummoner(Player p) { + if (p!=null && !p.isDead()) { + PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); + if (needsUpdating(pd)) { + return getPlayerMode(p)==PlayerMode.SUMMONER; + } else { + return pd.lastmode==PlayerMode.SUMMONER; + } + } else { + return false; + } + } + public static boolean isNormal(Player p) { if (p!=null && !p.isDead()) { PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); @@ -251,6 +267,24 @@ public enum PlayerMode { return false; } } + + public static boolean Check_isSummoner(Player p) { + if (p!=null && !p.isDead()) { + PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); + if (needsUpdating(pd)) { + if (GenericFunctions.onlyHoldingScepter(p) && + GenericFunctions.AllLeatherArmor(p)) { + return true; + } else { + return false; + } + } else { + return pd.lastmode==PlayerMode.SUMMONER; + } + } else { + return false; + } + } String name=""; Book helperBook; diff --git a/src/sig/plugin/TwosideKeeper/LivingEntityStructure.java b/src/sig/plugin/TwosideKeeper/LivingEntityStructure.java index 250949e..67c33b7 100644 --- a/src/sig/plugin/TwosideKeeper/LivingEntityStructure.java +++ b/src/sig/plugin/TwosideKeeper/LivingEntityStructure.java @@ -9,6 +9,7 @@ import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.attribute.Attribute; import org.bukkit.entity.Entity; +import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Monster; import org.bukkit.entity.Player; @@ -50,9 +51,12 @@ public class LivingEntityStructure { public long lastCrippleTick=0; public long lastBurnTick=0; public long lastHit=0; + public long lastHitbyPlayer=0; public float MoveSpeedMultBeforeCripple=1f; public Channel currentChannel=null; public boolean isImportantGlowEnemy=true; + public boolean isPet=false; + public Player petOwner=null; public HashMap aggro_table = new HashMap(); final static String MODIFIED_NAME_CODE = ChatColor.RESET+""+ChatColor.RESET+""+ChatColor.RESET; @@ -190,11 +194,13 @@ public class LivingEntityStructure { } public void setGlow(Player p, GlowAPI.Color col) { + GlowAPI.setGlowing(m, col, p); glowcolorlist.put(p.getUniqueId(), col); } public void setGlobalGlow(GlowAPI.Color col) { for (Player p : Bukkit.getOnlinePlayers()) { + GlowAPI.setGlowing(m, col, p); glowcolorlist.put(p.getUniqueId(), col); } } @@ -264,7 +270,7 @@ public class LivingEntityStructure { } } }catch (NullPointerException npe) { - + GlowAPI.setGlowing(m, false, p); } } } @@ -505,7 +511,44 @@ public class LivingEntityStructure { if (target!=null && !EntityUtils.isValidEntity(target)) { aggro_table.remove(target.getUniqueId()); + } + } + + public static boolean isFriendly(LivingEntity ent1, LivingEntity ent2) { + if (!(ent1 instanceof Player) && + !(ent2 instanceof Player)) { + LivingEntityStructure les1 = LivingEntityStructure.GetLivingEntityStructure(ent1); + LivingEntityStructure les2 = LivingEntityStructure.GetLivingEntityStructure(ent2); + if (les1.isPet && les2.isPet) { + if (les1.petOwner!=null && les2.petOwner!=null) { + return PVP.isFriendly(les1.petOwner, les2.petOwner); + } else { + return true; + } + } else { + return false; + } + } else + if (!(ent1 instanceof Player) ^ + !(ent2 instanceof Player)) { + if (ent1 instanceof Player) { //ent2 is the pet. + LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(ent2); + if (les.isPet && les.petOwner!=null) { + return PVP.isFriendly(les.petOwner,(Player)ent1); + } else { + return false; + } + } else { //ent1 is the pet. + LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(ent1); + if (les.isPet && les.petOwner!=null) { + return PVP.isFriendly(les.petOwner,(Player)ent2); + } else { + return false; + } + } + } else + { + return PVP.isFriendly((Player)ent1,(Player)ent2); } - } } diff --git a/src/sig/plugin/TwosideKeeper/PlayerStructure.java b/src/sig/plugin/TwosideKeeper/PlayerStructure.java index 8ffa45c..ea3b1ae 100644 --- a/src/sig/plugin/TwosideKeeper/PlayerStructure.java +++ b/src/sig/plugin/TwosideKeeper/PlayerStructure.java @@ -19,6 +19,7 @@ import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.YamlConfiguration; import org.bukkit.entity.ArmorStand; import org.bukkit.entity.Arrow; +import org.bukkit.entity.EntityType; import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -39,6 +40,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.CustomModel; import sig.plugin.TwosideKeeper.HelperStructures.DeathStructure; import sig.plugin.TwosideKeeper.HelperStructures.FilterCubeItem; import sig.plugin.TwosideKeeper.HelperStructures.OptionsMenu; +import sig.plugin.TwosideKeeper.HelperStructures.Pet; import sig.plugin.TwosideKeeper.HelperStructures.PlayerMode; import sig.plugin.TwosideKeeper.HelperStructures.ServerType; import sig.plugin.TwosideKeeper.HelperStructures.Common.GenericFunctions; @@ -192,6 +194,10 @@ public class PlayerStructure { public double lastPVPHitDamage=0; public boolean blocking=false; public long lastShieldCharge=0; + public LivingEntity lastTarget=null; + public long lastGrabbedTarget=0; + public UUID lastViewedTarget=null; + public boolean mouseoverhealthbar=true; /*State 1 * 1: Best of 3 Rounds * 2: Best of 5 Rounds @@ -270,6 +276,9 @@ public class PlayerStructure { public long lastFailedCastTime=0; public Location locBeforeInstance=null; + public Pet myPet=null; + public int petID=0; + List equipmentset = new ArrayList(); public HashMap> filtercubestructure = new HashMap>(); @@ -372,6 +381,7 @@ public class PlayerStructure { this.customtitle = new AdvancedTitle(p); this.lastLocationChange = TwosideKeeper.getServerTickTime(); this.lastblock = TwosideKeeper.getServerTickTime(); + //this.myPet = new Pet(p,EntityType.OCELOT,"Test"); //Set defaults first, in case this is a new user. loadConfig(); //p.getInventory().addItem(new ItemStack(Material.PORTAL)); @@ -563,6 +573,7 @@ public class PlayerStructure { workable.set("tooConsistentAdjustments", tooConsistentAdjustments); workable.set("freshBlood", freshBlood); workable.set("firstPVPMatch", firstPVPMatch); + workable.set("mouseoverhealthbar", mouseoverhealthbar); int buffcounter=0; for (String key : buffs.keySet()) { Buff b = buffs.get(key); @@ -681,6 +692,7 @@ public class PlayerStructure { workable.addDefault("tooConsistentAdjustments",tooConsistentAdjustments); workable.addDefault("freshBlood",freshBlood); workable.addDefault("firstPVPMatch",firstPVPMatch); + workable.addDefault("mouseoverhealthbar",mouseoverhealthbar); workable.options().copyDefaults(); @@ -757,6 +769,7 @@ public class PlayerStructure { String tempworld = workable.getString("restartloc_world"); this.freshBlood = workable.getBoolean("freshBlood"); this.firstPVPMatch = workable.getBoolean("firstPVPMatch"); + this.mouseoverhealthbar = workable.getBoolean("mouseoverhealthbar"); if (!workable.getString("instanceloc_world").equalsIgnoreCase("null")) { locBeforeInstance = new Location( Bukkit.getWorld(workable.getString("instanceloc_world")), diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java index 2dad776..9539fea 100644 --- a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java +++ b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java @@ -241,6 +241,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.Loot; import sig.plugin.TwosideKeeper.HelperStructures.MalleableBaseQuest; import sig.plugin.TwosideKeeper.HelperStructures.MonsterDifficulty; import sig.plugin.TwosideKeeper.HelperStructures.OptionsMenu; +import sig.plugin.TwosideKeeper.HelperStructures.Pet; import sig.plugin.TwosideKeeper.HelperStructures.PlayerMode; import sig.plugin.TwosideKeeper.HelperStructures.Pronouns; import sig.plugin.TwosideKeeper.HelperStructures.QuestStatus; @@ -2835,6 +2836,45 @@ public class TwosideKeeper extends JavaPlugin implements Listener { pd.myModel = mymod; models.add(pd.myModel); }break; + case "PET":{ + PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); + pd.myPet = new Pet(p, EntityType.OCELOT, "Test"); + }break; + case "SCEPTER":{ + ItemStack scepter = new ItemStack(Material.BONE); + ItemMeta meta = scepter.getItemMeta(); + meta.setLore(Arrays.asList(ChatColor.LIGHT_PURPLE+"Summoner Gear")); + scepter.setItemMeta(meta); + GenericFunctions.giveItem(p, scepter); + }break; + case "UNGLOW":{ + LivingEntity target = aPlugin.API.rayTraceTargetEntity(p, 16); + if (target!=null) { + target.setCustomName(""); + target.setGlowing(false); + GlowAPI.setGlowing(target, false, p); + LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(target); + les.setGlow(p, null); + } + }break; + case "GLOW":{ + LivingEntity target = aPlugin.API.rayTraceTargetEntity(p, 16); + if (target!=null) { + if (args.length>1) { + //target.setCustomName(ChatColor.valueOf(args[1])+""); + //target.setGlowing(true); + //GlowAPI.setGlowing(target, GlowAPI.Color.valueOf(args[1]), p); + LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(target); + les.setGlow(p, GlowAPI.Color.valueOf(args[1])); + } + } + }break; + case "HOTBARSWITCH":{ + TwosideKeeper.log(p.getOpenInventory().toString(), 0); + for (int i=0;i1) { finaltext = TextUtils.createAggroBar(les.getAggroPercentage(p)) + " "+ finaltext; @@ -8965,47 +9008,49 @@ public class TwosideKeeper extends JavaPlugin implements Listener { habitat_data.startinglocs.remove(m.getUniqueId()); //log("Killed by a player.",0); killedByPlayer = true; - Player p = (Player)ms.GetTarget(); - if (p!=null) { - AwardDeathAchievements(p,ev.getEntity()); - if (GenericFunctions.isArtifactEquip(p.getEquipment().getItemInMainHand()) && - GenericFunctions.isArtifactWeapon(p.getEquipment().getItemInMainHand()) && - p.getEquipment().getItemInMainHand().getType()==Material.BOW) { - PlayerStructure pd = (PlayerStructure)playerdata.get(p.getUniqueId()); - if (pd.nextarrowxp>0) { - AwakenedArtifact.addPotentialEXP(p.getEquipment().getItemInMainHand(), pd.nextarrowxp, p); - pd.nextarrowxp=0; - } - } - - PlayerStructure pd = (PlayerStructure)playerdata.get(p.getUniqueId()); - - if (PlayerMode.isRanger(p) && - GenericFunctions.getBowMode(p)==BowMode.CLOSE) { - pd.fulldodge=true; - } - - dropmult+=pd.partybonus*0.33; //Party bonus increases drop rate by 33% per party member. - ItemStack item = p.getEquipment().getItemInMainHand(); - if (item!=null && - item.getType()!=Material.AIR && - GenericFunctions.isWeapon(item)) { - log("Adding "+(item.getEnchantmentLevel(Enchantment.LOOT_BONUS_MOBS)*0.1)+"to dropmult for Looting.",5); - dropmult+=item.getEnchantmentLevel(Enchantment.LOOT_BONUS_MOBS)*0.1; //Looting increases drop rate by 10% per level. - } - for (int i=0;i0) { + AwakenedArtifact.addPotentialEXP(p.getEquipment().getItemInMainHand(), pd.nextarrowxp, p); + pd.nextarrowxp=0; + } + } + + PlayerStructure pd = (PlayerStructure)playerdata.get(p.getUniqueId()); + + if (PlayerMode.isRanger(p) && + GenericFunctions.getBowMode(p)==BowMode.CLOSE) { + pd.fulldodge=true; + } + + dropmult+=pd.partybonus*0.33; //Party bonus increases drop rate by 33% per party member. + ItemStack item = p.getEquipment().getItemInMainHand(); + if (item!=null && + item.getType()!=Material.AIR && + GenericFunctions.isWeapon(item)) { + log("Adding "+(item.getEnchantmentLevel(Enchantment.LOOT_BONUS_MOBS)*0.1)+"to dropmult for Looting.",5); + dropmult+=item.getEnchantmentLevel(Enchantment.LOOT_BONUS_MOBS)*0.1; //Looting increases drop rate by 10% per level. } + for (int i=0;iTwosideKeeper.getServerTickTime())) { //Get the player that killed the monster. int luckmult = 0; int unluckmult = 0; @@ -10289,6 +10334,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener { GenericFunctions.playProperEquipSound(p,armor.getType()); p.updateInventory(); ItemSet.updateItemSets(p); + //GenericFunctions.refreshInventoryView(p); } @EventHandler(priority=EventPriority.LOW,ignoreCancelled = true) diff --git a/src/sig/plugin/TwosideKeeper/runServerHeartbeat.java b/src/sig/plugin/TwosideKeeper/runServerHeartbeat.java index 265da74..9780366 100644 --- a/src/sig/plugin/TwosideKeeper/runServerHeartbeat.java +++ b/src/sig/plugin/TwosideKeeper/runServerHeartbeat.java @@ -52,6 +52,7 @@ import sig.plugin.TwosideKeeper.HelperStructures.DamageStructure; import sig.plugin.TwosideKeeper.HelperStructures.FilterCubeItem; import sig.plugin.TwosideKeeper.HelperStructures.ItemSet; import sig.plugin.TwosideKeeper.HelperStructures.MonsterDifficulty; +import sig.plugin.TwosideKeeper.HelperStructures.Pet; import sig.plugin.TwosideKeeper.HelperStructures.PlayerMode; import sig.plugin.TwosideKeeper.HelperStructures.ServerType; import sig.plugin.TwosideKeeper.HelperStructures.WorldShop; @@ -318,6 +319,8 @@ final public class runServerHeartbeat implements Runnable { performRejuvenationHealing(p,pd); + RemoveTargetIfInvalid(p,pd); + updateCustomTitle(p, pd); TwosideKeeper.HeartbeatLogger.AddEntry("Update Custom Title", (int)(System.nanoTime()-time));time=System.nanoTime(); } @@ -417,6 +420,18 @@ final public class runServerHeartbeat implements Runnable { TwosideKeeper.HeartbeatLogger.AddEntry(ChatColor.LIGHT_PURPLE+"Total Server Heartbeat", (int)(System.nanoTime()-totaltime));totaltime=System.nanoTime(); } + private void RemoveTargetIfInvalid(Player p, PlayerStructure pd) { + if (pd.lastTarget!=null && !pd.lastTarget.isValid()) { + pd.lastTarget=null; + } else + if (pd.lastTarget!=null && pd.lastTarget.isValid() && + p.getLocation().distanceSquared(pd.lastTarget.getLocation())>Pet.LEASHRANGE_SQUARED) { + LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(pd.lastTarget); + les.setGlow(p, null); + pd.lastTarget=null; + } + } + private void performRejuvenationHealing(Player p, PlayerStructure pd) { if (pd.lastusedRejuvenation+200>TwosideKeeper.getServerTickTime()) { //Regenerate health. diff --git a/src/sig/plugin/TwosideKeeper/runServerTick.java b/src/sig/plugin/TwosideKeeper/runServerTick.java index c10cd11..8304094 100644 --- a/src/sig/plugin/TwosideKeeper/runServerTick.java +++ b/src/sig/plugin/TwosideKeeper/runServerTick.java @@ -4,10 +4,16 @@ import org.bukkit.Bukkit; import org.bukkit.ChatColor; import org.bukkit.Material; import org.bukkit.block.BlockFace; +import org.bukkit.entity.ArmorStand; +import org.bukkit.entity.LivingEntity; import org.bukkit.entity.Player; +import org.bukkit.potion.PotionEffectType; +import org.inventivetalent.glow.GlowAPI; +import org.inventivetalent.glow.GlowAPI.Color; import sig.plugin.TwosideKeeper.HelperStructures.CustomModel; import sig.plugin.TwosideKeeper.HelperStructures.DamageLabel; +import sig.plugin.TwosideKeeper.HelperStructures.PlayerMode; import sig.plugin.TwosideKeeper.HelperStructures.Common.BlockModifyQueue; import sig.plugin.TwosideKeeper.HelperStructures.Utils.Classes.ColoredParticle; @@ -27,10 +33,43 @@ public class runServerTick implements Runnable{ TwosideKeeper.labelqueue.remove(i--); } } - /*for (Player p : Bukkit.getOnlinePlayers()) { + for (Player p : Bukkit.getOnlinePlayers()) { PlayerStructure pd = PlayerStructure.GetPlayerStructure(p); - pd.myModel.displayModel(p.getLocation()); - }*/ + //pd.myModel.displayModel(p.getLocation()); + if (pd.myPet!=null) { + pd.myPet.run(); + } + if (PlayerMode.isSummoner(p)) { + //long timer = System.nanoTime(); + LivingEntity targetent = aPlugin.API.rayTraceTargetEntity(p, 16); + if (targetent!=null) { + LivingEntityStructure les = LivingEntityStructure.GetLivingEntityStructure(targetent); + if (LivingEntityStructure.isFriendly(p,targetent)) { + les.setGlow(p, Color.DARK_AQUA); + } else { + les.setGlow(p, Color.DARK_GRAY); + } + if (pd.lastTarget!=null && pd.lastTarget!=targetent) { + LivingEntityStructure les2 = LivingEntityStructure.GetLivingEntityStructure(pd.lastTarget); + les2.setGlow(p, null); + pd.lastTarget.setGlowing(false); + GlowAPI.setGlowing(pd.lastTarget, null, p); + pd.lastTarget=null; + } + pd.lastTarget=targetent; + } + //TwosideKeeper.log("Time Execution took: "+((System.nanoTime()-timer)/1000000)+"ms", 1); + } + if (pd.mouseoverhealthbar && pd.lastGrabbedTarget+10<=TwosideKeeper.getServerTickTime()) { + LivingEntity targetent = aPlugin.API.rayTraceTargetEntity(p, 16); + if (targetent!=null && (!(targetent instanceof ArmorStand) || (targetent instanceof ArmorStand && ((ArmorStand)targetent).isVisible())) && + !targetent.hasPotionEffect(PotionEffectType.INVISIBILITY) && (pd.lastViewedTarget==null || !pd.lastViewedTarget.equals(targetent.getUniqueId()))) { + pd.customtitle.updateCombatBar(p, targetent); + pd.lastGrabbedTarget=TwosideKeeper.getServerTickTime(); + pd.lastViewedTarget = targetent.getUniqueId(); + } + } + } runServerHeartbeat.resetDamageQueue(); /*if (Bukkit.getPlayer("sigonasr2")!=null) { Player p = Bukkit.getPlayer("sigonasr2");