mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
More Mining optimizations
This commit is contained in:
parent
388fd364ac
commit
5404fc8703
@ -76,9 +76,11 @@ public class mcBlockListener implements Listener
|
||||
if(m.shouldBeWatched(block))
|
||||
{
|
||||
int id = block.getTypeId();
|
||||
if (id == 17 || id == 39 || id == 40 || id == 91 || id == 86 || id == 73 || id == 74) {
|
||||
|
||||
//Only needed for blocks that use their block data (wood, pumpkins, etc.)
|
||||
if (id == 17 || id == 81 || id == 83 || id == 86 || id == 91)
|
||||
plugin.misc.blockWatchList.add(block);
|
||||
} else {
|
||||
else {
|
||||
//block.setData((byte) 5); //Change the byte
|
||||
//The following is a method to get around a breakage in 1.1-R2 and onward
|
||||
//it should be removed as soon as functionality to change a block
|
||||
|
@ -92,7 +92,10 @@ public class m
|
||||
return shouldBeWatched(id);
|
||||
}
|
||||
public static boolean shouldBeWatched(int id) {
|
||||
return id == 103 || id == 82 || id == 16 || id == 73 || id == 49 || id == 81 || id == 83 || id == 86 || id == 91 || id == 1 || id == 17 || id == 42 || id == 87 || id == 89 || id == 2 || id == 3 || id == 12 || id == 13 || id == 21 || id == 15 || id == 14 || id == 56 || id == 38 || id == 37 || id == 39 || id == 40 || id == 24;
|
||||
return id == 2 || id == 3 || id == 12 || id == 13 || id == 82 || //Excavation
|
||||
id == 1 || id == 14 || id == 15 || id == 16 || id == 21 || id == 24 || id == 49 || id == 56 || id == 73 || id == 74 || id == 87 || id == 89 || //Mining
|
||||
id == 17 || id == 37 || id == 38 || id == 39 || id == 40 || id == 81 || id == 83 || id == 86 || id == 91 || id == 103 || id == 106 || id == 111 || //Woodcutting & Herbalism
|
||||
id == 42; //Anvil
|
||||
}
|
||||
|
||||
public static int getPowerLevel(Player player)
|
||||
|
@ -79,10 +79,10 @@ public class Mining
|
||||
public static void blockProcSimulate(Block block)
|
||||
{
|
||||
Location loc = block.getLocation();
|
||||
Material mat = Material.getMaterial(block.getTypeId());
|
||||
int id = block.getTypeId();
|
||||
Material mat = Material.getMaterial(id);
|
||||
byte damage = 0;
|
||||
ItemStack item = new ItemStack(mat, 1, (byte)0, damage);
|
||||
int id = block.getTypeId();
|
||||
|
||||
if(id != 89 && id != 73 && id != 74 && id != 56 && id != 21 && id != 1 && id != 16) {
|
||||
m.mcDropItem(loc, item);
|
||||
@ -108,7 +108,7 @@ public class Mining
|
||||
m.mcDropItem(loc, item);
|
||||
}
|
||||
}
|
||||
//LAPUS
|
||||
//LAPIS
|
||||
else if(id == 21)
|
||||
{
|
||||
mat = Material.getMaterial(351);
|
||||
@ -220,11 +220,8 @@ public class Mining
|
||||
*/
|
||||
public static Boolean canBeSuperBroken(Block block)
|
||||
{
|
||||
int t = block.getTypeId();
|
||||
if(t == 49 || t == 87 || t == 89 || t == 73 || t == 74 || t == 56 || t == 21 || t == 1 || t == 16 || t == 14 || t == 15 || t == 112)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
int id = block.getTypeId();
|
||||
return id == 1 || id == 14 || id == 15 || id == 16 || id == 21 || id == 24 || id == 49 || id == 56 || id == 73 || id == 74 || id == 87 || id == 89;
|
||||
}
|
||||
|
||||
public static void SuperBreakerBlockCheck(Player player, Block block, mcMMO plugin)
|
||||
@ -241,12 +238,11 @@ public class Mining
|
||||
|
||||
//Pre-processing
|
||||
Location loc = block.getLocation();
|
||||
Material mat = Material.getMaterial(block.getTypeId());
|
||||
int id = block.getTypeId();
|
||||
Material mat = Material.getMaterial(id);
|
||||
int xp = 0;
|
||||
byte damage = 0;
|
||||
ItemStack item = new ItemStack(mat, 1, (byte)0, damage);
|
||||
int id = block.getTypeId();
|
||||
|
||||
|
||||
if(id == 1 || id == 24)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user