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

Diff of /miscJava/bukkit-minecraft-plugins/HoerupUtils/src/main/java/dk/thoerup/bukkit/hoeruputils/chests/AdvancedChest.java

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

revision 2431 by torben, Mon Mar 9 12:29:22 2015 UTC revision 2432 by torben, Mon Mar 9 13:55:54 2015 UTC
# Line 84  public class AdvancedChest  implements L Line 84  public class AdvancedChest  implements L
84    
85    
86                  Block b = player.getTargetBlock( (Set<Material>)null, 30);                                        Block b = player.getTargetBlock( (Set<Material>)null, 30);                      
87                    Material mat = b.getType();
88                  if (b.getTypeId() != 54 && b.getTypeId() != 154) {                  
89                    if (mat != Material.CHEST && mat != Material.HOPPER) {
90                          player.sendMessage("[Chest] Please look at the chest/hopper you want to protect");                          player.sendMessage("[Chest] Please look at the chest/hopper you want to protect");
91                          return true;                          return true;
92                  }                  }
93    
94                  Location loc = b.getLocation();                  Location loc = b.getLocation();
95                  Location loc2 = null;                  Location loc2 = null;
96                  if ( b.getTypeId() == 54) { //dont find neighbours for Hoppers                  if ( mat == Material.HOPPER) { //dont find neighbours for Hoppers
97                          loc2 = getNeighborChest(loc);                          loc2 = getNeighborChest(loc);
98                  }                  }
99    
# Line 182  public class AdvancedChest  implements L Line 183  public class AdvancedChest  implements L
183                                  player.sendMessage("You need to specify which player should own this chest");                                  player.sendMessage("You need to specify which player should own this chest");
184                                  return true;                                  return true;
185                          }                          }
186                            
187                            @SuppressWarnings("deprecation")//user by name is our only option here
188                          OfflinePlayer p2 = server.getOfflinePlayer(args[1]);                          OfflinePlayer p2 = server.getOfflinePlayer(args[1]);
189                            
190                          if ( p2.hasPlayedBefore() == false && p2.isOnline() == false) {                          if ( p2.hasPlayedBefore() == false && p2.isOnline() == false) {
191                                  player.sendMessage("Unknown user: " + args[1] );                                  player.sendMessage("Unknown user: " + args[1] );
192                                  return true;                                  return true;
# Line 207  public class AdvancedChest  implements L Line 211  public class AdvancedChest  implements L
211                                  player.sendMessage("You need to specify which player to add or remove");                                  player.sendMessage("You need to specify which player to add or remove");
212                                  return true;                                  return true;
213                          }                          }
214                            
215                            @SuppressWarnings("deprecation")//user by name is our only option here
216                          OfflinePlayer p2 = server.getOfflinePlayer(args[1]);                          OfflinePlayer p2 = server.getOfflinePlayer(args[1]);
217                          if ( p2.hasPlayedBefore() == false && p2.isOnline() == false) {                          if ( p2.hasPlayedBefore() == false && p2.isOnline() == false) {
218                                  player.sendMessage("Unknown user: " + args[1] );                                  player.sendMessage("Unknown user: " + args[1] );

Legend:
Removed from v.2431  
changed lines
  Added in v.2432

  ViewVC Help
Powered by ViewVC 1.1.20