Fixed item drops for custom skeletons

This commit is contained in:
David Berdik 2019-07-28 17:17:23 -04:00
parent 4d8d188bda
commit 8cb2941520

View File

@ -54,15 +54,17 @@ public class CustomSkeleton extends EntitySkeleton implements CustomEntity {
@Override
public void killCustom() {
/*for (int i = 1; i <= 2500; ++i) {
if (Herobrine.getPluginCore().getConfigDB().npc.contains("npc.Demon.Drops." + Integer.toString(i))) {
final int chance = new Random().nextInt(100);
if (chance <= Herobrine.getPluginCore().getConfigDB().npc.getInt("npc.Demon.Drops." + Integer.toString(i) + ".Chance")) {
getBukkitEntity().getLocation().getWorld().dropItemNaturally(getBukkitEntity().getLocation(),
new ItemStack(Material.getMaterial(i), Herobrine.getPluginCore().getConfigDB().npc.getInt("npc.Demon.Drops." + Integer.toString(i) + ".Count")));
}
Object[] items = Herobrine.getPluginCore().getConfigDB().npc.getConfigurationSection("npc.Demon.Drops")
.getKeys(false).toArray();
for (Object itemObj : items) {
String item = itemObj.toString();
final int chance = new Random().nextInt(100);
if (chance <= Herobrine.getPluginCore().getConfigDB().npc.getInt("npc.Demon.Drops." + item + ".Chance")) {
getBukkitEntity().getLocation().getWorld().dropItemNaturally(getBukkitEntity().getLocation(),
new ItemStack(Material.matchMaterial(item), Herobrine.getPluginCore().getConfigDB().npc
.getInt("npc.Demon.Drops." + item + ".Count")));
}
}*/
}
setHealth(0.0f);
}