mirror of
https://github.com/TotalFreedomMC/TF-ProjectKorra.git
synced 2025-02-11 11:40:40 +00:00
Extraction: Fixed Dupe Bug
http://projectkorra.com/forum/threads/extraction-dupe-glitch.1905/
This commit is contained in:
parent
e2ec2d26e3
commit
8b6ede61c6
1 changed files with 16 additions and 0 deletions
|
@ -27,22 +27,38 @@ public class Extraction {
|
|||
}
|
||||
if (!Methods.isRegionProtectedFromBuild(player, "Extraction", block.getLocation())) {
|
||||
if (Methods.canMetalbend(player) && Methods.canBend(player.getName(), "Extraction")) {
|
||||
Material type = null;
|
||||
|
||||
switch(block.getType()) {
|
||||
case IRON_ORE:
|
||||
block.setType(Material.STONE);
|
||||
player.getWorld().dropItem(player.getLocation(), new ItemStack(Material.IRON_INGOT, getAmount()));
|
||||
type = Material.STONE;
|
||||
break;
|
||||
case GOLD_ORE:
|
||||
block.setType(Material.STONE);
|
||||
player.getWorld().dropItem(player.getLocation(), new ItemStack(Material.GOLD_INGOT, getAmount()));
|
||||
type = Material.STONE;
|
||||
break;
|
||||
case QUARTZ_ORE:
|
||||
block.setType(Material.NETHERRACK);
|
||||
player.getWorld().dropItem(player.getLocation(), new ItemStack(Material.QUARTZ, getAmount()));
|
||||
type = Material.NETHERRACK;
|
||||
break;
|
||||
default:
|
||||
break; // shouldn't happen.
|
||||
}
|
||||
|
||||
if(type != null) {
|
||||
/* Update the block from Methods.movedearth to Stone otherwise
|
||||
* players can use RaiseEarth > Extraction > Collapse
|
||||
* to dupe the material from the block.
|
||||
* */
|
||||
if(Methods.movedearth.containsKey(block)) {
|
||||
Methods.movedearth.remove(block);
|
||||
}
|
||||
}
|
||||
|
||||
Methods.playMetalbendingSound(block.getLocation());
|
||||
bPlayer.addCooldown("Extraction", cooldown);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue