Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.logging.Logger;
- import org.bukkit.Bukkit;
- import org.bukkit.Location;
- import org.bukkit.Material;
- import org.bukkit.block.Block;
- import org.bukkit.enchantments.Enchantment;
- import org.bukkit.entity.Player;
- import org.bukkit.event.EventHandler;
- import org.bukkit.event.Listener;
- import org.bukkit.event.block.BlockBreakEvent;
- import org.bukkit.inventory.ItemStack;
- import org.bukkit.plugin.PluginDescriptionFile;
- import org.bukkit.plugin.java.JavaPlugin;
- public class Main extends JavaPlugin implements Listener {
- public final Logger logger = Logger.getLogger("Minecraft");
- public static Main Plugin;
- @Override
- public void onDisable() {
- PluginDescriptionFile pdfFile = this.getDescription();
- this.logger.info(pdfFile.getName() + " Has Been Disabled!");
- }
- @Override
- public void onEnable() {
- PluginDescriptionFile pdfFile = this.getDescription();
- this.logger.info(pdfFile.getName() + " Version " + pdfFile.getVersion()
- + " Has Been Enabled!");
- getConfig().options().copyDefaults(true);
- saveConfig();
- Bukkit.getPluginManager().registerEvents(this, this);
- }
- @EventHandler
- public void onBlockBreak(BlockBreakEvent event) {
- Player player = event.getPlayer();
- ItemStack item = player.getItemInHand();
- if (item.getEnchantments().containsKey(Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) <= 4) {
- Location loc = event.getBlock().getLocation();
- if (event.getBlock().getType() == Material.IRON_ORE) {
- event.getBlock().getWorld()
- .getBlockAt(event.getBlock().getLocation())
- .setType(Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(loc,
- new ItemStack(Material.IRON_INGOT, 1));
- player.giveExp(1);
- event.getBlock().getDrops().clear();
- } else {
- if (item.getEnchantments().containsKey(
- Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) <= 4) {
- if (event.getBlock().getType() == Material.GOLD_ORE) {
- event.getBlock()
- .getWorld()
- .getBlockAt(
- event.getBlock().getLocation())
- .setType(Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(
- Material.GOLD_INGOT, 1));
- player.giveExp(1);
- event.getBlock().getDrops().clear();
- } else {
- if (item.getEnchantments().containsKey(
- Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) <= 4) {
- if (event.getBlock().getType() == Material.STONE) {
- event.getBlock()
- .getWorld()
- .getBlockAt(
- event.getBlock()
- .getLocation())
- .setType(Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(
- Material.STONE,
- 1));
- player.giveExp(1);
- event.getBlock().getDrops().clear();
- } else {
- if (item.getEnchantments()
- .containsKey(
- Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) <= 4) {
- if (event.getBlock()
- .getType() == Material.NETHERRACK) {
- event.getBlock()
- .getWorld()
- .getBlockAt(
- event.getBlock()
- .getLocation())
- .setType(
- Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(
- Material.NETHER_BRICK_ITEM,
- 1));
- player.giveExp(1);
- event.getBlock()
- .getDrops()
- .clear();
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- @EventHandler
- public void onBlockBreak0(BlockBreakEvent event) {
- Player player = event.getPlayer();
- ItemStack item = player.getItemInHand();
- Location loc = event.getBlock().getLocation();
- if (item.getEnchantments().containsKey(Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) >= 5) {
- if (event.getBlock().getType() == Material.IRON_ORE) {
- event.getBlock().getWorld()
- .getBlockAt(event.getBlock().getLocation())
- .setType(Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(Material.IRON_INGOT,
- getConfig().getInt("Five")));
- player.giveExp(1);
- event.getBlock().getDrops().clear();
- } else {
- if (item.getEnchantments().containsKey(
- Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) >= 5) {
- if (event.getBlock().getType() == Material.GOLD_ORE) {
- event.getBlock()
- .getWorld()
- .getBlockAt(
- event.getBlock().getLocation())
- .setType(Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(
- Material.GOLD_INGOT,
- getConfig().getInt(
- "Five")));
- player.giveExp(1);
- event.getBlock().getDrops().clear();
- } else {
- if (item.getEnchantments().containsKey(
- Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) >= 5) {
- if (event.getBlock().getType() == Material.STONE) {
- event.getBlock()
- .getWorld()
- .getBlockAt(
- event.getBlock()
- .getLocation())
- .setType(Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(
- Material.STONE,
- getConfig()
- .getInt("Five")));
- player.giveExp(1);
- event.getBlock().getDrops().clear();
- } else {
- if (item.getEnchantments()
- .containsKey(
- Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) >= 5) {
- if (event.getBlock()
- .getType() == Material.NETHERRACK) {
- event.getBlock()
- .getWorld()
- .getBlockAt(
- event.getBlock()
- .getLocation())
- .setType(
- Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(
- Material.NETHER_BRICK_ITEM,
- getConfig()
- .getInt("Five")));
- player.giveExp(1);
- event.getBlock()
- .getDrops()
- .clear();
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- @EventHandler
- public void onBlockBreak1(BlockBreakEvent event) {
- Player player = event.getPlayer();
- ItemStack item = player.getItemInHand();
- Location loc = event.getBlock().getLocation();
- if (item.getEnchantments().containsKey(Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) >= 10) {
- if (event.getBlock().getType() == Material.IRON_ORE) {
- event.getBlock().getWorld()
- .getBlockAt(event.getBlock().getLocation())
- .setType(Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(Material.IRON_INGOT,
- getConfig().getInt("Ten")));
- player.giveExp(1);
- event.getBlock().getDrops().clear();
- } else {
- if (item.getEnchantments().containsKey(
- Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) >= 10) {
- if (event.getBlock().getType() == Material.GOLD_ORE) {
- event.getBlock()
- .getWorld()
- .getBlockAt(
- event.getBlock().getLocation())
- .setType(Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(
- Material.GOLD_INGOT,
- getConfig().getInt(
- "Ten")));
- player.giveExp(1);
- event.getBlock().getDrops().clear();
- } else {
- if (item.getEnchantments().containsKey(
- Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) >= 10) {
- if (event.getBlock().getType() == Material.STONE) {
- event.getBlock()
- .getWorld()
- .getBlockAt(
- event.getBlock()
- .getLocation())
- .setType(Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(
- Material.STONE,
- getConfig()
- .getInt("Ten")));
- player.giveExp(1);
- event.getBlock().getDrops().clear();
- } else {
- if (item.getEnchantments()
- .containsKey(
- Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) >= 10) {
- if (event.getBlock()
- .getType() == Material.NETHERRACK) {
- event.getBlock()
- .getWorld()
- .getBlockAt(
- event.getBlock()
- .getLocation())
- .setType(
- Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(
- Material.NETHER_BRICK_ITEM,
- getConfig()
- .getInt("Ten")));
- player.giveExp(1);
- event.getBlock()
- .getDrops()
- .clear();
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- @EventHandler
- public void onBlockBreak2(BlockBreakEvent event) {
- Player player = event.getPlayer();
- ItemStack item = player.getItemInHand();
- Location loc = event.getBlock().getLocation();
- if (item.getEnchantments().containsKey(Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) >= 15) {
- if (event.getBlock().getType() == Material.IRON_ORE) {
- event.getBlock().getWorld()
- .getBlockAt(event.getBlock().getLocation())
- .setType(Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(Material.IRON_INGOT,
- getConfig().getInt("Fiften")));
- player.giveExp(1);
- event.getBlock().getDrops().clear();
- } else {
- if (item.getEnchantments().containsKey(
- Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) >= 15) {
- if (event.getBlock().getType() == Material.GOLD_ORE) {
- event.getBlock()
- .getWorld()
- .getBlockAt(
- event.getBlock().getLocation())
- .setType(Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(
- Material.GOLD_INGOT,
- getConfig().getInt(
- "Fiften")));
- player.giveExp(1);
- event.getBlock().getDrops().clear();
- } else {
- if (item.getEnchantments().containsKey(
- Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) >= 15) {
- if (event.getBlock().getType() == Material.STONE) {
- event.getBlock()
- .getWorld()
- .getBlockAt(
- event.getBlock()
- .getLocation())
- .setType(Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(
- Material.STONE,
- getConfig()
- .getInt("Fiften")));
- player.giveExp(1);
- event.getBlock().getDrops().clear();
- } else {
- if (item.getEnchantments()
- .containsKey(
- Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) >= 15) {
- if (event.getBlock()
- .getType() == Material.NETHERRACK) {
- event.getBlock()
- .getWorld()
- .getBlockAt(
- event.getBlock()
- .getLocation())
- .setType(
- Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(
- Material.NETHER_BRICK_ITEM,
- getConfig()
- .getInt("Fiften")));
- player.giveExp(1);
- event.getBlock()
- .getDrops()
- .clear();
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- @EventHandler
- public void onBlockBreak3(BlockBreakEvent event) {
- Player player = event.getPlayer();
- ItemStack item = player.getItemInHand();
- Location loc = event.getBlock().getLocation();
- if (item.getEnchantments().containsKey(Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) >= 20) {
- if (event.getBlock().getType() == Material.IRON_ORE) {
- event.getBlock().getWorld()
- .getBlockAt(event.getBlock().getLocation())
- .setType(Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(Material.IRON_INGOT,
- getConfig().getInt("Twenty")));
- player.giveExp(1);
- event.getBlock().getDrops().clear();
- } else {
- if (item.getEnchantments().containsKey(
- Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) >= 20) {
- if (event.getBlock().getType() == Material.GOLD_ORE) {
- event.getBlock()
- .getWorld()
- .getBlockAt(
- event.getBlock().getLocation())
- .setType(Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(
- Material.GOLD_INGOT,
- getConfig().getInt(
- "Twenty")));
- player.giveExp(1);
- event.getBlock().getDrops().clear();
- } else {
- if (item.getEnchantments().containsKey(
- Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) >= 20) {
- if (event.getBlock().getType() == Material.STONE) {
- event.getBlock()
- .getWorld()
- .getBlockAt(
- event.getBlock()
- .getLocation())
- .setType(Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(
- Material.STONE,
- getConfig()
- .getInt("Twenty")));
- player.giveExp(1);
- event.getBlock().getDrops().clear();
- } else {
- if (item.getEnchantments()
- .containsKey(
- Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) >= 20) {
- if (event.getBlock()
- .getType() == Material.NETHERRACK) {
- event.getBlock()
- .getWorld()
- .getBlockAt(
- event.getBlock()
- .getLocation())
- .setType(
- Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(
- Material.NETHER_BRICK_ITEM,
- getConfig()
- .getInt("Twenty")));
- player.giveExp(1);
- event.getBlock()
- .getDrops()
- .clear();
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- @EventHandler
- public void onBlockBreak4(BlockBreakEvent event) {
- Player player = event.getPlayer();
- ItemStack item = player.getItemInHand();
- Location loc = event.getBlock().getLocation();
- if (item.getEnchantments().containsKey(Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) >= 25) {
- if (event.getBlock().getType() == Material.IRON_ORE) {
- event.getBlock().getWorld()
- .getBlockAt(event.getBlock().getLocation())
- .setType(Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(Material.IRON_INGOT,
- getConfig().getInt("Twentyfive")));
- player.giveExp(1);
- event.getBlock().getDrops().clear();
- } else {
- if (item.getEnchantments().containsKey(
- Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) >= 25) {
- if (event.getBlock().getType() == Material.GOLD_ORE) {
- event.getBlock()
- .getWorld()
- .getBlockAt(
- event.getBlock().getLocation())
- .setType(Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(
- Material.GOLD_INGOT,
- getConfig().getInt(
- "Twentyfive")));
- player.giveExp(1);
- event.getBlock().getDrops().clear();
- } else {
- if (item.getEnchantments().containsKey(
- Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) >= 25) {
- if (event.getBlock().getType() == Material.STONE) {
- event.getBlock()
- .getWorld()
- .getBlockAt(
- event.getBlock()
- .getLocation())
- .setType(Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(
- Material.STONE,
- getConfig()
- .getInt("Twentyfive")));
- player.giveExp(1);
- event.getBlock().getDrops().clear();
- } else {
- if (item.getEnchantments()
- .containsKey(
- Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) >= 25) {
- if (event.getBlock()
- .getType() == Material.NETHERRACK) {
- event.getBlock()
- .getWorld()
- .getBlockAt(
- event.getBlock()
- .getLocation())
- .setType(
- Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(
- Material.NETHER_BRICK_ITEM,
- getConfig()
- .getInt("Twentyfive")));
- player.giveExp(1);
- event.getBlock()
- .getDrops()
- .clear();
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- @EventHandler
- public void onBlockBreak5(BlockBreakEvent event) {
- Player player = event.getPlayer();
- ItemStack item = player.getItemInHand();
- Location loc = event.getBlock().getLocation();
- if (item.getEnchantments().containsKey(Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) >= 30) {
- if (event.getBlock().getType() == Material.IRON_ORE) {
- event.getBlock().getWorld()
- .getBlockAt(event.getBlock().getLocation())
- .setType(Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(Material.IRON_INGOT,
- getConfig().getInt("Thirty")));
- player.giveExp(1);
- event.getBlock().getDrops().clear();
- } else {
- if (item.getEnchantments().containsKey(
- Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) >= 30) {
- if (event.getBlock().getType() == Material.GOLD_ORE) {
- event.getBlock()
- .getWorld()
- .getBlockAt(
- event.getBlock().getLocation())
- .setType(Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(
- Material.GOLD_INGOT,
- getConfig().getInt(
- "Thirty")));
- player.giveExp(1);
- event.getBlock().getDrops().clear();
- } else {
- if (item.getEnchantments().containsKey(
- Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) >= 30) {
- if (event.getBlock().getType() == Material.STONE) {
- event.getBlock()
- .getWorld()
- .getBlockAt(
- event.getBlock()
- .getLocation())
- .setType(Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(
- Material.STONE,
- getConfig()
- .getInt("Thirty")));
- player.giveExp(1);
- event.getBlock().getDrops().clear();
- } else {
- if (item.getEnchantments()
- .containsKey(
- Enchantment.LOOT_BONUS_BLOCKS)) {
- if (item.getEnchantmentLevel(Enchantment.LOOT_BONUS_BLOCKS) >= 30) {
- if (event.getBlock()
- .getType() == Material.NETHERRACK) {
- event.getBlock()
- .getWorld()
- .getBlockAt(
- event.getBlock()
- .getLocation())
- .setType(
- Material.AIR);
- event.getBlock()
- .getWorld()
- .dropItemNaturally(
- loc,
- new ItemStack(
- Material.NETHER_BRICK_ITEM,
- getConfig()
- .getInt("Thirty")));
- player.giveExp(1);
- event.getBlock()
- .getDrops()
- .clear();
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement