View difference between Paste ID: DDU7sZq6 and srwfysUj
SHOW: | | - or go back to the newest paste.
1
   public boolean handlePlayer(EntityPlayer player) {
2
      for(int i = 0; i < player.field_71071_by.func_70302_i_(); ++i)    // COMMENT:  check all items in players hotbar (i think)
3
       { // COMMENT: for block start
4
         ItemStack item = player.field_71071_by.func_70301_a(i);   // COMMENT: get handle for current item
5
         if(item != null &&   // COMMENT: hotbar slot is not empty
6
            item.func_77973_b() == ExtraUtils.ethericSword &&   // COMMENT: item is ethericSword
7
            player.field_71071_by.func_70298_a(i, 1) != null) // COMMENT: if removing item is successfull
8
         {  // COMMENT: if block start
9
            player.field_71071_by.func_70441_a(createNewStack());  // give new item
10
            return true;   // return success, in this case no further code in this sub gets executed
11
         }  // COMMENT: if block end
12
      }  // COMMENT: for block end
13
 
14-
      return false;
14+
      return false;  // no success yet so return failure
15
   }