Fatal Survivor fix. Equipment that drops gets re-equipped on you when
the Fatal Survivor buff is used.
This commit is contained in:
parent
5623d4995d
commit
e9c4ff2317
@ -4754,7 +4754,7 @@ public void payDay(int time)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int get_ItemCubeID(ItemStack item_cube) {
|
public int get_ItemCubeID(ItemStack item_cube) {
|
||||||
|
@ -11530,6 +11530,23 @@ implements Listener
|
|||||||
for (int i=0;i<e.getDrops().size();i++) {
|
for (int i=0;i<e.getDrops().size();i++) {
|
||||||
drops.add(e.getDrops().get(i));
|
drops.add(e.getDrops().get(i));
|
||||||
}
|
}
|
||||||
|
final ItemStack helmet_slot = p.getEquipment().getHelmet();
|
||||||
|
final ItemStack chestplate_slot = p.getEquipment().getChestplate();
|
||||||
|
final ItemStack leggings_slot = p.getEquipment().getLeggings();
|
||||||
|
final ItemStack boots_slot = p.getEquipment().getBoots();
|
||||||
|
//Remove them from the drops list, since they will be placed on the player's equipment slots.
|
||||||
|
if (drops.contains(helmet_slot)) {
|
||||||
|
drops.remove(helmet_slot);
|
||||||
|
}
|
||||||
|
if (drops.contains(chestplate_slot)) {
|
||||||
|
drops.remove(chestplate_slot);
|
||||||
|
}
|
||||||
|
if (drops.contains(leggings_slot)) {
|
||||||
|
drops.remove(leggings_slot);
|
||||||
|
}
|
||||||
|
if (drops.contains(boots_slot)) {
|
||||||
|
drops.remove(boots_slot);
|
||||||
|
}
|
||||||
//Bukkit.broadcastMessage("Added in "+drops.size()+" drops.");
|
//Bukkit.broadcastMessage("Added in "+drops.size()+" drops.");
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() {
|
Bukkit.getScheduler().scheduleSyncDelayedTask(this.plugin, new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
@ -11537,6 +11554,10 @@ implements Listener
|
|||||||
for (int i=0;i<drops.size();i++) {
|
for (int i=0;i<drops.size();i++) {
|
||||||
//Bukkit.broadcastMessage("Giving back "+drops.get(i).getType()+"x"+drops.get(i).getAmount());
|
//Bukkit.broadcastMessage("Giving back "+drops.get(i).getType()+"x"+drops.get(i).getAmount());
|
||||||
p.getInventory().addItem(drops.get(i));
|
p.getInventory().addItem(drops.get(i));
|
||||||
|
p.getEquipment().setBoots(boots_slot);
|
||||||
|
p.getEquipment().setChestplate(chestplate_slot);
|
||||||
|
p.getEquipment().setLeggings(leggings_slot);
|
||||||
|
p.getEquipment().setHelmet(helmet_slot);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},5);
|
},5);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user