  
                          if (itemstack == null)
                          {
-@@ -1704,6 +1713,8 @@
+@@ -1506,7 +1515,8 @@
+         {
+             ItemStack itemstack1 = this.field_71439_g.field_71071_by.func_70448_g();
+ 
+-            if (itemstack1 != null && this.field_71442_b.func_78769_a(this.field_71439_g, this.field_71441_e, itemstack1))
++            boolean result = !net.minecraftforge.event.ForgeEventFactory.onPlayerInteract(field_71439_g, net.minecraftforge.event.entity.player.PlayerInteractEvent.Action.RIGHT_CLICK_AIR, field_71441_e, null, null).isCanceled();
++            if (result && itemstack1 != null && this.field_71442_b.func_78769_a(this.field_71439_g, this.field_71441_e, itemstack1))
+             {
+                 this.field_71460_t.field_78516_c.func_78445_c();
+             }
+@@ -1704,6 +1714,8 @@
  
              while (Mouse.next())
              {

             if (flag)
             {
                 int j = this.field_71439_g.field_71069_bz.field_75151_b.size() - 9 + inventoryplayer.field_70461_c;
@@ -2751,8 +2659,11 @@
         p_70001_1_.func_152767_b("gl_max_texture_size", Integer.valueOf(func_71369_N()));
     }
 

                 i = Mouse.getEventButton();
                 KeyBinding.func_74510_a(i - 100, Mouse.getEventButtonState());
 
@@ -2213,7 +2225,13 @@
         NetworkManager networkmanager = NetworkManager.func_150722_a(socketaddress);
         networkmanager.func_150719_a(new NetHandlerLoginClient(networkmanager, this, (GuiScreen)null));
         networkmanager.func_179290_a(new C00Handshake(47, socketaddress.toString(), 0, EnumConnectionState.LOGIN, true));
