/[projects]/miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/PowerMiner.java
ViewVC logotype

Diff of /miscJava/bukkit-minecraft-plugins/HoerupUtils/src/dk/thoerup/bukkit/hoeruputils/PowerMiner.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1490 by torben, Mon May 30 20:25:59 2011 UTC revision 1590 by torben, Tue Aug 16 16:04:01 2011 UTC
# Line 25  public class PowerMiner extends BlockLis Line 25  public class PowerMiner extends BlockLis
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");                          sender.sendMessage("Only ops can use powerminer");
30                          return false;                          return false;
31                  }                  }*/
32                                                    
33                  if (! (sender instanceof Player) ) {                  if (! (sender instanceof Player) ) {
34                          sender.sendMessage("Only in-game players can use powerminer");                          sender.sendMessage("Only in-game players can use powerminer");
# Line 37  public class PowerMiner extends BlockLis Line 37  public class PowerMiner extends BlockLis
37                                                    
38                                    
39                  Player p  = (Player) sender;                  Player p  = (Player) sender;
40    
41    
42                    if ( ! p.hasPermission("hoeruputils.powerminer") ) {
43                            sender.sendMessage("You don't have permissions to use powerminer!");
44                            return false;
45                    }
46    
47                  if (miners.contains(p.getName())) {                  if (miners.contains(p.getName())) {
48                          miners.remove( p.getName() );                          miners.remove( p.getName() );
49                          p.sendMessage("PowerMiner disabled");                          p.sendMessage("PowerMiner disabled");
# Line 75  public class PowerMiner extends BlockLis Line 82  public class PowerMiner extends BlockLis
82                  case 27:                  case 27:
83                  case 28:                  case 28:
84                          return null; //instabreak drops powered and detector rails                          return null; //instabreak drops powered and detector rails
85                    case 50:
86                            return null; //instabreak drops torches
87                    case 53:
88                            return null; //instabreak drops wood for wooden stairs
89                  case 54:                  case 54:
90                          return null; //instabreak drops chests                          return null; //instabreak drops chests
91                  case 56: //diamond ore drops diamond                  case 56: //diamond ore drops diamond
# Line 82  public class PowerMiner extends BlockLis Line 93  public class PowerMiner extends BlockLis
93                  case 58:                  case 58:
94                          return null; //instabreak drops craft tables                          return null; //instabreak drops craft tables
95                  case 64: //instabreak drops wooden doors                  case 64: //instabreak drops wooden doors
96                    case 65: //instabreak drops ladders
97                  case 66:                  case 66:
98                          return null; //instabreak drops rails                          return null; //instabreak drops rails
99                  case 71: //instabreak drops iron doors                  case 71: //instabreak drops iron doors
# Line 89  public class PowerMiner extends BlockLis Line 101  public class PowerMiner extends BlockLis
101                  case 73:                  case 73:
102                  case 74:                  case 74:
103                          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
104                    case 75:
105                    case 76:
106                            return null; //instabreak drops redstone torches (both on and off)
107                  case 82:                  case 82:
108                          return null; //instabreak drops clay from clayblock                          return null; //instabreak drops clay from clayblock
109                  case 88:                  case 88:
110                          return null; //instabreak drops soul sand                          return null; //instabreak drops soul sand
111                    case 93: //instabreak drops repeater both on and off
112                    case 94:
113                            return null;
114                  default:                  default:
115                          return new ItemStack(b.getTypeId(), 1,(short)0, b.getData());                          return new ItemStack(b.getTypeId(), 1,(short)0, b.getData());
116                  }                  }
# Line 101  public class PowerMiner extends BlockLis Line 119  public class PowerMiner extends BlockLis
119          public void onBlockDamage(BlockDamageEvent event) {          public void onBlockDamage(BlockDamageEvent event) {
120                  Player p = event.getPlayer();                  Player p = event.getPlayer();
121                                    
                 if (! p.isOp() )  
                         return;  
                   
122                  if (p.getItemInHand().getType() == Material.FEATHER) {                  if (p.getItemInHand().getType() == Material.FEATHER) {
123                          if ( miners.contains(p.getName()) ) {                                            if ( miners.contains(p.getName()) ) {                  
124                                                                    

Legend:
Removed from v.1490  
changed lines
  Added in v.1590

  ViewVC Help
Powered by ViewVC 1.1.20