Permalink
Browse files

Added untested option to CustomDrops to remove vanilla drops.

  • Loading branch information...
me4502 committed Jul 31, 2017
1 parent 99d9d3f commit 54bf15d79831089e4bd5a2a7155afb00e0f71b30
Showing with 13 additions and 0 deletions.
  1. +13 −0 src/main/java/com/sk89q/craftbook/mechanics/drops/CustomDrops.java
@@ -300,6 +300,11 @@ public void onBlockBreak(BlockBreakEvent event) {
reward.giveReward(event.getPlayer());
}
}
if (removeVanillaDrops) {
event.setCancelled(true);
event.getBlock().setType(Material.AIR);
}
}
@EventHandler(priority = EventPriority.HIGH)
@@ -388,14 +393,22 @@ public void onEntityDeath(EntityDeathEvent event) {
reward.giveReward(killer);
}
}
if (removeVanillaDrops) {
event.getDrops().clear();
}
}
private boolean customDropPermissions;
private boolean removeVanillaDrops;
@Override
public void loadConfiguration (YAMLProcessor config, String path) {
config.setComment(path + "require-permissions", "Require a permission node to get custom drops.");
customDropPermissions = config.getBoolean(path + "require-permissions", false);
config.setComment(path + "remove-vanilla-drops", "Remove all vanilla drops.");
removeVanillaDrops = config.getBoolean(path + "remove-vanilla-drops", false);
}
}

0 comments on commit 54bf15d

Please sign in to comment.