mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-29 16:46:46 +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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Drop natural block with Silk Touch
|
||||||
|
if(player.getItemInHand().getEnchantments().containsKey(Enchantment.SILK_TOUCH)){
|
||||||
|
m.mcDropItem(loc, item);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
switch (id){
|
switch (id){
|
||||||
//GLOWSTONE
|
//GLOWSTONE
|
||||||
case 89:
|
case 89:
|
||||||
mat = Material.getMaterial(348);
|
mat = Material.getMaterial(348);
|
||||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
item = new ItemStack(mat, 1, (byte)0, damage);
|
||||||
m.mcDropItem(loc, item);
|
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;
|
break;
|
||||||
//REDSTONE
|
//REDSTONE
|
||||||
case 73:
|
case 73:
|
||||||
@ -270,6 +281,7 @@ public class Mining
|
|||||||
int xp = 0;
|
int xp = 0;
|
||||||
byte damage = 0;
|
byte damage = 0;
|
||||||
ItemStack item = new ItemStack(mat, 1, (byte)0, damage);
|
ItemStack item = new ItemStack(mat, 1, (byte)0, damage);
|
||||||
|
boolean silkTouch = player.getItemInHand().getEnchantments().containsKey(Enchantment.SILK_TOUCH);
|
||||||
|
|
||||||
//STONE
|
//STONE
|
||||||
if(id == 1)
|
if(id == 1)
|
||||||
@ -280,8 +292,12 @@ public class Mining
|
|||||||
blockProcCheck(block, player);
|
blockProcCheck(block, player);
|
||||||
blockProcCheck(block, player);
|
blockProcCheck(block, player);
|
||||||
}
|
}
|
||||||
mat = Material.getMaterial(4);
|
|
||||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
if(!silkTouch)
|
||||||
|
{
|
||||||
|
mat = Material.getMaterial(4);
|
||||||
|
item = new ItemStack(mat, 1, (byte)0, damage);
|
||||||
|
}
|
||||||
m.mcDropItem(loc, item);
|
m.mcDropItem(loc, item);
|
||||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||||
block.setType(Material.AIR);
|
block.setType(Material.AIR);
|
||||||
@ -319,9 +335,20 @@ public class Mining
|
|||||||
blockProcCheck(block, player);
|
blockProcCheck(block, player);
|
||||||
blockProcCheck(block, player);
|
blockProcCheck(block, player);
|
||||||
}
|
}
|
||||||
mat = Material.getMaterial(348);
|
|
||||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
if(!silkTouch)
|
||||||
m.mcDropItem(loc, item);
|
{
|
||||||
|
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());
|
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||||
block.setType(Material.AIR);
|
block.setType(Material.AIR);
|
||||||
}
|
}
|
||||||
@ -332,9 +359,13 @@ public class Mining
|
|||||||
xp += LoadProperties.mcoal;
|
xp += LoadProperties.mcoal;
|
||||||
blockProcCheck(block, player);
|
blockProcCheck(block, player);
|
||||||
blockProcCheck(block, player);
|
blockProcCheck(block, player);
|
||||||
}
|
}
|
||||||
mat = Material.getMaterial(263);
|
|
||||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
if(!silkTouch)
|
||||||
|
{
|
||||||
|
mat = Material.getMaterial(263);
|
||||||
|
item = new ItemStack(mat, 1, (byte)0, damage);
|
||||||
|
}
|
||||||
m.mcDropItem(loc, item);
|
m.mcDropItem(loc, item);
|
||||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||||
block.setType(Material.AIR);
|
block.setType(Material.AIR);
|
||||||
@ -346,7 +377,7 @@ public class Mining
|
|||||||
xp += LoadProperties.mgold;
|
xp += LoadProperties.mgold;
|
||||||
blockProcCheck(block, player);
|
blockProcCheck(block, player);
|
||||||
blockProcCheck(block, player);
|
blockProcCheck(block, player);
|
||||||
}
|
}
|
||||||
m.mcDropItem(loc, item);
|
m.mcDropItem(loc, item);
|
||||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||||
block.setType(Material.AIR);
|
block.setType(Material.AIR);
|
||||||
@ -371,8 +402,12 @@ public class Mining
|
|||||||
blockProcCheck(block, player);
|
blockProcCheck(block, player);
|
||||||
blockProcCheck(block, player);
|
blockProcCheck(block, player);
|
||||||
}
|
}
|
||||||
mat = Material.getMaterial(264);
|
|
||||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
if(!silkTouch)
|
||||||
|
{
|
||||||
|
mat = Material.getMaterial(264);
|
||||||
|
item = new ItemStack(mat, 1, (byte)0, damage);
|
||||||
|
}
|
||||||
m.mcDropItem(loc, item);
|
m.mcDropItem(loc, item);
|
||||||
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||||
block.setType(Material.AIR);
|
block.setType(Material.AIR);
|
||||||
@ -398,14 +433,21 @@ public class Mining
|
|||||||
blockProcCheck(block, player);
|
blockProcCheck(block, player);
|
||||||
blockProcCheck(block, player);
|
blockProcCheck(block, player);
|
||||||
}
|
}
|
||||||
mat = Material.getMaterial(331);
|
|
||||||
item = new ItemStack(mat, 1, (byte)0, damage);
|
if(!silkTouch)
|
||||||
m.mcDropItem(loc, item);
|
{
|
||||||
m.mcDropItem(loc, item);
|
mat = Material.getMaterial(331);
|
||||||
m.mcDropItem(loc, item);
|
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);
|
||||||
m.mcDropItem(loc, item);
|
m.mcDropItem(loc, item);
|
||||||
|
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());
|
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||||
block.setType(Material.AIR);
|
block.setType(Material.AIR);
|
||||||
}
|
}
|
||||||
@ -416,20 +458,26 @@ public class Mining
|
|||||||
blockProcCheck(block, player);
|
blockProcCheck(block, player);
|
||||||
blockProcCheck(block, player);
|
blockProcCheck(block, player);
|
||||||
}
|
}
|
||||||
mat = Material.getMaterial(351);
|
|
||||||
item = new ItemStack(mat, 1, (byte)0,(byte)0x4);
|
if(!silkTouch)
|
||||||
m.mcDropItem(loc, item);
|
{
|
||||||
m.mcDropItem(loc, item);
|
mat = Material.getMaterial(351);
|
||||||
m.mcDropItem(loc, item);
|
item = new ItemStack(mat, 1, (byte)0,(byte)0x4);
|
||||||
m.mcDropItem(loc, item);
|
|
||||||
if(Math.random() * 10 > 5)
|
|
||||||
m.mcDropItem(loc, item);
|
m.mcDropItem(loc, item);
|
||||||
if(Math.random() * 10 > 5)
|
|
||||||
m.mcDropItem(loc, item);
|
m.mcDropItem(loc, item);
|
||||||
if(Math.random() * 10 > 5)
|
|
||||||
m.mcDropItem(loc, item);
|
m.mcDropItem(loc, item);
|
||||||
if(Math.random() * 10 > 5)
|
|
||||||
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);
|
||||||
|
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());
|
player.incrementStatistic(Statistic.MINE_BLOCK, block.getType());
|
||||||
block.setType(Material.AIR);
|
block.setType(Material.AIR);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user