25 |
|
|
26 |
@Override |
@Override |
27 |
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { |
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { |
28 |
if (!sender.isOp()) |
if (!sender.isOp()) { |
29 |
|
sender.sendMessage("Only ops can use powerminer"); |
30 |
return false; |
return false; |
31 |
if (! (sender instanceof Player) ) |
} |
32 |
|
|
33 |
|
if (! (sender instanceof Player) ) { |
34 |
|
sender.sendMessage("Only in-game players can use powerminer"); |
35 |
return false; |
return false; |
36 |
|
} |
37 |
|
|
38 |
|
|
39 |
Player p = (Player) sender; |
Player p = (Player) sender; |
40 |
if (miners.contains(p.getName())) { |
if (miners.contains(p.getName())) { |
66 |
case 17: |
case 17: |
67 |
return null; //instabreak drops wood |
return null; //instabreak drops wood |
68 |
case 18: |
case 18: |
69 |
return (rand.nextInt(16) == 0) ? new ItemStack(6,1,(short)0, (byte)rand.nextInt(4) ) : null; //leaves has 6.25% chance of dropping sapplings - the sappling type is randomized |
return (rand.nextInt(16) == 0) ? new ItemStack(6,1,(short)0, b.getData() ) : null; //leaves has 6.25% chance of dropping sapplings |
70 |
case 21: //lapis lazuli |
case 21: //lapis lazuli |
71 |
int count = rand.nextInt(5) + 4; |
int count = rand.nextInt(5) + 4; |
72 |
return new ItemStack(351,count,(short)0, (byte)4); |
return new ItemStack(351,count,(short)0, (byte)4); |
73 |
|
case 27: |
74 |
|
case 28: |
75 |
|
return null; //instabreak drops powered and detector rails |
76 |
case 56: //diamond ore drops diamond |
case 56: //diamond ore drops diamond |
77 |
return new ItemStack(264,1); |
return new ItemStack(264,1); |
78 |
|
case 66: |
79 |
|
return null; //instabreak drops rails |
80 |
case 73: |
case 73: |
81 |
case 74: |
case 74: |
82 |
return new ItemStack(331,4); //redstone ore (both glowing and non-glowing) drops 4 redstone |
return new ItemStack(331,4); //redstone ore (both glowing and non-glowing) drops 4 redstone |
83 |
|
case 82: |
84 |
|
return null; //instabreak drops clay from clayblock |
85 |
default: |
default: |
86 |
return new ItemStack(b.getTypeId(), 1); |
return new ItemStack(b.getTypeId(), 1,(short)0, b.getData()); |
87 |
} |
} |
88 |
} |
} |
89 |
|
|
93 |
if (! p.isOp() ) |
if (! p.isOp() ) |
94 |
return; |
return; |
95 |
|
|
96 |
if ( miners.contains(p.getName()) ) { |
if (p.getItemInHand().getType() == Material.FEATHER) { |
97 |
if (p.getItemInHand().getType() == Material.FEATHER) { |
if ( miners.contains(p.getName()) ) { |
98 |
|
|
99 |
Block b = event.getBlock(); |
Block b = event.getBlock(); |
100 |
|
|