Fix Loot not dropping.

This commit is contained in:
sigonasr2 2016-08-03 23:51:32 -05:00
parent 4d76fc9bce
commit 804497e931
5 changed files with 25 additions and 13 deletions

Binary file not shown.

View File

@ -1,6 +1,6 @@
name: TwosideKeeper name: TwosideKeeper
main: sig.plugin.TwosideKeeper.TwosideKeeper main: sig.plugin.TwosideKeeper.TwosideKeeper
version: 3.7.3b version: 3.7.3br1
commands: commands:
money: money:
description: Tells the player the amount of money they are holding. description: Tells the player the amount of money they are holding.

View File

@ -2616,12 +2616,8 @@ public class GenericFunctions {
public static void DealDamageToMob(double dmg, LivingEntity target, LivingEntity damager, ItemStack artifact) { public static void DealDamageToMob(double dmg, LivingEntity target, LivingEntity damager, ItemStack artifact) {
if (damager!=null && (target instanceof Monster)) { if (damager!=null && (target instanceof Monster)) {
Monster m = (Monster)target; Monster m = (Monster)target;
m.setTarget(damager); if (damager instanceof Player) {
if (TwosideKeeper.monsterdata.containsKey(m.getUniqueId())) { NewCombat.addMonsterToTargetList(m, (Player)damager);
MonsterStructure ms = (MonsterStructure)TwosideKeeper.monsterdata.get(m.getUniqueId());
ms.SetTarget(damager);
} else {
TwosideKeeper.monsterdata.put(m.getUniqueId(),new MonsterStructure(m,damager));
} }
TwosideKeeper.habitat_data.addNewStartingLocation(target); TwosideKeeper.habitat_data.addNewStartingLocation(target);
} }

View File

@ -396,8 +396,8 @@ public class NewCombat {
} }
} }
static void addMonsterToTargetList(Monster m,Player p) { public static void addMonsterToTargetList(Monster m,Player p) {
m.setTarget(p); if (!m.hasPotionEffect(PotionEffectType.GLOWING)) {m.setTarget(p);}
if (TwosideKeeper.monsterdata.containsKey(m.getUniqueId())) { if (TwosideKeeper.monsterdata.containsKey(m.getUniqueId())) {
MonsterStructure ms = (MonsterStructure)TwosideKeeper.monsterdata.get(m.getUniqueId()); MonsterStructure ms = (MonsterStructure)TwosideKeeper.monsterdata.get(m.getUniqueId());
} else { } else {

View File

@ -1090,7 +1090,7 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
//If we can grab their stats, then calculate it. //If we can grab their stats, then calculate it.
Player p = Bukkit.getPlayer(args[0]); Player p = Bukkit.getPlayer(args[0]);
sender.sendMessage("Displaying stats for "+ChatColor.YELLOW+p.getName()); sender.sendMessage("Displaying stats for "+ChatColor.YELLOW+p.getName());
showPlayerStats(p); showPlayerStats(p,sender);
} else { } else {
sender.sendMessage("Player "+ChatColor.YELLOW+args[0]+" is not online!"); sender.sendMessage("Player "+ChatColor.YELLOW+args[0]+" is not online!");
} }
@ -4089,6 +4089,9 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
aPlugin.API.damageItem(p, p.getEquipment().getItemInMainHand(), 1); aPlugin.API.damageItem(p, p.getEquipment().getItemInMainHand(), 1);
} }
GenericFunctions.knockOffGreed(p); GenericFunctions.knockOffGreed(p);
if (ev.getEntity() instanceof Monster) {
NewCombat.addMonsterToTargetList((Monster)ev.getEntity(), (Player)ev.getDamager());
}
} }
} }
} //Negative damage doesn't make sense. We'd apply it normally. } //Negative damage doesn't make sense. We'd apply it normally.
@ -6181,6 +6184,10 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
} }
public void showPlayerStats(Player p) { public void showPlayerStats(Player p) {
showPlayerStats(p,p);
}
public void showPlayerStats(Player p, CommandSender receiver) {
PlayerStructure pd = (PlayerStructure)playerdata.get(p.getUniqueId()); PlayerStructure pd = (PlayerStructure)playerdata.get(p.getUniqueId());
double old_weapondmg = pd.prev_weapondmg; double old_weapondmg = pd.prev_weapondmg;
double old_buffdmg = pd.prev_buffdmg; double old_buffdmg = pd.prev_buffdmg;
@ -6199,13 +6206,22 @@ public class TwosideKeeper extends JavaPlugin implements Listener {
p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Dodge Chance: "+ChatColor.RESET+""+ChatColor.DARK_AQUA+df.format((NewCombat.CalculateDodgeChance(p))*100)+"%"); p.sendMessage(ChatColor.GRAY+""+ChatColor.ITALIC+"Dodge Chance: "+ChatColor.RESET+""+ChatColor.DARK_AQUA+df.format((NewCombat.CalculateDodgeChance(p))*100)+"%");
TextComponent f = new TextComponent(ChatColor.GRAY+""+ChatColor.ITALIC+"Current Mode: "); TextComponent f = new TextComponent(ChatColor.GRAY+""+ChatColor.ITALIC+"Current Mode: ");
f.addExtra(GenericFunctions.PlayerModeName(p)); f.addExtra(GenericFunctions.PlayerModeName(p));
p.spigot().sendMessage(f); if (receiver instanceof Player) {
((Player)receiver).spigot().sendMessage(f);
} else {
receiver.sendMessage(f.toPlainText());
}
TextComponent msg = DisplayPerks(p.getEquipment().getItemInMainHand(),"Weapon",p,0);if (!msg.toPlainText().equalsIgnoreCase("")) {p.spigot().sendMessage(msg);}; TextComponent msg = DisplayPerks(p.getEquipment().getItemInMainHand(),"Weapon",p,0);if (!msg.toPlainText().equalsIgnoreCase("")) {p.spigot().sendMessage(msg);};
msg = DisplayPerks(p.getEquipment().getHelmet(),"Helmet",p,903);if (!msg.toPlainText().equalsIgnoreCase("")) {p.spigot().sendMessage(msg);}; msg = DisplayPerks(p.getEquipment().getHelmet(),"Helmet",p,903);if (!msg.toPlainText().equalsIgnoreCase("")) {p.spigot().sendMessage(msg);};
msg = DisplayPerks(p.getEquipment().getChestplate(),"Chestplate",p,902);if (!msg.toPlainText().equalsIgnoreCase("")) {p.spigot().sendMessage(msg);}; msg = DisplayPerks(p.getEquipment().getChestplate(),"Chestplate",p,902);if (!msg.toPlainText().equalsIgnoreCase("")) {p.spigot().sendMessage(msg);};
msg = DisplayPerks(p.getEquipment().getLeggings(),"Legging",p,901);if (!msg.toPlainText().equalsIgnoreCase("")) {p.spigot().sendMessage(msg);}; msg = DisplayPerks(p.getEquipment().getLeggings(),"Legging",p,901);if (!msg.toPlainText().equalsIgnoreCase("")) {p.spigot().sendMessage(msg);};
msg = DisplayPerks(p.getEquipment().getBoots(),"Boot",p,900);if (!msg.toPlainText().equalsIgnoreCase("")) {p.spigot().sendMessage(msg);}; msg = DisplayPerks(p.getEquipment().getBoots(),"Boot",p,900);if (!msg.toPlainText().equalsIgnoreCase("")) {p.spigot().sendMessage(msg);};
p.sendMessage("----------");
if (receiver instanceof Player) {
((Player)receiver).sendMessage("----------");
} else {
receiver.sendMessage("----------");
}
} }
public static TextComponent DisplayPerks(ItemStack item,String type,Player p, int slot) { public static TextComponent DisplayPerks(ItemStack item,String type,Player p, int slot) {