mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 22:56:45 +01:00
Made Super Breaker & Silk Touch work together properly.
This commit is contained in:
parent
c95d2a9b84
commit
ade31de797
@ -89,12 +89,23 @@ public class Mining
|
||||
return;
|
||||
}
|
||||
|
||||
//Drop natural block with Silk Touch
|
||||
if(player.getItemInHand().getEnchantments().containsKey(Enchantment.SILK_TOUCH)){
|
||||
m.mcDropItem(loc, item);
|
||||
return;
|
||||
}
|
||||
|
||||
switch (id){
|
||||
//GLOWSTONE
|
||||
case 89:
|
||||
mat = Material.getMaterial(348);
|
||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
||||
m.mcDropItem(loc, item);
|
||||
m.mcDropItem(loc, item);
|
||||
if(Math.random() * 10 > 5)
|
||||
m.mcDropItem(loc, item);
|
||||
if(Math.random() * 10 > 5)
|
||||
m.mcDropItem(loc, item);
|
||||
break;
|
||||
//REDSTONE
|
||||
case 73:
|
||||
@ -270,6 +281,7 @@ public class Mining
|
||||
int xp = 0;
|
||||
byte damage = 0;
|
||||
ItemStack item = new ItemStack(mat, 1, (byte)0, damage);
|
||||
boolean silkTouch = player.getItemInHand().getEnchantments().containsKey(Enchantment.SILK_TOUCH);
|
||||
|
||||
//STONE
|
||||
if(id == 1)
|
||||
@ -280,8 +292,12 @@ public class Mining
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
|
||||
if(!silkTouch)
|
||||
{
|
||||
mat = Material.getMaterial(4);
|
||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
||||
}
|
||||
m.mcDropItem(loc, item);
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||
block.setType(Material.AIR);
|
||||
@ -319,8 +335,19 @@ public class Mining
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
|
||||
if(!silkTouch)
|
||||
{
|
||||
mat = Material.getMaterial(348);
|
||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
||||
m.mcDropItem(loc, item);
|
||||
m.mcDropItem(loc, item);
|
||||
if(Math.random() * 10 > 5)
|
||||
m.mcDropItem(loc, item);
|
||||
if(Math.random() * 10 > 5)
|
||||
m.mcDropItem(loc, item);
|
||||
}
|
||||
else
|
||||
m.mcDropItem(loc, item);
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||
block.setType(Material.AIR);
|
||||
@ -333,8 +360,12 @@ public class Mining
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
|
||||
if(!silkTouch)
|
||||
{
|
||||
mat = Material.getMaterial(263);
|
||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
||||
}
|
||||
m.mcDropItem(loc, item);
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||
block.setType(Material.AIR);
|
||||
@ -371,8 +402,12 @@ public class Mining
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
|
||||
if(!silkTouch)
|
||||
{
|
||||
mat = Material.getMaterial(264);
|
||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
||||
}
|
||||
m.mcDropItem(loc, item);
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||
block.setType(Material.AIR);
|
||||
@ -398,6 +433,9 @@ public class Mining
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
|
||||
if(!silkTouch)
|
||||
{
|
||||
mat = Material.getMaterial(331);
|
||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
||||
m.mcDropItem(loc, item);
|
||||
@ -406,6 +444,10 @@ public class Mining
|
||||
m.mcDropItem(loc, item);
|
||||
if(Math.random() * 10 > 5)
|
||||
m.mcDropItem(loc, item);
|
||||
}
|
||||
else
|
||||
m.mcDropItem(loc, item);
|
||||
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||
block.setType(Material.AIR);
|
||||
}
|
||||
@ -416,6 +458,9 @@ public class Mining
|
||||
blockProcCheck(block, player);
|
||||
blockProcCheck(block, player);
|
||||
}
|
||||
|
||||
if(!silkTouch)
|
||||
{
|
||||
mat = Material.getMaterial(351);
|
||||
item = new ItemStack(mat, 1, (byte)0,(byte)0x4);
|
||||
m.mcDropItem(loc, item);
|
||||
@ -430,6 +475,9 @@ public class Mining
|
||||
m.mcDropItem(loc, item);
|
||||
if(Math.random() * 10 > 5)
|
||||
m.mcDropItem(loc, item);
|
||||
}
|
||||
else
|
||||
m.mcDropItem(loc, item);
|
||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||
block.setType(Material.AIR);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user